3
votes
1answer
48 views

Formatting code into the style used in Stackoverflow

I know that there is minted and listings for displaying nice code in .tex documents. However, I'd like to use the style that is used for Stackoverflow code: example. Are there any packages for this, ...
4
votes
2answers
26 views

Latex listings package, issue with caption touching the frame and junk character instead of space

I am using listings package and facing two issues Following is the LaTeX code and output \lstset{language=Java, basicstyle=\small, frame=single, breaklines=true, ...
3
votes
1answer
28 views

Inconsistent style of “other keywords” when breaklines=true [duplicate]

Some keywords defined with the otherkeywords key are not formatted as expected when breaklines is set to true. Here is my MWE: \documentclass[12pt, a4paper]{article} \usepackage{listings} \lstset{ ...
3
votes
0answers
33 views

Code in listing not formatted correctly [duplicate]

My preamble is as follows: \documentclass{llncs} \usepackage{xcolor} \usepackage{harvard} \usepackage{listings} \usepackage{chngcntr} \makeatletter \lst@InstallKeywords ...
4
votes
2answers
124 views

lstlistoflistings formatting problem

I'm using \lstlistoflistings to create list of listings. Everything generates well except for the formatting issue I have. I tried to fix it but don't have enough knowledge. This is how the ...
2
votes
0answers
102 views

Deciding whether to end a line with a character or not in lstlisting [closed]

I need to write a document where there are written inputs and outputs of unix command line interface software (through bash). For example I need to show something like: $ git log --pretty=format:"%h ...
1
vote
0answers
52 views

LaTeX listings / email quoting [duplicate]

I've been trying to do someting with LaTeX. I have some emails that I want to insert in a document. I've searched all over the web but can't find a valid solution. What I want to do is to have those ...
5
votes
1answer
126 views

Emphasizing some parts of string in lstlisting

I need to stress out some parts of string in lstlisting. I tried with \emph{}, but I got the verbatim result. Is there any way to that? \begin{lstlisting}[frame=single] Array1: 78 54 31 54 92 86 23 ...
5
votes
1answer
109 views

Is it possible to use the listings package incrementally in beamer?

Given a frame that has code rendered in a \begin{lstlisting}...\end{lstlisting} environment, is it possible to use beamer's incremental frame building feature to highlight code snippets? Here is an ...
9
votes
2answers
496 views

Two code blocks working syncronously

I need two code blocks in my beamer frame. One will be the code and other will be the output for each line of code. I want to uncover each code line and corresponding output line. So, first it will ...
2
votes
1answer
249 views

How to define HTML keywords in \listings

I'm working on the implementation of a HTML5 code style for \listings. Currently I have the problem that there are different ways to define HTML tags. In my example, I don't get /p in ...
5
votes
1answer
342 views

How to use alsolanguage in \listings package?

I defined keywords for the JavaScript programming language and HTML. I have read that it is possible to use the keywords of both languages in a \listings code snippet. But in my example, the ...
14
votes
2answers
3k views

\listings code style for HTML5 (CSS, HTML, JavaScript)

I would like to create a code style for HTML5 that can be used with the \listings package. An HTML5 document consists of three languages: CSS, HTML and JavaScript. That makes the whole thing a bit ...
1
vote
1answer
199 views

How to use listings with multiple languages?

I've got a HTML document with JavaScript inside that I want to show in my article. For that I would like to use my JavaScript and HTML formatting. How can I get the listings package to use two ...
7
votes
2answers
373 views

How can I use line numbers with leading zeros?

I use the listings package for source-code and have read all documentation. However, it appears that leading zeros for line numbers are not implemented as standard option yet. How can I redefine the ...
4
votes
1answer
154 views

Caption for a listing

I have captions on each of my listings. Each caption is prefaced with "Listing # [text]" where # is the number of the listing. Each caption is centered over my listing. How can I modify the options of ...
3
votes
2answers
159 views

Formatting the Listing

The listing I have in my paper is Java Code. When it is displayed through TeX I lose some of the formatting that I did inside my .java files. For example, all of my comments in my code were lined up, ...
2
votes
1answer
543 views

vim type Display for C Code in Latex

Target Display: My Latex Code: % xxxxxxxxxxxxxxxxxxxxxxxxx Code Snippet STARTS xxxxxxxxxxxxxxxxxxxxxx \lstset{ language=C, % choose the language of the code stepnumber=1, ...
6
votes
1answer
519 views

How to Format C Program Code Block Nicely

I am using the following settings to format my code blocks: % xxxxxxxxxxxxxxxxxxxxxxxxx Code Snippet STARTS xxxxxxxxxxxxxxxxxxxxxx \lstset{ language=C, % choose the language of ...
0
votes
1answer
372 views

Defining a listings style and available options

When defining a style for a listings environment, I can set the background color by doing: \lstdefinestyle{highlight}{ backgroundcolor=\color{orange} } Apart from backgroundcolor, which other ...
0
votes
1answer
302 views

listings package-Problem with formatting the parenthesis [duplicate]

In the following code, I've one problem with the formatting of closing parenthesis. I don't know why. I give this long testing and uggly code because with smaller ones I've no trouble. ...
0
votes
0answers
43 views

Prevent listings grouping together [duplicate]

Possible Duplicate: Keeping tables/figures close to where they are mentioned I'm writing a document with a large number of code listings. Most of the time I want them to be shown on the ...
6
votes
2answers
663 views

Listings language definition keyword suffixes

I'm trying to create a listings language definition for ARM assembly and many of the instructions have prefixes/suffixes (i.e. BGT, BLE, BNE, BEQ branch instructions). Is there a way to define B with ...
3
votes
1answer
2k views

Can you change lstinline without changing the global lstset?

Consider that I want to be able to write: \inline{some code or keyword} and just have it distinguished from the rest of the paragraph text, I've done that like this: ...
4
votes
1answer
582 views

How to color digits with the listings package

For my project, I've been using the listings package in order to color the keywords, comments, strings, and digits in the code. The thing is, I've managed to color the keywords, comments and strings, ...
5
votes
1answer
3k views

Fortran syntax highlighting in listings

I've got some Fortran 90 source code I want to put into my thesis appendix. For this I'm using the listings package. Is it possible to have colored syntax highlighting for the Fortran code?
11
votes
2answers
19k views

set the font family for lstlisting

I have the following set up for my listings : \lstset{basicstyle=\footnotesize,breaklines=true} \lstset{framextopmargin=50pt,frame=bottomline} I would like to change the font family to Courier. ...
0
votes
1answer
378 views

Display FASTA File in LaTeX [closed]

Is there a proper way to show a FASTA file in LaTeX? So far I tried $'s or listings and TeXshade but this does not seems to work.
4
votes
1answer
200 views

How to change appearance of a particular line when using \lstincludelisting?

I'm using the listings package and include code into my document through \lstincludelistings. The problem is that I want to set some code lines to bold to indicate changes from previous code segments. ...
1
vote
1answer
392 views

Enlarge list of listings

I'm using \cleardoublepage \renewcommand{\lstlistlistingname}{Quellcodeverzeichnis} \enlargethispage{\baselineskip} %EITHER \lstlistoflistings \enlargethispage{\baselineskip} %OR THIS ...
12
votes
2answers
2k views

How to insert code and graphic in textbox

I want to put a graphic and a little linux bash code in a textbox, like the picture blow... with the follow in problem: all in a textbox with yellow backgroud left part is a graphic (a finger)... ...
3
votes
3answers
1k views

Eat space in a line break in \lstinline{}

I use the listings package. If a line break inside a multi-word \lstinline{} occurs, I get a nasty spaces at the beginning of the new line: page left page right | ...