1

I see in Latexmk documentation, that -e option is used for a way of giving initialisation code directly on latexmk’s command line. I know, that the single quotes block normal UNIX/LINUX command shells from treating the characters inside the quotes as special.

I try this command under MS-Windows:

latexmk -pvc -pdfxe -time -e "$pdflatex='xelatex -interaction=nonstopmode -halt-on-error'" -e "$pdf_previewer = 'start \"c:/Program Files/SumatraPDF/SumatraPDF.exe" %O %S'" my_file.tex 

specially, I have a problem with second part of the command above:

-e "$pdf_previewer = 'start \"c:/Program Files/SumatraPDF/SumatraPDF.exe" %O %S'"

Where should be used single and double quotes?

I have this error message:

Latexmk: Stopping because executing following code from command line
    $pdf_previewer = 'start c:/Program
gave an error:
    Can't find string terminator "'" anywhere before EOF at (eval 11) line 1.
  • 1
    Don't know nothing about MS-DOS, but latexmk is perl. I am not sure that %0 and %S will be expanded inside simple quote. Anyway, the issue is somewhere else : maybe since you escape the first ", you should also escape the closing one (or escape none. I would try without \, since I can't see why you escaped it). The message error is related to ' but it might help. – sztruks Oct 10 '17 at 16:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.