I'm using TeXstudio 2.11 on windows 8.1 and have problems with a syntax highlighting when I use math symbols in a new environment:
My Code:
\documentclass{book}
\usepackage{verbatim}
\usepackage{minted}
\newenvironment{languagebat}{\VerbatimEnvironment\minted[
frame=single,
xleftmargin=0mm,
numbersep=5pt,
autogobble,
breaklines,
breakanywhere,
breaklines,
framesep=2mm,
rulecolor=black!30,
bgcolor=black!3,
linenos=false,
startinline,
tabsize=4
]{bat}}{\endminted}
\begin{document}
\begin{languagebat}
$ git rm --cached giant_file
\end{languagebat}
\end{document}
Result in the editor:
I think the languagebat
environment extends from verbatim environment correctly and that should be working fine.
The problem seems to be the $
sign in the languagebat
environment, and TeXstudio believes that I have entered some math code that I have not yet terminated with an ending $
sign. Is there a way to tell TeXstudio to ignore syntax highlighting within a particular environment?
- They had the same problem but I don't understand how to fix it in TeXstudio: Using math symbols within lstlisting