26 votes
Accepted

How to remove box outlines around parenthesis/brackets in TexStudio?

I found the answer myself. These boxes are called placeholders. They can be removed by going to Options > Configure TexStudio. Then on the bottom left check Show Advanced Options. Go to the Completion ...
jkrod's user avatar
  • 593
18 votes

How to remove box outlines around parenthesis/brackets in TexStudio?

The boxes are placeholders. You can navigate between them using Ctrl+Left/Right. They vanish, if you type over them e.g. if the cursor is before a closing bracket placeholder ), typing ) will move ...
Tim Hoffmann's user avatar
  • 11.1k
15 votes
Accepted

TeXstudio chemfig commands marked as unrecognized

Short answer: It's not in the .cwl file for some reason, you're gonna have to add it in manually. (I think(!) that's the only alternative. I'm happy to be proven wrong..) Long answer: The Why: ...
Troy's user avatar
  • 13.7k
12 votes

Add keyword to language in minted

Since I only needed highlighting for one word and couldn't find any quick solution (and didn't want to rewrite the entire highlighting), I came up with this (ashamingly) dirty workaround: Firstly, ...
cabeer's user avatar
  • 121
11 votes

Highlight footnote in the original tex file?

In TeXstudio, you can modify the Language Definition. Note: We expose the language specification to you as end-user to give you more flexibility in adapting TeXstudio to your needs. But you should ...
Tim Hoffmann's user avatar
  • 11.1k
9 votes
Accepted

The listings package highlights "e3" in "20e3" as identifier

There are some workarounds, each with their own limitations. One possibility is to declare e as a number using alsodigit={e}. This has the disadvantage that other uses of e are also treated as a ...
Marijn's user avatar
  • 35.9k
8 votes
Accepted

Latex Equations: Colour all instances of symbol

(edited/simplified the code after OP clarified that only z_l instances need to be colored for now) You could achieve your objective by using LuaLaTeX and taking a preprocessor-based approach, as is ...
Mico's user avatar
  • 495k
8 votes

Change color of some items in lstlisting

Why don't you use escapechar option, and then set color on every item that you want? Really, I have no idea how to do that automatically. add the following option to the lsset: escapechar={|}, so ...
javadr's user avatar
  • 2,394
8 votes
Accepted

Vim does not recognize math environment (but handles other math fine)

Check if the syntax highlighting rules are up to date. Those should be located under /usr/share/vim/vim80/syntax/tex.vim. In this file there should be a block name Standard Math Zones:. Below that you'...
Skillmon's user avatar
  • 57.7k
8 votes
Accepted

Why does my regex code not work?

Every regex implementation is slightly different, particualrly once one goes outside of the core features. Your regex is using a positive look-behind ((?<=): that's not a totally 'standard' feature....
Joseph Wright's user avatar
  • 257k
8 votes
Accepted

How to embedded source code on-demand into PDF?

Yes, you may embed your source code as a file in the pdf. I'm using usually the package attachfile, but there are some more, the embedfile package e.g. or attachfile2. Using attachfile I'm printing ...
Keks Dose's user avatar
  • 30.7k
8 votes

How to avoid syntax error highlights on Overleaf with redefined meaning of \[, \], \(, \) commands?

Don’t. Just don’t. Seriously...
Gaussler's user avatar
  • 12.7k
7 votes
Accepted

How to make #include <stuff> to be highlighted as keywords?

You can define a new line comment style for all lines starting with #. The style format then is applied up to the end of the line. The relevant changes to your document are: \lstdefinestyle{cpp}{ ...
siracusa's user avatar
  • 13.3k
7 votes
Accepted

Using 'mintinline' inside 'tabu'

This seems to work: using \tabuDisableCommands to let \mintinline do something different and less complicated during the measuring phase and only do its thing during typesetting. It has a drawback, ...
cgnieder's user avatar
  • 66.3k
7 votes
Accepted

Combining multiple listings styles in a single \lstdefinestyle command

Well, in the documentation of listings you can find in chapter 3: There you can find (see red arrows in image): Moreover it is possible to activate other styles. For me that means you can call ...
Mensch's user avatar
  • 65.2k
6 votes

How to make this fancy highlight?

You can try with a tcbox \documentclass{article} \usepackage[most]{tcolorbox} \usepackage{lmodern} \newtcbox{\code}[1][]{% size=fbox, tcbox raise base, nobeforeafter, enhanced, ...
Ignasi's user avatar
  • 135k
6 votes
Accepted

Color of marked Text in TeXStudio

The colour of the selection is set by your OS settings by default in TXS. As of now (TXS version 2.12.8), the option to change the colour of this element is not available in the general settings of ...
Troy's user avatar
  • 13.7k
6 votes
Accepted

Annoying syntax highlighting of unclosed group at \cs:w

(I'm on support staff at Overleaf.) The code aspects have already been addressed in another answer. I'll focus on "Overleaf yelling at you" :-). Overleaf uses chktex as the in-editor syntax checker. ...
Paul Gessler's user avatar
  • 29.4k
6 votes

Dollar sign breaks syntax highlighting in Vim

As the other answer says, if you are writing LaTeX you should have let g:tex_flavor="latex" set in the .vimrc. With that, Vim will skip highlighting verbatim environments but it will still ...
musarithmia's user avatar
  • 12.4k
6 votes
Accepted

Highlight PHP code with minted without <?php

You can use the startinline option: \documentclass{article} \usepackage{minted} \begin{document} % This produces highlighted code. \begin{minted}{php} <?php echo "Hello"; \end{minted} ...
Marijn's user avatar
  • 35.9k
6 votes
Accepted

How to highlight TeX code?

Your problem arises from asking listings to highlight TeX code when you are actually giving it LaTeX code. In TeX \begin, \hline, \multicolumn, etc. are not used and are accordingly not highlighted. ...
Dan's user avatar
  • 3,679
6 votes
Accepted

Why UM Typewriter font not working properly?

As David wrote, you can fix this on the fly in LuaLaTeX by adding a feature to change the glyph width: \documentclass{article} \usepackage{fontspec} % First define the feature. We set the width to ...
Marcel Krüger's user avatar
5 votes

Latex Equations: Colour all instances of symbol

Just try to make your own definition for that. As a starting point a example for your case: \documentclass{article} \usepackage{amsmath,xcolor} \def\zl{{\ensuremath{\color{blue} z_l}}} \begin{...
TeXnician's user avatar
  • 33.4k
5 votes

Latex Equations: Colour all instances of symbol

You do not have to have markup (or Lua) to colour math tokens for example \documentclass{article} \usepackage{color} \mathchardef\zmath\mathcode`z \mathcode`z="8000 {\makeatletter \def~{\@...
David Carlisle's user avatar
5 votes
Accepted

Highlight footnote in the original tex file?

Rather than using syntax highlighting, why don't you improve readability by moving your footnotes out of the main paragraph? With the sepfootnotes package you can put (longer) footnotes outside ...
n.r.'s user avatar
  • 4,870
5 votes

Efficiently highlight known math macros in AucTeX

AUCTeX has built-in facilities for custom fontification. Check the documentation, section User-defined keyword classes. You have to set the variable font-latex-user-keyword-classes. I did this in ...
Arash Esbati's user avatar
  • 7,270
5 votes
Accepted

Add keyword to language in minted

Regarding minted, the answer is: You have to write an extension to the JavaScript lexer of pygmentize or modify a copy of the lexer. See the answers to the question How to add custom C++ keywords to ...
gernot's user avatar
  • 48.6k
5 votes

TeXstudio syntax highlighting for Tikz

I got the desired result. For some strange reason, circle is highlighted as a grammatical error, that disappears if I select the dictionary in English (I'm italian). It is not a big deal. I'm not ...
vi pa's user avatar
  • 3,364
5 votes

Annoying syntax highlighting of unclosed group at \cs:w

I don't know about Overleaf yelling at you. But you can surely avoid it by using better code: \ExplSyntaxOn \NewDocumentCommand{\newenvcommand}{ m m } % #1 = env name, #2 = command name { \...
egreg's user avatar
  • 1.1m
5 votes
Accepted

Dollar sign breaks syntax highlighting in Vim

If Vim fails to detect that the dollar sign is used in a verbatim environment, it probably means it is not using the right syntax highlighting flavour. Use :set syntax to find out which syntax ...
Skippy le Grand Gourou's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible