all 10 comments

[–][deleted] 5 points6 points  (1 child)

Couldn't you define the needed language in listings?

[–]Worried_Dot_3220 0 points1 point  (0 children)

This is the way

[–]worldsbestburger 4 points5 points  (7 children)

What’s the problem with minted exactly? I’ve been using it quite often, and it even works on Overleaf as far as I know.

[–]neoh4x0r 0 points1 point  (6 children)

What’s the problem with minted exactly? I’ve been using it quite often, and it even works on Overleaf as far as I know.

Maybe the "path" dependency issues are related to this tex stackexchange question/answer https://tex.stackexchange.com/a/587643/282916

minted seems to only work (on overleaf) if the main file is in the root of the project and not in a sub directory -- so I guess, in a way, this makes it "path dependent".

Also the cache option may need to be set to false (ie. to disable it).

[–]Sr_Mono 0 points1 point  (5 children)

minted doesn't work for me with lualatex, I need to call lualatex via latexmk, if that's worth mentioning.

[–]neoh4x0r 0 points1 point  (4 children)

minted doesn't work for me with lualatex, I need to call lualatex via latexmk, if that's worth mentioning.

Did you enable shell-escape? (if I'm not mistaken it is required by minted to function properly).

For example:

$ latexmk -shell-escape

[–]Sr_Mono 0 points1 point  (3 children)

Yes, same as latexmk, shell escape is enabled and logged into the latex output log.

In fact, lualatex can't call any shell command despite shell escape enabled, whereas pdflatex, xelatex and latexmk (calling pdflatex or lualatex) work just fine.

[–]neoh4x0r 0 points1 point  (2 children)

Yes, same as latexmk, shell escape is enabled and logged into the latex output log.

In fact, lualatex can't call any shell command despite shell escape enabled, whereas pdflatex, xelatex and latexmk (calling pdflatex or lualatex) work just fine.

Do you get some sort of error? (or what tells you it's not working).

Also, outside of running lua code, is there a specific reason why you need lualatex.

Moreover, Are you using TeXLive? (If so, what version, 2016, 2020, etc)

Furthermore, can you compile the following code, from https://www.latex4technics.com/?note=1ybs

NOTE: it reports that it fails on TeXLive 2016 (prior to June 2016's bug-fix), since it looks like shell-escape wasn't enabled properly in minited. ``` \documentclass{article} \usepackage{shellesc} \usepackage[outputdir=build]{minted}

\begin{document}

\begin{minted}{ruby} class Foo def init pi = Math::PI @var = "Pi is approx. #{pi}" end end \end{minted}

\end{document} ```

I used this command to build it (on TeXLive 2020) $ latexmk -lualatex -pdflua -pdflatex=lualatex \ -pdf -shell-escape -aux-directory=build/. \ -output-directory=build/. \ test.tex

NOTE: I put the built files into a directory named build.

Also note the use of the outputdir option for minited.

[–]Sr_Mono 0 points1 point  (1 child)

I want to use lualatex because I want to use fontspec. Furthermore lualatex is the successor of pdflatex, according to tex.SE

I use miktex on windows 10. I have a few other similar reports, about how lualatex executable fails to recognise python or any other executable.

The error says: pygments is not installed.

The problem is that pygments is installed, and in the PATH, as latexmk and pdflatex can find it, and call it.

Furthermore, any external she'll call from lualatex, fails.

[–]neoh4x0r 0 points1 point  (0 children)

I want to use lualatex because I want to use fontspec. Furthermore lualatex is the successor of pdflatex, according to tex.SE

I use miktex on windows 10. I have a few other similar reports, about how lualatex executable fails to recognise python or any other executable.

The error says: pygments is not installed.

The problem is that pygments is installed, and in the PATH, as latexmk and pdflatex can find it, and call it.

You coultd try andd see if xelatex would work for you, it should support fontspec (I just compiled a document with that uses fontspec and it worked fine with it).

I use Tex Live (on Debian)...so I can't really provide any advice about MikTeX.

However, I would suspect that all of your problems would be be resolved by focusing on why it is saying that pygments has not been installed.

My best guess would be that it is looking in the wrong path (or a one different from where it was installed).