1

I was compiling my main.tex file fine with latexmk using latexmk -xelatex -outdir=output -auxdir=auxil main.tex

Until suddenly latexmk stopped detecting the options i gave it:

(venv) PS C:\Users\user\PycharmProjects\test2\src> latexmk -xelatex -outdir=output -auxdir=auxil main.tex
Usage
=====
  latexmk [options] [filename]

latexmk: error: no such option: -x

Moreover: Latexmk does the same with any first passed option that is longer than 1 character:

(venv) PS C:\Users\user\PycharmProjects\test2\src> latexmk -outdir=output -auxdir=auxil main.tex              
Usage
=====
  latexmk [options] [filename]

latexmk: error: no such option: -o

The error does not come from xelatex because I can run it separately and it works fine but as I can't use latexmk I have to manually compile my main.tex several times.

I have checked the version of latexmk and it says:

(venv) PS C:\Users\user\PycharmProjects\test2\src> latexmk --version                                              
latexmk 0.4

I finally uninstalled and reinstalled the latexmk module from my computer but it didn't change anything.

I have been looking for similar problems online but I can't seem to find one.

1
  • 2
    You should update your latex installation. I have latexmk version 4.80, so no wonder -xelatex is not known to your version of latex, it wasn't added until much later.
    – daleif
    May 31, 2023 at 8:18

1 Answer 1

1

tl;dr : there was a conflict between latexmk and latexmk.py

Thank you @daleif for your comment,

I checked my latexmk version because i updated it several times and it seemed wierd to me that is was outdated and my version was in fact 4.80 on MikTex.

I then typed latexmk -h to obtain help and it showed me that it was the python version of latexmk and this package was effectively in version 0.4.

So I checked in my PyCharm pip (I am using PyCharm for my project) and the module wasn't detected.

I had to use the Windows shell and not the PyCharm terminal to uninstall it and then when I tried to check latexmk's version I finally got:

(venv) PS C:\Users\user\PycharmProjects\test2\src> latexmk --version
Initial Win CP for (console input, console output, system): (CP850, CP65001, CP1252)
I changed them all to CP1252
Latexmk, John Collins, 4 Apr. 2023. Version 4.80
Reverting Windows console CPs to (in,out) = (850,65001)

Finally telling me that I am using the Perl (and original) version of Latexmk

Edit: And most Importantly, the compilation works now !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .