TransWikia.com

Configuring syntax highlighting in Latex

TeX - LaTeX Asked on February 22, 2021

I am new to latex and would like to underline code that would produce a syntax error within a latex document. I have defined a custom lstset and I have code in a document that looks like this:

JavaStyle
begin{lstlisting}
// Simple Variable declarations 
// take the following form: 
// <type> <name>;
// Declaring and Assigning an int named x 
int x = 30 ; 
// Declaring and Assigning an int named y
int y = 12;  
// Declaring and assigning an int named z with 
// the value produced by the expression 
// on the right hand side of the equal sign.
int z = x + y; 
end{lstlisting}

I’d like to highlight code that would produce a syntax error. Similar to the way VSCode highlights obvious syntax errors.

The image above shows a compilation error due to an invalid character constant. I’d like to define a similar underline command that looks similar to the syntax highlighting provided by vscode.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP