Latex: reset font style

Posted by watain on Stack Overflow See other posts from Stack Overflow or by watain
Published on 2010-01-12T09:30:10Z Indexed on 2010/06/07 7:02 UTC
Read the original article Hit count: 376

Filed under:
|
|
|

Is there a way I can reset the style of a certain character sequence? I'm using the listings package to display source code and the prebreak property to display a escape character \ to indicate that the current lines was broken. The problem is that sometimes the backslash is colored because of the syntax highlighting used.

So I need basically something like a resetstyle statement, as in the following imaginary example:

\textbf{Some bold text \resetstyle{not bold, no color} foo bar}

EDIT: Here are the settings that I'm using via 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}
}

© Stack Overflow or respective owner

Related posts about latex

Related posts about reset