我使用了examplep
描述列表项中的包,我只是按照答案进行操作史蒂芬·柯特维茨他在回答这个问题时说:逐字描述列表项。
这是测试代码,这正是该问题的答案。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[Q=yes]{examplep}
\begin{document}
\begin{description}
\item[\Q{list comprehension [f a | a <- M a]}] bla bla bla
\item[\PVerb{testing: \verb||{} #_$ }] item text
\end{description}
\end{document}
如果我没记错的话,它在我的 TexLive 2020 及更早版本中运行正常。但它似乎在我的新 TexLive 2021 中失败了(我使用的是 Windows 7 64 位操作系统,并使用了 Xelatex),出现以下错误:
(e:/texlive/2021/texmf-dist/tex/latex/lm/t1lmtt.fd
File: t1lmtt.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
)
! Package examplep Error: \PVerb inner delimiter must be brace,
(examplep) not backslash or control sequence or active char.
See the examplep package documentation for explanation.
Type H <return> for immediate help.
...
l.7 \item[\PVerb{testing: \verb||{} #_$ }]
item text
Try typing <return> to proceed.
If that doesn't work, type X <return> to quit.
! You can't use `macro parameter character #' in restricted horizontal mode.
<argument> \PVerb {testing: \verb ||{} ##
_$ }
l.7 \item[\PVerb{testing: \verb||{} #_$ }]
item text
Sorry, but I'm not programmed to handle this case;
I'll just pretend that you didn't ask for it.
If you're in the wrong mode, you might be able to
return to the right one by typing `I}' or `I$' or `I\par'.
! Missing $ inserted.
<inserted text>
$
l.7 \item[\PVerb{testing: \verb||{} #_$ }]
item text
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.
有什么想法可以解决这个问题吗?