4
votes
1answer
52 views

Lstlisting: width of background box

I'm trying to modify my listing environment in a way that the background color for the listing is expanded over the whole width of the page. So no white border left. Is this possible? I tried doing ...
4
votes
1answer
31 views

Color behind numbers in lstlisting

Currently, my listings use this style : \definecolor{lstgrey}{RGB}{217, 217, 217} \definecolor{lstback}{RGB}{246, 246, 246} \newlength{\numberlengthnormal} ...
6
votes
1answer
65 views

How can I prevent the background from overlapping the rounded corners in an \lstinputlisting?

I want to include listings of external files in my document. These listings should have a solid background and rounded corners. The problem is, that if I define a style with frameround and ...
3
votes
1answer
78 views

Verbatim environment with gray background color and italics

I want a verbatim environment with gray background color and italics(bold fonts may be used also). The \lstlisting can set background but can't set italics. The \mdframed combined with \alltt can ...
4
votes
3answers
101 views

Put a grey background behind code extracts in a Latex document (like this site does)

I'm using the listings user package to insert extracts of code into my document, however it isn't distinct enough from the normal text as I'd like. Is there a way to put a grey background behind the ...
6
votes
1answer
133 views

Change the background color of line numbers in a lstlisting?

Consider the following code which deals with a lstlisting. \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \usepackage{xcolor} ...
1
vote
1answer
69 views

code-like strings with background color, and using tabular environment

I am going to create the following code-like strings with latex, with same background (gray), font, etc. How can I do this? I used listings package but inside \begin{lstlisting}...\end{lstlisting} ...
8
votes
3answers
309 views

Listing background broken by \colorbox and \framebox

I am using listing environment (listings package) with the background parameter. I want to highlight some lines of code and I am using the \colorbox, \makebox and \framebox to achieve this. However, a ...
3
votes
1answer
85 views

How to set a background color for a listing?

Someone who knows how to fill with color only the box? \begin{shaded} \begin{lstlisting} if (a < b) { printf("A is smaller than B!\n"); } a = b; \end{lstlisting} \end{shaded}
1
vote
1answer
424 views

lstaddons: Dynamic linewidth calculation

I use the package called "lstaddons" (creator, initial question) to get colored line backgrounds on listings. I want to color the whole line to the frame. What I miss there is a dynamic calculation ...
9
votes
1answer
373 views

Background images for code listings

I've been searching around but I can't find any info for adding an image background for my code listing using the listings package. Is there a way to do this?
3
votes
1answer
885 views

White horizontal lines in lstlisting

I'm having the following problem: I'm using the listings package to render what is supposed to look like a teminal screenshot. But the background colour is striped. In my other code snippets the ...
4
votes
1answer
773 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 ...
5
votes
2answers
1k views

Background overflows when using rounded corners for listings (package: `listings`)

I'm using listings to list code in my document, and I want the code to be displayed in a frame with rounded corners and a grey background color. But the background overflows the frame, as if the frame ...