为什么在 tufte-handout 中使用带有 newfloat 选项的 minted 包时需要在列表环境中留一个空行

为什么在 tufte-handout 中使用带有 newfloat 选项的 minted 包时需要在列表环境中留一个空行

如标题所述。MWE:

\documentclass{tufte-handout}
\usepackage[newfloat]{minted}
\begin{document}
\begin{listing}

\begin{minted}{python}
a = 666
\end{minted}
\end{listing}
\end{document}

如果我删除空白行,pdflatex 会报错。如果我更改为文章并删除空白行,它就可以正常工作。这是怎么回事?

我不确定日志的哪一部分应该放在这里,因为它太丰富了。以下是其中的一部分:

! Bad space factor (0).
<recently read> \@savsf 
                        
l.7 \end{minted}
                
I allow only values in the range 1..32767 here.


! LaTeX Error: \begin{minipage} on input line 5 ended by \end{VerbatimOut}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.7 \end{minted}
                
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

! Missing } inserted.
<inserted text> 
                }
l.7 \end{minted}
                
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.

runsystem(pygmentize -S default -f latex -P commandprefix=PYG > mwe.out.pyg)...
executed.

(./mwe.out.pyg)
runsystem(pygmentize -S default -f latex -P commandprefix=PYGdefault > mwe.out.
pyg)...executed.

 (./mwe.out.pyg)
runsystem(pygmentize -l php -f latex -P commandprefix=PYG -F tokenmerge -o mwe.
out.pyg mwe.pyg)...executed.

 (./mwe.out.pyg)

! LaTeX Error: \begin{lrbox} on input line 5 ended by \end{minted}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.7 \end{minted}
                
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

! Improper \prevdepth.
\@gtempa ...negatefalse \iftrue \ifnum \prevdepth 
                                                  >0\relax \TE@setvaltrue \e...

相关内容