作者wyvernlee (wyvernlee)
看板LaTeX
标题Re: [问题] 关於字与字的间距微调
时间Sun May 4 20:37:48 2008
※ 引述《[email protected] (蒙古大夫 2.0)》之铭言:
: ※ 引述《[email protected] (wyvernlee)》之铭言:
: > 大家好,小弟有一个问题百思不得其解,google 了老半天实在找不大到答案,因此上
: > 网向大家请教。小弟写了一个小 command 定义如下:
: > \definecolor{lgray}{gray}{.8}
: > \newcommand{\bashcommand}[1]{
: > \begin{flushleft}
: > \hskip 0.5cm
: > \fontfamily{phv}\selectfont
: > %\def {\hspace{1em}} % 定义空白为 0.4em
: > \colorbox{lgray}{#1} \Enter
: > \end{flushleft}
: > }
: 排版程式码请使用 listings package,无需自行定义。
关於 listings package,我也写了一小段 code 如下:
\lstnewenvironment{command}[1][]
{\lstset{language=bash,frame=single,#1}
\fontfamily{phv}\selectfont
}
{}
如此一来我就可以用
\begin{command}
ls -al
\end{command}
来表达我要输入的文字,但是问题就在於 listing package 跟 keystroke package
似乎不能和平共处,因此少了 \Enter 这个符号。
有关 keystroke 的资料可看:
http://dante.ctan.org/CTAN/macros/latex/contrib/keystroke/
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 125.229.4.190