Skip to content

Commit

Permalink
Merge pull request #13 from UtrechtUniversity/fileinclude-fix
Browse files Browse the repository at this point in the history
Bugfix: graphicspath ignored in IfFileExists
  • Loading branch information
jkorb authored Jun 9, 2023
2 parents 41bc6f8 + 59b292b commit 7234761
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 25 deletions.
17 changes: 13 additions & 4 deletions lib/classes/beamerouterthemeuubeamer.sty
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% uubeamer - Outer theme
%
% Copyright 2022, J. Korbmacher (j.korbmacher@uu.nl)
% Copyright 2023, J. Korbmacher (j.korbmacher@uu.nl)
%
% DISCLAIMER
%
Expand Down Expand Up @@ -43,20 +43,29 @@
\else
\renewcommand{\@payoffpath}{UU_logo_2021_EN_BLACK_payoff.png}
\fi
\providecommand*{\input@path}{}
\newcommand{\IfImageExists}[3]{%
\begingroup
\ifdefined\Ginput@path
\edef\input@path{\input@path\Ginput@path}%
\fi
\IfFileExists{#1}{#2}{#3}%
\endgroup
}
\newcommand{\@print@logo}{%
\IfFileExists{\@logopath}{\includegraphics{\@logopath}}{%
\IfImageExists{\@logopath}{\includegraphics{\@logopath}}{%
\fbox{Warning! Logo not found.}
\ClassWarning{uubeamer}{Couldn't locate the logo file. Put
it somewhere where LaTeX can find it.}}
}
\newcommand{\@print@titlelogo}{%
\IfFileExists{\@titlelogopath}{\includegraphics[width=.5\linewidth]{\@titlelogopath}}{%
\IfImageExists{\@titlelogopath}{\includegraphics[width=.5\linewidth]{\@titlelogopath}}{%
\fbox{Warning! Logo not found.}
\ClassWarning{uubeamer}{Couldn't locate the logo file. Put
it somewhere where LaTeX can find it.}}
}
\newcommand{\@print@payoff}{%
\IfFileExists{\@payoffpath}{\includegraphics[scale=0.5]{\@payoffpath}}{%
\IfImageExists{\@payoffpath}{\includegraphics[scale=0.5]{\@payoffpath}}{%
\fbox{Warning! Payoff not found.}
\ClassWarning{uubeamer}{Couldn't locate the logo file. Put
it somewhere where LaTeX can find it.}}
Expand Down
17 changes: 13 additions & 4 deletions lib/classes/uuletter2.cls
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%
% A simple letter class for UU letters.
%
% Copyright 2021, J. Korbmacher (j.korbmacher@uu.nl)
% Copyright 2023, J. Korbmacher (j.korbmacher@uu.nl)
%
% DISCLAIMER
%
Expand All @@ -11,7 +11,7 @@
% third parties without permission granted in advance.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uuletter2}[2021/09/10 v1.0]
\ProvidesClass{uuletter2}[2023/06/09 v1.1]
\newif\if@dutch
\newif\if@opensans
\newif\if@merriweather
Expand Down Expand Up @@ -286,16 +286,25 @@
\else
\@website
\fi}
\providecommand*{\input@path}{}
\newcommand{\IfImageExists}[3]{%
\begingroup
\ifdefined\Ginput@path
\edef\input@path{\input@path\Ginput@path}%
\fi
\IfFileExists{#1}{#2}{#3}%
\endgroup
}
\newcommand{\@printsignature}{%
\if@signature
\IfFileExists{\@sigpath}{\includegraphics[width=3.5cm]{\@sigpath}\\}{%
\IfImageExists{\@sigpath}{\includegraphics[width=3.5cm]{\@sigpath}\\}{%
\fbox{Warning! Signature not found}\\
\ClassWarning{uuletter2}{You selected \protect\withsignature\space
but LateX couldn't locate the signature.}}
\else
\fi}
\newcommand{\@print@logo}{%
\IfFileExists{\@logopath}{\includegraphics{\@logopath}}{%
\IfImageExists{\@logopath}{\includegraphics{\@logopath}}{%
\fbox{Warning! Logo not found.}
\ClassWarning{uuletter2}{Couldn't locate the logo file. Put
it somewhere where LaTeX can find it.}}}
Expand Down
30 changes: 13 additions & 17 deletions lib/classes/uureport.cls
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% uureport.cls
%
% Copyright 2021, J. Korbmacher (j.korbmacher@uu.nl)
% Copyright 2023, J. Korbmacher (j.korbmacher@uu.nl)
%
% DISCLAIMER
%
Expand All @@ -9,7 +9,7 @@
% third parties without permission granted in advance.

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uureport}[2021/09/08 v1.0]
\ProvidesClass{uureport}[2023/06/09 v1.1]

% Some conditionals for later options

Expand Down Expand Up @@ -500,23 +500,19 @@

%%%%% Internal commands to print layout

% \newcommand{\@print@logo}{%
% \begin{minipage}[b][\@logoheight][t]{\@logowidth}
% \if@dutch
% \IfFileExists{UU_logo_2021_NL_RGB}{\includegraphics{UU_logo_2021_NL_RGB}}{%
% \fbox{Warning! Logo not found.}
% \ClassWarning{uudoc}{Couldn't locate the Dutch logo file. Put
% it somewhere where LaTeX can find it.}}
% \else
% \IfFileExists{UU_logo_2021_EN_RGB}{\includegraphics{UU_logo_2021_EN_RGB}}{%
% \fbox{Warning! Logo not found.}
% \ClassWarning{uudoc}{Couldn't locate the English logo file. Put
% it somewhere where LaTeX can find it.}}
% \fi
% \end{minipage}}
\providecommand*{\input@path}{}

\newcommand{\IfImageExists}[3]{%
\begingroup
\ifdefined\Ginput@path
\edef\input@path{\input@path\Ginput@path}%
\fi
\IfFileExists{#1}{#2}{#3}%
\endgroup
}

\newcommand{\@print@logo}{%
\IfFileExists{\@logopath}{\includegraphics{\@logopath}}{%
\IfImageExists{\@logopath}{\includegraphics{\@logopath}}{%
\fbox{Warning! Logo not found.}
\ClassWarning{uuletter2}{Couldn't locate the logo file. Put
it somewhere where LaTeX can find it.}}}
Expand Down

0 comments on commit 7234761

Please sign in to comment.