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 ...
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 ...
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:
...
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, ...
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 ...
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 ...
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 ...
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 ...
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'...
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....
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 ...
8
votes
How to avoid syntax error highlights on Overleaf with redefined meaning of \[, \], \(, \) commands?
Don’t. Just don’t. Seriously...
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}{
...
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, ...
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 ...
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, ...
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 ...
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. ...
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 ...
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}
...
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. ...
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 ...
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{...
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~{\@...
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 ...
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 ...
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 ...
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 ...
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
{
\...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
syntax-highlighting × 157listings × 39
texstudio × 36
minted × 26
highlighting × 18
editors × 11
math-mode × 7
color × 7
auctex × 7
emacs × 6
python × 6
pdftex × 5
texmaker × 5
overleaf × 5
verbatim × 5
code × 5
pygments × 5
environments × 4
texshop × 4
tikz-pgf × 3
beamer × 3
macros × 3
latex3 × 3
r × 3
texworks × 3