{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
21 views

Alignment of minted line numbers

I'm using the minted package for code highlighting. The below is just a minimal example. What I find annoying about this package is that line numbers appear in the margin. This causes several ...
2
votes
1answer
15 views

Using `inputminted` in lyx has no effect on document

I'm trying to import a complete code file into a lyx document using the minted package. But the resulting document has no code at all. Here is a minimal example. And there's nothing in the resulting ...
1
vote
2answers
38 views

TexStudio Special Comments for math mode over highlighting in minted environment

Latex sudo noob here. I had a question regarding the answer to the question TeXstudio recognize $ in R code as that of the math mode How does one create the special comment listed in the answer? It ...
1
vote
1answer
28 views

Using minted for syntax highlighting with RTL language reverses code

I'm writing a LyX document in Hebrew and I want to inset some inline code snippet but the code is reversed when rendered. The minimal lyx example is here. And it look like this: LyX source: ...
5
votes
1answer
65 views

Syntax highlighting code fragments

I am trying to split a long code listing into two columns, on a Beamer slide, using Minted. However, because the second column isn't syntactically valid (i.e., without the lead in from the first), ...
5
votes
2answers
119 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} ...
1
vote
1answer
25 views

argument in newenvironment

I am trying to write a newenvironment that would be a wrapper for code layout, using minted. So far, I tried that: \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} ...
5
votes
1answer
36 views

handling of `--` in minted

I'm using minted for pretty printing console output and have just noticed that double hyphens, i.e. --, for program options are getting turned in en-hyphens, i.e. –. A MWE is: \documentclass{memoir} ...
2
votes
1answer
32 views

How to use the latest minted package in overleaf?

I am working on a document in overleaf. I am using the minted package to place code in my document. I need to use the breaklines option of the minted package which only the latest version of the ...
0
votes
0answers
15 views

'<' and '>' - minted unable to print it

I am trying to print \documentclass[11pt]{article} \usepackage{acl2015} \usepackage{times} \usepackage{url} \usepackage{latexsym} \usepackage{minted} \usepackage{framed} \usepackage{graphicx} ...
4
votes
1answer
41 views

How to place a code snippet using minted inside a tcolorbox?

This is a piece of my LaTeX code: \documentclass[a4paper,oneside] \usepackage{minted} \usepackage{tcolorbox} \tcbuselibrary{breakable,skins} \usepackage{etoolbox} \usepackage{fancyvrb} ...
2
votes
0answers
39 views

Python console code with minted

I am using minted to highlight source code in my document. I have defined \definecolor{codeyellow}{RGB}{255,251,204} \newminted{python}{linenos,breaklines,frame=lines,bgcolor=codeyellow} in the ...
1
vote
1answer
42 views

Give code fragments a numbering (like equation-numbers, not line-numbers)

Can I give my code fragments in minted a numbering, like with equation numbers, so they'd have a (1) etc. at the right side of them so they can be referred to? (E.g. to write something like "Combine ...
0
votes
0answers
44 views

Getting the latex minted package to work in Anki

This is my Edit_LaTeX_build_process.py file (note the -shell-escape option) newLaTeX = \ [ ["latex", "-shell-escape", "-interaction=nonstopmode", "tmp.tex"], ["dvipng", "-D", "200", "-T", ...
3
votes
0answers
33 views

minted or listings input a file between markers

Is it possible, using the minted or listings package to format a file between or till a certain textual marker automatically. E.g. consider a source file: code code //marker code ... //end marker ...
1
vote
0answers
42 views

Getting minted and LyX work together

I need to insert code in my report, so I decided to use minted with LyX, my usual editor. I found a solution for getting minted and LyX together in this post (pwaller answer), by adding a custom ...
0
votes
0answers
17 views

Build errors while using minted package

When i execute latex source, i get following error. ! Undefined control sequence. l.42 \newmintinline [command]{LaTeX}{} The control sequence at the end of the top line of your error message was ...
0
votes
0answers
25 views

Correct highlighting of code listings using minted

I've done some coding using Qt and I need to list the code in a document. One of the advantages of Qt is the multiple template classes such as QList or QMap for example. I'm trying to get the correct ...
3
votes
1answer
33 views

Relax a command inside minted

I'm using rich unicode in LaTeX as specified here. However I also use unicode in Julia language, so when I input Julia code in XeLaTeX I get an error because √ is bound to \sqrt in LaTeX, but is a ...
0
votes
0answers
21 views

Minted and Tabularx

I've seen lots of questions on using minted with tabular. I'm getting this problem when using minted with tabularx. Code: \begin{tabularx}{|l|X}|} A & B\\ testing & \begin{minted}{c} int ...
2
votes
1answer
67 views

LaTeX minted Error

I receive the following errors: ! Package minted Error: You must invoke LaTeX with the -shell-escape flag. ! Package minted Error: You must have `pygmentize' installed to use this packag in ...
4
votes
1answer
57 views

Minted caching in tikz externalize job

Enabled caching options for minted and tikz lead to unexpected and inefficient caching. For every tikz figure that is externalized, all minted code blocks of the main document are cached within the ...
4
votes
0answers
65 views

\inputminted: distinct file parts in one listing (equivalent to linerange in listings)

I want to include code from a file into my document. However, several distinct line ranges should appear in the same listing. Also, I want to use gobbling, and it would be nice to include some blank ...
0
votes
0answers
63 views

Same caption space

I want to have the same vertical spacing between figures/listings and their captions. Currently, the space between figure and caption is shorter than that between listing and caption. What should I ...
0
votes
0answers
35 views

Add a chapter for \listoflistings

I've struggled for some time to get the \listoflistings to work. I'm using minted to insert code-examples like this: \begin{listing}[H] ...
1
vote
1answer
336 views

Minted not working

I'm trying to use the minted package on Windows 8. I installed python and Pygment, added C:\Python34 and C:\Python34\Scripts on my path. When I try to compile the following latex code: ...
3
votes
0answers
273 views

Undefined Control Sequence with minted

For some reason, minted is giving me a "Undefined Control Sequence" error on every line that I used "\usepackage". I searched about it but I couldn't see an answer that fits me. The error: ! ...
3
votes
2answers
208 views

Why are some Unicode characters missing when using XeTeX and Ubuntu Mono?

I'm trying to typeset a document using minted code listings that contain quite some amount of non-standard Unicode characters. I'd like to use Ubuntu Mono as a monospaced font. The following supresses ...
3
votes
2answers
58 views

Haskell minted environement - problems with brackets

After doing some research on the interweb - I finally made the switch to minted. As I need to document Haskell with Latex, I created the following listing according to examples found on this page. ...
5
votes
0answers
51 views

Source code explanation in LaTeX [duplicate]

I was just wondering if it is possible to create source code explanations like the image below using LaTeX (listings or minted it doesn't matter). I'm Sorry I'm kind of new to LaTeX. Thanks in ...
3
votes
1answer
55 views

Disabling one keyword in minted

I'm formatting SQL code in my document using minted: \usepackage{minted} \newmintedfile[sql]{sql}{breaklines=true,samepage,fontsize=\footnotesize} % ... \sql{query.sql} In some of these files I'm ...
1
vote
1answer
33 views

How to write a onecolumn page while using the IEEEtran class?

I am writing a document in which I have to add a code in the appendix section. I am using the IEEEtran class but it does not help me while adding the code using the minted package. Is there a way I ...
0
votes
0answers
117 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 ...
4
votes
2answers
104 views

How to space before and after a `minted` code block with bgcolor?

I'm using minted to format code samples in my document, and I have set a bgcolor option to make them stand out. By default (as in Harish's answer below) the code block will naturally have some ...
2
votes
1answer
52 views

What are the advantages of the different ways you can use tcolorbox together with minted? Is one to be preferred over the other?

I'm listing code with the minted package and drawing the box around it using the tcolorbox package. However, there are two ways to do it, and I don't know which one is best. To list code that resides ...
2
votes
0answers
77 views

Options problem with LaTeX using AucTeX

In my file, I use the package minted that require to use the option -shell-escape . In order to use this option, I need to add the following line in AucTeX : %%% TeX-command-extra-options: ...
2
votes
1answer
99 views

Typeset colored terminal output using minted

I need to reproduce the output of a command in a LaTeX document. The command uses ANSI escape codes to produce colored output. I'd like to use minted, but using \inputminted{shell}{coloredoutput} ...
4
votes
1answer
116 views

LaTeX to HTML using htlatex - Background problem

I've been trying to highlight Python code and convert it to HTML. For highlighting I used the minted package since it provided a few styles that I was looking for and I used htlatex for HTML ...
1
vote
1answer
163 views

Two column minted listing inside tcolorbox

I have a quite long but narrow code I want to typeset inside a tcolorbox. Is it possible to enable a two (or more) column mode inside the box (not break the box and set the parts adjacent). The ...
2
votes
1answer
120 views

Minted package throws font warning when using triple " for python docstrings using inconsolata

Using minted for code listings I have set my font to inconsolata and get the wargning: LaTeX Font Warning: Font shape `T1/zi4/m/it' undefined when using Inconsolata font and Python documentation ...
3
votes
1answer
139 views

Style Pygments at PythonTeX

Can I use style pygmentize with Pygments at PythonTeX. Let MWE like this : \documentclass{article} \usepackage{pythontex} \begin{document} \begin{pygments}[style= murphy]{python} % murpyhy is style ...
0
votes
0answers
129 views

Different minted styles for different languages

I am trying to add two different snippets of code to a document, one in Java and one in ObjC. I have been able to set up the languages the way I like them, but I would like to set a different style ...
0
votes
0answers
12 views

Avoid converting doublequotes in minted environment

The code \documentclass{article} \begin{document} \begin{minted}[]{scala} "test" \end{minted} \end{document} compiles to ”test” The doublequotes are the wrong ones.
1
vote
0answers
78 views

tcolorbox line numbers

I am trying to make a generic environment to use for all my boxes in my document. I want all my boxes to have line numbers. I can only get this to work some of the time. I don't get line numbers when ...
4
votes
2answers
89 views

minted Perl with dollar symbol

I'm using minted to display some Perl, however the "unmatched" '$' in it is breaking compilation. Escaping it with a '\' results in the \ being displayed with the rest of the code block. Is there a ...
0
votes
0answers
37 views

Minted crop lines from beggining and end of file

I am having a following problem with minted and LaTeX: I would like to include (a bunch) of c header files in my document, but since they are actual implemetantions, they have header guards, such as ...
2
votes
1answer
88 views

Why : Error Minted package with rule color?

I have problem about use minted package, my mwe like this : \documentclass{article} \usepackage{minted} \usepackage{xcolor} \definecolor{Rub}{HTML}{061089} \begin{document} ...
0
votes
1answer
61 views

How to dim part of the syntax-highlighted source?

I'd like to typeset a (LaTeX) source code with syntax highlighting (I guess I'm going to use minted, but I haven't decided that for sure yet). I'd like to have complete examples (with \documentclass ...
0
votes
0answers
111 views

Highlighting code lines with minted in diff like GitHub?

What I'm seeking is something like you find in this question but together with the minted package. Preferably without any extra steps. I know that it's possible to create your own pygment styles, but ...
1
vote
1answer
75 views

'Errors' using the minted VHDL environment

I recently started university, and was annoyed to find out, we had to do our reports and assignments in LaTeX... until I learned how to use it! I went from hating it to loving it in one day. :) But ...