gpoore / minted

minted is a LaTeX package that provides syntax highlighting using the Pygments library. Highlighted source code can be customized using fancyvrb.
1.75k stars 127 forks source link

Red <MINTED> output for every line #418

Closed xathon closed 2 weeks ago

xathon commented 2 weeks ago

Similarly to #402 , minted prints <MINTED> in red instead of the code.

Document:

\documentclass{article}
\usepackage[debug]{minted}
\begin{document}

X\mintinline{python}{"x"}X

\end{document}

Output: image

Logfile:

cat output.log

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 7 Apr. 2024. Version 4.85.
Latexmk: Changing directory to '/var/lib/sharelatex/data/compiles/6720e5b3d7867b7384ef9a16-669f82c8a8b0583f02e77632/'
Latexmk: applying rule 'xelatex'...
Rule 'xelatex':  Reasons for rerun
Changed files or newly in use/created:
  /usr/local/texlive/2024/texmf.cnf
Category 'changed_user':
  /usr/local/texlive/2024/texmf.cnf

------------
Run number 1 of rule 'xelatex'
------------
------------
Running 'xelatex -no-pdf -synctex=1 -interaction=batchmode -recorder --jobname="output"  "main.tex"'
------------
This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode

SyncTeX written on output.synctex.gz.Latexmk: Getting log file 'output.log'
Latexmk: Examining 'output.fls'
Latexmk: Examining 'output.log'
Latexmk: Log file says output to 'output.xdv'
Latexmk: applying rule 'xdvipdfmx'...
Rule 'xdvipdfmx':  Reasons for rerun
Changed files or newly in use/created:
  output.xdv
Category 'changed_source_rules':
  xelatex
Category 'no_dest':
  xdvipdfmx

------------
Run number 1 of rule 'xdvipdfmx'
------------
------------
Running 'xdvipdfmx -E -o "output.pdf"  "output.xdv"'
------------
Latexmk: All targets (output.xdv output.pdf) are up-to-date
Latexmk: Undoing directory change

root@4f358aad4381:/var/lib/sharelatex/data/compiles/6720e5b3d7867b7384ef9a16-669f82c8a8b0583f02e77632# cat output.log 
This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex 2024.10.29)  29 OCT 2024 16:21
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**main.tex
(./main.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-10-09>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2024/02/08 v1.4n Standard LaTeX file (size option)
)
\c@part=\count190
\c@section=\count191
\c@subsection=\count192
\c@subsubsection=\count193
\c@paragraph=\count194
\c@subparagraph=\count195
\c@figure=\count196
\c@table=\count197
\abovecaptionskip=\skip49
\belowcaptionskip=\skip50
\bibindent=\dimen141
) (/usr/local/texlive/2024/texmf-dist/tex/latex/minted/minted.sty
Package: minted 2024/10/07 v3.1.2 Yet another Pygments shim for LaTeX
(/usr/local/texlive/2024/texmf-dist/tex/generic/catchfile/catchfile.sty
Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO)
(/usr/local/texlive/2024/texmf-dist/tex/generic/infwarerr/infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
) (/usr/local/texlive/2024/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty
Package: ltxcmds 2023-12-04 v1.26 LaTeX kernel commands for general use (HO)
) (/usr/local/texlive/2024/texmf-dist/tex/generic/etexcmds/etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
(/usr/local/texlive/2024/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
))) (/usr/local/texlive/2024/texmf-dist/tex/latex/etoolbox/etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count198
) (/usr/local/texlive/2024/texmf-dist/tex/latex/fvextra/fvextra.sty
Package: fvextra 2024/09/14 v1.8.0 fvextra - extensions and patches for fancyvr
b
(/usr/local/texlive/2024/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Package: fancyvrb 2024/01/20 4.5c verbatim text (tvz,hv)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2022/05/29 v1.15 key=value parser (DPC)
\KV@toks@=\toks17
)
\FV@CodeLineNo=\count199
\FV@InFile=\read2
\FV@TabBox=\box52
\c@FancyVerbLine=\count266
\FV@StepNumber=\count267
\FV@OutFile=\write3
) (/usr/local/texlive/2024/texmf-dist/tex/latex/upquote/upquote.sty
Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verba
tim
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/textcomp.sty
Package: textcomp 2024/04/24 v2.1b Standard LaTeX package
)) (/usr/local/texlive/2024/texmf-dist/tex/latex/lineno/lineno.sty
Package: lineno 2023/05/20 line numbers on paragraphs v5.3
Invalid UTF-8 byte or sequence at line 292 replaced by U+FFFD.
(/usr/local/texlive/2024/texmf-dist/tex/latex/kvoptions/kvoptions.sty
Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO)
(/usr/local/texlive/2024/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty
Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO)
))
\linenopenalty=\count268
\output=\toks18
\linenoprevgraf=\count269
\linenumbersep=\dimen142
\linenumberwidth=\dimen143
\c@linenumber=\count270
\c@pagewiselinenumber=\count271
\c@LN@truepage=\count272
\c@internallinenumber=\count273
\c@internallinenumbers=\count274
\quotelinenumbersep=\dimen144
\bframerule=\dimen145
\bframesep=\dimen146
\bframebox=\box53
LaTeX Info: Redefining \\ on input line 3180.
)
\c@FancyVerbWriteLine=\count275
\c@FancyVerbBufferIndex=\count276
\c@FancyVerbBufferLength=\count277
\c@FancyVerbBufferLine=\count278
\c@FV@oldbufferlength=\count279
\c@FV@TrueTabGroupLevel=\count280
\c@FV@TrueTabCounter=\count281
\FV@TabBox@Group=\box54
\FV@TmpLength=\skip51
\c@FV@HighlightLinesStart=\count282
\c@FV@HighlightLinesStop=\count283
\FV@LoopCount=\count284
\FV@NCharsBox=\box55
\FV@BreakIndent=\dimen147
\FV@BreakIndentNChars=\count285
\FV@BreakSymbolSepLeft=\dimen148
\FV@BreakSymbolSepLeftNChars=\count286
\FV@BreakSymbolSepRight=\dimen149
\FV@BreakSymbolSepRightNChars=\count287
\FV@BreakSymbolIndentLeft=\dimen150
\FV@BreakSymbolIndentLeftNChars=\count288
\FV@BreakSymbolIndentRight=\dimen151
\FV@BreakSymbolIndentRightNChars=\count289
\c@FancyVerbLineBreakLast=\count290
\FV@LineBox=\box56
\FV@LineIndentBox=\box57
\c@FV@BreakBufferDepth=\count291
\FV@LineWidth=\dimen152
) (/usr/local/texlive/2024/texmf-dist/tex/latex/latex2pydata/latex2pydata.sty
Package: latex2pydata 2024/05/16 v0.2.0 latex2pydata - write data to file in Py
thon literal format
(/usr/local/texlive/2024/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
)
\c@pydata@bufferindex=\count292
\c@pydata@defaultbufferlength=\count293
) (/usr/local/texlive/2024/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr
/local/texlive/2024/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
\pgfkeys@pathtoks=\toks19
\pgfkeys@temptoks=\toks20

(/usr/local/texlive/2024/texmf-dist/tex/generic/pgf/utilities/pgfkeyslibraryfil
tered.code.tex
\pgfkeys@tmptoks=\toks21
))) (/usr/local/texlive/2024/texmf-dist/tex/latex/pgfopts/pgfopts.sty
Package: pgfopts 2014/07/10 v2.1a LaTeX package options with pgfkeys
\pgfopts@list@add@a@toks=\toks22
\pgfopts@list@add@b@toks=\toks23
) (/usr/local/texlive/2024/texmf-dist/tex/latex/tools/shellesc.sty
Package: shellesc 2023/07/08 v1.0d unified shell escape interface for LaTeX
Package shellesc Info: Restricted shell escape enabled on input line 77.
) (/usr/local/texlive/2024/texmf-dist/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count294
\float@exts=\toks24
\float@box=\box58
\@float@everytoks=\toks25
\@floatcapt=\box59
)
\c@minted@tmpcnt=\count295
\c@minted@tmpcodebufferlength=\count296
\c@minted@numcachefiles=\count297
\c@minted@FancyVerbLineTemp=\count298
\@float@every@listing=\toks26
\c@listing=\count299
) (/usr/local/texlive/2024/texmf-dist/tex/latex/xcolor/xcolor.sty
Package: xcolor 2024/09/29 v3.02 LaTeX color extensions (UK)
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-cfg/color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: xetex.def on input line 274.
(/usr/local/texlive/2024/texmf-dist/tex/latex/graphics-def/xetex.def
File: xetex.def 2022/09/22 v5.0n Graphics/color driver for xetex
) (/usr/local/texlive/2024/texmf-dist/tex/latex/graphics/mathcolor.ltx)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1349.
Package xcolor Info: Model `RGB' extended on input line 1365.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1367.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1370.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1371.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1372.
) (/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
File: l3backend-xetex.def 2024-05-08 L3 backend support: XeTeX
\g__graphics_track_int=\count300
\l__pdf_internal_box=\box60
\g__pdf_backend_annotation_int=\count301
\g__pdf_backend_link_int=\count302
) (./output.aux)
\openout1 = `output.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 3.
LaTeX Font Info:    Trying to load font information for TS1+cmr on input line 3
.
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1cmr.fd
File: ts1cmr.fd 2023/04/13 v2.5m Standard LaTeX font definitions
)
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 3.
LaTeX Font Info:    ... okay on input line 3.
\pydata@fh@_78E6221F6393D1356681DB398F14CE6D.data.minted=\write4
\openout4 = `_78E6221F6393D1356681DB398F14CE6D.data.minted'.

runsystem(latexminted config  --timestamp 20241029162133Z  --debug 78E6221F6393
D1356681DB398F14CE6D)...executed safely (allowed).

(./_78E6221F6393D1356681DB398F14CE6D.config.minted)
runsystem(latexminted cleanconfig  --timestamp 20241029162133Z  --debug 78E6221
F6393D1356681DB398F14CE6D)...executed safely (allowed).

\minted@intempfile=\read3
\openout4 = `_78E6221F6393D1356681DB398F14CE6D.data.minted'.

\c@minted@tmpdatabufferlength=\count303
LaTeX Font Info:    Font shape `TU/lmtt/bx/n' in size <10> not available
(Font)              Font shape `TU/lmtt/b/n' tried instead on input line 5.

[1

] (./output.aux)
 ***********
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-10-09>
 ***********
runsystem(latexminted batch  --timestamp 20241029162133Z  --debug 78E6221F6393D
1356681DB398F14CE6D)...executed safely (allowed).

 ) 
Here is how much of TeX's memory you used:
 6070 strings out of 476189
 147839 string characters out of 5785578
 627267 words of memory out of 5000000
 28601 multiletter control sequences out of 15000+600000
 558093 words of font info for 39 fonts, out of 8000000 for 9000
 36 hyphenation exceptions out of 8191
 85i,5n,93p,363b,266s stack positions out of 10000i,1000n,20000p,200000b,200000s

Output written on output.xdv (1 page, 904 bytes).
cat _78E6221F6393D1356681DB398F14CE6D_1.data.minted 
[
{
"command": "styledef",
"jobname": "output",
"timestamp": "20241029162133Z",
"currentfilepath": "",
"currentfile": "",
"inputlineno": "5",
"cachepath": "_minted/",
"styledeffilename": "default.style.minted",
"style": "default",
"commandprefix": "PYG",
},
{
"command": "highlight",
"code":
"""\
\"x\"
""",
"pyopt.lexer": "python",
"pyopt.commandprefix": "PYG",
"pyopt.autogobble": "false",
"pyopt.encoding": "utf8",
"pyopt.funcnamehighlighting": "true",
"pyopt.gobble": "0",
"pyopt.gobblefilter": "0",
"pyopt.keywordcase": "none",
"pyopt.literalenvname": "MintedVerbatim",
"pyopt.mathescape": "false",
"pyopt.python3": "true",
"pyopt.rangeregexmatchnumber": "1",
"pyopt.rangeregexdotall": "false",
"pyopt.rangeregexmultiline": "false",
"pyopt.startinline": "false",
"pyopt.stripall": "false",
"pyopt.stripnl": "false",
"pyopt.texcl": "false",
"pyopt.texcomments": "false",
"pyopt.codetagify": "",
"pyopt.escapeinside": "",
"pyopt.literatecomment": "",
"pyopt.rangestartstring": "",
"pyopt.rangestartafterstring": "",
"pyopt.rangestopstring": "",
"pyopt.rangestopbeforestring": "",
"pyopt.rangeregex": "",
"jobname": "output",
"timestamp": "20241029162133Z",
"currentfilepath": "",
"currentfile": "",
"inputlineno": "5",
"cachepath": "_minted/",
"highlightfilename": "01B4F230317551DC7C1832CCF24B5905.highlight.minted",
},
]
cat _minted/01B4F230317551DC7C1832CCF24B5905.highlight.minted 
\begin{MintedVerbatim}[commandchars=\\\{\}]
\PYG{l+s+s2}{\PYGZdq{}}\PYG{l+s+s2}{x}\PYG{l+s+s2}{\PYGZdq{}}
\end{MintedVerbatim}

I have installed minted with tlmgr. Latexminted is on the path: image

image

image

What can I do there?

gpoore commented 2 weeks ago

By default, minted version 3 requires 2 compiles the first time that it is used. In most cases, this makes cache creation faster. It looks like latexmk isn't detecting that a second compile is needed. You can disable this optimization instead: \usepackage[highlightmode=immediate]{minted}.

xathon commented 2 weeks ago

Huh, indeed. No idea how I didn't catch that. Thanks!