crop 和 minted 包之间不兼容吗?

crop 和 minted 包之间不兼容吗?

crop我在使用包(用于添加裁剪标记)和包(用于代码语法高亮)时遇到了问题minted。仅仅加载这两个包就会导致pdflatex挂起。这是一个 MWE:

\documentclass{article}
% cross and cam options seems to be the problem
\usepackage[cam]{crop}
\usepackage{minted}
\begin{document}
Testing, 1, 2, 3.
\end{document}

如果我删除 minted usepackage 或 crop usepackage,示例排版会很好。但是,无论以何种顺序放置这两个 usepackage,排版都会挂起,我必须使用^c如下所示的方式中断它。

% pdflatex -shell-escape test.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2022-11-01>
L3 programming layer <2022-11-02>
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2022/texmf-dist/tex/latex/crop/crop.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/iftex/ifluatex.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/color.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-def/pdftex.def)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg))
(/usr/local/texlive/2022/texmf-dist/tex/xelatex/xetexconfig/crop.cfg))
(/Users/shieber/Library/texmf/tex/latex/minted.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))
(/usr/local/texlive/2022/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/float/float.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/tools/calc.sty)
(/usr/local/texlive/2022/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/tools/shellesc.sty)
(/usr/local/texlive/2022/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/infwarerr/infwarerr.sty))
(/usr/local/texlive/2022/texmf-dist/tex/generic/catchfile/catchfile.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/etexcmds/etexcmds.sty))
(./test.w18))
(/usr/local/texlive/2022/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2022/texmf-dist/tex/generic/xstring/xstring.sty
(/usr/local/texlive/2022/texmf-dist/tex/generic/xstring/xstring.tex))
(/usr/local/texlive/2022/texmf-dist/tex/latex/lineno/lineno.sty))
(./_minted-test/default.pygstyle)/Users/shieber/.pyenv/shims/pygmentize

(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./test.aux)
(/usr/local/texlive/2022/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2022/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2022/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(./_minted-test/default-pyg-prefix.pygstyle)^C
! Interruption.
\CROP@@info ...fter \csname \CROP@font \endcsname 
                                                  {``\jobname ''\x \the \yea...
l.7 \end{document}
                  
? ^D
! Emergency stop.
\CROP@@info ...fter \csname \CROP@font \endcsname 
                                                  {``\jobname ''\x \the \yea...
l.7 \end{document}
                  
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
% 

该问题仅出现在裁剪包的某些设置中,特别是交叉或凸轮选项(可能还有其他选项)。我仅在将 TeXLive 更新到 2022 版本时才注意到此问题。在 2017 下我没有遇到任何问题。

作为参考,我在 TeX Live 2022 版本中使用 pdftex 的 3.141592653-2.6-1.40.24 版本。

% pdflatex -version
pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03

非常感谢您对导致此问题的原因的任何见解。

答案1

您正在使用非标准铸造:

/Users/shieber/Library/texmf/tex/latex/minted.sty 

删除它,并允许使用来自 texlive 2022 的那个

相关内容