{minted} is a package that facilitates expressive syntax highlighting in LaTeX using the powerful Pygments library. The package provides options to customize the highlighted source code output using {fancyvrb}. You'll need to install python-pygments (e.g sudo apt-get install python-pygments). ...

learn more… | top users | synonyms

7
votes
2answers
1k views

minted's listing environment with hyperref and caption package together

I use the minted package for code highlight. I use its listing environment. I also use the hyperref package to provide links all through my document: figures, tables, listings, etc. If I import the ...
7
votes
1answer
1k views

LaTeX minted package: numbering lines does not work [closed]

I'm having a problem with the minted package. When I try to add line numbering to the minted command, I get the following error: ! Package keyval Error: stepnumber undefined. See the keyval package ...
15
votes
3answers
1k views

How to add custom C++ keywords to be recognized by Minted?

I have defined several structures and types in a C++ project. I have to write some documentation for this code, and I use the minted package to typeset my code. I would like to be able to add some ...
8
votes
1answer
1k views

Using minted to define a new environment

Can I define a newenvironment that has inside it a minted environment? eg and environment that would be a quickhand for the following code: \begin{figure}[htp] \centering ...
7
votes
2answers
1k views

Red box drawn around question-mark operator in minted Erlang code

I'm trying to include some Erlang code samples in a document using the minted package which include the ? operator to denote a message being received from a process. The code \documentclass{minimal} ...
8
votes
1answer
671 views

Use autoref with minted and its listing environment

I would like to use autoref from the hyperref package to create a reference to a floating listing as provided by minted. This code \documentclass[a4paper]{book} \usepackage{minted} ...
20
votes
2answers
3k views

Code spanning over two pages with minted, inside listing with caption

I am trying using minted to display some code in my document, but the code is long and spans over two pages, this works fine, however when I place my code inside \begin{listing} ...
1
vote
1answer
1k views

Texments/minted not working - Undefined control sequence

I'm trying to add some syntax highlighting to my code and found two packages: texments and minted. I tried to use them, but I'm getting errors while trying to build. I used following code to test both ...
16
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 ...
10
votes
2answers
2k views

Breaking long lines using latex with minted and pygments

Since Acrobat obviously isn't able to convert XML to PDF from command line, I'm trying to achieve it using LaTeX. I found the minted package doing a quite good (and simple) job since it uses pygments ...
13
votes
2answers
2k views

Background colour with minted package: code misplaced

With the following example \listfiles \documentclass{article} \usepackage{minted} \definecolor{bg}{rgb}{0.95,0.95,0.95} \begin{document} Some text \begin{minted}{latex} A test \end{minted} Some text ...
4
votes
2answers
1k views

Minted with fancyvrb label

I am using minted for the first time and after reading the docs, I could not find a way to put a label in the code listing. Just to be clear, I am not speaking of the \label of a listing environment. ...
4
votes
2answers
778 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 ...
7
votes
1answer
621 views

References to specific lines in program source code

How do I make references to specific lines in program source code (e.g. Python)? For example, I want to say: In lines 22-30, the algorithm is implemented... If I changed the Python source code, ...
11
votes
3answers
845 views

Can I enter code directly from a source file?

In a project I'm working, all the files are in the same folder (source codes, papers, images, etc). In the documentation, I'm including some code with minted which is really great, but I want to do ...
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 ...
51
votes
6answers
11k 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?