diff --git a/beamerthemeuulm.sty b/beamerthemeuulm.sty index 527c773..db81968 100644 --- a/beamerthemeuulm.sty +++ b/beamerthemeuulm.sty @@ -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 % --------------------------------------------- @@ -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 @@ -705,4 +706,24 @@ % => \mynote and \mynotetight % furthermore defines the environment \begin{note}{} ... \end{note} \uulm@DeclareBox{note}{red} -% --------------------------------------------- \ No newline at end of file +% --------------------------------------------- + +% --------------------------------------------- +% 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}} +} +% --------------------------------------------- diff --git a/demo-slides/demoSlides.pdf b/demo-slides/demoSlides.pdf index bf17729..002057b 100644 Binary files a/demo-slides/demoSlides.pdf and b/demo-slides/demoSlides.pdf differ diff --git a/demo-slides/demoSlides.tex b/demo-slides/demoSlides.tex index accbad9..e443f6b 100644 --- a/demo-slides/demoSlides.tex +++ b/demo-slides/demoSlides.tex @@ -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 diff --git a/pics/nature/jun22-clouds2.txt b/pics/nature/jun22-clouds2.txt new file mode 100644 index 0000000..a919d48 --- /dev/null +++ b/pics/nature/jun22-clouds2.txt @@ -0,0 +1 @@ +https://en.wikipedia.org/wiki/Cloud \ No newline at end of file