{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
0answers
31 views

Adjust vertical spacing between caption and listing in KOMA (scrartcl)

In the standard article class the distance between caption and the listing below it is fine. But when using KOMA-Script's documentclass scrartcl the vertical space is too big (see the image below). I'...
3
votes
2answers
351 views

Using minted package on Ubuntu: .w18 file not found error

I am trying to run the following code through XeLaTeX, using the -shell-escape option: \documentclass{article} \usepackage{minted} \begin{document} \end{document} The file is named guess.tex and ...
1
vote
1answer
62 views

Background color for a range of lines in Minted

I have a long piece of code that highlight with minted. I would like to have a background only around a block of code. How can I achieve that? I tried to use something like escapeinside=|| to create ...
1
vote
3answers
128 views

Combine minted and tcolorbox for code from file (inputminted?)

Thanks to Thomas F. Sturm and Gonzalo Medina I have a nice looking environment for code listings with appropriate ref functionalities. However, I just cannot figure out a way to make the defined ...
2
votes
1answer
163 views

minted with Texmaker on OS X

I'm trying to use minted with texmaker. The weird thing is, that it works, when I invoke pdflatex --shell-escape testfile in the system shell, but not from texmaker, though Options -> Configure ...
3
votes
1answer
125 views

minted fails with breaklines and obeytabs

The following example with a minted enviroment fails with the error message _minted-test/7587C145B52367AE51CACC4AFB0EC13D2F785CCAC2A2CC760CA216BD1781DF79.pygtex:3: Extra }, or forgotten \endgroup. [ ...
1
vote
0answers
31 views

How to present minted environments side-by-side?

I have two minted environments that I'd like to present side-by-side (before and after). I've used minipage, but some of the minted options don't seem to work too great with it (e.g., autogobble). ...
0
votes
1answer
24 views

How to fix or change randomly marked json snippet?

So my problem is that my json snippets are marked red, but I don't want to mark them red. How my JSON looks like: [ {obj1} {obj2} {obj3} ] And my snippet looks like: [ {obj1} ... ] And that ......
47
votes
2answers
5k 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 ...
2
votes
1answer
40 views

Tcolorbox + minted source code listing that works in beamer

I copied and modified the code snippet in the accepted answer here to highlight cpp code: \usepackage{tcolorbox} \tcbuselibrary{minted,skins} \newtcblisting{cppcode}[1][]{ listing engine=minted, ...
9
votes
1answer
1k views

Problem in adding a background color in a minted environment

I want to add a background color to the minted environment in my LaTeX document. However, when I add the the background color the environment does not start in a new line. Could someone help me fix ...
5
votes
1answer
261 views

XeLaTeX and ifplatform/catchfile (loaded by “minted”): Errors on compilation

I'm using minted along with XeLaTeX, but recently I've run into strange problems. To illustrate what I mean, consider the following MWE (the filename is main.tex): \documentclass{minimal} \...
0
votes
0answers
16 views

XeLaTeX Beamer and minted, some characters are invisible [duplicate]

fibonacci.tex: \documentclass[xcolor={dvipsnames,svgnames}]{beamer} \usepackage{pgfpages} \setbeameroption{show notes} \setbeameroption{show notes on second screen=right} \usepackage{minted} \...
1
vote
0answers
50 views

Nested \( \) and group () [closed]

I am trying to allow programmers using Felix to write some formulas in LaTeX, in such a way they compile correctly, display correctly online using MathJaX, and typeset correctly using pdflatex with ...
1
vote
1answer
71 views

minted: how to highlight java method at class

I'm trying to highlight a method at a Java class with minted. The usual notation (at least in Javadocs) for a method at a class is classname#method, but when I do something like: \mintinline{java}{...
2
votes
3answers
410 views

Adding additional blank lines in Minted

I currently have two minted environments in each their minipage environment, so that they can be situated next to each other: \begin{figure}[!h] \centering \begin{minipage}{0.45\linewidth} \begin{...
1
vote
1answer
51 views

shell escape is disabled

I am trying to use minted for code highlighting. Now to use this package I need to enable shell escape. So I have set the compiler options as follows: However, I am still getting the same error ...
4
votes
1answer
47 views

minted v2.2 (TeX Live 2016): changing style in the preamble does not longer work

I have just upgraded mi MacTeX installation to MacTeX 2016 (from '2015 with all packages updated) and I found that changing the default style using \setminted{style=...} in the document preamble does ...
1
vote
0answers
31 views

How can I fill a page with a minted included json file?

I'm trying to add some huge json files to my document and have no idea how can I solve this two problems. Code: \linespread{1.0} \subsection{File xpto.json for X = 1} \label{ap:json_xpto1} \beCengin{...
2
votes
1answer
66 views

German quotation marks in the bibliography along with syntax highlighting

Let's begin with the MWE: \documentclass{scrreprt} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} \usepackage[backend=biber,style=alphabetic]{biblatex} \addbibresource{lit.bib} % \...
12
votes
1answer
462 views

TeX Live 2016: minted doesn't work with LuaLaTeX

I've installed TeX Live 2016 as it was released today (thanks to the developers for that). Now I have the following MWE: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{...
1
vote
1answer
27 views

Minted bug or misuse?

Consider the following minted code: \begin{minted}[escapeinside=||]{ocaml} foo |this is escaped| bar \end{minted} which works as expected, i.e., the escaped text is actually escaped. However, if ...
4
votes
1answer
123 views

Work-around for minted code highlighting in arXiv?

I am currently trying to submit my bachelors thesis to arXiv. However, it does not work: (/texlive/2011/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) Package ifplatform Warning: shell escape is ...
3
votes
1answer
763 views

Pygmentize not working properly with minted package in TexShop on OS X

I am using TexShop on mac OS X 10.11.1 and I'm trying to output some Python code inside my LaTeX document. Here is an example of a document I would want to produce : \documentclass[12pt]{article} \...
31
votes
3answers
5k 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} \inputminted{java}{...
1
vote
1answer
571 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 ...
2
votes
1answer
45 views

How to remove extra space added by tex4ht to minted listing at start of each line?

This is really annoying. For some reason, tex4ht adds an extra space to the left of each line in the listing when using minted. This does not happen with listings or verbatim. Only with minted. If you ...
0
votes
1answer
30 views

minted complilation problem when changing machine

I'm writing a document science 7 months in my office desktop and every things worked well, but when I take all files to compile in my home computer, I got this error compilation with the minted ...
1
vote
0answers
31 views

ShareLatex - using minted in subfiles

I am using ShareLatex with each of my sections split into subfiles, and now needs to insert some source code. In doing so i have used the package minted which works fine if i keep my code example in ...
12
votes
3answers
3k 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 ...
5
votes
3answers
722 views

Break lines at any character in minted

Consider any snippet of minted code that contains a large string not containing any spaces like: \documentclass{article} \usepackage{minted} \setminted{breaklines} \begin{document} \begin{minted}{xml}...
1
vote
1answer
54 views

Display character % with minted

How can I display the % character with minted without it being considered a comment? If I write \minted{%} the rest of the line is considered a comment, and if I write \minted{\%} minted displays both ...
0
votes
2answers
74 views

If I have a double quote ' " ' in my text it shows up in the pdf as \textquotedbl{}

I am new to latex. I am running xubuntu 14.04. I am using Lyx 2.0.8. I can write, compile to pdf then view the pdf. Unfortunately, if I have a double quote ' " ' in my text it shows up in the pdf as \...
4
votes
2answers
742 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 ...
0
votes
0answers
40 views

Minted error - Undefined Color from Sharetex example

Error: ! Package xcolor Error: Undefined color `LightGray'. See the xcolor package documentation for explanation. Type H <return> for immediate help. ... ...
2
votes
1answer
59 views

Highlight #pragma in code listing using minted

I'm going to give a talk on OpenMP soon and I'm currently preparing my beamer slides. Since a lot of the OpenMP magic happens inside of #pragma instructions, I'd like to highlight those in some bright ...
0
votes
0answers
20 views

Undefined control sequence \mintinline [duplicate]

I want to write inline mysql code with minted. However, there is an error Undefined control sequence \mintinline. This is MWE: \documentclass[a4paper,oneside, 12pt]{memoir} % подешавање српског ...
5
votes
1answer
329 views

Censor minted source code in pdf

I'm using minted in my publication to embed my source code examples with proper highlighting. Unfortunately, they are under non-disclosure agreement (NDA), so I have to blank them out before ...
13
votes
3answers
3k 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 ...
2
votes
0answers
64 views

LatexMK incorrectly tries to build files used by minted

I am using LatexMK from a Makefile with the -use-make option. A really great tool to automatically compile my document while making sure all images are up-to-date. When trying to compile a document ...
0
votes
0answers
77 views

minted not highlighting and inserting random characters in code

I am trying to syntax highlight some Haskell code in my latex document. The rest of my document works fine except for one section. I have the \usepackage{minted} command where my other packages are ...
2
votes
1answer
89 views

Is it possible to break page on a double line break in the minted environment?

For a project, I am printing a large amount of source code using Minted. Certain blocks, such as CSS blocks, are fairly short, but are split across pages, which means they are not as readable. Is it ...
1
vote
1answer
58 views

Length of external plain text file

(Xelatex) How can one determine the maximal line length (e.g. in characters) of a external, plain text file? This file likely contains special Latex characters. Usecase is syntax highlighted code by ...
5
votes
2answers
1k 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: \documentclass[10pt,a4paper]{...
0
votes
0answers
16 views

Is it possible to visualize a page break in a mdframed environment?

I'm using mdframed to style my code listings. I use minted to realize the code listings. My question is, if there is an easy way to visualize the page break of mdframed. I tried to sketch what I try ...
4
votes
1answer
67 views

How to highlight (color/draw attention to) a particular snippet in Minted

I'm currently doing some work on error messages in programming languages. As such, I'm showing faulty pieces of code, alongside the compiler-errors accompanying them. I'm using minted for the code ...
2
votes
4answers
810 views

Minted working from terminal but not Texpad

I'm using the minted package in latex on my mac (running lion). Now when I use the terminal to type pdflatex -shell-escape My_Ruby_Notes.tex it compiles fine and the resultant pdf looks perfect. ...
1
vote
1answer
2k 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} \usepackage{...
3
votes
0answers
78 views

How can I highlight certain words in minted with different colors?

I would like to highlight some specific words inside the minted environment when using beamer. \documentclass[14pt]{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile]{} \begin{...
2
votes
1answer
142 views

Centralize minted environment in beamer

I would like to insert some code inside the minted environment when using beamer. \documentclass[14pt]{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile]{} \begin{figure} \...