{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

5
votes
2answers
3k views

minted not working on mac

I am using texmaker on a Mac and I tired to use the minted package with this code \documentclass[12pt,A4]{article} \usepackage{minted} \begin{document} \begin{minted}{python} def __init__(self, ...
16
votes
1answer
883 views

In the minted package, how do I enforce straight single quotes?

Basically I want \mint{python}|'banana'| to produce straight single quotes, rather than the curly ones it normally produces (in pdflatex).
10
votes
2answers
2k 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}{} ...
9
votes
1answer
2k views

How to customize the default xelatex command in TexShop for OSX

I am trying to make use of the minted package for source code highlighting, and am running into an error telling me I need to install pygmentize combined with an message regarding the --shell-escape ...
2
votes
1answer
611 views

Beamer columns won't align minted code and TikZ diagram

I'm trying to create a two column Beamer slide, with the first column displaying a short minted code listing, and the second column displaying a TikZ diagram. Unfortunately the minted code listing is ...
11
votes
1answer
2k views

How do I import a source file using minted

Currently, I have something like this: \begin{minted}{csharp} public static void Main (string[] args) { Console.WriteLine ("Hello World!"); } \end{minted} Where the source code is copy/pasted ...
3
votes
1answer
1k views

Showing only specific lines using the listings package

I am very new to TeX. My source code is in an external file, let's call it source.java, and I use \lstinputlisting{source.java}. How could I use only the lines 3-5 for my code listing? (and not the ...
3
votes
0answers
342 views

The [H] “put it here” placement option doesn't work with floatrow [closed]

I'm using the minted, floatrow, caption, and listing packages to create code blocks like these: To do this, I'm using a hack based on this answer. Here is what I have: ... \usepackage{listings} ...
1
vote
1answer
318 views

How can I assign a node name while wrapping minted environment?

I was thinking how can I frame particular pieces of minted environment for beamer slides. I had a choice either to use overlays and split code across several blocks ( Beamer vs. Minted: overlays ) or ...
5
votes
1answer
771 views

New environment with minted

I want to create a new environment to transform this: \begin{listing} \caption{some caption} \label{code:label} \begin{minted}[options]{language} My code here \end{minted} \end{listing} ...
3
votes
1answer
627 views

Wrapping minted in a Tikz box with a command

I'm familiar with the Defining a command for a minted environment question. In addition to defining the mint parameters I also want to wrap the minted code inside a Tikz box for its nice looks. I've ...
1
vote
0answers
60 views

Minted split code into two pages [duplicate]

Possible Duplicate: minted truncates the code if it doesn't fit into one page I am using minted in order to write some Objective-C code inside a report I am trying to create. I use it ...
4
votes
1answer
6k views

How to install minted in Ubuntu [duplicate]

Possible Duplicate: How do I install an individual package on a Linux system? I'm very new to Latex and have understood basic concepts. Now I would like to get syntax highlighting. minted ...
7
votes
1answer
362 views

polyglossia and minted - The current roman font does not contain the Hebrew script!

Trying to use minted with Hebrew as the default language with polyglossia: \documentclass{article} \usepackage{minted} \usepackage{polyglossia} \setdefaultlanguage[calendar=hebrew, ...
3
votes
1answer
1k views

Error when using both minted and TikZ externalize with xelatex

See the following MWE. \documentclass{article} \usepackage{minted, tikz} \usepackage{fontspec} \setmainfont{Arial} \usetikzlibrary{external} \tikzset{external/system call={% xelatex ...
4
votes
1answer
142 views

How to let minted highlight a whole file from disk

I am using the minted package to highlight source code in LaTeX. It works well for a piece of code embedded in \begin{minted} ... \end{minted}. Now the question is if it is possible to highlight a ...
1
vote
0answers
114 views

Print programs with its proper syntax by minted [closed]

I have post a question several weeks ago: Print programs with its proper syntax, and I finally decided to use the package minted. I summarize a little bit my needs here: the language I define has its ...
5
votes
3answers
464 views

Is it possible to compile minted under Emacs?

I am trying to use minted package... Here is an example minimal.tex: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{c} int main() { printf("hello, world"); return 0; 4 } ...
3
votes
1answer
434 views

minted chokes on umlauts

I would like to use ü in the caption of my listings. It works with the lstinputlisting command, but not with inputminted: \documentclass[11pt]{report} \usepackage{geometry} \geometry{a4paper, ...
3
votes
1answer
423 views

Belowskip on minted?

Is it possible to remove the spacing below the code of a minted environment? When I have a block of code underneath another it doesn't produce any spacing (which is what I want), but it does for text ...
3
votes
3answers
944 views

Using minted with mixed Python code and output

I'm using minted to highlight code in Python. In some cases I want to mix code with output that the user will see. This gives me the red syntax error boxes, for example like so: And sometimes it ...
8
votes
1answer
840 views

Using minted and tabs

I just started using the minted package. When I insert tabs as indentation, it gives me a bunch of characters instead: However, when I copy the example from the documentation it seems to work fine. ...
2
votes
1answer
328 views

Force minted to insert new space in code that won't fit on the page

Essentially I would like to have listings' breaklines option on minted. I can't seem to find it. I could manually insert new lines but it becomes difficult when the code comes from an external file.
7
votes
2answers
1k views

How to place two code snippets next to each other with minted?

The minted package for code highlighting comes with a float environment called listing. Now I would like to place two of this code listings next to each other, but I have no idea how to do this. I ...
1
vote
1answer
629 views

minted: Force comments to be displayed in a more console-like font

In minted's default style, as well as a few others (emacs for instance), comments and other stuff like C preprocessor commands show up in a very un-code-like italic font, as shown in the 2 examples ...
6
votes
1answer
528 views

Make the vim minted style use light terminal-like highlighting instead of dark

Whenever I'm highlighting code with the minted package, I use \usemintedstyle{vim}, which looks okay aside from the fact that it looks like a dark VIM color scheme applied onto a light background and ...
6
votes
1answer
652 views

Is it possible to find methods in source code using \inputminted?

My document MWE: \documentclass[12pt,a4paper]{mwrep} \usepackage{minted} \begin{document} \inputminted[gobble=4,firstnumber=3,firstline=3,lastline=9,linenos,tabsize=4]{java}{Foo.java} \end{document} ...
4
votes
2answers
3k views

Minted, setstretch and font size

I'm using minted package. My problem is \usepackage[nodisplayskipstretch]{setspace} \setstretch{1.5} line. I do need this line stretch, but I don't want it to affect code sources generated by minted. ...
4
votes
0answers
450 views

Syntax highlighting blocks of code with LaTeX and literate programming tools [closed]

Using packages like minted (thanks to Pygments), LaTeX can generate beautifully highlighted/colored source code. Literate programming tools such as noweb and cweb can generate beautifully typeset and ...
2
votes
2answers
1k views

Setting font for a minted environment in a beamer frame

I'm having a problem setting the font of a minted environment in a beamer frame to the particular font I want. I want the area to be in Inconsolata (or at least a monospaced font with a slash through ...
3
votes
1answer
964 views

Way to present programming code side by side to show the differences to the reader?

I am trying to make a side by side comparison of the result of listing-mode and minted-mode for a piece of Ruby and Java-code. I have problems making this look 'side by side'. Any suggestions to make ...
3
votes
1answer
463 views

Loading babel with the 'hungarian' (magyar) option breaks 'pygments' code highlighting

Given the following TeX file everything works as expected: the (Hungarian) text Árvíztűrő Tükörfúrógép typesetted as expected and the code snippet also formatted brilliantly. \documentclass{article} ...
6
votes
4answers
1k views

Beamer vs. Minted: overlays

How to use beamer overlay inside minted code? The obvious solution does not work: \documentclass{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile] \frametitle{Foo} ...
4
votes
1answer
930 views

Defining a command for a minted environment

How can I define a newcommand macro or an environment for minted? What is causing the problem that the following does not work? \newcommand{\CppSourceCode}{ \begin{minted}[linenos=true, mathescape, ...
2
votes
1answer
698 views

Using package minted inside a multicol (multicol package)

I'm trying to list some code (package minted) inside a multicol (package multicol). Example Code: \documentclass{article} \usepackage{minted} \usepackage{multicol} \begin{document} ...
10
votes
3answers
1k views

Reference source code line in minted package

Does anybody know a working example, where a source code line is reference in minted? I have not found any help till now how to do this? \begin{minted}[linenos=true]{c++} bla bla bla bla ; ...
7
votes
2answers
937 views

minted truncates the code if it doesn't fit into one page

minted works well when the code snippet is short, or fit into one page. The problem occurs when I pasted a code snippet with several hundred lines. Sometimes it processed but the output was truncated; ...
13
votes
5answers
9k 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: ...
20
votes
5answers
990 views

Speeding up minted compilation

I've been looking into speeding up my pdflatex compilation time and it's lighting fast now. Only one thing's still very slow: compiling source code using the minted package. I was wondering if ...
13
votes
4answers
2k views

Using package minted with non-english characters

I would like to use LaTeX package minted to colorize my c and Cuda code. I need to write comments in the code in czech. I use package inputenc with utf-8 and czech characters (ěščřžýáíé) work good in ...
7
votes
2answers
1k views

minted's listing environment with hyperref and caption package together

I use the minted package for code highlight. I use its listing environment. I also use the hyperref package to provide links all through my document: figures, tables, listings, etc. If I import the ...
7
votes
1answer
1k views

LaTeX minted package: numbering lines does not work [closed]

I'm having a problem with the minted package. When I try to add line numbering to the minted command, I get the following error: ! Package keyval Error: stepnumber undefined. See the keyval package ...
15
votes
3answers
1k views

How to add custom C++ keywords to be recognized by Minted?

I have defined several structures and types in a C++ project. I have to write some documentation for this code, and I use the minted package to typeset my code. I would like to be able to add some ...
7
votes
1answer
1k views

Using minted to define a new environment

Can I define a newenvironment that has inside it a minted environment? eg and environment that would be a quickhand for the following code: \begin{figure}[htp] \centering ...
7
votes
2answers
965 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} ...
7
votes
1answer
629 views

Use autoref with minted and its listing environment

I would like to use autoref from the hyperref package to create a reference to a floating listing as provided by minted. This code \documentclass[a4paper]{book} \usepackage{minted} ...
19
votes
2answers
3k 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} ...
1
vote
1answer
1k views

Texments/minted not working - Undefined control sequence

I'm trying to add some syntax highlighting to my code and found two packages: texments and minted. I tried to use them, but I'm getting errors while trying to build. I used following code to test both ...
16
votes
3answers
3k views

Preferred method for inline code samples

I tend to use the minted package for including code samples within my documents, which produces very nice output. However, because Pygments always produces a verbatim environment there's no way to ...
10
votes
2answers
2k 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 ...