如何在 LaTeX 中包含一大块正则表达式?
是否可以包含一大块正则表达式(例如: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html)而不先转义所有冲突字符?
我想到类似的东西
\begin{following_section_will_not_be_parsed_by_latex}
(a+?b)
\end{...}
Is it possible to include a large block of a regex (like this one: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html) without escaping all colliding characters first?
I think of something like
\begin{following_section_will_not_be_parsed_by_latex}
(a+?b)
\end{...}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以包含
\usepackage{listings}
然后使用You can include
\usepackage{listings}
and then use查看 fancyvrb 包。来自自述文件:
所以你可以这样做:
为了不让巨大的正则表达式弄乱你的 Latex 文件,你可以 也逐字包含文件。
Look at fancyvrb package. From the README:
So you can do something like:
In order to not clutter your Latex file with the huge regex, you can include a file verbatim as well.
使用
逐字
块。但它看起来不会很好:(Use a
verbatim
block. But it won't look very nice :(