Linked Questions

4
votes
2answers
7k views

How do I get selective bold in Verbatim? [duplicate]

I previously wrote a computer professional book in which I showed what the user typed on the console and the computer's resultant output. The way I liked to do this was with everything in courier and ...
0
votes
2answers
824 views

How to hide LaTeX commands and keywords in a listing? [duplicate]

Possible Duplicate: How can I highlight some lines from source code? How to hide LaTeX command (keywords) in a listing? When I use for example \textbf{} in the listing it appears as \textbf{}. ...
27
votes
7answers
19k views

Highlight text in code listing while also keeping syntax highlighting

I’m using the listings package for code listings. Now I try to highlight some part of the code using \hl from the soul package. Here’s an example of a resulting query where the injected part of a SQL ...
24
votes
3answers
11k views

How to make overlay still work inside lstlisting environment?

Problem I want to explain C# programming language step by step using overlay in beamer.cls. But it does NOT works as shown in the following figure. How to solve this problem? Code Snippet \...
28
votes
2answers
17k views

How best to include programming source code in LaTeX documents? [duplicate]

Possible Duplicate: Syntax Coloring in LaTeX I'm relatively new to LaTeX, and am starting to use it for academic paper writing. I'm doing a lot of computer programming as part of my academic work,...
18
votes
1answer
2k views

Source Code Margin Comments

In the paper "Beautiful Code Compelling Evidence", by J.R. Heard -- Code is formated in a particular way which includes margin comments. I am looking for a way to do this as I think it is a very clear ...
11
votes
2answers
3k views

How to define a new environment with a fancy box (tikz) around sample source-code (listings)?

This is what I want to do: \documentclass{beamer} \begin{document} \begin{frame}[fragile]{Frame 1} Some \structure{Python} code here: % I want to define a new "pythoncode" environment, so ...
8
votes
2answers
8k views

Using Beamer to step through an algorithm written in pseudocode.

I am trying to create a beamer presentation in which I would step through an algorithm, highlighting the current line in the algorithm on each slide. I know it is possible to do with the semiverbatim ...
3
votes
1answer
4k views

Use textit in listing

How can I use \textit in a listing? \documentclass[a4paper]{article} \begin{document} \begin{lstlisting}[label=test] Some code. \textit{This should be italic.} Some code. \end{lstlisting} \end{...
2
votes
1answer
2k views

How can I typeset Greek letters in listings?

Is it possible (and if yes, of course how) to use Greek letters within lstlisting (of the listings package)? However, \epsilon, for instance, puts of course exactly that and not a Greek epsilon. I ...
6
votes
1answer
376 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 ...
0
votes
1answer
1k views

Can I mark specific lines in lstlisting?

I want to give listings and somehow mark a particular set of lines. My preference would be to make them italic. (The purpose of wanting to do this is so I can say "these lines are required but you do ...
5
votes
1answer
140 views

Color text inside lstlisting

So I've been looking for a way to color text inside a lstlisting. There are already several questions answere. E.g. here: How can I highlight some lines from source code? All solutions I've found ...
3
votes
1answer
412 views

How to use onslide in a listing?

I need to animate single contiguous code listings by showing and hiding parts of code using \onslide. However, TeX is complaining. How can I achieve this? I tried the advice here but it didn't work. ...
0
votes
1answer
481 views

Highlight code in lstlisting

I would like to highlight code in a listlisting environment. I tried two techniques: using \usepackage{lstlinebgrd} and using \usepackage{color} (based on this conversation) but none really match what ...

15 30 50 per page