Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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). If you want to run your file with pdflatex, then you need to do so with the -shell-escape flag, e.g. pdflatex -shell-escape myfile.tex

Filter by
Sorted by
Tagged with
0 votes
0 answers
40 views

Copy paste mistakes while listing code

I have noticed that the lstlisting environment produces many errors that must be corrected if you try to copy-paste the code and compile it. Other environments such as minted produces way fewer errors,...
user avatar
  • 895
2 votes
1 answer
34 views

Page break with minted: code gets out of background

I'm using minted for displaying C++ code. If there is a long line at the bottom of the page, the line breaks as expected. Unfortunately there is also a gray arrow to indicate the line break. How can I ...
user avatar
1 vote
1 answer
26 views

Minted comments too long

I'm working with in the Overleaf environnement. I have a problem with the length of my minted codes and don't know how to solve it: I used a simple code called "test.m": function [x] = test(...
user avatar
0 votes
1 answer
14 views

How to make sublistings with minted package?

I use the minted package for creating highlighted code listings in my text, and I have a need to display several snippets under one float. Firstly, I've tried to use the \subcaptionbox command from ...
user avatar
2 votes
3 answers
40 views

Fit minted environment to textwidth

I can't get minted environments to fit into linewidth: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{minted} \begin{document} \begin{listing} \begin{minted}{python} from foo import ...
user avatar
  • 123
0 votes
0 answers
44 views

Integrate Python code into Latex

Hi I would like to display a code with Minted. I have written the following \documentclass[11pt]{article} \usepackage{minted} \usemintedstyle{fruity} \begin{document} \begin{minted}{python} import ...
user avatar
  • 1
0 votes
0 answers
31 views

Texmaker Minted Error: You must have pygmentize installed

I know there are a lot of similar questions out there, but sadly I wasn't able to solve my problem with any of the given answers. I am using Texmaker on a company owned Laptop running Windows 10. I ...
user avatar
0 votes
2 answers
33 views

Changed minted text color - no language (text option)

I wanted to enclose a bit of text/minimal HTML code in a minted text box. The HTML (a couple <br> and <a href='link'> doesn't matter to me, so I opted to use the text option for language ...
user avatar
  • 163
0 votes
1 answer
31 views

How to display a large python file on multiple frames automatically with beamer?

I have a large python file that I would like to display on my beamer presentation. I usually use minted but I cannot find how to display the file on multiple frames automatically (like it is done by ...
user avatar
  • 3
0 votes
0 answers
21 views

tcblisting box w/ minted shows incorrect listings

When using one of the tcblisting boxes for code and comments with minted, I often have problems getting the code snippets to show up. Previously, I used listings and had no problems, but the second I ...
user avatar
  • 163
1 vote
0 answers
24 views

Latin Modern under T1 encoding, "lighttt" setting, and "lmtt/m/sl" in place for italic: Error at apostrophe "\textquotesingle"

The MWE: \documentclass{article} \usepackage[lighttt]{lmodern} \usepackage[T1]{fontenc} \ttfamily \DeclareFontFamily{T1}{lmtt}{} \DeclareFontShape{T1}{lmtt}{m}{it}{ <-> ssub * lmtt/m/sl }{} ...
user avatar
0 votes
1 answer
24 views

When using minted to insert code snippets, the wrong snippet can be inserted

I'm writing a project where I need to include snippets of code from old git commits. I'm using a Python script to pre-process my LaTeX source code and convert %: ...
user avatar
0 votes
1 answer
44 views

How to render a long code listing in multiple pages with the package minted?

I'm using the package minted for formatting code in my paper. The package minted provides a "listing" environment, which treats the code inside it as a float. It works very well under most ...
user avatar
0 votes
1 answer
32 views

How can I patch `minted` to use `soul`s higlighting

I'd like to highlight code with a gray background like StackExchange does. I know that I can set bgcolor in minted to put a solid background color on inline code. However, this makes minted use ...
user avatar
  • 413
0 votes
1 answer
30 views

fixed position with newfloat

Listed code renders text with some text related to the third listing above source code with cat file2. Forced positioning with H solves the problem however this option is not available in newfloat ...
user avatar
  • 1
0 votes
0 answers
22 views

Increasing `minted` spacing

I've been switching my code environments from lstlistings to minted. However, in the process of switching, I noticed that all minted environments used smaller spacing between characters (the font ...
user avatar
  • 1
0 votes
0 answers
52 views

How to indent minted code blocks?

I'm using org-mode to generate the pdf and set the code backend to minted. The org source is shown as below: Some text. #+begin_src c #include <stdio.h> int main() { printf("Hello, ...
user avatar
0 votes
0 answers
14 views

How to remove space added below frame when using formatcom in minted codeblock

My overall goal is to get a black background with a white font and no syntactical highlighting. Based on the answer here, I manage to style the background and the font color. However, as soon as I add ...
user avatar
  • 101
0 votes
0 answers
18 views

Submitting to arXiv with "minted" package [duplicate]

I'm trying to add python code to my paper and submit it to arXiv. But the processing keeps failing. I've reduced the issue to: \documentclass[11pt,fancychapters]{report} \usepackage[a4paper, total={...
user avatar
0 votes
1 answer
32 views

XeLaTeX error when using nested tcolorbox listing environment inside custom xparse environment

I want to start by saying I don't fully understand how environments work, so I apologize if this is turns out to be a bit out of topic. Desired behaviour I'm trying to create a wrapper environment for ...
user avatar
  • 35
0 votes
0 answers
40 views

Underscore visible a prime symbols when used in minted package code

I am trying to include a Matlab code in a latex document. The package minted works well for this purpose despite one quirk: the variables and function containing underscore symbol "_" do not ...
user avatar
1 vote
1 answer
27 views

how to make minted options work with tex4ht? fontsize not changing

This answer shows how to use minted in tex4ht. But options do not seem to be passed through as with pdf. For example, trying to change the font size as shown in this answer does not work with tex4ht ...
user avatar
  • 18.1k
0 votes
0 answers
29 views

\tcblisting with minted puts out code from a previous listing using Tectonic

I'm trying to move some of my compile process over to Tectonic, but running into compatibility issues. The most recent one involves the use of code listings using TColorBox and Minted. Using the ...
user avatar
0 votes
1 answer
46 views

How to make tcolorbox with minted Python take up the entire document by shrinking whitespace?

I want to make a tcolorbox with minted Python code similar to this answer, including the size/aspect-ratio of the box, but with an additional requirement. I would like the rendered tcolorbox to take ...
user avatar
  • 148
0 votes
0 answers
26 views

Inconsistent colors by minted

Consider \documentclass[11pt,a4paper,onecolumn,openright,final,oneside]{memoir} \usepackage{minted} \begin{document} \begin{minted}{scala} def uncurry[A,B,C](f: A => B => C): (A, B) => C \...
user avatar
  • 260
0 votes
0 answers
23 views

Display % with \newcommand{\mintinline{...}} [duplicate]

I don't understand why the two frames below are not treated the same way. The first one correctly displays the % symbol, while the second one gives an error. \documentclass[10pt]{beamer} \usepackage{...
user avatar
  • 189
0 votes
0 answers
35 views

Python code shows outside figure, but not inside figure

I have defined the following newtcblisting: \newtcblisting{pythoncode}[2][]{ listing engine=minted, breakable, coltitle=CustomColorOne, colback=gray!25, colframe=CustomColorTwo, listing ...
user avatar
  • 148
0 votes
0 answers
53 views

Package tocbasic is used twice when tcolorbox, minted and scrhack is used

I have problem when I use these packages \usepackage[most]{tcolorbox} \usepackage[newfloat]{minted} \usepackage{scrhack} together with class scrbook from Koma-Scripts. During compile with ...
user avatar
  • 3,516
0 votes
1 answer
44 views

Removing extra vertical padding from minted/listings code snippet

I have some extra vertical space in my listings/minted code snippet that I can't figure out how to get rid of (especially the bottom). The code originally came from this answer. I have read the ...
user avatar
0 votes
1 answer
53 views

Using special Characters with minted + Haskell

I want to use a special character(U+2225) with minted for Haskell syntax: \begin{document} $\parallel$ this works as expected \begin{minted}{haskell} regardless which method I use in here I cannot ...
user avatar
0 votes
1 answer
29 views

Minted: no margin outside of frame when using background color

I am using minted with a background color and a frame (see MWE below) for displaying code with syntax highlighting in my document. How can I remove the space (see red arrows in image below) outside of ...
user avatar
  • 3
0 votes
0 answers
42 views

Using minted package on specific devices

I have been using the minted package on my laptop and PC for many months without issue, but recently I reinstalled Python and it has broken the minted package on my PC. Tex files that compile ...
user avatar
1 vote
1 answer
27 views

Setting caption on an imported minted file in a beamer frame

I'm trying to add a caption to a code file referenced via \inputminted on a beamer frame. The listing part works as expected in my thesis (using \documentclass[a4paper,11pt,oneside]{book}), but not ...
user avatar
  • 330
1 vote
1 answer
53 views

Compilation hangs when minted precedes istgame

I can't get the following code to compile on my Windows machine after upgrading to TeX Live 2021. This used to work fine with TeX Live 2019. \documentclass{article} \usepackage{istgame} \usepackage[...
user avatar
  • 135
1 vote
1 answer
71 views

begin{minted}{python} not showing in PDF

This question was asked ans answered here Minted \begin{minted}{...} KO but \inputminted OK. The problem was supposedly fixed with fancyvrb 4.1 but I have installed full TextLive+Texmaker (fancyvrb 4....
user avatar
0 votes
1 answer
73 views

Minted tango style with MiKTeX : Unaligned code

When using tango style of minted package with MiKTeX (under windows), the code is not properly aligned: \documentclass{article} \usepackage{babel} \usepackage[T1]{fontenc} \usepackage{minted} \...
user avatar
  • 151
0 votes
1 answer
27 views

Error in package fancyvrb: Too many }'s

When I include the package fancyvrb via \usepackage{fancyvrb} or other packages that make use of that package (for example minted), I get the error Missing \endscname inserted (line 535 of fancyvrb....
user avatar
0 votes
1 answer
50 views

Using standalone document option displaying minted code on a single line

I want to use standalone option for my latex document. I am trying to display code using the minted package but the entire line of code gets displayed on a single line. Below is a example. code.cpp ...
user avatar
0 votes
0 answers
11 views

Showing file name using \inputminted [duplicate]

I would like to make \inputminted to show the file name before the contents. I could not find an option for this at http://tug.ctan.org/macros/latex/contrib/minted/minted.pdf Is there an option for ...
user avatar
  • 747
1 vote
1 answer
53 views

minted: How to change the start number for numering lines?

When you use \begin{minted}[linenos], it numbers the lines starting at 1, ie: 1 console.log('something') 2 console.log('another thing) ... What should I do to start the numbering on any number, say, ...
user avatar
  • 13
0 votes
2 answers
28 views

How to make ucharclasses escape minted?

I am using ucharclasses to use multiple languages. I am using Noto Serif font for English. But ucharclasses is also changing minted codes into Noto Serif which should be Source Code Pro instead. How ...
user avatar
1 vote
1 answer
54 views

Is it normal for minted to run slow?

I just install minted, but the simple command: latexmk -pdf -shell-escape main.tex with main.tex simply being: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}{r} sprem <...
user avatar
  • 11
0 votes
0 answers
49 views

How to define a part of style for \newminted?

I'm trying to do this: \documentclass{article} \usepackage{minted} \newcommand\mystyle{framerule=1pt,rulecolor=gray} \newminted[foo]{text}{\mystyle,linenos,numbersep=2pt} \begin{document} Hello, world!...
user avatar
  • 10.1k
0 votes
0 answers
40 views

tcblisting box with minted doesn't support comments

I noticed that for some tcblisting boxes, the code doesn't show correctly. At first, I thought it was something with the preamble since it had occurred another time with another file, but after some ...
user avatar
  • 163
1 vote
1 answer
27 views

Minted environment returning blank after compile

I want to display the following computer code in Latex: But when I compile I get nothing at all! \documentclass{beamer} \usetheme{Berkeley}%{Marburg} \pgfdeclarelayer{pre main} \...
user avatar
0 votes
0 answers
51 views

How to run minted on Windows [duplicate]

I am using TeXstudio on windows to compile latex code that requires loading the minted package. When the code is compiled following error is thrown: Package minted Error: You must invoke LaTeX with ...
user avatar
  • 611
0 votes
0 answers
52 views

Problem in writing Haskell Codes in Minted Package in Texstudio

I used this \documentclass[12pt]{article} \usepackage{minted} \begin{document} \begin{minted}{haskell} --type Stack a = [a] --push :: Stack a -> a -> Stack a --push xs x = x:xs --pop :: Stack ...
user avatar
0 votes
1 answer
50 views

Aboveskip on minted?

I'm using minted inside a multicol enviroment and would like to remove the spacing at the start of the first column. I found the answer for belowskip and I am looking for the same code for aboveskip: ...
user avatar
  • 5
1 vote
1 answer
49 views

Ampersand (for matrix align) still appear in math mode in minted, listings?

Here is the tex code \documentclass{article} \usepackage{amsmath,amsthm} \usepackage{mathtools} \usepackage{listings} \usepackage{minted} \begin{document} \begin{minted}[escapeinside=||,mathescape=...
user avatar
  • 147
0 votes
0 answers
33 views

minted stops working, no clear error [duplicate]

After a series of updates (Pygments, TeXLive, OS), minted stopped working. I can't spot any error in the log. On this input: %!TEX TS-options = -shell-escape \documentclass{article} \usepackage{...
user avatar

1
2 3 4 5
18