Tagged Questions
3
votes
1answer
78 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
72 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
59 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
99 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
116 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
130 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 ...
5
votes
1answer
390 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
504 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 ...
4
votes
2answers
1k 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
552 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
428 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
2k 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 ...