diff --git a/assets/tex/webwork2.sty b/assets/tex/webwork2.sty index 7329447e25..d7c3c96d98 100644 --- a/assets/tex/webwork2.sty +++ b/assets/tex/webwork2.sty @@ -85,23 +85,59 @@ % These macros declare copyright in the footer of the last page. -\newcommand{\webworkSetCopyrightFooter}{% -\@ifpackageloaded{fancyhdr}% + +% Define the footer components + +\newcommand{\webworkSetCopyrightFooterLeft}{% +\raisebox{-0.325cm}{\includegraphics[width=3cm]{webwork_logo.png}}% +} +\newcommand{\webworkSetCopyrightFooterCenter}{% +\small\sffamily Generated by WeBWorK, \copyright~The~WeBWorK~Project.% +} +\newcommand{\webworkSetCopyrightFooterRight}{% +\url{openwebwork.org}% +} + +% Define the macro that declares the copyright +% A format if fancyhdr is available +% A format if exam class is available +% Empty otherwise + +\AtBeginDocument{% +\newcommand{\webworkSetCopyrightFooter}{\relax} +\makeatletter% + +\@ifpackageloaded{fancyhdr}{% +\@ifpackageloaded{tcolorbox}{% +\renewcommand{\webworkSetCopyrightFooter}{% +\fancyfoot[L]{\webworkSetCopyrightFooterLeft}% +\fancyfoot[C]{\webworkSetCopyrightFooterCenter}% +\fancyfoot[R]{\webworkSetCopyrightFooterRight}% +\pagestyle{fancy}% +}% +}% {% -\fancyfoot[L]{\raisebox{-0.325cm}{\includegraphics[width=3cm]{webwork_logo.png}}}% -\fancyfoot[C]{\small\sffamily Generated by WeBWorK, \copyright~The~WeBWorK~Project.}% -\fancyfoot[R]{\url{openwebwork.org}}% +\renewcommand{\webworkSetCopyrightFooter}{% +\fancyfoot[L]{\webworkSetCopyrightFooterLeft}% +\fancyfoot[C]{\webworkSetCopyrightFooterCenter}% +\fancyfoot[R]{\webworkSetCopyrightFooterRight}% \pagestyle{fancy}% -\@ifpackageloaded{tcolorbox}{}{\clearpage}% +\clearpage% +}% }% {}% +}% + \@ifclassloaded{exam}% {% +\renewcommand{\webworkSetCopyrightFooter}{% \footer% -{\raisebox{-0.325cm}{\includegraphics[width=3cm]{webwork_logo.png}}}% -{\small\sffamily Generated by WeBWorK, \copyright~The~WeBWorK~Project.}% -{\url{openwebwork.org}}% +{\webworkSetCopyrightFooterLeft}% +{\webworkSetCopyrightFooterCenter}% +{\webworkSetCopyrightFooterRight}% \clearpage }% +}% {}% +\makeatother% }