Skip to main content

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
2 answers
41 views

How to use verbatim code in the bib file?

I have tried using \mintinline but it adds braces which should not be there when used in the bib file. \documentclass{article} \usepackage{biblatex} \usepackage{minted} \addbibresource{main.bib} \...
jakun's user avatar
  • 6,085
3 votes
1 answer
149 views

How to format code in the style used in academic papers?

I came across a scientific article that features beautifully formatted code, as shown in the image below. I'm interested in using a similar style for my own article, but I'm not sure how to achieve ...
drobilc's user avatar
  • 161
0 votes
0 answers
47 views

Specify the correct output directory for minted

I am using the minted package to put code fragments in my documents. I usually redirect the output to a build directory using --output-directory=build in the command line. Accordingly, I use \...
Shai Avr's user avatar
  • 909
1 vote
1 answer
23 views

`@` in minted SHACL/SPARQL listing introduces an unwanted hyperlink

I want to display a SHACL listing in my paper. It seems that there is no dedicated SHACL lexer but the SPARQL lexer is fine for my purposes. However, for some reason, the @ symbol at the start of my ...
John Doe's user avatar
  • 231
5 votes
1 answer
172 views

minted: preserve colours even with `gray` option to `xcolor`

Is there a possibility to preserve the colours of minted's syntax highlighting, even if I load the xcolor package with the option gray? Consider the following MWE (requires -shell-escape to compile ...
Stephan Lukasczyk's user avatar
0 votes
0 answers
24 views

Minted package does not work with TeXShop [duplicate]

I'm using TeXShop on Mac and I cannot use minted package even after following the official documentation. In TeXShop settings, in engine, I've added -shell-escape at the end of the string in Tex and ...
Katherine's user avatar
3 votes
2 answers
137 views

Math symbols in minted

Greetings to TeXperts out there, I am trying to write some code in a minted environment, but I am struggling with the "greater-or-equal" symbol. "≥" is not displayed at all (...
DBa's user avatar
  • 133
1 vote
1 answer
44 views

Wrapping minted-Enviroment in a ocg-Enviroment

I cannot wrap my minted-Environment, which is wrapped in a tcolorbox into an ocg-Environment. The wrapping of the minted-Environment into the tcolorbox is working fine. Does anyone more competent than ...
TrizZm4ster's user avatar
0 votes
0 answers
17 views

Minted, custom escape processing

just quick probing question is it possible to make minted to inspect lines and react to it? Usecase: # This will print "This is a comment" echo "This is a comment" #>This is a ...
jr.root.cs's user avatar
0 votes
1 answer
16 views

How can I use escapeinside within a minted environment with the bash lexer?

The escapeinside functionality doesn't work properly with the bash lexer. Is there any way to fix this? MWE: \documentclass{article} \usepackage{minted} \begin{document} \begin{minted}[escapeinside=|...
OpenAI was the last straw's user avatar
1 vote
1 answer
47 views

Code listing with Title above it?

I recently checked one of my Professor's tests and saw that his questions involved some code blocks that that have title for it, with a box surrounding it and horizontal lines that do not extend to ...
Juan De Castro's user avatar
2 votes
0 answers
90 views

minted package doesn't work in XeLaTeX but works well in PdfLaTeX [closed]

I'm trying to use the minted package in my new computer. My tex code is as follows, and I'm using MikTeX + TexMaker in Windows 10: \documentclass{article} \usepackage[cache=false]{minted} \begin{...
Neymar87's user avatar
  • 101
0 votes
1 answer
50 views

How to include minted file with "[ ]" in filename

I use bash to generate list of files and make sections git ls-files *js | while read i; do name=${i//\/\\/ } name=${name//_/\\_} echo "\newpage" &...
eri's user avatar
  • 103
1 vote
0 answers
88 views

tcolorbox locally change color of text in a code block

I've been working with \tcolorbox for a bit to get the desired output of my code blocks, see below for an example: and code: \documentclass[12pt]{report} \usepackage[letterpaper,margin=1in]{geometry}...
Matteo's user avatar
  • 387
1 vote
2 answers
82 views

How to avoid code block splitting over 2 pages with Minted

I was wondering if there is a simple way to insert a page break when a too long Python code has a function splited over 2 pages and won't fit inside current page? The page break should be placed just ...
Nexus1138's user avatar
0 votes
0 answers
57 views

unknown issue with tcolorbox bash code

Hi there I've been recently, thanks to the help received in this post, updated all my code blocks to a much nicer and neat view using tcolorbox. Unfortunately, for some reason, two of them show the ...
Matteo's user avatar
  • 387
1 vote
1 answer
47 views

suppress Listing: # in code blocks with tcolorbox

Hi there I've been recently experimenting with code blocks in LaTex and I had the need to have my code blocks with captions and a label to catch them once clicked on the appropriate link in the ...
Matteo's user avatar
  • 387
2 votes
1 answer
58 views

How to achieve consistent vspace between minted environment annotated by tikzpicture and next paragraph?

I am using tikzmark and tikzpicture to annotate code examples. I noticed that there is inconsistent vspace between the next paragraph(or text line) and the code examples. I tried \vspace{-1em} or ...
Pyi Soe's user avatar
  • 330
0 votes
0 answers
34 views

How do I get minted to work in the latest TexShop?

I'm using TeXShop Version 5.27 (5.27). I've got the correct python installed and pygmentize. They are in my path. The helps I've seen for --shell-escape are not what I want to do. Also, the answers to ...
user3708023's user avatar
1 vote
0 answers
43 views

Problem using minted option from tcbuselibrary

I'm still a newbie using LaTeX and I need to add a line of code in my document. For this, I use the library listings from the package tcolorbox. I always get the same error, so I put this example from ...
Michael Rosales Vilca's user avatar
0 votes
0 answers
19 views

Modified \listoflistings don´t show listings on Table of Listings . Package Minted

I have a problem using a redefined \listoflistings command to generate a table of listings for my thesis on a template based on a previous version of puthesis.cls. I need to generate a list of ...
Oscar Alejandro Arcila Giraldo's user avatar
0 votes
0 answers
96 views

Local LaTeX won't compile: Fatal error occurred, no output PDF file produced!

So after i've ran out of compile time in overleaf, i started to use pycharm with textify to create latex documents. However, when i run the code, i get this: Fatal error occurred, no output PDF file ...
Tim W's user avatar
  • 1
3 votes
1 answer
81 views

Issue with Inline Code Highlighting using tcbox and mintedinline - Renders # as ##

I've created a command for inline code highlighting using tcbox and mintedinline, but I'm encountering a problem. When I attempt to write just a #, it renders as ##. I've experimented with various ...
Oliver Hihn's user avatar
3 votes
1 answer
49 views

How to use \<lang>inline| | within caption command (minted)

I have read the minted package docs from texdoc minted terminal prompt. It states that I can define the \cppinline|| command as: So I have next code: \documentclass[11pt]{report} \usepackage[...
Vladyslav Rehan's user avatar
2 votes
1 answer
64 views

fit all the code inside the linewidth, or within the margin setting in latex [duplicate]

The following is an simple example, as you can see the code go beyond the page, how could I make it sits within the linewidth with pre-determined margin of the document? Thank you. \documentclass{...
G-09's user avatar
  • 123
1 vote
1 answer
79 views

Export all minted code fragments to files

I would like to export all the code fragments of a lectures book I wrote in a ordered tree structure as <chapter>/<section>/<some name or number>.<ext>. the code is in variuous ...
max's user avatar
  • 51
0 votes
1 answer
47 views

TeX compilers cannot find mathematica Pygments style

I am trying to compile a .tex file and typeset some Mathematica code using the minted package. I get the following error: (./out/_minted-thesis/mathematica.pygstyle)Could not find style module '...
Green05's user avatar
  • 141
0 votes
1 answer
44 views

The `minted` package messes up with the `diagmat` module of `physics2`?

I use the minted package to write code listings in my document and I use the physics2 package for many of its useful modules. I tried to use the diagmat module to write diagonal matrices, and it seems ...
Shai Avr's user avatar
  • 909
0 votes
0 answers
87 views

! LaTeX Error: Environment Verbatim undefined in Texlive in Linux Mint

I'm using Texmaker with Texlive in Linux Mint 21.3 Cinnamon to write an article with some Python code. Then I got a problem: ! LaTeX Error: Environment Verbatim undefined in Texlive in Linux Mint The ...
trequartista's user avatar
  • 1,900
2 votes
0 answers
63 views

Why is mintinline inside `text` inserting a stray n character at the end of the code?

The following: \documentclass{standalone} \usepackage{minted} \usepackage{amsmath} \setminted{breaklines,breakafter={_}} \begin{document} $\text{\mintinline{python}{...
Eric's user avatar
  • 683
0 votes
1 answer
77 views

I can't create command with \DeclareDocumentCommand{}{omv}{}

I have to make list environment based on description that should be used to describe code functions. Here is the prototype: % !TeX program = lualatex \documentclass[11pt]{report} \usepackage{enumitem}...
Vladyslav Rehan's user avatar
0 votes
0 answers
163 views

Compiling problem when using minted

I want to highlight Python code in a Latex document and I tried to reproduce this example, but I get several errors, I cannot even put all of them here as they are a lot... An example is: graphics\...
cicciodevoto's user avatar
1 vote
1 answer
42 views

Distance between minted environment and text and section

I'm using minted and somehow the distance between the minted environment and the text around or the (sub)section are not the same and vary too much from normal spacing. Here is my MWE: \documentclass{...
trequartista's user avatar
  • 1,900
0 votes
1 answer
30 views

Shorter version of \mintinline{language}

I'm using minted and for each inline code, I have to use \mintinline{python}{} which is quite long to type or copy for the whole big book. Is there any way to rewrite this command into something like ...
trequartista's user avatar
  • 1,900
1 vote
1 answer
78 views

\pause of beamer inside a minted environment

How can I use \pause command in beamer to pause displaying my code now putted in a minted environment? I have searched on TSE and I found two solutions for quite similar problems but not exactly mine, ...
trequartista's user avatar
  • 1,900
0 votes
0 answers
36 views

Customize minted environment w.r.t IDLE

I'm writing a document using Python code and I want to make it like IDLE style. With minted, we can custom the environment so that each line of code starts with >>>, however, I want >>&...
trequartista's user avatar
  • 1,900
1 vote
1 answer
58 views

Font issue when using multi-page code (minted)

To add multi-page listings, the code environment is used. The first page number style uses a mono font. The second page number style uses a serif font. I need the serif font for all pages. Where is my ...
Youra_P's user avatar
  • 1,128
0 votes
1 answer
96 views

Customizations of minted environment in LaTeX [closed]

I'm using minted to write Python code in my document. I have two question as follows: Can we reduce \begin{minted}{python} \end{minted} into simpler command like \begin{mtpt} \end{mtpt}? In fact I ...
trequartista's user avatar
  • 1,900
1 vote
1 answer
36 views

Interaction between minted and beamerswitch

The beamerswitch package allows to have multiple parallel compilations for the same document, typically to generate both an article and slides version. I wish to use it in conjunction with minted, to ...
Meven Lennon-Bertrand's user avatar
1 vote
1 answer
52 views

How can I change the caption of a Listing which is outside of minted code?

I am working on a LaTeX document using the scrarticle class and the minted package for syntax highlighting. My objective is to have a properly aligned caption with the code listing, similar to the ...
JAdel's user avatar
  • 95
1 vote
1 answer
89 views

Hack 'minted' definition with NewTCBListing und RenewDocumentEnvironment

A colleague and myself are trying to hack the minted environment by assigning the original meaning to oldminted using \NewEnvironmentCopy and then use this saved version in a redefinition of minted ...
lukeflo's user avatar
  • 1,597
1 vote
1 answer
234 views

Custom language lexer alias not found by pygments for minted

Problem I've made a custom lexer for a pseudocode language in Python (3.11). The file is saved in the same directory as my TeX project. I am using pdflatex to compile my project, and it has the --...
BrightBulb123's user avatar
3 votes
1 answer
46 views

Weird coloring with @ symbol (LaTeX Minted for Python)

The @ symbol is used by NumPy (a Python module) for matrix multiplication. I got a weird coloring when writing this in a LaTeX document using Minted: \documentclass{article} \usepackage{minted} \...
Héhéhé's user avatar
  • 131
0 votes
1 answer
56 views

Why minted package hangs up compilation? [closed]

Why pdflatex hangs up \documentclass[a4paper,12pt]{article} \usepackage{minted} \begin{document} Assembler translates \begin{minted}{mips} addu $t5, $t1, $t2 \end{minted} into binary code: \end{...
Caner Çetin's user avatar
0 votes
0 answers
64 views

How to make an environment created with newtcblisting behave the same as one created by the minted environment?

I have declared a new envrionment in a class file like this (the complete file exists here): \renewcommand{\theFancyVerbLine}{\parbox{10pt}{\centering\footnotesize\arabic{FancyVerbLine}}} \...
Sujal Singh's user avatar
1 vote
1 answer
183 views

Minted styling not working : no pygstyle file created

I want to start this post by telling that I already know the answer to the question. I just came here to post the solution I found so it hopefully helps someone without having to spend an hour ...
Allemand Instable's user avatar
1 vote
1 answer
38 views

Minted fancyverb error in beamer [closed]

I'm using minted for code higlight in a beamer presentation, and I'm getting an error: FancyVerb Error:. ^^I^^I^^I\end{minted}^^I \documentclass[]{beamer} \usepackage{minted} \begin{document} \begin{...
td211's user avatar
  • 153
1 vote
1 answer
29 views

Minted + new environment that can be turned off

I am writing a notebook for some students where I would like to provide optional solutions to coding exercises. I know that, in principle, I can use a custom environment solutions that contains code ...
qubert's user avatar
  • 21
0 votes
0 answers
25 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
3 votes
0 answers
373 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

1
2 3 4 5
21