Re: [問題] 訊息框裡面放\verb= =?

看板LaTeX (論文排版)作者時間18年前 (2007/11/03 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/4 (看更多)
※ 引述《jsb.bbs@ptt.cc (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} > ※ 引述《EdwardLee.bbs@bbs.cs.nctu.edu.tw (蒙古大夫 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
文章代碼(AID): #17A-kp00 (LaTeX)
文章代碼(AID): #17A-kp00 (LaTeX)