3

How do I set up for latexmk compilation for pdflatex in texlive? I have the following (see picture) setup for latexmk compilation for xelatex (I just found it somewhere), but I don't know what to change for pdflatex.

enter image description here

Sverre
  • 20,729
  • I'd guess the xelatex that follows q/ should be pdflatex. But I haven't used Windows in almost a decade. – jon Sep 10 '13 at 17:13
  • Latexmk should use pdfLaTeX by default with the -pdf switch: did you try just removing the $pdflatex ... line? – Joseph Wright Sep 10 '13 at 18:08
  • @JosephWright That seems to work, although I see a warning I have never seen before: Unquoted string "tex" may clash with future reserved word at (eval 8) line 2 (possibly completely unrelated). – Sverre Sep 10 '13 at 18:13
  • latexmk is a Perl script. You must have a Perl interpreter installed in your machine. – Raniere Silva Sep 10 '13 at 18:29
  • @RaniereSilva Yes ...? I don't understand what you are trying to tell me ... – Sverre Sep 10 '13 at 18:34
  • Some time ago I try to use latexmk in a W* machine with MiKTeX and have no success because the machine haven't a Perl script. AFAIK the LaTeX distribution don't install a Perl script. I just want to warning you about this. – Raniere Silva Sep 10 '13 at 18:56
  • As seen in my question, I use texlive (in Windows). Texlive comes with its own perl interpreter. – Sverre Sep 10 '13 at 19:00
  • @JosephWright I think your suggestion doesn't quite work. When compiling the tex file I just posted in http://tex.stackexchange.com/questions/132660/count-items-later-in-the-document, I get (in addition to the Unquoted string "tex" ... warning, a fontspec error The fontspec package requires either XeTeX or LuaTeX to function. – Sverre Sep 10 '13 at 19:54
  • @Sverre Well you can't use fontspec with pdfLaTeX, so that is not really a surprise. You have to use either XeLaTeX or LuaLaTeX to use fontspec. – Joseph Wright Sep 10 '13 at 19:56
  • @JosephWright I know, but if you look at the linked document, I'm not loading fontspec, so I'm baffled. – Sverre Sep 10 '13 at 20:01
  • 1
    @Sverre OK, drop the -e (it seems this is actually linked to the xelatex business). For me, that removes the warning, and latexmk -pdf <filename> with the linked demo is fine. – Joseph Wright Sep 10 '13 at 20:08
  • Good. If you don't mind, I'll provide a quick and simple answer. – Sverre Sep 10 '13 at 20:15

1 Answers1

4

Based on Joseph's comments, this:

enter image description here


The latexmk procedure for xelatex given in the question can also be simplified to the following:

enter image description here

Sverre
  • 20,729
  • 1
    Along the lines of this configuration, you should be able to simplify the xelatex configuration: Just replace -pdf (from this configuration) with -xelatex. The only difference seems to be that the configuration you posted heeds some variable $synctexoption, which I can’t find in the latexmk documentation, so I’m guessing it’s TeXworks-specific. What happens if you keep the xelatex configuration and only replace xelatex (in the 3rd line) with pdflatex? – doncherry Sep 11 '13 at 09:59
  • @doncherry You seem to be suggesting two different things here. I tried your first suggestion, and that seemed to work fine in the document I tested it on. I'll add it to my answer above. – Sverre Sep 11 '13 at 10:31
  • Yes, those were two different things. Overall, there should be (at least) four possible configurations, two each for pdflatex and xelatex. The one not pictured yet is the pdflatex configuration I described in the second part of my last comment. – doncherry Sep 11 '13 at 10:39
  • Since the one I pictured would be the simpler one, I guess that should be preferable. – Sverre Sep 11 '13 at 10:51