{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

0
votes
0answers
13 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
29 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
29 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
13 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
18 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
25 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
15 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 ...
1
vote
0answers
35 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
45 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
47 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
59 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
28 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
253 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
199 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
176 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
56 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
49 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
28 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
94 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
89 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
50 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
68 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
84 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
99 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
139 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
106 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
121 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
111 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
73 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
80 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
34 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
80 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
59 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
100 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
66 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 ...
5
votes
1answer
103 views

minted: Hiding comments in code?

Is there anyway to have minted hide code comments completely? This is related to How to strip a listing of all (line and block) comments without leaving white space? But that question is about the ...
1
vote
1answer
117 views

Python indentation lost in minted when export to bearmer/latex in orgmode [closed]

I have a strange problem when exporting to beamer in org-mode. I use minted to export python. But for a reason I don't understand, I lost sometime the indentation. For instance: ** NDVI is SciPy 1/2 ...
3
votes
1answer
191 views

mintinline command not compiling with pdflatex

Whenever I try to use the mintinline command in a source file and then compile that file with pdflatex, I get an error. Minimum example to show the error is provided below: \documentclass{book} ...
0
votes
0answers
136 views

AucTex minted package not finding pygmentize

I am trying to compile a latex document with the minted package. I can do this quite happily from the terminal (I'm using texlive on os x) with the following code: xelatex --shell-escape demo.tex ...
4
votes
1answer
181 views

Using BW style for minted code highlighting not pure BW

I'm trying to use the minted package with bw style for JavaScript code highlighting. Under the document I added \usemintedstyle{bw} and use highlighting like this: ...
4
votes
1answer
151 views

How to use Serbian cyrillic script with Polyglossia and minted

I'm using polyglossia for writing a document in Serbian cyrillic script, but when I try to use minted for source code syntax highlighting there's an error (although pdf is generated): polyglossia: ...
7
votes
1answer
524 views

Emacs org-mode minted export with #+ATTR_LATEX

When I try to export a file like this: #+LaTeX_CLASS: tufte #+ATTR_LaTeX: :float t :options label={test} #+begin_src c #include <iostream> using namespace std; int main() { ...
5
votes
2answers
914 views

Break Lines in minted environment

Usually when adding code in a LaTeX document, I use the listings package. When trying to modify and personalise styles in listings, @1010011010 suggested to use the minted package. To be quite frank, ...
2
votes
1answer
232 views

minted and tabs

I can get a code block including tab characters in a minted environment to work with the obeytabs option, which results in a tab size of 8. The tabsize option, however, will mess up the tab alignment. ...
2
votes
0answers
161 views

custom syntax highlight for minted [closed]

I am trying to get a custom syntx highlight for minted. My actual code for this style looks like this: from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, ...
5
votes
1answer
201 views

Correctly highlighting custom html tags in listings

Problem statement I have several code listings containing HTML markup in my latex files. These listings contain multiple custom html tags (created in combination with corresponding AngularJS ...
2
votes
0answers
39 views

Cyrillic in minted label

Is it posible to use the Cyrillic text for the label option in minted source code listing? I try to compile this piece of latex code with xelatex: ...
4
votes
0answers
135 views

(Clickable) cross-reference in lstlisting

To generate documentation for an 'application programming interface', I would like to have a syntax highlighted area (with the class declaration), which has clickable links to the documentation (which ...