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
9 views

How to preserve minted's foreground color while highlighting code sections with \colorbox

I'm currently working on highlighting specific sections of code snippets in my LaTeX document. To achieve this, I followed the example provided in the documentation for the minted package, ...
Átila Gama Silva's user avatar
1 vote
0 answers
249 views

MikTeX Lualatex can't find Pygmentize

I'm struggling to compile this minimal example: \documentclass[12pt]{scrartcl} \usepackage{minted} \begin{document} \begin{minted}{python} a = 42 \end{minted} \end{document} I'm using W11, MiKTeX 4....
Alan Smithee's user avatar
0 votes
1 answer
34 views

Only, Uncover and Visible Beamer overlay commands within a minted codeblock

I want to explain a complicated piece of LaTeX code in a presentation by using beamer's overlays within a minted codeblock. Existing solutions I found are not sufficient because of two main issues: I ...
Treeniks's user avatar
1 vote
1 answer
17 views

Placing two code snippets next to each other with minted with a headline over each snippet causes box shift

I am refering to this question: How to place two code snippets next to each other with minted? I am trying to use the answer provided there, but with a headline over each code snippet. Sadly, this is ...
Martin Schmeißer's user avatar
0 votes
0 answers
40 views

Minted Assembly code indentation problems

I want to align the code as in the source code (image 1), because as you can see in the output (image 2) it comes out completely different. \documentclass[12pt, a4paper]{article} % Language setting % ...
Davide's user avatar
  • 1
0 votes
1 answer
15 views

How to make minted work inside custom environments?

I have am using the macro below and sometimes I the content I pass in via the third argument contains a minted environment. However, the code doesn't compile. How can I fix this issue? \newcommand{\...
Chad Winters's user avatar
1 vote
1 answer
197 views

I can't get minted package to work under MikTeX in Windows

I'm trying to compile a document which needs the package minted, but it throws the same error over and over: ! Package minted Error: You must have `pygmentize' installed to use this package I can't ...
JokingReaper's user avatar
1 vote
1 answer
39 views

Toggle to hide minted environment

For a syllabus .cls I'm updating for work, I already have a answer environment, that is only shown when the documentclass is provided the answers toggle (by default, the class receives noanswer). I ...
pkok's user avatar
  • 63
0 votes
0 answers
18 views

(minted) pygtex file contents being output to PDF instead of formatted source code?

When I compile my tex doc, instead of getting correctly formatted code, I get what appears to be the contents of the *.pygtex files in the _minted-* folder. There are no errors with compiling. I am ...
41d3n's user avatar
  • 1
0 votes
1 answer
43 views

How to teach \cref to refer to lines inside "minted" environments?

Here is my code: \documentclass{article} \usepackage{minted} \usepackage{cleveref} \begin{document} \begin{minted}[linenos,escapeinside=||]{cpp} Hello, world! |\label{foo}| \end{minted} See line no.\...
yegor256's user avatar
  • 11.5k
0 votes
0 answers
20 views

How to print quotation mark glyphs inside the verbatim, minted, listings & texttt?

Assuming the desired quotation marks in the code are called glyphs, how to print the left & the right quotes as desired, as it's printed in `monster' inside the verbatim, minted, listings ...
Lars Malmsteen's user avatar
0 votes
0 answers
20 views

Prevent the line feed on the multiple-line minted code at the footnote

When I add a multiple-line minted code at the footnote, the minted code block is (automatically) line fed. See the image below. I'd like to print the code at the same line as the footnote mark. How to ...
Lars Malmsteen's user avatar
0 votes
0 answers
42 views

How to use the different styles (mainly color schemes) of minted (pygments)?

How can you use the different minted styles?. For example solarized-dark, monokai,... \documentclass{article} \usepackage{minted} %\usemintedstyle{solarized-dark} \begin{document} \begin{minted}[...
Mika Ike's user avatar
  • 3,651
1 vote
1 answer
48 views

Error With LaTeX (TeXStudio) Package "Pygmentize"

After downloading the Minted and Pygmentize packages for TeXstudio, I am experiencing an error: File 'pygmentize.sty' not found. \begin. Here is the code for my document so far: \documentclass{...
mandjelo's user avatar
0 votes
1 answer
31 views

Minted Not Working Package error shell escape [duplicate]

i appear to be having a similar issue as described in other minted issue however my issue differs that none of the solutions there work. No matter how many times i uninstall/reinstall minted or miktex ...
Justin Smith's user avatar
4 votes
1 answer
122 views

Is there a way to confine the effect of \XeTeXinterwordspaceshaping=2 to a paragraph within a page?

I am typesetting in Burmese language. Setting \XeTeXinterwordspaceshaping=2 gives me the desired line breaking when paragraphs are fully justified. I've tried several ways, only this option works ...
Pyi Soe's user avatar
  • 311
1 vote
1 answer
40 views

Minted inside Xsim environment

It is needed to insert a Minted inside Xsim environment. The basic code is as follow: \documentclass{book} \usepackage{xcolor} \usepackage{minted} \usepackage[verbose]{xsim}%paquete de ejercicios ...
ABV's user avatar
  • 539
0 votes
0 answers
13 views

Confused by minted failures - line numbers not pointing to error

I'm making a book using minted but I spend (too much) time debugging minted issues. For example, this sample fails to build for me. I get the following error: % rubber --module xelatex --shell-escape ...
Matt Harrison's user avatar
0 votes
2 answers
41 views

How do you use minted to render a code block in monospaced font with all black text?

How do you use minted to render a code block in teletype font (monospace fixed width font) and all text is the same color (probably black)? What would you write if you wanted all text to be black ...
IdleCustard's user avatar
1 vote
0 answers
32 views

tcolorbox minted doesnot break python docstring

I try to produce boxed minted code in Python, and it does not break Python docstring. I have tried different break... options, unsuccessfully. MVE as follows: \documentclass{article} \usepackage{...
Moshe Gueta's user avatar
2 votes
1 answer
65 views

wrong directionality in minted environment

I write a document in Lyx and use a minted environment. I added a python code inside a Tex code box, but after compilation, Lyx "reverses" the order of the words inside the " " ...
Guy Weizman's user avatar
0 votes
1 answer
39 views

Error using minted environment

I write a document in Lyx (specifically a summary of a course in numerical analysis), and I get the following error when trying to compile my document, using a minted environment for Python code: ...
Guy Weizman's user avatar
1 vote
1 answer
51 views

Annotate with Call-Outs on tcolorbox

I'd like to do call-outs on a tcolorbox like the ones in this diagram from the longfbox documentation's Breakable Content Section. I've got my whole document using tcolorbox and pstricks but can't ...
Craie's user avatar
  • 37
0 votes
0 answers
20 views

Configure Texstudio with Macport (minted/pygments)

I got a MacAir from work and I wanted to use LaTeX as usual. I installed Macport and used it to install texlive and texlive-extra, which should contain most packages. Then I installed python and ...
Titanlord's user avatar
  • 521
2 votes
2 answers
132 views

'Too deeply nested' error in `\renewcommand`

I am following this QnA to create a renewed \inputminted command. \documentclass{article} \usepackage{minted} % code highlighting, uses python pygments \usepackage{mdframed} \...
fishfin's user avatar
  • 181
0 votes
0 answers
40 views

latex in mintinline but language=python

First, I want to highlight Python code in latex. Obviously, I can use the command: \begin{minted}[escapeinside=||]{python} |$\omega_x$ = [1,2,3]| \end{minted} But the command does not apply to inline....
Young Q's user avatar
0 votes
0 answers
20 views

How can minted (or something similar) work with automatic alignment of code? [duplicate]

I typeset Lisp code in a proportional typeface, and it relies on alignment. An example of the typesetting can be seen here: If I ignore font selection, it was typeset using this code: \begin{tabbing} ...
matj1's user avatar
  • 109
4 votes
1 answer
168 views

Emojis with lualatex

I'm trying to use both the lualatex or xelatex commands to produce my document: xelatex -shell-escape -synctex=1 -interaction=nonstopmode -file-line-error -recorder "book.tex" or lualatex -...
fullStackChris's user avatar
0 votes
0 answers
29 views

Styling filenames and extension in LaTeX

I have a question that's more about style: How do you style your filenames and extensions in LaTeX? Right now I'm mostly using \mintinline{bash}{.fileextension} or \mintinline{bash}{file.ext} like in ...
Melon_ The_Great's user avatar
1 vote
1 answer
73 views

Continue code on the next page with line numbering (minted, tcolorbox)

Here is my code: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \usepackage{minted} \usepackage{xcolor} \usepackage{tcolorbox} \tcbuselibrary{listings, minted, skins} \tcbset{...
WinnieNotThePooh's user avatar
0 votes
1 answer
43 views

minted with tcolorbox: Syntax Highlighting Issue with SASS Code Snippet

I've built a command that combines minted with tcolorbox, but I'm having issues with SASS syntax. Here's a minimum reproducable example: \documentclass[a4paper,headinclude=on,footinclude=on,12pt,...
fullStackChris's user avatar
1 vote
1 answer
50 views

How to make caption above minted listing?

I am using minted package for my code: \begin{listing}[htbp] \begin{minted}[baselinestretch=1, linenos, xleftmargin=1.5em, breaklines]{solidity} ...
Nick's user avatar
  • 11
0 votes
0 answers
49 views

Minted copyable spaces

I looked at a lot of answers regarding this topic, but they all seemed to be pretty old. I also looked into the documentation of the minted package, which did not give me a solution either. I want a ...
Titanlord's user avatar
  • 521
0 votes
0 answers
22 views

Minted does not detect functions and methods declared in other files

I am working with minted to make a C Language book. Functions declared after keyword void are correctly identified and styled. When I am calling functions from other files it classifies them as ...
user avatar
4 votes
1 answer
116 views

JetBrains arrow `->`, `<-` code ligatures do not apply consistently in different environments

I want to use JetBrains Mono (and its code ligatures) to render -> as an arrow. However, I get mixed results depending on the monospaced environment I am using. My goal is for this to work in the ...
Phrohlych's user avatar
  • 205
0 votes
0 answers
22 views

Wide column-spanning minted listing with caption (twocolumn)

In a twocolumn document class, can I use minted to display a code excerpt which spans both columns? A figure, containing a minted listing, can instead be used to cross both columns. Figures allow the ...
user4417's user avatar
  • 1,054
0 votes
1 answer
43 views

Minted: colorize variable in inline mode

Is it possible to specify how to color a variable with mintinline? What I mean is, for instance, to use \mintinline{python}{myClass} and color myClass as a Class variable, or as a function. If I use ...
PerroNoob's user avatar
  • 641
1 vote
1 answer
167 views

Minted Highlight code with multiple colors

I would like to highlight a function in minted by giving it a multiple background colors. So I would like the same highlight than the following picture I succes to highlight the green line, but I ...
Adri's user avatar
  • 113
2 votes
1 answer
65 views

How to exclude line numbers in code listing from being copied?

How to make lines code numbering uncopiable and white (or any other color)? % arara: pdflatex: {shell: 1} \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \usepackage{minted} \...
WinnieNotThePooh's user avatar
0 votes
1 answer
40 views

How can I modify my tcblisting to show input code and the expected output side-by-side?

I have a code listing and tcblisting defined as follows. \lstdefinelanguage{MyScheme}{ basewidth=0.5em, morekeywords=[1]{define, cond, lambda, else}, alsodigit=!\$\%&*+-./:<=>?@^_~, ...
TheProgrammer's user avatar
1 vote
1 answer
63 views

Use lmodern package for minted code and palatino package for the rest of the report

I am writing a technical report and I need to use the palatino package for it. However, the minted code font is not very legible since it doesn't use deep black but slight gray instead. Hence I want ...
yolo_ML's user avatar
  • 11
1 vote
0 answers
21 views

Figures Breaking Code [duplicate]

I am writing a report where I have figures (floats) and also code snippets. I am using graphicx and minted, respectively for the figures and code. I know that you aren't supposed to use [h] for ...
Robert's user avatar
  • 11
0 votes
1 answer
81 views

Using python 3 or specifying python executable path to use minted package?

I wish to use minted package also in Windows, however, I have Python 3 installed in my Windows and added to PATH. I do not wish python command be overridden by Python 2 executable. So, is there any ...
cylee's user avatar
  • 103
1 vote
2 answers
1k views

Package minted Error: You must have `pygmentize' installed to use this package, while Pygments is already installed?

Installed MacTex2023 on a new Mac and all is well except for a nagging issue with "pygmentize" that I've already installed. I cannot find how to adjust system to recognise the installed &...
RosesBouquet's user avatar
1 vote
0 answers
70 views

minted change comment character [closed]

I am trying to add some asm code to my document with minted. For that I have this implementation: \documentclass[a4paper,12pt,twoside]{article} % Syntax Highlighting \usepackage{pdfcol} \usepackage[...
RaphBilder's user avatar
0 votes
0 answers
28 views

Captions throws error when used with fancyvrb/fvextra

Suppose I have a file verbatim.py with the following contents: def f(x): s = "908df0sdfdsfsd78g89f7g98fd7gh98fdhfd7h98df7h98dfh99h8dfa897hf9d7h98fd7hf98dh" return x def f(x): s = ...
user32882's user avatar
  • 1,574
1 vote
1 answer
106 views

Change font in minted Python

I'm using minted to include Python code in my document, but I want to change the font of the letters only in the annotations and make it look more like what is portrayed in Jupyter Notebook. This is ...
felipe's user avatar
  • 13
1 vote
1 answer
65 views

Align minted number of lines inside and outside of a tcolorbox

I have this MWE \documentclass{article} \usepackage[many]{tcolorbox} \usepackage{minted} \usepackage{graphicx} \usepackage{mwe} \setminted{linenos} \tcbset{ common/.style={ before=\...
miticollo's user avatar
  • 109
1 vote
1 answer
100 views

Syntax highlighting doesn't work after percent symbol %

I'm trying to highlight my R code using minted package. However, after %, a few lines didn't get highlighted. When I delete % problem disappears. My code: \documentclass{article} \usepackage{minted} \...
Sawyer Shu's user avatar
3 votes
1 answer
81 views

Use minted code for moodle questions

I am a teacher for Computer Science, and I would like to use Moodle quizzes for coding questions. To do so I am experimenting with this code example for generating the question xml which I import into ...
Andy's user avatar
  • 181

1
2 3 4 5
20