Tagged Questions
4
votes
1answer
64 views
LaTeX code formatting using lstlistings: custom keywords not recognized
I'm trying to add some keywords to an existing language using the morekeywords setting:
\documentclass[12pt]{article}
\usepackage{color}
\usepackage[usenames,dvipsnames]{xcolor}
...
2
votes
1answer
59 views
Add keywords to an existing language in listings
I've already read extending a language with additional keywords and I have found kind of a solution, but I'm not quite sure if it's the right way and if I won't have problems in the future.
The ...
2
votes
1answer
125 views
How to correctly use equal sign in keywords for listings?
I work on a listings code style for HTML5. The style looks quite good but I have a little problem with the equals sign. I defined the equals sign as a keyword:
ndkeywords={=, ... }
This will cause ...
3
votes
1answer
137 views
How to use angle brackets for a keyword in \listings?
I've got a code of a HTML website that I want to show in my LaTeX document. The problem is, that the HTML code has a tag called <canvas> and the JavaScript code inside the HTML document has a ...
3
votes
2answers
171 views
How to use a colon in lstlisting keywords?
for the use of CSS code I've defined the following style:
\lstdefinelanguage{CSS}{
sensitive=true,
alsodigit={-},
keywords={transform, transition-property, transition-duration, ...
2
votes
0answers
45 views
Override properties of a predefined listing style
I use the listings package and I want to override an attribute of the HTML style.
Unfortunately my code overrides the whole HTML style and not just a single property:
\lstloadlanguages{HTML}
...
1
vote
1answer
132 views
Include a lstlistings keyword in lstlistings caption
I'm writing a small summary for my fellow students about VB in LaTeX. I have to cover the basic loops and found the \lstlistnigs package to be the best for writing colored code. I have already added ...
4
votes
1answer
94 views
How to I emphazise all words beginning with ` in an lstlisting
I use a preprocesser to process some code before my verilog compiler.
All preprocesser words start with the ` character
Example:
`pp_if
unfortunately its possible to define your own preprocessor ...
3
votes
0answers
45 views
Highlighting keywords with spaces with the listings package [duplicate]
Possible Duplicate:
How to emphasize within a listing two successive identifiers separated by a space?
I am trying to highlight the following keywords with the listings package:
over ...
3
votes
1answer
208 views
mark LaTeX keywords in listings
I am using this code to define keywords for listings
\lstdefinestyle{demostyle}{
columns=flexible,
keepspaces=true,
basicstyle=\small\ttfamily,
language = [LaTeX]TeX,
...
1
vote
2answers
502 views
adding keywords to be highligted in the lstlistings
The recent version of C++ has added a some new keywords e.g. decltype etc..
I want to highlight them in my report.
I saw this post but it didn't work for me.
Extend a language with additional ...
4
votes
1answer
173 views
How to highlight a non-ascii keyword using the listings package?
I'm trying to highlight a couple of keywords which contain non-ASCII characters using the listingsutf8 package. This is the relevant part of my document:
\usepackage[brazilian]{babel}
...
10
votes
2answers
4k views
Extend a language with additional keywords?
I'm using listings and I want to extend a language with additional keywords for highlightning. I know there is an option morekeywords available, but that only works for a particular lstset declaration ...
2
votes
1answer
924 views
How to highlight own keywords in HTML lstlistings?
I would like to highlight some words in a lstlisting. The language is HTML.
However, \emph seems not to be working with HTML.
Any suggestions how I could work around this problem?
Right now I have:
...
7
votes
1answer
606 views
listings package - Can I include a backslash \ in language keyword (\begin) for syntax highlighting in LaTeX code?
I want to highlight a LaTeX code (including backslash \, e.g. \begin). Unfortunately, by default a LaTeX listings package does syntax highlighting only keywords WITHOUT back slash (e.g. begin).