13
votes
1answer
205 views

Possible to have # start a comment that ends at EOL or at next #, whichever comes first?

I'm trying to create a listings language in which the # symbol starts a comment that ends at the end of the line or at the next # symbol encountered, whichever comes first. Of course, I'd like to ...
4
votes
2answers
132 views

Saving language preferences for inputing source code

Using the listings package, I am trying to input a Java source file into my document using a specified, user-defined style. This works just fine if I have the specified style definition in the same ...
2
votes
1answer
64 views

Define new language listing with comments ONLY in the beginning of a line

I am trying to create listing for a home-brew language (using \lstdefinelanguage). The problem is that the comments in the language are somewhat ambiguous. For example, the following code is valid: * ...
1
vote
0answers
20 views

Change language of caption in lstlisting [duplicate]

When I define a caption in lstlisting, LaTeX writes, for example, "Listing 1.1: ..." but I want to change the "Listing" to another language. How can I do this?
2
votes
1answer
2k 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 ...
6
votes
2answers
586 views

Listing with mixed english and russian symbols in comments

I'm using the listings package for formatting .cpp code in LaTeX. My code needs to have mixed English and Russian words in comments. The font must be monospaced (preffered Courier family). /* Prints ...
5
votes
1answer
283 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} ...
4
votes
1answer
960 views

Change in \lstdefinelanguage the font?

Im using \lstdefinelanguage to add some new languages. Now everything is fine, I just would like to add another font to my language. I would like to use inconsolata. I have now this: %... ...
4
votes
2answers
781 views

Listings package with caption legend in spanish

I'm using the listings package and would like to translate the caption text displayed to Spanish, so instead of Listing 1: Dummy label it will display Listado 1: Dummy label. This is my code: ...
1
vote
1answer
276 views

Looking for HAML and CoffeeScript support

I need support for HAML and CoffeeScript like other languages already got with the listings package. Do you know any solutions?
2
votes
1answer
489 views

babel package and lstlisting caption incompatibility

I am using babel package for Turkish language and I also use listings package. A code sample for one of my listings is as follows: \begin{lstlisting}[label=some-code,caption=Poo Class] public class ...
11
votes
2answers
2k views

How to automatically include command line session output in documents?

When I write documents that contain source code examples and snippets the listings package is a great solution to include such things. Especially with the \lstinputlisting command and ...
22
votes
2answers
10k 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 ...
8
votes
3answers
766 views

Listing language for “screen session”

I am writing a set of tutorial documents on some command-line based tools. This tutorials need to show a "screen session". Something along the lines of: $ git status # on branch "master" I want to ...