5
votes
2answers
109 views

Best way to deal with overfull inline listings

I am typesetting inline code listings using the listings package. Since I'm using C# syntax, oftentimes listings contain long words (type names/variable names). Since words in listings won't be ...
4
votes
1answer
183 views

Making Inline Code Printing Pretty

I have to include small code snippets like method and class names within continuous text. I do not want to display those snippets as complete seperated listings, they should be displayed inline, ...
5
votes
1answer
247 views

How can I make \lstinline function normally inside math mode?

\lstinline of the listings package doesn't work in math mode. When I try to use it, I get the error that \ttfamily is invalid in math mode. However, when reasoning about program semantics, it is ...
3
votes
1answer
795 views

LaTeX - Using commands inside inline code

I want to be able to have inline code (printed in typewriter or something) where I can also use LaTeX commands like \myinlinecode{here comes a backslash: <\textbackslash>}. So it should be ...
1
vote
1answer
160 views

\lstinline break at punctuation

I need listing package (\usepackage{listing}) to break at punctuation namespace::subnamespace::class ^ ^ at either these two locations
3
votes
1answer
113 views

Aligning a listing environment within a paragraph

I have the following code that displays a listing in a paragraph. However, because there are not so many line of code, I would like to move it to the right and the paragraph be on the left hand side. ...
2
votes
2answers
270 views

inlinelisting adds a space after keywords

I am having problem with lstinline macro. It keeps adding a space after the keyword "Module" - see MWE. How could I convince Latex not to do so? I already tried with including the "." inside the ...
6
votes
1answer
222 views

Include BibTeX contents in a listings block

I am trying to include the literal contents of a BibTeX file in my LaTeX document using the listings package but am running into an issue. As BibTeX does not appear to be natively supported (though ...
1
vote
1answer
479 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 ...
7
votes
1answer
1k views

Avoid line breaks after \lstinline

I'm writing a computer science paper with LaTeX and have a lot of inline code. Now, when this code is followed by a comma and is at the end of line, the line break is inserted before the comma, which ...
5
votes
1answer
682 views

avoid linebreak in \lstinline if possible

By using \lstinline{mysourcecode} I put some code within my document. I would like to avoid that this code is broken to a new line, if possible. so, if the codeline itself is less long than a full ...
8
votes
2answers
3k views

\lstinline!Foo! vs \lstinline{Foo}

I wonder what is the difference or correct usage of \lstinline!...! and \lstinline{...}? I like better {} because I feel there it's more consistent with other commands but for example in below ...
6
votes
1answer
886 views

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets?

How to redefine \lstinline to automatically highlight or draw frames around all inline code snippets? E.g. using \bh and \eh commands from Highlight text in code listing while also keeping syntax ...
4
votes
1answer
771 views

How to avoid background / frame break in code listings with math / mathescape?

I have lots of C++ sources with LaTeX formulas in the comments. Ideal for using the listings packages to pretty print the source. However, most of the formulas break either, the background or the ...
15
votes
3answers
3k views

Preferred method for inline code samples

I tend to use the minted package for including code samples within my documents, which produces very nice output. However, because Pygments always produces a verbatim environment there's no way to ...
2
votes
3answers
318 views

How can I have inline code (delimited by |) in a footnote or in a caption?

I've defined | as a "short inline character", using \lstMakeShortInline| I'd like to use that delimiter to typeset inline code in a footnote or a caption, e.g. \footnote{Java uses the |break| ...