Can I avoid math mode highlighting?

TXS - Help
Stu
2010-01-29
2012-10-17
  • Stu
    Stu
    2010-01-29

    I have a custom command that is a modified verbatim environment. Form the
    preamble:

    \usepackage{fancyvrb}
    
    \DefineVerbatimEnvironment
    {rcode}{Verbatim}
    {formatcom=\color{BrickRed}, frame=single, rulecolor=\color{OliveGreen}}
    

    So in the actual document I have something like:

    \begin{rcode}
    mean(cars$speed)
    \end{rcode}
    

    and because of that '$' everything starts being highlighted as if it is in
    math mode. Is there a way I can get it to either ignore code within my custom
    environment or maybe treat my environment the same way it treats verbatim?

     
  • Stu
    Stu
    2010-01-29

    One work-around is to use rename my custom verbatim environment to 'verbatim'
    and this will be OK since I'm not use the verbatim package. However if I
    create a 2nd custom verbatim environment I'm kind stuck.

     
  • You can copy/change the verbatim context tag in utilities/qxs/tex.qnfa, but
    you have to recompile texmakerx afterwards

     
  • Stu
    Stu
    2010-02-02

    Could an additional context tag be added? Such as 'Verbatim' -- this is the
    one fancyvrb uses by default. Then at least the highlighting accommodates the
    use of an extra package as well as giving the user two tags to 'play' with.

     
  • that won't benecessary as i am working on a user defineable custom enviroments
    for syntax highlighting
    it will take some days though

     
  • custom enviroment highling has been implemented in svn rev. 723.
    You can put additional enviroments in Options/custom environments table which
    are subsequently treated as verbatim-environment (or math if you like)

     
  • Stu
    Stu
    2010-02-03

    I'm going to put a picture of you of the wall.