{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

1
vote
1answer
57 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: ...
3
votes
1answer
443 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} ...
0
votes
2answers
64 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 ...
3
votes
2answers
277 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
682 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
18 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. ... ...
1
vote
1answer
44 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 ...
2
votes
1answer
43 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 ...
1
vote
2answers
74 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 ...
0
votes
0answers
19 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
318 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
2k 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
47 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
29 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
78 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
50 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
814 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: ...
0
votes
0answers
14 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
42 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
766 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} ...
3
votes
0answers
48 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]{} ...
2
votes
1answer
62 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} ...
1
vote
1answer
17 views

POVRay code not highlighted minted

Bonjour ! I want to highlight PovRay code with minted but I don't get any result ! PovRay is in the list of pygments language supported, and I run my file with -enable -write18 in windows vista 64 bit ...
4
votes
0answers
56 views

How to let minted break across pages but keep the caption together with the end of listing?

I want to create a listing using minted that has background colour and can be split across pages. The usual advice in that case is to use the mdframed environment and I have written a command that ...
3
votes
0answers
74 views

Minted text changes _ to \_ in the final PDF

I'm writing a report and I found something wrong after compiling it. The PDF file showed things like \_ instead of _ and \textquotedbl{} instead of quotation marks. It's pretty important for me to fix ...
1
vote
0answers
39 views

Centering code listings in tabular

I'm inserting code listings using mint into a tabular, but the text and listings in corresponding columns aren't centered. How do I center them? Here's my table code: \begin{center} ...
0
votes
2answers
89 views

Converting latex highlighted code listing to image

Does someone know how I could submit a paper to a journal which contains source code highlighting with minted https://github.com/gpoore/minted ? I really like the highlighting and don't want to go ...
12
votes
2answers
4k views

Inline code and short verb with minted

I it possible to use minted for inline code and to add a short verb sing for minted? Like \lstMakeShortInline| in listings.sty? \documentclass{article} \usepackage{minted} \newminted{tex}{} ...
7
votes
1answer
114 views

! I can't find file `['

I am writing my thesis by using LaTeX and the toptesi package. I am mostly writing on my laptop, but sometimes I need to switch to my other PC. I encounter some problems here when generating the pdf ...
5
votes
1answer
53 views

Avoid space when using mintinline wrapped in a new command

I want to wrap mintinline into a new command \cc but it produces an additional whitespace when using it: \documentclass{article} \usepackage{minted} \newcommand{\cc}[1]{{\mintinline{latex}{#1}}} ...
1
vote
0answers
25 views

Best options to highlight Geogebra syntax

I want to write something about geogebra in LaTeX. I usually use the minted package for listings. Is there any language supported by minted which which is very close to the Geogebra Syntax (as used in ...
1
vote
3answers
192 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 ...
3
votes
1answer
46 views

New environment for Python source code

I am trying hard to create an environment for my source code. Here's my current state \documentclass[a4paper,fontsize=12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...
9
votes
4answers
2k views

Red box drawn around question-mark operator in minted Erlang code

I'm trying to include some Erlang code samples in a document using the minted package which include the ? operator to denote a message being received from a process. The code \documentclass{minimal} ...
3
votes
1answer
48 views

Natural width when centering a minted environment

I'm writing a report in which I have some code snippets. Using the following code, I'm able to create, and centre, a good-looking minted environment: \documentclass{article} % Required for minted ...
16
votes
5answers
19k views

How to install syntax highlight package minted on Windows 7?

I followed the instruction from this link: http://tug.ctan.org/tex-archive/macros/latex/contrib/minted/ Firstly, I install Python 2.7, then create a folder named Scripts in the directory: ...
3
votes
2answers
64 views

“Figure” as name of listings in listoflistings with minted and newfloat

The following MWE gives me a List of Listings with "Figure" as name of listings. \documentclass{scrreprt} \usepackage{classicthesis} \usepackage[newfloat]{minted} \begin{document} ...
2
votes
1answer
2k 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
2answers
141 views

How to draw over minipage in tikz?

I've got a code snippet, that I'd like to annotate with arrows, boxes, and bubbles pointing to the various parts of the code. Right now, I've got the code in a minted environment, inside a minipage, ...
1
vote
2answers
64 views

Displaying minted code line numbers from within preview environment

I'd like to have the line numbers corresponding to code highlighted using the minted package displayed in the output of a preview environment. Perhaps because the line numbers are set in the margin, ...
0
votes
0answers
43 views

Is it possible to use tikzmark inside minted?

As I've pointed out in a related question, I'd like to have some arrows pointing to parts of a source-code listing. I know this is possible with the listings package, but is it possible with minted? ...
2
votes
2answers
90 views

xelatex: Minted code block represents tabs as ^^I

I am producing LaTeX output with org mode. My code snippets wind up being indented with tabs, because of my c-mode settings. Changing these would be inconvenient. Although the snippet I am posting ...
4
votes
1answer
164 views

Difficulties with Minted and UTF-8

I'm trying to typeset Python programs with LaTeX and the Minted package. I'm under Ubuntu 15.10, with TeXlive installed from Ubuntu standard repositories. The python-pygment package is at version ...
16
votes
2answers
5k 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 ...
11
votes
1answer
1k 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 ...
6
votes
1answer
784 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 ...
3
votes
2answers
93 views

How to supress chktex errors in minted environment?

Is there a way to make chktex play nice with the minted package? Right now, it seems to assume that normal checks apply to the content of the minted environments and produces a lot of warnings.
0
votes
1answer
271 views

Python error while generating code snippets with minted and Pygments in Anki

On the command line everything works fine but in in Anki I get a python error. My computer: MacBook Air (13-inch, Mid 2012) Processor 2 GHz Intel Core i7 Memory 8 GB 1600 MHz DDR3 My operating ...
11
votes
2answers
247 views

Extract source code on the fly to a file?

I'm trying to create a programming text to use for my students. My goal is to have an environment (say, "code", for instance), so, if I type the following in my .tex file: \begin{code}{Sample script} ...