Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
feat: automatic picture links (Elias Kuiter)
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 4066a18
Author: Benno2000 <benno.hoelz@gmx.de>
Date:   Sat Sep 9 12:52:12 2023 +0200

    feat: pic command for automatic picture links
  • Loading branch information
Benno2000 committed Sep 30, 2023
1 parent ed2d93b commit e0b4634
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
25 changes: 23 additions & 2 deletions beamerthemeuulm.sty
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
\usepackage{tcolorbox} % used for color boxes (definition, example, note)
\usepackage{ifthen}
\usepackage{multicol} % for auto multi-column in content overview
\usepackage{catchfile} % for automatic link on pictures
% ---------------------------------------------


Expand All @@ -21,7 +22,7 @@
\beamertemplatenavigationsymbolsempty % remove the default navigation symbols

\AtEndPreamble{
\appto\Ginput@path{{../pics/logos/}{../pics/uulm/}{../pics/nature/}}
\setpaths{{../pics/logos/}{../pics/uulm/}{../pics/nature/}}
}

\newif\ifuniqueslidenumbersuffix
Expand Down Expand Up @@ -705,4 +706,24 @@
% => \mynote and \mynotetight
% furthermore defines the environment \begin{note}{<title>} ... \end{note}
\uulm@DeclareBox{note}{red}
% ---------------------------------------------
% ---------------------------------------------

% ---------------------------------------------
% Pictures
% ---------------------------------------------
% GRAPHICSPATH
\makeatletter
\newcommand{\setpaths}[1]{
\appto\Ginput@path{#1} % for loading pictures
\def\input@path{#1} % for loading picture sources
}
\makeatother

% adding links from text file to pictures automatically
\newcommand\hreffile[1]{%
\CatchFileDef\myurl{#1}{\catcode`\#=12\catcode`\%=12\endlinechar=-1}%
\expandafter\href\expandafter{\myurl}}
\newcommand{\pic}[2][]{%
\IfFileExists{#2.txt}{\hreffile{#2.txt}}{}{\includegraphics[#1]{#2}}
}
% ---------------------------------------------
Binary file modified demo-slides/demoSlides.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions demo-slides/demoSlides.tex
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,13 @@ \subsection{Easy Navigation in Slides}
\vfill
\end{frame}

\subsection{Adding Links to Pictures Automatically}
\begin{frame}{\insertsubsection}
Using the command \texttt{\textbackslash pic\{filename\}} a picture can be included. In order to automatically add a (source) link to the picture, the link simply has to be stored in a txt-file with the same filename:

\pic[width=0.5\textwidth]{jun22-clouds2}
\end{frame}

\subsection{Repeating the Last Title Slide}
\againtitle

Expand Down
1 change: 1 addition & 0 deletions pics/nature/jun22-clouds2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://en.wikipedia.org/wiki/Cloud

0 comments on commit e0b4634

Please sign in to comment.