![为什么 fancyvrb 会将评论变成非评论?](https://linux22.com/image/388927/%E4%B8%BA%E4%BB%80%E4%B9%88%20fancyvrb%20%E4%BC%9A%E5%B0%86%E8%AF%84%E8%AE%BA%E5%8F%98%E6%88%90%E9%9D%9E%E8%AF%84%E8%AE%BA%EF%BC%9F.png)
当我执行以下代码时,我得到了一个很好的.pdf
结果:
\documentclass{minimal}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim}
sdfsdfs
\end{Verbatim}
\end{document}
下面是相同的代码,但使用以下方法添加了一些注释%
\documentclass{minimal}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim} % Upper case `V` references package{fancyvrb}
sdfsdfs
\end{Verbatim} % Upper case `V` references package{fancyvrb}
\end{document}
添加评论后,我收到以下错误消息:
[Loading MPS to PDF converter (version 2006.09.02).]
)
! FancyVerb Error:
Extraneous input `sdfsdfs' between \begin{Verbatim}[<key=value>] and line end
.
\FV@Error ... {FancyVerb Error:
\space \space #1
}
l.5 sdfsdfs
我尝试执行清理操作(删除所有临时.aux
文件,,,.gz
等等.synctex
......
以下是我所使用的软件的描述:
--------------------------------------------------
| `fancyvrb' |
| Version 3.1 |
| Nov 17, 2018 |
| |
| Timothy Van Zandt (Princeton University - USA) |
| |
| Packaging, documentation and support |
| Denis Girou (CNRS/IDRIS - France) |
| <[email protected]> |
| Sebastian Rahtz (Elsevier - GB) |
| Herbert Voss, Berlin ([email protected]) |
--------------------------------------------------
--- fancyvrb.sty
3.1a 2018/11/20 - small changes to the documentation (hv)
3.1 2018/11/17 - load package xcolor only if it is not done already (hv)
3.0 2018/11/01 - remove the example part from francyvrb (hv)
[etc...]
--- fancyvrb-ex.sty
0.01 2018/11/01 - first CTAN version
答案1
无论该行文本是否是注释,您都会收到错误。
\documentclass{minimal}
\usepackage{fancyvrb}
\begin{document}
\begin{Verbatim} xxx
sdfsdfs
\end{Verbatim}
\end{document}
将注释转换为非注释或多或少是逐字环境的主要特征,这种环境的全部意义在于特殊字符就像%
只是变成以自己方式排版的普通字符,而不是按照其通常的特殊行为行事。