4
votes
1answer
135 views

Can the listings package be set up to highlight Prolog code like minted does?

I am interested to know how listings can be customized to mimic the Pygments's Prolog lexer (i.e. make Prolog code represented by listings look the same as it is done with minted) I previously asked ...
4
votes
2answers
77 views

How to make a minted code listing centered on a page?

So, I am writing a report with Prolog code listings in it. I have been using lstlisting to make my listings and I made my code centered on the page, such as this: \renewcommand{\figurename}{Listing} ...
35
votes
4answers
2k views

Has the time come for a LaTeX3 successor to 'listings'?

I'm currently looking for a nice and challenging open-source project to work/collaborate on after my thesis. I don't have a Comp. Sci. background, but I'd like to learn more about compiler ...
3
votes
1answer
95 views

How to wrap floated minted listing in my own environment?

Here's what I'd like to do: \begin{code}{c}{Hello World in C}% I would prefer the caption to be optional #include <stdio.h> int main(void) { printf("Hello, world!\n"); return 0; } ...
0
votes
1answer
109 views

Using listing with minted gets wrong listoflistings

I wanted to make a \begin{minted} block to show on the ToC in Listings section with a link to its label. So I did (with links to my Github working repo) \begin{listing}[!h] \begin{minted}[ ...
2
votes
1answer
130 views

Adding caption and counter to source code environment

I have a source code listing with minted environment. How can I make a counter/caption to be shown as follows. I also need to make \tableofsourcecode to enlist all the source code references. The ...
1
vote
1answer
104 views

Syntax highlighting for SPARQL query in a listing? (works fine in minted environment but not in listing with mint)

I can do syntax highlighting in the minted environment, for any SPARQL query using this Pygments lexer thanks to this answer. My problem is how to get SPARQL syntax highlighting to work with mint in ...
12
votes
2answers
395 views

Combine minted and tcolorbox

I have the idea to combine minted with tcolorbox. At first, I have created my own minted environments: \newminted[mycsharp]{csharp}{tabsize=2,fontsize=\footnotesize} ...
4
votes
1answer
379 views

listings caption gray box meaning of code

Some time ago I copied this code from Stackexchange to have a nice gray box at the top of my imported source code which I displayed with listings: \DeclareCaptionFont{white}{\color{white}} ...
1
vote
0answers
54 views

How to add a caption to a listing with minted? [duplicate]

Package minted provides a way to add captions and labels to a listing wrapping it around with listing environment. With this environment the code block is put inside a floating box which won't break ...
1
vote
1answer
209 views

Minted: customise listing name? [duplicate]

How do I customize listing name: Listing 1: thing -- when I use minted? Here's an MWE: \documentclass{article} \usepackage{minted} % \renewcommand{\lstlistingname}{Something} % doens't work! ...
1
vote
1answer
212 views

Highlighting a Chunk of Code within a lstlisting by specifying the line number

This question in somehow related to http://stackoverflow.com/questions/1304315/highlighting-a-chunk-of-code-within-a-lstlisting but not exactly the same. I want to make some slides with animation ...
29
votes
2answers
2k views

minted vs. texments vs. verbments

Regarding the typesetting of syntax-colored source code, I know that listings is inferior because it doesn't utilize a full lexer. Instead the Python-based solution is recommended. It seems there are ...
1
vote
1answer
136 views

Minted cross reference line

I used to use listings a lot but minted+pygmentize has outstanding output. However, there are a few features from listings that are hard to find in minted, like having the line numbers on the right. ...
2
votes
1answer
514 views

minted list of listings and TOC conflict

I am using minted for source code highlighting. I want a List of Listings, and I want the List of Listings to itself have an entry in the main Table of Contents. I thought I could do this with ...
4
votes
1answer
373 views

Creating a table around a java script code highlighted using minted

I would like to create a block around javascript code in latex. I use minted package for format highlighting. Here is my example code: \documentclass[]{article} \usepackage{minted} %opening ...
7
votes
1answer
268 views

Insert Text between “List of XXX” Heading and Actual Listing

I would like to insert a small paragraph of text between the "List of Figures" heading and the actual list of figures, and also between "List of Listings" and the actual list of listings. I am using ...
8
votes
3answers
4k views

How to put C++ source code into beamer slides [duplicate]

Possible Duplicate: How display LaTeX code in LaTeX document? How do I fit java style source code in one frame in beamer? How do I add C++ formatted and coloured source code to my beamer ...
4
votes
1answer
762 views

Highlight certain texts in listings or minted [duplicate]

Possible Duplicate: Manual highlight of TeX code in a verbatim environment I want to highlight certain parts of a program output listing which represent user input. For example I want to ...
14
votes
1answer
698 views

In the minted package, how do I enforce straight single quotes?

Basically I want \mint{python}|'banana'| to produce straight single quotes, rather than the curly ones it normally produces (in pdflatex).
10
votes
2answers
1k views

Inline code and short verb with minted

I it possible to use minted for inline code and to add a short verb sing for minted? Like \lstMakeShortInline| in listings.sty? \documentclass{article} \usepackage{minted} \newminted{tex}{} ...
3
votes
1answer
1k views

Showing only specific lines using the listings package

I am very new to TeX. My source code is in an external file, let's call it source.java, and I use \lstinputlisting{source.java}. How could I use only the lines 3-5 for my code listing? (and not the ...
2
votes
1answer
296 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.
3
votes
1answer
832 views

Way to present programming code side by side to show the differences to the reader?

I am trying to make a side by side comparison of the result of listing-mode and minted-mode for a piece of Ruby and Java-code. I have problems making this look 'side by side'. Any suggestions to make ...
15
votes
3answers
3k 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 ...
4
votes
2answers
657 views

pass “global” options to minted/fancyvrb

Is there a way to override default options for the minted environment, rather than having to specify them for each and every snippet of code ? In other words, is there an equivalent to listings's ...
8
votes
1answer
1k views

Package to indent and syntax highlight C++ code

I am looking for a package to have an environment for C++ source code, with options for syntax highlighting, automatic indentation, proper multipage behavior, etc. I read something about the listings ...
48
votes
6answers
10k views

Syntax Coloring in LaTeX

Is there any way to include Python code in a LaTeX file and automatically color its syntax? Is it possible to do syntax coloring with any other language? If yes what packages can I use to do that?