我已经按我想要的方式做了,而且
仍然保留单个逐字环境的语义
这样地:
\usepackage{fancyvrb}
\makeatletter
\newcommand{\nl}[1]{\hbox to\z@{%
\hss (#1) \kern3pt}}
\makeatother
用法:
\begin{Verbatim}[commandchars=\\\{\}]
HTTP/1.1 200 OK
Server: Apache/2.2.3 (Red Hat)
Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT
ETag: "b300b4-1b6-4059a80bfd280"
\nl{1}Accept-Ranges: bytes
Content-Type: text/html; charset=UTF-8
Connection: Keep-Alive
Date: Tue, 15 Dec 2009 11:52:46 GMT
Age: 2528
Content-Length: 438
<HTML>
<HEAD>
<TITLE>Example Web Page</TITLE>
</HEAD>
<body>
\nl{2}<p>You have reached this web page by typing "example.com",
"example.net",
or "example.org" into your web browser.</p>
<p>These domain names are reserved for use in documentation and are not available
for registration. See <a href="http://www.rfc-editor.org/rfc/rfc2606.txt">RFC
2606</a>, Section 3.</p>
</BODY>
</HTML>
\end{Verbatim}