homepage icon indicating copy to clipboard operation
homepage copied to clipboard

comments:latexmk

Open utterances-bot opened this issue 4 years ago • 9 comments

Using Latexmk — homepage

https://mg.readthedocs.io/latexmk.html

utterances-bot avatar Sep 11 '20 23:09 utterances-bot

When I run this I get lots of error messages about missing files, on third re-run it is finally quiet but does not produce pdf file. Seems to be not working as I would have expected, as a working drop-in for pdflatex. (pdflatex compiles the file just fine with no error message)

2sn avatar Sep 11 '20 23:09 2sn

I see, I need to specify -pdf option, then it seems to work. But somehow I need to run it twice before it decides that it is all done. Maybe there is a missing iteration for use with beamer?

2sn avatar Sep 11 '20 23:09 2sn

Yeah, you'll have to use -pdf at the command line or use $pdf_mode = 1; in your configuration file.

I don't know about the beamer problem, the whole idea of latexmk is to figure out how many times to run LaTeX ...

If you manage to make a minimal reproducible example, you can probably report this problem to the author (http://www.personal.psu.edu/~jcc8/)?

mgeier avatar Sep 15 '20 16:09 mgeier

hey can we change the deafult options for latexmk i want to use lualatex for pdf generation but latexmk throws error showing it uses pdflatex

anutosh491 avatar Sep 28 '21 03:09 anutosh491

You can try using this in your configuration file:

$pdf_mode = 1;
$pdflatex = 'lualatex';

UPDATE:

Actually, there is a dedicated mode for lualatex, no need to redefine the pdflatex command. Just use -pdflua on the command line or set this in the config file:

$pdf_mode = 4;

mgeier avatar Sep 29 '21 21:09 mgeier

Is there some way to error only on warnings in the final run of latex in latexmk? I have set up latexmk in Jenkins to make sure no one breaks the build of a document. I tried using -Werror, but it breaks on the first run of latex, when there are naturally a lot of undefined references, etc. I'd really like latexmk to error only if there are warnings in the final run. Thanks!

rpgoldman avatar Aug 29 '22 15:08 rpgoldman

I tried using -Werror, but it breaks on the first run of latex

Are you using the latest version? According to man latexmk, errors should only be caused in the last run:

   -Werror
          This causes latexmk to return a non-zero status code if  any  of
          the  files  processed  gives a warning about problems with cita‐
          tions or references (i.e., undefined citations or references  or
          about  multiply  defined references).  This is after latexmk has
          completed all the runs it needs to try  and  resolve  references
          and  citations.  Thus -Werror causes latexmk to treat such warn‐
          ings as errors, but only when they occur on the last run of *la‐
          tex  and  only after processing is complete.  Also can be set by
          the configuration variable $warnings_as_errors.

As a work-around, you could try to run latemk once without -Werror and immediately run it again with -g -Werror, which should repeat the last run (but I didn't test if it handles warnings as expected).

mgeier avatar Aug 31 '22 09:08 mgeier

Please update link: https://personal.psu.edu/~jcc8/software/latexmk/ to https://www.cantab.net/users/johncollins/latexmk/index.html as the old server is going retired.

js-open-projects avatar Aug 27 '23 09:08 js-open-projects

Thanks @js-open-projects, I have updated the links in #18.

mgeier avatar Aug 27 '23 10:08 mgeier