Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [minted]

{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 the Python package Pygments (e.g using pip install Pygments). ...

3
votes
1answer
104 views

How do I set a background color and font for inline verb text?

I wish to customize the verb command such that I can customize the font and color, as well as set a rounded colored rectangle as background. I found this in the Tcolorbox manual: \DeclareTotalTCBox{\...
0
votes
0answers
11 views

match line spacing in different minted code snippents

I want to compare pseudo-code snippets from 2 made up languages side by side. I matched them in number of lines but the line spacing is different, so the lines are not aligned 1:1 even though they ...
3
votes
1answer
39 views

Advanced customization of Minted code?

I'm a newbie to LaTeX, especially the minted package. I would like to customize it such that the code has a similar style to the attached screenshot. Specifically, I wish to be able to customize: The ...
0
votes
1answer
18 views

Errors after upgrading OS and Lyx

I use Lyx everyday. Yesterday I decided to format my computer and install Xubuntu 18.04 (I had Xubuntu 16.04). After installing Lyx I am getting this errors: Although the errors, the PDF is properly ...
3
votes
1answer
32 views

workaround for minted environments in in Beamer notes

A work around for adding code to beamer notes is described here: LaTeX beamer: Code listings in notes. Here is how I've adapted it for use with Minted: \documentclass{beamer} \setbeameroption{show ...
0
votes
0answers
20 views

Trying to use minted package and getting error “Package minted Error: You must invoke LaTeX with the -shell-escape flag.” [duplicate]

I am using Windows 8.1, MiKTeX 2.9, TeXstudio. Everything including packages are fully updated. I am trying to compile this: \documentclass{article} \usepackage{minted} \begin{document} \end{...
0
votes
2answers
24 views

How to let \listoflistings of minted use subsection's subheading and appear in TOC?

I want the \listoflistings of minted to appear as a subsection heading. (My \documentclass is scrartcl.) Things like \printbibliography have a "heading" option, which you can use to define, which ...
0
votes
1answer
17 views

How to remove minted indentation level with correct latex indentation?

When writing with minted code snippets I dislike to remove indentation in latex source, so correct results are generated. Is there a way to substract latex indentation-level from minted indentation? I ...
0
votes
1answer
18 views

How can I make such an environment with '"minted'?

How can I make such an environment: \documentclass[a4paper,12pt]{report} \usepackage{minted,fancyvrb} \newenvironment{mycode}[1]{ \begin{listing} \begin{minted}{bash}}{ \end{minted} \...
2
votes
1answer
30 views

Forcing mintinline background to have the height of the line

I'm having trouble with \mintinline, because I am using a black background for it, and the characters render in a way that I find unpleasing. Namely, when doing something like: \documentclass{article}...
3
votes
1answer
37 views

Why is the # character duplicated in footnotes?

I've run into a weird issue related to footnotes. When I compile the document I pasted below, the "regular" #import statement is shown exactly as it appears in the source code. However, when I use ...
0
votes
0answers
35 views

How can I prevent the minted environment to highlight the code? [duplicate]

I'm writing a LaTeX document and I'm using the minted package to highlight the code. This is what I've written: \documentclass{report} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[...
4
votes
0answers
47 views

One tcbcolorbox with alternative color in different lines

\documentclass{article} \usepackage{geometry} \geometry{left=2.5cm,right=2cm,top=2.5cm,bottom=2.5cm} \usepackage{fontawesome} \usepackage{varwidth} % tcolorbox \usepackage[dvipsnames, svgnames]{xcolor}...
2
votes
0answers
49 views

A weird box in the code styled with minted [closed]

I use minted to style my codes in a document. But in some cases, there is a weird box in the code in which most of the time a quotation mark is encircled. The following MWE shows my problematic ...
3
votes
1answer
44 views

pass parameter #1 to minted's \mintinline, when #1 begins with `#`

I noticed the following unexpected (by me!) behaviour, illustrated by this MWE and its output in the figure below: % arara: xelatex: { shell : yes } \documentclass[11pt]{article} \usepackage{...
0
votes
0answers
36 views

A single column Listing with Minted into a two column layout document?

I have a two column document: \documentclass[twocolumn]{elsarticle} \usepackage{minted} \usepackage{caption} \captionsetup[listing]{position=top} \usepackage{listings} \begin{document} \begin{...
2
votes
1answer
66 views

Minted variables alone vs in expressions being colorized differently

We are using minted for a paper. Variable/function names are being colorized when they stand alone in inline expressions, but not when they are part of arithmetic expressions. For example, the n and ...
0
votes
1answer
37 views

minted - how to highlight html also, when language “twig” is selected

I use minted and I try to format twig-Code. But when I select twig as the code-language, it does highlight the twig code but it doesn't highlight html-code! This looks like this: Is there any way to ...
2
votes
1answer
54 views

tikz with beamer inside minted

I'm trying to define a tikz node inside a minted frame. I have the following MWE: \documentclass[tikz, xcolor={svgnames}, aspectratio=43]{beamer} \usepackage{minted} \usepackage{tikz} \...
1
vote
1answer
305 views

Package minted Error: Missing Pygments output [closed]

I installed minted today as well as Python and Pygments, which I can run from the cmd. When I try this code \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{c} int main() {...
2
votes
0answers
44 views

Read out text file until first empty line is found

Im currently writing a manual for a package and wanted to include parts of a Matlab file. I was able to display the whole file with the listings package but my goal is to only display the first part ...
1
vote
1answer
71 views

Top alignment of listings in a tabu/tabularx-environment - lstlisting/minted in a table

I want to insert code snippets into a tabular environment. For the Code snippets I'm using the package listing and to insert it into a tabular environment I put the code into a box. To get linebreaks ...
0
votes
1answer
73 views

texify.exe in TeXworks in MSWindows 10: MiKTex encountered internal error when compile with --shell-escape

I try to compile a tex text using the minted package using TeXworks and choosing the option XeLaTex+MakeIndes+BibTeX. When i try to build as is I get the error: ! Package minted Error: You must ...
3
votes
1answer
90 views

tcolorbox + minted: a box always starts on a new page/column leaving a big empty space

I'm trying to write a command to insert a boxed listing that break across pages. To this goal I'm trying to use minted for prettyprinting the listing and tcolorbox for creating the boxes (but I've ...
1
vote
1answer
40 views

Correct loading order of package newfloat along with hyperref and algorithmic packages?

There is extensive documentation that hyperref must be loaded towards the end. In particular, the following is the correct loading order for these specific packages: \usepackage{float} \usepackage{...
0
votes
1answer
67 views

include sql files and use minted for highlighting

I write in latex a documentation about a database project. I would like to include some sql files in my latex document and highlight this files with minted. My initial approach is the following, ...
0
votes
1answer
74 views

Loading tcolorbox with the minted option breaks tikzexternalize and results in compilation error with makeglossaries

I have a weird problem that has now been localised to either of the lines: \usepackage[minted]{tcolorbox} \makeglossaries{} in my preamble. I am using luatex with shell-escape enabled (for minted). ...
2
votes
1answer
39 views

Cleveref does not change its string even after changing minted's listing environment caption name

I am using the minted package's listing environment to typeset MATLAB source code. As explained in the minted manual, I have used the \SetupFloatingEnvironment{listing}{name=Program code} option to ...
2
votes
1answer
47 views

How to escape to latex within minted comments?

I am using the minted package for typesetting matlab source code. There is an escapeinside option for the listing environment provided by minted to escape to regular TeX commands. However, this does ...
0
votes
1answer
57 views

Minted doesn't break the line at the desired character

I'm writing a document using minted. I installed Python, pygmentize, everything works great. But there is a behaviour I don't understand. I want to break the text inside the minted environment at the ...
1
vote
1answer
67 views

Custom name of listing in list of listings with minted not working

I am using the minted package to highlight source code and also to add a list of listings. My code already looks like it should: \begin{listing}[hb] \inputminted[frame=single,linenos]{c}{code/...
4
votes
1answer
82 views

Breaking pages in minted package

The total line number of my code is larger than the line number of the page, in minted, there is a breaklines option but it seems to breaks lines exceed the length of page line. \documentclass[12pt]{...
0
votes
1answer
71 views

TexMaker minted package, there is no output in pdf file

The minted package was used but the code blocks did not appear in the pdf file in TexMaker \usepackage[cache=false]{minted} \begin{minted}[mathescape, linenos, ...
1
vote
1answer
48 views

With pdflatex and the minted package, how do I eliminate whitespace and include entire document?

I'm using tex because it seems to be the most appropriate tool for my workflow... I'm making posters to teach computer programming, these need to be full of syntax-highlighted code. I have a ...
0
votes
1answer
280 views

Pygmentize not installed error on Visual Studio Code

I have been using VS Code + Latex Workshop for the last year and so to write up my tex documents however today I tried using the minted package which I have installed in /usr/local/bin/pygmentize In ...
0
votes
1answer
44 views

Missing \endgroup inserted when using \mint in caption?

I'm using minted for code syntax highlighting in my document and it's been working great: In my caption, I want to refer to some variables and format them: \begin{figure} \inputminted{js}{...
3
votes
1answer
24 views

Listing Code Snippet goes under page numbering

\begin{listing}[p] \centering \inputminted[linenos, frame=lines, firstline=46, lastline=93]{python}{Codes/MyCode.py} \caption{Part 1 Of Feature Extraction Python Code} \label{listing:Feat} \end{...
1
vote
1answer
43 views

Problems setting up minted and tcolorbox to include source code and set title

For my PhD thesis, I am using minted package for source code listings. I'd like to have a custom command \mylisting something along the lines of \mylisting[Name in title]{filename of source code} or ...
0
votes
1answer
60 views

How to ignore shellcheck when using minted in sublime?

I want to ignore shellcheck when writing a LaTeX document while using minted package. I know, when using shellcheck I can easily ignore warnings or errors globally by placing a line right at the ...
0
votes
1answer
38 views

Installing pygments and configuring minted for continuous builds on travis-CI

I have set up a continuous integration system using github and travis CI using this workflow that was given as an answer to a similar question here. Everything works fine and I am able to build the ...
1
vote
0answers
69 views

Minted vs matlab-prettifier for thesis [closed]

I am writing my PhD thesis now for which I need to list snippets of source-code within the main text and full listings in the appendix. I did my coding entirely in MATLAB using advanced constructs ...
0
votes
0answers
50 views

ifplatform.sty error after installing miktex on Ubuntu Mate 16.04

I can't tell if this is Windows or *nix; you appear to be neither. The error above is what I receive even when I try to compile something as simple as this: \documentclass[11pt]{article} \...
2
votes
1answer
106 views

FancyVerb Error in using minted package with beamer

Could someone help me with the following error? I am trying to use minted package in beamer. FancyVerb Error: File ended while scanning use of \FancyVerbGetLine. This is a MWE that duplicates the ...
3
votes
1answer
73 views

Typset shell code with sensible terminal highlighting in LaTeX

I'm familiar with typesetting script code in my documents, however, I have been unable to obtain nice highlighting for code (e.g. similar to that afforded to me by my gnome-terminal). Basically this ...
3
votes
1answer
42 views

Include only a part of external file in minted

I am using minted package to display source code from an external file using the inputminted command but I don't want to display the whole file but a certain line number if possible, say from 2 to 15. ...
1
vote
0answers
308 views

Error compiling with minted package

I'm trying to use the minted package in a document. When I compile the document I get the following error: The minted package is installed under MiKTeX, and Pygemnts is also installed (when I -m pip ...
0
votes
1answer
35 views

Creating custom environment with ruled caption

I'm trying to create an environment for listing code that will use a ruled caption (in the style of the algorithm package). I don't want it to be a float environment, since I have to allow pagebreaks ...
0
votes
1answer
70 views

Cannot set custom fontsize on minted package after setting custom sans font using fontspec

\documentclass[11pt]{article} \usepackage{minted} \usepackage{fontspec} \defaultfontfeatures[CalibriLight]{ Extension = .TTF , UprightFont = fonts/Calibri-Light , ...
3
votes
1answer
41 views

Hierarchical Numbering of Listings with \captionof

I'm using the \captionof command from the caption package to add captions to listings produced with \inputminted. E.g. \documentclass{report} \usepackage{caption} \usepackage{minted} \begin{...
0
votes
1answer
123 views

Error with pygmentize when using minted package

Problem: I get multiple undefined control sequences when using the package minted and I believe it is caused by pygmentize. Background I use the software Texpad and the active LaTeX distribution is ...