LaTeX中逐字环境中的文本颜色

LaTeX中逐字环境中的文本颜色,latex,Latex,如何在逐字记录环境中更改文本某些部分的颜色。我有这样的想法: \tiny\begin{verbatim} HTTP/1.1 200 OK Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Expires: Mon, 1 Aug 2011 09:00:00 GMT Connection: close Access-Control-Max-Age: 0 Acce

如何在逐字记录环境中更改文本某些部分的颜色。我有这样的想法:

\tiny\begin{verbatim}
HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Expires: Mon, 1 Aug 2011 09:00:00 GMT
Connection: close
Access-Control-Max-Age: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Headers: Content-Type
Content-type: application/json
[{"error":{"type":1,"address":"/","description":"unauthorized user"}}] <--- This text needs to be red
\end{verbatim}
\normalsize
似乎非常适合此任务:

\documentclass{article}
\usepackage{fancyvrb,xcolor}

\begin{document}

This is some preceding text.

\begin{Verbatim}[fontsize=\small,commandchars=\\\(\)]
HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Expires: Mon, 1 Aug 2011 09:00:00 GMT
Connection: close
Access-Control-Max-Age: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Headers: Content-Type
Content-type: application/json
(\color(red)"error":{"type":1,"address":"/","description":"unauthorized user"}}])
\end{Verbatim}

This is some following text.
\end{document}


由于在逐字记录要求中没有出现
\
,因此它被用作控制序列和参数文本分隔符。

同样的问题和正确的答案是相同的。
\documentclass{article}
\usepackage{fancyvrb,xcolor}

\begin{document}

This is some preceding text.

\begin{Verbatim}[fontsize=\small,commandchars=\\\(\)]
HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Expires: Mon, 1 Aug 2011 09:00:00 GMT
Connection: close
Access-Control-Max-Age: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE
Access-Control-Allow-Headers: Content-Type
Content-type: application/json
(\color(red)"error":{"type":1,"address":"/","description":"unauthorized user"}}])
\end{Verbatim}

This is some following text.
\end{document}