Questions tagged [syntax-highlighting]
For questions about highlighting document source code in your editor.
165 questions
23
votes
2
answers
9k
views
How to remove box outlines around parenthesis/brackets in TexStudio?
As can be seen on the first image there are outlines around the brackets and parenthesis (blue and red colored), on the second picture is shown what happens to these outlines if I move away to another ...
11
votes
4
answers
2k
views
Highlight footnote in the original tex file?
I am writing academic papers with lots of footnotes. The writing process is not ideal, since when I am writing the original .tex file, all footnotes are embedded in the main text. Often, a long ...
10
votes
2
answers
2k
views
Looking for a good Emacs/AUCTeX setup for LaTeX3
I'm trying to switch my editor from vscodium (telemetry free VS Code) to Emacs. So far, I've installed AUCTeX and tried some things in a testdocument. For regular LaTeX code everything is fine.
But ...
9
votes
1
answer
3k
views
TeXstudio chemfig commands marked as unrecognized
I included the chemfig package to draw chemical stuff in LaTex.
But the commands aren't recognized by TeXstudio. I even added the package to the autocompletion list in the settings to get recognized ...
7
votes
3
answers
8k
views
Add keyword to language in minted
I use minted to highlight some javascript code.
I use
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{js}
const mySchema = new Schema({
name: String,
is_true: ...
7
votes
1
answer
4k
views
Combining multiple listings styles in a single \lstdefinestyle command
Here is my code:
\documentclass{article}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{xcolor}
\lstdefinestyle{style1}{
basicstyle=\ttfamily,
columns=fullflexible,
keepspaces=...
7
votes
3
answers
359
views
LaTeX3 macro identification in TeXstudio
The LaTeX3 syntax is not recognized by TeXstudio, and I'm looking for ways to solve it.
The problem comes from (IMHO) the underscores being taken as "separators"...
Here is an example:
The ...
6
votes
1
answer
139
views
The listings package highlights "e3" in "20e3" as identifier
LaTeX code:
\documentclass{article}
\usepackage{listings}
\usepackage{textcomp}
\usepackage{xcolor}
\lstset{
basicstyle=\ttfamily,
columns=fullflexible,
keepspaces=true,
upquote=true,
...
6
votes
1
answer
1k
views
How to embedded source code on-demand into PDF?
I wondered if its possible to embed source code of some software you are writing about into the PDF but not displayed by default. E.g. you have a long script I would be nice if the user/reader could ...
6
votes
1
answer
360
views
How to make #include <stuff> to be highlighted as keywords?
I have the following snippet of code:
\documentclass{beamer}
% Solarized colors
\definecolor{sbase03}{HTML}{002B36}
\definecolor{sbase02}{HTML}{073642}
\definecolor{sbase01}{HTML}{586E75}
\...
6
votes
2
answers
3k
views
In Tex Studio, is there a way to get rid of "math command outside of math env" warnings?
When I use the mathpartir package, Tex Studio does not seem to identify that mathpar is a math environment, and highlights all my math mode commands in red. When I hover the mouse over them, it says "...
6
votes
1
answer
889
views
Efficiently highlight known math macros in AucTeX
I am using AucTeX to write LaTeX and I have fontification enabled. The highlighting of marcos works but while macros like \begin are highlighted using font-lock-keyword-face all math macros (\sum, \...
6
votes
3
answers
886
views
Escaped percent sign is syntax-highlighted as comment by listings package
My code:
\documentclass{article}
\usepackage{listings}
\usepackage{xcolor}
\lstset{
language=[latex]tex,
basicstyle=\ttfamily,
commentstyle=\color{violet},
columns=fullflexible,
...
6
votes
2
answers
740
views
minted escapeinside works for all supported languages except LaTeX
I want to add some math symbols into the escaped contents, minted works well for languages like Python, but not LaTeX. A sample code:
\documentclass{article}
\usepackage{minted}
\begin{document}
\...
6
votes
1
answer
4k
views
Highlight JSON code snippet with minted
I have a JSON code snippet that I like to include into my LaTeX document:
"builders": [
{
"type": "test",
"image": "ubuntu:latest",
"changes": [
"EXPOSE 123 ...