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

Spacing between minted listing and text

The space between code listings using the minted package it is unsatisfactory. This is the MWE: \documentclass{article} \usepackage{caption} \captionsetup{ font = small, labelfont ...
0
votes
1answer
32 views

Inside of a \newtcbinputlisting how can I change the color of the line number as well as specify line numbers from an existing script?

I am working on code-highlighting using pygments through the minted package. I am wondering how I can change the color of the line number text on the left side of the highlighted code block to use ...
0
votes
0answers
16 views

newcommand to apply mintinline for C++ breaks on include statements [duplicate]

Staying away from LaTeX for barely more than 2 years has devastating effects. I think once I knew how to protect this stuff, but I have no idea now. I defined the newcommand below to be faster in ...
2
votes
2answers
34 views

line spacing in the list of algorithms(2e) disappears with newfloat option of minted

I noticed some really weird interaction between algorithms2e and the option newfloat of the minted package. \documentclass{book} \usepackage{algorithm2e} \usepackage[newfloat]{minted} \begin{...
0
votes
1answer
11 views

is it possible to omit lines from template in the produced document?

My tex files look like this: \documentclass[varwidth=13.20cm,border=2mm]{standalone} \usepackage{minted} \usemintedstyle{solarized} \begin{document} \begin{LARGE} \inputminted{php}{create_array....
0
votes
0answers
10 views

Problem with minted package

I try to compile the MWE found here: https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{...
0
votes
1answer
44 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
1answer
49 views

Configure minted style in LaTeX for code highlighting

I need to configure the minted code highlighting in LaTex. This is what I want to get: Until now, this is what I get: What is remaining is the "import" and "as" keywords to be in ...
4
votes
1answer
2k views

minted environment not working in overleaf

The code it's not working on Overleaf when it comes to minted environment (or mint command) used in a file placed in a subdirectory. Note that the very same code works if placed in main directory. ...
0
votes
0answers
15 views

specify line width for minted breaklines

The minted package includes a [breaklines] option and numerous configuration possibilities for breaklines.... but in reading the minted documentation I don't see anything about the "width". ...
0
votes
1answer
28 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 ...
2
votes
2answers
76 views

Hiding an environment that contains minted code

Task: I want to create a 'notes' command and an environment which can be hidden by a boolean flag. Problem: These 'notes' can contain minted code blocks which mess up previous solutions found on the ...
0
votes
1answer
48 views

Automatically adjust tcolobox to size of minted line numbers

I want to create several minted listings inside tcolorboxes. Similarly to https://tex.stackexchange.com/a/396731, I would like to adjust the size of the tcolorbox to contain the line numbers. However, ...
1
vote
1answer
66 views

How to display code snippets incrementally?

I want to use BEAMER and PythonTEX to prepare a slideshow that contains a lot of code. When displaying a code snippet in console mode I would like to show one line at a time. I'm struggling to achieve ...
6
votes
1answer
286 views

One tcolorbox with alternative color in different lines

This is what I want to get This is what I already have \documentclass{article} \usepackage{geometry} \geometry{left=2.5cm,right=2cm,top=2.5cm,bottom=2.5cm} \usepackage{fontawesome} \usepackage{...
11
votes
7answers
6k views

Beamer vs. Minted: overlays

How to use beamer overlay inside minted code? The obvious solution does not work: \documentclass{beamer} \usepackage{minted} \begin{document} \begin{frame}[fragile] \frametitle{Foo} \begin{minted}...
3
votes
1answer
76 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} \...
1
vote
1answer
18 views

How to reset line numbers when importing from source file with minted

I'm importing a portion of code from a source file with \inputminted[firstline=22,lastline=41]{python}{file.py} which gives : However, I wish for the line numbers to be reset to 1 and I don't know ...
1
vote
1answer
456 views

Typing code with minted and Greek: “! Package polyglossia Error: The current roman font does not contain the Greek”

I have made my first tex text in order to test how to use it on my essays: % !TEX TS-program = XeLaTeX \documentclass[a4paper,draft]{article} \usepackage{minted} \usepackage[Greek,Latin]{...
2
votes
0answers
31 views

in source code comments $ gets turned into £

I'm creating pdfs of source code using the minted package... and surprised to see $ get turned into £. pdflatex --shell-escape create_array.tex is the command. create_array.tex looks like: \...
0
votes
0answers
24 views

how to set the document width according width of text

I would like my documents to be automatically sized to the width of the text they contain, that is the width of their longest line. I have a directory of files of code (python scripts) and I'm ...
0
votes
0answers
43 views

Mac minted pygmentize Texpad issue

I have read tons of relevant posts to get minted working on Texpad. minted not working on mac Cannot get 'pygmentize' to work correctly on mac However, I think I completely messed it up. ...
2
votes
1answer
30 views

Verbatim environment that optionally shows nothing

I am trying to create an environment that may or may not display source code with minted depending on an optional parameter. I did some tests and noticed that the following code does not work. The ...
1
vote
0answers
23 views

How do I “disable” code lines in minted (in beamer)?

I want to reproduce the following screenshot with minted (in beamer, though I don't think that matters). How would I go about doing that?
0
votes
0answers
74 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
15 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}{...
1
vote
1answer
46 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
60 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
29 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
45 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
21 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} \...
20
votes
4answers
2k views

Work-around for minted code highlighting in arXiv?

I am currently trying to submit my bachelors thesis to arXiv. However, it does not work: (/texlive/2011/texmf-dist/tex/generic/oberdiek/etexcmds.sty)) Package ifplatform Warning: shell escape is ...
0
votes
1answer
88 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 ...
1
vote
0answers
42 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
66 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
0answers
45 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
22 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 ...
2
votes
2answers
272 views

Count lines of multiple files (Using minted for formatting.)

I am using minted to show source code in my document like this: \section{Image functions} \inputminted{python}{src/imagefuncs.py} \section{Matrix operations} \inputminted{python}{src/matrices.py} \...
0
votes
0answers
15 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
45 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
26 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} \...
0
votes
1answer
23 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
0answers
10 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
25 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 ...
1
vote
1answer
352 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} \...
0
votes
2answers
69 views

Why can't I use \@MakeShortVerb with minted?

shortvrb's \MakeShortVerb allows defining single active tokens, e.g. |, in a way that makes |\foo| equivalent to \verb|\foo|. To do this, | is defined to expand to \verb| and added to both \dospecials ...
12
votes
3answers
3k views

New environment with minted

I want to create a new environment to transform this: \begin{listing} \caption{some caption} \label{code:label} \begin{minted}[options]{language} My code here \end{minted} \end{listing} into ...
2
votes
1answer
556 views

OSX Sierra - Pygmentize sometimes not recognized

I've recently decided to switch to minted due to way better Python highlighting. I am having weird issues with minted sometimes not being able to find pygmentize on my Mac - never had the same issues ...
5
votes
1answer
758 views

minted escapeinside and code ligatures

When using Fira Code in listings you'll get programming/code ligatures. This behavior has to be enabled and usually minted does nothing special. But if you turn on escapeinside with any character that ...
0
votes
1answer
34 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'...

1
2 3 4 5
16