{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

3
votes
1answer
834 views

How can I solve “Float(s) lost” when using afterpage / minted packages?

I'm writing a document where I have a lot of long listings. I use the package minted to typeset the listings, which I always embed in a float. Since the listings are quite long, and LaTeX usually does ...
4
votes
1answer
391 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
210 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} ...
1
vote
0answers
283 views

Cannot get 'pygmentize' to work correctly on mac

I am using TeXworks on Mac osX 10.7.5 and I'm trying to compile some python code within my tex file but with limited success. My tex file looks like: \documentclass[12pt,A4]{article} ...
0
votes
1answer
105 views

minted : changing fontfamily to support UTF8 chars

I'd like to print out the output of a "/usr/bin/tree" command. For instance : /etc/puppet/hieradata/ ├── common.yaml └── virtual ├── false.yaml └── true.yaml My idea was to put this in a ...
3
votes
1answer
887 views

LaTeX packages minted and scrhack

I'd like to use the minted package and the scrhack package in the same LaTeX document, that is: \usepackage{scrhack} \usepackage{minted} However, I get the following error: ...
1
vote
0answers
81 views

Why does Minted color the first method of a c++ class differently?

I am using minted to list c++ source code in LaTeX. When I compile the following sample I get a strange result. \documentclass[12pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{minted} ...
3
votes
0answers
177 views

Minted PHP with line numbers

I've added minted and inserted PHP code. The result is that I must put < ?php and ?> tags to get the code colored, then if I want to display line numbers it starts from < ? php line like ...
4
votes
1answer
177 views

tcolorbox minted library with python3 non-determinism

Later versions of the package tcolorbox allows formatting source code with its minted library (which uses the minted package). When a document is compiled, a temporary file with extension .pyg is ...
4
votes
1answer
177 views

Minted does not escape beamer's \end{frame}

It seems that the following code does not work as expected (ie. printing the \end{frame} as a verbatim colored code. Instead, the \end{frame} is interpreted by LaTeX: ...
1
vote
1answer
38 views

minted custom numbering

Is it possible to define custom numbers to each source code line, like: 1 string title = "This is a Unicode π in the sky" 22 /* 23 Defined as $\pi=\lim_{n\to\infty}\frac{P_n}{d}$ where $P$ is the ...
38
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
90 views

In a multicol with a separating border, set a margin between the border and the content

I have a minted code listing, displayed in a multicol environment with a separating border between the columns: The border is too close to some of the content, like stracka(1,sg,ka). and ...
1
vote
0answers
311 views

Beamer doesn't compile on windows using minted

Have the same problem than him: Beamer presentation fails to compile after TeX Live upgrade I'm on windows using miktex (texworks), compiling with --shell-escape. I have the same message: LaTeX ...
8
votes
2answers
2k views

I can't get minted package to work under Ubuntu (pygments error)

I'm currently using ubuntu13.10, TeXlive and Texmaker editor, and I found out that minted package is the best way to get source code highlighting on LaTeX. So I installed python-pygments via terminal ...
0
votes
0answers
124 views

No caption label using minted with caption and hyperref

I'm trying to use the caption and hyperref with the listing environment and the minted package. If you compile the MWE, the listing will only show a number but no name. hyperref inserts a link, ...
4
votes
2answers
400 views

Beamer \pause in LaTeX minted

How can I \pause in the middle of a minted source code in Beamer? \documentclass[12pt]{beamer} \usepackage{minted} ... \newminted{csharp}{bgcolor=gray!25,fontsize=\footnotesize,mathescape} ... ...
4
votes
1answer
224 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; } ...
3
votes
0answers
538 views

beamer + minted most basic example fails (not the “fragile” problem)

I'm failing to get the simplest possible beamer+minted example to work. Here's my latex code \documentclass{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile] \begin{minted}{python} ...
0
votes
1answer
247 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
205 views

Lyx minted environment layout

Before I resolved a problem to set up a minted environment in LaTeX. Now, I would like to add this environment as a LyX layout. I have tried with Style MatlabCode Category MainText ...
1
vote
2answers
99 views

Simple minted \newenvironment

I'm trying to do a minted \newenvironment I looked at this post new-environment-with-minted, but I would like to know if there's a more simple way to do that, like \newenvironment{matlabcode} ...
4
votes
1answer
196 views

minted and Unicode: symbols missing

Code: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, ...
2
votes
1answer
307 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 ...
2
votes
1answer
760 views

How can I change the font size of the number in minted environment?

How can I change the font size of the number in minted environment? The font can be modified with fontsize parameter, but the number on the left side is not affected with it. This is the code: ...
3
votes
1answer
164 views

Issue with firstnumber Option from minted Package

I don't understand why the code in the next MWE does not lead to the Cpp-language lines being numbered starting from 1 in the resulting pdf document (I'm on pdfTeX). \documentclass{memoir} ...
3
votes
0answers
87 views

Reference source code line in minted environment with cleveref

I'd like to reference lines in the minted environment (solved here for regular \ref) using cleveref. MWE: % !TEX TS-program = arara % arara: pdflatex: { shell: yes } % arara: pdflatex: { shell: yes ...
2
votes
1answer
206 views

tabulation minted xelatex

When I use tabulation inside the minted environment in pdflatex, they show as normal (several spaces). But when I use xelatex, they appear as ^^I. Example (before each letter a b c, there is ...
3
votes
0answers
182 views

Customize comment color in minted style

I'm using the minted package to highlight some Python code, and currently I'm using \usemintedstyle{trac}. I want to change the color of the comment (from the current light brown-ish) to green. My ...
1
vote
1answer
138 views

Using `minted` environment inside a `tabu` table

I am trying to use a piece of highlighted code using the minted package inside a tabu table: \documentclass{article} \usepackage{minted} \usepackage{longtable} \usepackage{tabu} \begin{document} ...
1
vote
1answer
154 views

Turn off syntax highlighting in minted?

How do I turn off syntax highlighting in minted? Defining my DSL with a CFG and then a PEG; and the syntax highlighting is getting in the way.
5
votes
1answer
76 views

Confusing Problems with LaTeX3/expl3 \pdftex_if_engine:TF Switch

For a number of days I've been confused with some problems I had when using the \pdftex_if_engine:TF switch in a LaTeX3/expl3 class of my own. I thought it would be equivalent to the \ifpdf switch, ...
1
vote
1answer
179 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 ...
8
votes
1answer
169 views

Formatting code fragments extracted from file with minted

I would like to use the catchfilebetweentags package to grab code snippets from a source file and use minted to highlight them. Imagine I have the following in program.scala: //<a def ...
7
votes
0answers
624 views

break lines in minted code

Thanks to this question minted is able to break long source code lines. It is working really fantastic, except in one case: When already indented code gets breaked into two lines, than line two gets ...
2
votes
0answers
166 views

Minted Package escaping code for SQL [closed]

I'm using minted package in LaTeX to display SQL statements however, I have a variable which it confuses with the keyword "ORDER" in SQL. How can escape this? Is it possible?
3
votes
0answers
146 views

minted creating garbage output on PDF file [closed]

Good Day, I'm using texlive 2013 which I updated today 20JULY13. When I attempt to compile my LaTeX file using only the most basic minted statements \begin{minted}{c} Test \end{minted} results in ...
13
votes
2answers
779 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
0answers
188 views

Latex - picture color and minted color

I'm using minted package. If logo (top-picture) contains green, code color change. \definecolor{codecolor}{RGB}{108,247,10} ...
1
vote
1answer
121 views

minted Environment Inside varwidth Environment

Is there a way to incorporate a minted environment inside a varwidth environment? I have colored backgrounds for code snippets, and I did manage to put a minted environment inside a minipage, based on ...
3
votes
1answer
88 views

l3doc in combination with minted

The following question is related: How to add listings environment to DTX files I want to use the document class l3doc in combination with minted. However I am not able to get a nice result. If I ...
1
vote
1answer
293 views

minted Environment Inside minipage Environment

I am having to use the minted environment inside a minipage environment quite often in my document. I wanted to write a new environment for doing this, but since minted isn't designed to be included ...
3
votes
1answer
269 views

Package minted: \mint Command Not Working Inside tabularx Environment

The question, How to embed a minted environment inside a tabular environment?, addresses a similar issue, but I am using: the tabularx package, and the inline \mint command Is there a workaround ...
4
votes
1answer
326 views

Centering \inputminted inside a figure?

I'm using minted package to import some code and also kind of images using ASCII art. I've wrapped the \inputminted with \figure with a caption and all works fine. The only thing I can't accomplish ...
4
votes
1answer
485 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
2answers
362 views

Using \inputminted from lyx with relative path

I'm using the minted package with lyx. I want to use \inputminted and must be able to specify a relative path (to share between machines with different home directory names). The problem is that the ...
1
vote
1answer
93 views

Vertical centering of text inside tabular does not work as expected

I have a simple table with three columns. The second and third columns contain minted environments, and the first column contains text that should be vertically centered for each row. I'm using the ...
2
votes
0answers
100 views

Editing math.py for pygment [closed]

I'm using the minted package to syntax my code. When I'm doing so in I'm using the Matlab language. When to continue on the next line, we do so in Matlab by entering ... before the next row. However, ...
2
votes
1answer
92 views

Non-raised tildes in a minted environment

Consider the following minimal example that combines Beamer + Minted: \documentclass[11pt,utf8]{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile] \frametitle{Foobar} ...
6
votes
0answers
555 views

How to have inline code and line numbering with minted?

I'm using the code found in this answer to allow minted to provide inline code. But, unfortunately, this breaks line numbering, which is not shown anymore. How can I have both inline code and line ...