1

I would like to customize the settings for text highlighting on TexStudio.

I'm working with lot of big and small equations and using the breqn package. Here is some sample code:

\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath} 
\usepackage{mathpazo}
\usepackage[mathpazo]{flexisym}
\usepackage{breqn}
\newcommand{\eq}[1]{\begin{dmath}#1\end{dmath}}

\begin{document}
    A small inline equation: $small$\\

    A regular non-inlined equation:
    \begin{equation}
        Regular = \omega \times \delta
    \end{equation}

    A big equation that might need line breaks:
    \begin{dmath}
        Big = \omega \times \delta + bla + bla + bla + bla + bla  + bla + bla + bla + bla  + bla + bla + bla  + bla + bla + bla  
    \end{dmath}

    The way I'd like to deal with this:
    \eq{something = \omega + \delta}    
\end{document}

And the result is fine:

The resulting PDF

However, when working on the text editor of TexStudio, the code looks like this: Working with TexStudio

My question: Is there a way to get TeXstudio to understand that the dmath environment is an equation environment so that it does not highlights the math symbols in red but use the formatting used in the equation environment? Would it be possible to do the same with the custum command as well?

Mefitico
  • 135
  • I don't use TeXstudio, but perhaps the documentation can help you: http://texstudio.sourceforge.net/manual/current/usermanual_en.html – Skillmon Jan 28 '18 at 22:55
  • You need to write your own .cwl file I think, see e.g. https://tex.stackexchange.com/questions/102272/texstudio-how-to-add-custom-highlighting-for-custom-environment – Torbjørn T. Jan 29 '18 at 08:19
  • 1
    See https://tex.stackexchange.com/a/361283/117534 for a bit more detail on how to write .cwl. Reading the documentation on cwl classification format will also be useful – Troy Jan 29 '18 at 10:08
  • @Troy yep, that did the trick, nice catch =) – Mefitico Jan 31 '18 at 02:39

0 Answers0