{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

4
votes
1answer
154 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
137 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
36 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
85 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
281 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 ...
7
votes
2answers
1k 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
116 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
358 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
178 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; } ...
2
votes
0answers
447 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
214 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
183 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
89 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
169 views

minted and Unicode: symbols missing

Code: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[mathescape, linenos, numbersep=5pt, gobble=2, ...
2
votes
1answer
268 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
671 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
145 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
84 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
177 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
156 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
127 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
135 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
74 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
154 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
151 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
545 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
152 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
143 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
701 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
175 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
119 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
85 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
280 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
256 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
296 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
448 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
342 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
88 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
91 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
91 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} ...
5
votes
0answers
531 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 ...
1
vote
1answer
207 views

How to embed a minted environment inside a tabular environment?

I'm using packages minted and booktabs, and would like to put a minted environment within a tabular one. However, the following does not work: \documentclass[11pt]{article} \usepackage{minted} ...
4
votes
1answer
432 views

Error when using minted package and -output-directory option

I am having problem when I use the -output-directory option while I am using minted. It does not move the .out.pyg and .pyg file to the output directory and it gives me an error. I there any ...
16
votes
2answers
2k views

Box around minted environment

I'm using the minted package to produce nice looking java-code but I would like to make a box around the code so it is easier to separate the code from the rest of the document. What is the easiest ...
11
votes
2answers
298 views

How can I define a new minted environment with optional arguments?

I have the following mwe: % arara: pdflatex: { shell: true } % arara: pdflatex: { shell: true } \documentclass{article} \usepackage{minted} \usepackage{listings} \usepackage{caption} ...
1
vote
2answers
118 views

Configure Minted Color XML

I'm using minted package for code listing, however I don't like some of the colors too much. Is it possible to configure these colors? For example, When I display the colors to view XML color, the ...
1
vote
0answers
57 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 ...
10
votes
2answers
2k views

How to use minted under MikTeX and Windows 7?

According to minted documentation: Windows support is sketchy / untested at the moment. There are two complications: installation and usage....... This question seeks a step by step ...
5
votes
2answers
389 views

Error using Minted for syntax highlighting in custom document class

I am writing Master thesis in LaTeX and want to use minted package for source code syntax highlighting. I have installed it successfully and minimal example from minted documentation works just fine. ...