有沒有一種方法可以重置某個字符序列的樣式? 我使用listings
包顯示源代碼,並使用prebreak
屬性顯示轉義字符\
以指示當前行已損壞。問題在於有時反斜槓因爲使用了語法高亮而被着色。乳膠:重置字體樣式
所以我需要基本的東西像resetstyle
聲明,如下面的假想例子:
\textbf{Some bold text \resetstyle{not bold, no color} foo bar}
編輯: 下面是我通過lstset
使用的設置:
\lstset{
extendedchars = \true,
inputencoding = utf8,
basicstyle = \scriptsize\ttfamily,
breaklines = true,
breakindent = 10pt,
breakatwhitespace = true,
breakautoindent = true,
prebreak = \\,
frame = leftline,
showtabs = true,
numbers = left,
stepnumber = 2,
numberstyle = \footnotesize,
numbersep = 10pt,
keywordstyle = \color[RGB]{0,0,255},
commentstyle = \itshape\color[RGB]{120,120,120},
stringstyle = \color[rgb]{0.627,0.126,0.941},
emphstyle = {[0]\color[RGB]{236,0,168}},
emphstyle = {[1]\color[RGB]{34,139,34}\underbar},
emphstyle = {[2]\textbf}
}
不起作用:/。實際上沒有任何反應。 – watain 2010-01-12 09:44:20