WeBWorK Main Forum

hardcopy error webworkSetCopyrightFooter

hardcopy error webworkSetCopyrightFooter

by Andras Balogh -
Number of replies: 5

I am trying v. 2.18 as a new installation.

Trying to generate hardcopy of sets results in error message:

Failed to convert TeX to PDF with command 

...

First error in TeX log is:

! LaTeX Error: Can be used only in preamble.

l.277 \webworkSetCopyrightFooter


A hardcopy file does get generated, and it looks fine to me.


In reply to Andras Balogh

Re: hardcopy error webworkSetCopyrightFooter

by Alex Jordan -

Is the latex version is recent? And did you run the webwork2 check_latex script to see if it says anything helpful?



In reply to Alex Jordan

Re: hardcopy error webworkSetCopyrightFooter

by Andras Balogh -

It is a new installation of Ubuntu 20.04.6 LTS with everything new as per distro packages. It provides texlive 2019.

check_latex shows Compilation Success!

I even installed texlive-full.

Downloading the tex file I see that the problem is the fancyhdr package:
! Undefined control sequence.
\webworkSetCopyrightFooter ...ancyhdr}{\fancyfoot 

There seems to be an issue with fancyhdr and texlive 2019 (https://tex.stackexchange.com/questions/654047/fancyhdr-not-working-in-tex-live)

There are no errors when I process the same file on my mac using TeX Live 2023.

In reply to Andras Balogh

Re: hardcopy error webworkSetCopyrightFooter

by Alex Jordan -

If it's not a problem for other reasons, I recommend installing TeXLive 2023. You could install it somewhere other than where the Ubuntu package version lands, and make changes in localOverrides.conf so that WeBWorK uses the 2023 version. You need to set the path for the latex executables, and also for things like dvisvgm that comes with TeXLive.

IIRC, I ran into other issues with TeXLive 2019 (with regular use, not necessarily with WeBWorK).

In reply to Andras Balogh

Re: hardcopy error webworkSetCopyrightFooter

by Glenn Rice -

Your error does not seem to be the same as the error in the stack exchange post that you linked.  Also, that stack exchange error does not seem to be an issue that has been confirmed for texlive 2019.  From the comments on that post, it looks like it is actually something wrong with that user's setup.

I don't think that your issue is with fancyhdr at all from the error that you are seeing.  You are getting "Undefined control sequence", and I suspect it is from the "\webworkSetCopyrightFooter" command it shows.  That is defined in the webwork2/assets/tex/webwork2.sty file.

Could you post a TeX file you get from the zip file generated when the "TeX Source" option is selected?

In reply to Glenn Rice

Re: hardcopy error webworkSetCopyrightFooter

by Andras Balogh -

The webwork hardcopy generator shows the error only at \webworkSetCopyrightFooter, but when I download the TeX source and make webwork2.sty available than the  \fancyfoot in the definition of \webworkSetCopyrightFooter seems to show up as undefined when using the distribution provided texlive 2019.

Installing manually texlive 2023 and changing to it in site.conf did resolve the problem, but installation took much longer than using the package manager. 

Attached is the source file.