3
votes
1answer
39 views

Problem with listings package for Python syntax coloring

I am implementing the method I learned here for putting Python code in Latex. Everything works great except that I have problems with comments. Here's the code from the link I mentioned: ...
4
votes
1answer
110 views

How can I highlight SPSS Syntax code with the listings package?

I'm writing my master thesis at the moment and I want to add some code listings to the appendix. The code is written in "Syntax", the programming language of SPSS Statistics. Is there a way to ...
1
vote
1answer
140 views

Syntax highlighting for SPARQL query in a listing? (works fine in minted environment but not in listing with mint)

I can do syntax highlighting in the minted environment, for any SPARQL query using this Pygments lexer thanks to this answer. My problem is how to get SPARQL syntax highlighting to work with mint in ...
2
votes
2answers
2k views

Syntax highlighting in listings for C# that it looks like in Visual Studio

Community, I want to get my C# listings syntax highlighted like in Visual Studio but I did not get it so far. Here's an image of the syntax highlighting of Visual Studio: Here is the code I have: ...
3
votes
0answers
256 views

Regular expressions in listings [closed]

I'm looking for a possibility to use regular expression in listings. I'd like to highlight each N thats followed by 4 decimal numbers for example N1234. How can I achieve that? Here is an example: ...
2
votes
1answer
825 views

Syntax highlighting for different programming languages [duplicate]

In my paper I want to include some source codes with colored sytax. For syntax highlighting I use the listings package: \lstset{frame=tb, language={[Visual]Basic}, aboveskip=3mm, belowskip=3mm, ...
2
votes
2answers
797 views

lstinputlistings syntax highlighting

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
19
votes
2answers
8k views

How to highlight Python syntax in LaTeX Listings \lstinputlistings command

I am using package listings to import my Python source code into my LaTeX document. I use the command \lstinputlistings. I have a Python source like class MyClass(Yourclass): def __init__(self, ...
3
votes
1answer
4k views

\lstdefinestyle syntax highlighting

I´m new to latex and got the following problem. I defined a listing style for XML Syntax highlighting like this: How can I get also the equals symbol in the attribute color (orange)? I want to do ...
5
votes
1answer
485 views

How to render Android listings with syntax highlighting?

I need to include the source code of a bigger Android project in the documentation written with LaTeX. Do you recommend any particular package that is capable of highlighting Java code and which also ...
4
votes
1answer
281 views

listings wrong syntax highlighting in perl - format specification

Perl uses '#' as an introduction for a comment, but also as a format specification. This produces problems in the syntax highlighting in the listings-package. How can I fix it? ...
-1
votes
1answer
330 views

Smalltalk syntax highlighting for Latex [closed]

What is the easiest way to format Smalltalk syntax using the listings package?
2
votes
1answer
866 views

Using “listings” package to colorize the source code of ANTLR grammar file?

I use listings package in my diploma thesis for source code. Besides the mainstream languages like Java and C# I also need to include the sources of the language grammars (.g) which are pure mark-up ...
6
votes
2answers
4k views

Is there a way to enable syntax highlighting coloring in Lyx for program listings?

I want to embed a small program listing and have used Insert -> Program Listing in LyX's menu for that. The settings dialog supports selecting a language (Java), but I can't actually see any ...
5
votes
3answers
2k views

Using keywords including a dot in the name with the listings package

I am using the listings package which works like charm in most cases. I tried to define new languages for my needs with the help of morekeywords options in \lstset, but entering special keywords ...
19
votes
3answers
2k views

Typesetting LaTeX Source Code with the listings package

I am writing some documentation for a LaTeX package, in which I am going to be including some example LaTeX code. What is the best way to typeset that code? I know I could just use verbatim, but it ...
51
votes
6answers
11k views

Syntax Coloring in LaTeX

Is there any way to include Python code in a LaTeX file and automatically color its syntax? Is it possible to do syntax coloring with any other language? If yes what packages can I use to do that?