4
votes
1answer
38 views

break line within mathescape in listing

How do I solve the evergreen problem of breaking a long equation into multiple lines but this time within the lstlisting[mathescape] environment. Attached is the minimum working example. ...
2
votes
0answers
43 views

Right-align the prebreak symbol in a listings environment

I’m using the breaklines and prebreak option with listings, but I find it visually not very pleasing that the prebreak-symbols are not vertically aligned. I’d prefer if they were all on the very right ...
4
votes
1answer
91 views

Line breaks in listings with long lines

This is a follow-up question to Line breaks in listings My MWE with a very long line demonstrate the problem: \documentclass{report} \usepackage{listings} \lstdefinelanguage{text}{} ...
2
votes
2answers
117 views

Multiline listing within multicolumn row

I have a problem putting a listing (using lstlisting package) within a table. The problem is that I want to put a multiline listing in a row taking 2 columns. The following minimal example shows ...
7
votes
1answer
126 views

Line breaks in listings

Is there a way like wrap the line after at most 60 letters but it should not break inside some commands like listings does? Example: \documentclass[a5paper]{article} \usepackage[T1]{fontenc} ...
1
vote
1answer
73 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
0answers
104 views

About autoindent and postbreak in the package listings

I am using the package listings to show my Matlab code. The code was pre-typed in a file and everything will be loaded from the file and a .tex file will be generated automatically to show the code ...
0
votes
0answers
59 views

Is that any way to make verbatim environment line breaking automatically and justify left and right [closed]

I am trying to show the text literally in verbatim environment with line breaking automatically. I Googled this and people recommended using the listings package. I am following the instructions in ...
2
votes
0answers
126 views

Enforce a line-break inside \lstinline

I use \lstinline{foo} from the listings package to set pieces of code in regular text. To get automatic line-breaks I use the following options: \lstset{ breaklines=true, breakatwhitespace=true, ...
1
vote
2answers
90 views

\begin{lstlisting} is overflowing?

I have done everything correctly but my \begin{lstlisting} is overflowing and I did not find any method to stop it. Plz help \begin{enumerate}[(b)] \item To generate a 128bit WEP key. We have added ...
4
votes
1answer
44 views

Listings WriteFile adds additional line if content contains two spaces between words

I use the listings latex package to write/read the environment body to a file. But if in the environment are two spaces between some words, there is an additional linebreak added at the beginning (I ...
2
votes
1answer
101 views

Is it possible to change the font of the text from a listing?

I have a listing of my Java code currently the font is too big and the code runs off the page. Here is what my listing looks like:
6
votes
1answer
147 views

Append character at autobreaks in listing

I'm writing a LaTeX document for a hands-on workshop which uses shell/bash commands. I'm making use of the listings package to format the chunks of code. Some of the commands are rather long so I'm ...
2
votes
1answer
109 views

Long lines when using listings

First Issue I'm using the listings package to present some algorithms using pseudocode. The problem is that sometimes the lines of my pseudocode are too "long" and listings breaks them in 2 lines. ...
2
votes
0answers
32 views

listings breaklines not working [duplicate]

Possible Duplicate: How to deal with very long lines that do not contain spaces? When I use the listings package with breaklines, it doesn't seem to break lines properly if there is no ...
4
votes
1answer
177 views

listings: closing parenthesis as delimiter not matched when linebreaks=true

I want code in parentheses and in brackets to appear in different colors. In the following document, the words brackets again appear in green as intended, and outside again is black as intended, but ...
1
vote
0answers
72 views

Preventing line break at the start of a long name in `\lstinline`

This question has developed from How to deal with very long lstinline-phrases like long class names?. That question is about line breaking inside a \lstinline phrase. I have provided an answer which ...
7
votes
2answers
167 views

How to deal with very long lstinline-phrases like long class names?

According to this Question: listing: How to deal with very long lines that do not contain spaces? My problem is that my \lstinline-phrases does not contain any special character like "-". In my ...
2
votes
1answer
236 views

Background color in inline code listings with linebreak

I want to highlight code inline with a gray background. Preferably with listings. This question is related to Colored background in inline listings. But as my MWE shows it doesn't work with line ...
2
votes
1answer
111 views

Listings not breaking up

I have a code listing as shown in the picture (number 4) that goes a bit out of the margin although breaklines=true. When I try to break new line it gives me an error Listings Error: lstinline ended ...
1
vote
1answer
105 views

Listings package does not break with mwrep document class

I cannot get listings package to break lines with any of the methods described in previous questions: Listings package does not break, ...
8
votes
1answer
363 views

Listings package does not break

The following code does not break even though the breaklines and breakatwhitespace is set: \lstset{ language=XML, numbers=left, numberstyle=\tiny\color{gray}, stepnumber=1, ...
5
votes
1answer
395 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 ...
2
votes
1answer
161 views

listings ignore final newline

When I write listings in my LaTeX code I usually follow this format \begin{lstlisting} foo bar baz \end{lstlisting} and when I put this inside a normal LaTeX document, things look fine. But when I ...
5
votes
1answer
505 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 ...
3
votes
1answer
360 views

How to set frame size in a listing

I'm trying to put a frame around my code, but the frame has the wrong dimension. How can I set them right? ...
2
votes
2answers
407 views

Why doesn't \newline work inside lstlisting?

I am new to LaTeX and am using a template provided by a friend: \subsection{P2P library} The library is implemented in C-Sharp and provides two basic facilities - maintaining a member list at every ...
6
votes
2answers
421 views

In listings, lines that are broken (option breaklines enabled) cause frame to be drawn badly. How do you fix this?

I have an lstlisting which has breaklines and frame enabled. The actual setting is as follows. \lstset{ basicstyle=\ttfamily, showstringspaces=false, breaklines=true, keywordstyle={}, ...
2
votes
1answer
209 views

Force minted to insert new space in code that won't fit on the page

Essentially I would like to have listings' breaklines option on minted. I can't seem to find it. I could manually insert new lines but it becomes difficult when the code comes from an external file.
1
vote
1answer
160 views

Using package listings with sciposter

Could you please provide a working example in which a source code delimited by listings environment word wraps its lines, without breaking the column layout of sciposter? Whenever I put a long line ...
9
votes
3answers
626 views

How to deal with very long lines that do not contain spaces?

I have a problem with a lstlisting environment. I want to use it for displaying several very long lines that can not be reformatted. Independently of the option breakatwhitespace=true or false my ...
4
votes
1answer
495 views

How can I create my own listings style/format?

I'm trying to format some SQL statements using the listings package. It looks OK for small statements but the long ones look bad. select * from Customers where C_nID=10; to select * from customers ...
4
votes
1answer
318 views

Listing, zebra effect and broken lines

In Creating a zebra effect using listings, I've found one solution to produce a zebra effect for listing. Unfortunately, this only works if the lines are not broken. Is there a way to fix this? Here ...