看板LaTeX
标 题Re: [问题] 讯息框里面放\verb= =?
发信站SayYA 资讯站 (Sat Nov 3 11:01:10 2007)
转信站ptt!ctu-reader!ctu-peer!news.nctu!News.Math.NCTU!SayYa
※ 引述《[email protected] (jsb)》之铭言:
> 多谢!结果用 \lrbox 解决了:
> \newsavebox{\verbex}
> \begin{lrbox}{\verbex}
> \verb=\parbox=
> \end{lrbox}
> \begin{center}
> \begin{minipage}[h]{10cm}
> \fbox{\parbox{10cm}
> {This is a test message. If the message is longer than the width
> indicated by \usebox{\verbex}, it breaks into the next line.}
> }
> \end{minipage}
> \end{center}
> ※ 引述《[email protected] (蒙古大夫 2.0)》之铭言:
> : \verb 不能当其他指令的参数。例如,不能用在 \fbox{} 里头。请参考:
> : http://www.tex.ac.uk/cgi-bin/texfaq2html?label=verbwithin
我个人的看法和 uk TeX FAQ 一样,\verb 及 verbatim 环境是 LaTeX 中,
食之无味,弃之可惜的东西,建议考虑 fancyvrb pacakge,或者只需简单
使用的话,verbdef package,例如以上的例子:
\usepackage{verbdef}
\verbdef\ParBox|\parbox|
[...]
\begin{center}
\begin{minipage}[h]{.9\textwidth}
\fbox{\parbox{.9\textwidth}
{This is a test message. If the message is longer than
the width indicated by \ParBox, it breaks into the next
line.}}
\end{minipage}
\end{center}
这样,文稿可能会比较好维护。
--
一个神圣的目标是很危险的。当一个目标变得神圣时,
要达到这个目标的手段往往会变得很卑下。(林语堂.快乐的天才)
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: edt1023.sayya.org