Questions tagged [syntax-highlighting]
For questions about highlighting document source code in your editor.
165 questions
0
votes
0
answers
23
views
AUCTex: recognize/ignore template for highlighting
How can I configure Emacs/AUCTeX so that it treats tags like <%foo%> as template delimiters rather than the start of a LaTeX comment, for syntax highlighting?
I am working with some third-party ...
4
votes
0
answers
147
views
Listings - How to define a custom listings style using \lstdefinestyle to colour nested parentheses differently without using \lstdefinelanguage?
Let's assume, I have nested parentheses like shown in the picture:
I want to define a custom code style using the listings package and \lstdefinestyle command to highlight nested parentheses with ...
3
votes
2
answers
143
views
Redefinition of \begin and \end
I have to use the following macros:
\newcommand{\lbeq}[1]{\begin{equation}\label{#1}}
\newcommand{\eeq}[1]{\end{equation}}
I know this is bad style!
Since I'm using TexStudio, there is the problem ...
3
votes
1
answer
1k
views
Latex highlighting error for lstinline
it has been quite a while that I have this problem and I have searched everywhere online and couldn't find a solution.
The problem is latex syntax highlighting doesn't work after this line:
\...
3
votes
2
answers
970
views
Texstudio + custom cwl: #include command ignored
Goal I am trying to derive my own class from memoir and would like to include all the auto-completiong from the original memoir class.
Problem I wrote a customg .cwl file using #include:class-memoir....
1
vote
1
answer
73
views
Highlight code fragments in LaTeX + using underscore package will cause hanging lines or fail to compile
I would like to highlight inline code fragments in my document using a \colorbox like here https://stackoverflow.com/questions/4709339/latex-color-box-inline-with-text
The problem is that much of the ...
2
votes
1
answer
212
views
ConTeXt: Syntax highlighting of source code within XHTML documents
Background
Looking to apply syntax highlighting to source code snippets embedded within XHTML code elements, demarcated with a class attribute to indicate the language.
Using:
mtx-context | ...
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: ...
2
votes
0
answers
44
views
How can I get Texmaker to recognize additional math modes?
Texmaker, my IDE of choice, has syntax highlighting that extends to some, but not all, math environments. As it happens to cover the most common environments, it is somewhat annoying when I decide to ...
2
votes
0
answers
90
views
Highlight `macrocode` environment for l3doc class without `ctxdoc` and `njuthesis` class
I'm trying to colorize the macrocode environment using the l3doc class. This isn't possible directly, but the ctxdoc class partially achieves this, and the njuthesis class along with the codehigh ...
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 ...
3
votes
1
answer
330
views
VSCode highlight .tikz file similar to .tex
Is there a way to enable the same syntax highlighting from a .tex file for a .tikz file?
When the tikz code is written inside a latex-document the highlighting with the Latex-Workshop extensions works ...
2
votes
1
answer
6k
views
LaTeX listings package JSON formatting
I am using package listings for JSON data. I am following this example How to improve listings display of JSON files from this stackexchange answer. It generates the following output:
I added caption ...
4
votes
1
answer
128
views
TeXstudio and highlighting of units syntax (ex, em, mm, cm, pt, ...)
I am moving from TeXnicCenter to the TeXstudio and wondering, if there is a way, how to make a custom syntax color for units like (pt, in, mm, cm, ex, em) in TexStudio. TexnicCenter has option for ...
1
vote
1
answer
343
views
Cannot obtain proper command highlighting with Texstudio and tex.qnfa
I'm trying to obtain a custom highlighting for the \xnote command in TexStudio editor, and I'm following these instructions, but when I add the lines to tex.qnfa as suggested it highlights the entire ...