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
0answers
54 views

Faster Compilation for a large latex book

I am working on an application where the user learns a topic by interacting with a chatbot. After the completion of the course, the user can generate a personalized notebook using their interaction ...
0
votes
0answers
11 views

What is RecustomVerbatimEnvironment?

I was looking for a way to center source code listings with minted, and came across the following snippet: \documentclass{article} \usepackage{minted} \RecustomVerbatimEnvironment{Verbatim}{...
0
votes
1answer
22 views

How to add dirs with spaces to PATH in TeXstudio

In order to use the minted package from within TeXstudio 3.0.1, I am trying to add the directory where my python.exe and my pygmentize.exe are to my PATH from within TeXstudio. If I do this using the ...
0
votes
0answers
35 views

Latex Workshop VSCode Issue with Minted

I am trying to compile a document with the minted package. I am using VSCode LaTeX workshop and compiling using LuaLaTeX. When I try to compile I get the following error Package minted Error: You must ...
0
votes
0answers
20 views

Using the minted package with Temaker produces 'pygmentize' error

Using Texmaker 5.04 on Windows 10 (with Python installed and up-to-date via Anaconda), I'm trying to compile the minimal example provided in the minted documentation. I expanded the command string ...
0
votes
0answers
40 views

Inconsistent spacing before environments (align, minted, etc) with and without empty lines before

Having an empty line before minted and align environments seems to make a big difference in layout. I would prefer to have latex always enforce a consistent layout with only a \baselineksip whether I ...
1
vote
0answers
17 views

How to insert python code inside multicols environment

I'm new to latex. I'm having a multicols table. Below is the latex code - \documentclass[10pt,english,landscape]{article} \usepackage{multicol} \usepackage{calc} \usepackage[landscape]{geometry} \...
1
vote
0answers
33 views

How can I highlight specific lines of code with minted in beamer?

I've been working on a set of slides in beamer, and one feature I really like as I'm learning is alert. In one part of my presentation, I have a relatively complex bit of code that's 12 lines long ...
1
vote
3answers
61 views

Customize the caption with a background

Hi there, i have some problems with modifying a caption which belongs to a listing. The current result is shown in picture. What i would like to change, can be seen in the second picture. As you can ...
0
votes
1answer
81 views

Python not found when using tcolorbox with minted

I'm new to LaTeX and I want to use it for my homeworks. Before asking help here, I opened a issue on minted's github, and the guy suggested to go here. So here is my problem : I'm trying to use ...
0
votes
0answers
27 views

Texmaker cannot find pygmentize when using minted package

This question has been asked a few times but I have tried all the solutions I could find. I have tried to do this on both windows and mac OS and I am having no luck. It worked on windows until my ...
0
votes
0answers
21 views

Compile minted code highlighting on system without minted installed

I'm currently working with the minted package for source code highlighting. As the title says, I'm looking for an option to compile latex code with minted content on a system that has not installed ...
0
votes
0answers
11 views

Minted highlight like tree command on Konsole

I'm using minted for quite some time when adding code to my latex documents, already tried it with a couple of languages and it works great. Today I tried to print the output of tree command like ...
0
votes
1answer
28 views

Formatting minted code box in tcblisting

I am creating a code/strategy reference document for my student organization to be built on by groups of students into the future, and trying to make it simple and readable for those who will be ...
1
vote
0answers
22 views

Todo notes inside minted

I'm trying to use Todonotes inside minted in order to easily annotate some code. I tried using escapeinside but the following code results in 5 errors unfortunately. \documentclass{article} \...
1
vote
1answer
41 views

How can I manually add italics or underlines to code listings using minted?

I'm a new user of minted, and I have a LaTeX fragment that looks like this: \begin{minted}{python} `s` = input(`prompt`) \end{minted} I was previously using the listings package: \begin{lstlisting} `...
0
votes
0answers
9 views

minted or similar with URI instead of local

Is it possible to pull code in via http from eg a public git repo using minted? This question is motivated by the fact that direct integration between git remotes and overleaf seems to have some ...
1
vote
0answers
23 views

Use mintinline to textformat a glossary category using glossaries-extra

I am using glossaries-extra and bib2gls. I'd like to format the text of glossary entries of certain categories using mintinline. texttt works fine however, I would prefer to have some syntax ...
0
votes
1answer
21 views

Break longer word into lines to fit the box (inputminted?)

I would like to fit the long string (as it is labelled url in the json file) inside the box without overflowing. As far as I understand, breaklines option only helps when strings consist of separated ...
0
votes
1answer
32 views

Use custom delimiter for inline minted environment

Using the listings package, we can do the following to create a | (pipe)-delimited inline code environment: \lstMakeShortInline| I am interested in using the minted package instead, however it doesn'...
0
votes
0answers
18 views

Using \mintinline causes emergency stop

Observe: This implies the second use, which is at the end of line 169 is causing the error. The use of \mintinline{python}{merge_sort()} is no difference to any other use. Does anyone have experience ...
0
votes
0answers
19 views

minted not finding pygments.sty after --shell-escape set

when I run pygmentize -V in my terminal I get Pygments version 2.3.1, (c) 2006-2017 by Georg Brandl. my Options -> Configure TexStudio -> Commands -> PdfLaTeX is set to pdflatex -synctex=1 -...
1
vote
1answer
46 views

tex4ebook and minted

I'm evaluating the possibility to convert my latex book to epub3. This is the MWE: \documentclass[a4paper,11pt]{book} \usepackage[top=1in, bottom=1in, left=1.1in, right=1in]{geometry} \usepackage[T1]{...
0
votes
1answer
52 views

Remove whitespace before and after minted

I am including Rust code into my Latex files by using minted. I am mostly showing 1-3 lines of code, with an explanation afterwards. So the large gaps before and after \begin{minted}{rust}...\end{...
0
votes
0answers
27 views

Red box around characters when using `escapeinside` option with `minted`

I'm trying to typeset Elixir code using minted. I run into problems when I want to color a custom keyword. More in particular, I run into errors when I use the escapeinside option. As soon as I pass ...
0
votes
0answers
17 views

including token in latex with syntax color

I use minted package or listing to include code snippets in my tex files. Now I just want to display a bit of token like struct. How should I do it? All I did was a customized type like \newcommand{\...
0
votes
0answers
17 views

What causes mmap to get to “\show\cmap@f@encoding % this is not accessed normally”, and how do I fix this?

I'm trying to revive an old (previously-compiling) development that produces a pdf from some Agda files. I am somehow managing to hit the line \show\cmap@f@encoding % this is not accessed normally in ...
1
vote
2answers
46 views

Using minted .Things are alright except List of Listing is small with * and in TOC the text is replaced by * instead of “List of Listings”

I am using listing and minted package already and code as follows: \documentclass[11pt,a4paper,openright,final,twoside,onecolumn]{memoir} \listfiles \fixpdflayout \usepackage[utf8]{inputenc} % ...
0
votes
0answers
28 views

parskip - customized spacing for code listing and equations

I'm writing a book in which I'm going to insert a lot of code listings (using minted). Usually, a code listing is followed by the output of the execution (either an equation, or plain text formatted ...
1
vote
1answer
38 views

Adjust minted code inside Minipage environment

I'm trying to show an equation on one side and its algortihm on the other. I tried using two minipages (one for equations and the other for algorithms) but it doesn't look beautiful; howerver, with ...
2
votes
1answer
49 views

Clipped minted environment inside a new PGF node shape

I want to make a file or page-like node shape in PGF and put a minted environment in that shape. See the image below: There are a few issues. One is that the text is drawn over the border at the ...
3
votes
1answer
64 views

minted escapeinside works for all supported languages except LaTeX

I want to add some math symbols into the escaped contents, minted works well for languages like Python, but not LaTeX. A sample code: \documentclass{article} \usepackage{minted} \begin{document} \...
2
votes
1answer
21 views

The command `defverbatim` forgets colors in `minted`

I'm trying to use minted inside uncover. It looks like that the minted environment has properties of a verbatim environment, so the hack defverbatim is required. The problem is that this hack forgets ...
0
votes
1answer
33 views

Freezing compilation coming from a macro when `\tcbuselibrary{minted}` is used

In the following code the use of \tcbuselibrary{minted} breaks the compilation and if I comment the use of \redoit{} the compilation succeeds. Why ? How do I fix this ? Here is the message I have with ...
0
votes
0answers
23 views

expl3 minted environment with optional arguments won't compile without optional arguments

I was trying to create a "code" environment based off of this answer of egreg's. Only problem is, I'm getting unexpected behavior that I can't figure out how to debug. I tried to boil it ...
1
vote
2answers
137 views

@ in python code with minted

I want to add some python code using the minted package to my latex file. I used \begin{minted} [ frame=lines, framesep=2mm, baselinestretch=1.2, fontsize=\footnotesize, linenos ] {python} A @ B \end{...
0
votes
0answers
68 views

Package minted Error: Missing Pygments output; \inputminted was [\end{mycode}]

My Tex files are follow: \documentclass{article} \usepackage{geometry} \geometry{left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm} \usepackage[dvipsnames, svgnames]{xcolor} \usepackage[minted]{tcolorbox}...
2
votes
1answer
36 views

Using the minted escapeinside option with the pycon lexer

What's going on here? \documentclass{article} \usepackage{minted} \begin{document} % I want to show the output as latex, this is a minimal repro without any output at all \begin{minted}[escapeinside=...
1
vote
0answers
29 views

Why do I need a blank line in the listing environment when using the minted package with the newfloat option in a tufte-handout

As described in the title. MWE: \documentclass{tufte-handout} \usepackage[newfloat]{minted} \begin{document} \begin{listing} \begin{minted}{python} a = 666 \end{minted} \end{listing} \end{document} ...
1
vote
1answer
304 views

Use minted for plain-text? (without syntax-highlighting) [duplicate]

I'm possibly too lazy to find how to do it without minted, but since I already use minted and I want top keep it's styles it applies to code boxes (like background color, the line break features, ...
0
votes
0answers
25 views

How to use captions in the style of headings in the appendix of floating environments?

TL;DR: If I have to word it differently, I could also ask: How can I use headings instead of captions for these entries (listings or figures)? I do have these elements: pictures in figure floats ...
1
vote
1answer
44 views

How can I make minted in newfloat mode work with dot2texi?

The following gives a compilation error: \documentclass{report} \usepackage{dot2texi} \usepackage[newfloat]{minted} \begin{document} Content \end{document} with output ... Package: dot2texi 2008/05/...
2
votes
1answer
61 views

Using minted in subfiles in a subdirectory

The answer here gives a MWE that shows how to make \inputminted work in a subfile. However, the approach does not work for \begin{minted}. For the following setup main.tex: \documentclass{article} \...
3
votes
2answers
142 views

Using the minted package breaks my paragraph indentation

I'm using the minted package for a paper that I'm writing and everything works perfectly fine and compiles without errors, except that, after the first time I use \begin{minted}{csharp} the usual ...
2
votes
1answer
78 views

tcolorbox & parskip & minted

I want to use minted code extract within tcolorbox, but it fails to properly set the parskip of the first box. I already use parskip=false inside the tcolorbox, but it doesn't solve the issue. \...
0
votes
0answers
29 views

How can I patch mintinline to work with breaklines and mathmode?

I've recently reported a bug in the minted package that this works: \documentclass{article} \usepackage{minted} \begin{document} $\mintinline{c}{void foo}$ \end{document} but \documentclass{article} \...
4
votes
2answers
186 views

Creating better HTML code with minted and tex4ht

I have a web publishing setup where I compile my LaTeX down to static HTML templates using tex4ht. I end up creating my own styling for these pages. I also use the minted package to style code in my ...
0
votes
0answers
10 views

Highlighting part of a XML code inside the minted environment in LaTeX

I want to highlight part of a xml code in LaTeX; however, it doesn't work. This is my code: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{listings} \...
1
vote
1answer
98 views

About verbatim in LaTeX (and LuaTeX)

What I intend to do... Initially, I wanted to write a series of environments that help me typeset verbatim environments. For example, I would like \begin{myverb}{stylea} \end{myverb} to be equivalent ...
0
votes
0answers
29 views

Toggle minted highlighting using OCG layers

I have a document which contains a minted listing spanning multiple pages. I would like the ability to toggle the highlighting using OCG layers. More specifically, I'd like the listing to have black ...

1
2 3 4 5
16