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
1answer
261 views

trouble with packages dsfont and minted with using vimtex

I'm trying to use vim / nvim as text editor in a (long) .tex file containing both minted and dsfont package. Here is an example: % !TeX document-id = {f2e9e8a7-1386-4a73-9989-55350ce6c529} % !TeX TXS-...
1
vote
1answer
51 views

Resolving a FancyVerb error when making a new code environment

full MWE presented at the end I am creating my own code environment with minted for a text I am writing. It is enumerable, as well as reference-able. Everything works fine and the document compiles ...
1
vote
1answer
232 views

Minted line numbers outside frame and outside margin

I have a code snippet where I use minted for nice display: \begin{figure}[H] \begin{minted}[ frame=single, obeytabs=true, tabsize=4, linenos, numbersep=6pt ...
1
vote
0answers
82 views

How can I use a minted listing inside a tcolorbox's top half *and* bottom half?

I'm creating reference documentation for a intro-to-programming class. As part of this, I'm going to have syntax definitions and examples of the syntax. To write this, I'd like to have LaTeX syntax ...
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 ...
0
votes
1answer
165 views

Error while using minted package to write a LaTeX code snippet in a document [duplicate]

I wish to write a LaTeX code snippet in a document and hence I loaded the minted package. But upon compiling, the following error popped up : ! Package minted Error: You must invoke LaTeX with the -...
0
votes
0answers
54 views

minted linebreak in framebox

I have a code snippet that I highlight with minted. The problem is that one line is too long, and goes out of the frame box. \begin{figure}[H] \begin{minted}[ frame=single, ...
1
vote
2answers
829 views

Pygmentize error while compiling with minted package

The pygment package has been placed in the python folder as well as in the scripts sub-folder within python folder; also added to the PATH; still getting error as below Request educate how to get ...
3
votes
2answers
145 views

Unicode text in minted source-code listing fails on certain characters

I'm currently writing a small mathematical paper and have lots of unicode in my source-code - e.g.: function y( 𝐰::Vector{<:Number}, Φ::(T where T <: Function), 𝐱::Vector{<:...
2
votes
0answers
830 views

Highlight JSON code snippet with minted

I have a JSON code snippet that I like to include into my LaTeX document: "builders": [ { "type": "test", "image": "ubuntu:latest", "changes": [ "EXPOSE 123 ...
0
votes
1answer
666 views

VSCode LaTeX Workshop - Use minted package?

I am using the VSCode Extension LaTeX Workshop v8.4.2 in Docker with the tianon/latex image. I am trying to use the minted package for some source code highlighting, however during compilation I'll ...
0
votes
0answers
41 views

Problem with the extension of the file which is used to save listings [duplicate]

I want to display a snippet of Python code as a colored framed box in a beamer presentation. Besides, I'd like to save the snippet in a file. The code below gets the job done: \documentclass{beamer} ...
0
votes
1answer
107 views

How to define a custom command in minted environment

I am new to Latex so I might be missing something basic. I need a custom command for code snippets. Normally I would write this: \begin{minted} [ frame=lines, firstnumber=182, framesep=2mm, ...
0
votes
1answer
198 views

Why wont the `minted` package produce output?

I'm trying to write a document with code examples using minted \documentclass{article} \usepackage[a4paper, total={6in, 8in}]{geometry} \usepackage{minted} \title{Modelling stuff} \begin{document} ...
0
votes
1answer
195 views

Minted using imported .m-files with å ä ö in code

Firstly, some hopefully useful information: Python version: 3.8.0 Pygments version 2.5.1 TexLive 2019 Texmaker 5.0.3 Build using PDFLaTeX (tried XeLaTeX and LuaLaTeX as well) Windows 10 (if that ...
5
votes
3answers
481 views

Disable copying text from minted listing

I want my minted listings not to have copyable text. I've found this: Is it possible to produce a PDF with un-copyable text? But after a few hours of trials I am not able to integrate it with my ...
0
votes
1answer
75 views

Minted error for XML containing long lines

Sorry for the cross-posting if any. I'm trying to use minted to print the XML file. \title{My document} \author{Mr. World} \date{\today} \documentclass[a4paper, 12pt]{article} \usepackage[utf8]{...
21
votes
1answer
922 views

Drawing Realistic Linux Command Shell Windows with tcolorbox

I'm trying to make these little imitation command shell window/box/things. The problem is I can't skip lines. The prompt (aka. $PS1) appears on every line; there's no room for the command output. Any ...
1
vote
1answer
65 views

minted and tcolorbox: putting code in the title

I suppose it's meant to be used like this: But sometimes I like to use the title section to represent code or a command or some kind of input, and show the output in the bottom section like this: ...
1
vote
0answers
214 views

Gummi cannot compile with minted package, but can compile at command line

I'm working off of an example from https://www.overleaf.com/learn/latex/Code_Highlighting_with_minted that shows how to import code into a LaTeX document, which I've simplified to give a minimal ...
1
vote
1answer
53 views

minted with tikz for multiple-page code

This question describes how to use tikzmarks inside minted code. However if the code spans longer than one page the result is not correct. Is there a way to fix this? MWE: \documentclass{article} \...
1
vote
1answer
1k views

Minted package :: Package minted Error: Missing Pygments output

My tags are follows: \documentclass[]{book} \usepackage[many,documentation]{tcolorbox} \tcbuselibrary{skins, breakable, minted} \usetikzlibrary{calc} \usepackage{minted} \usemintedstyle[jasonagent]{...
0
votes
1answer
231 views

minted: Error when using customized fontfamily

I want to use minted to display code in Latex in a customized font, e.g. Monaco. Here is my code. \documentclass{article} \usepackage{fontspec} \usepackage{minted} \newfontfamily\monaco{Monaco} \...
1
vote
1answer
44 views

package minted displays two # instead of one

I am using package minted within beamer in order to display LaTeX source code. Actually, I am having this code to display: \newcommand{\vektor}[1]{\vec{#1}} so i coded something like this within an ...
0
votes
1answer
172 views

How to set minted listing table of contents numwidth?

I managed to change my lstlinsting numwidth with \setlength\cftlstlistingnumwidth. But when I try to do the same with minted listing, I got Undefined control sequence: \cftlistingnumwidth \...
2
votes
1answer
443 views

Package caption Warning: The caption type was already set to `quadro' on input line 38

With the following minimal example, there are the nested environments code and quadro, where both use captionsetup. And when building the the example, I got the warning: Package caption Warning: The ...
0
votes
1answer
272 views

How to solve the `pygmentize' Error in LaTex after installing pygments and minted on Mac OS

I am currently trying to resolve the issue of outputting my Python code in my LaTex document via the minted package. Originally, I ran into the issue of the "shell-escape flag" Error which, after ...
0
votes
0answers
145 views

Catchfile error when using --shell-escape flag in LaTex system preferences

I am trying to use the minted package to copy and paste python code into a LaTex document. I am using MacOS13 and using TEXShop version 4.44. I used the following: \documentclass{article} \...
2
votes
2answers
195 views

How to fix minted and listings hyphen alignment on my list of codes?

I managed to put both listings and minted codes in a single list of codes called LISTINGS. However, the entries of the minted package on the list of codes are shorted on the distance between the ...
2
votes
2answers
50 views

Package minted Warning: Unexpected value for option `chapter'(minted) is ignored on input line 77

I am importing minted like this: \documentclass[english,12pt,a4paper,twoside,chapter=TITLE,section=TITLE,]{abntex2} \usepackage[newfloat,chapter,outputdir=setup/cache]{minted} \begin{document} Hi. \...
4
votes
2answers
80 views

How to pass text with # in the beginning to a macro (minted)?

I created a command to input code in my document with minted. \documentclass{scrartcl} \usepackage{minted} \newcommand{\inlinecode}[2][text]{% \mintinline{#1}{#2}% } \begin{document}% ...
2
votes
1answer
238 views

\inputminted inside listing environment is flush left

I want to include part of the following file, foo.py, using \inputminted in a listing environment. def foo(a, b): return a + b def bar(a, b) return a - b However, if this listing ...
3
votes
1answer
160 views

Aligning a minted block and a figure in a subfigure setting

I am trying to create a Figure where on the left side I have an actual figure while on the right side I have some code using the minted package. At the moment I have the following MWE: \documentclass{...
2
votes
1answer
47 views

Getting a proper reference number with \ref while using custom counter and environment

I am trying to make a reference-able environment with its own counter, that I later refer to in text. I want the counter of my environment to have the style Chapter.Number . I have been able to make ...
3
votes
0answers
289 views

How to split long C/C++ code line on two lines without inserting new line number?

I am using the following snippet to insert C/C++ code into my LaTeX document but the problem is that the code on one line is too long and it goes over the right side of the document page. How to split ...
1
vote
1answer
72 views

Decorate minted listing inside a tcolorobox [Merly done…]

I would like to decorate some listings just for pedagogical reasons. Here is a starting code where I can draw a line but I still fail to produce a frame. How can I do that ? \documentclass[12pt,...
1
vote
1answer
64 views

Latex keeps showing minted environment as Figures instead of Listening

I am trying to use "Figure" as name of listings in listoflistings with minted and newfloat fix, but it does not work. Latex keeps showing minted environment as Figures instead of Listening: ...
1
vote
0answers
338 views

How to reduce space above and below minted?

I'm using minted to display some code in my document and I noticed an uncomfortably large space above and below the minted environment and I wasn't able to find out where does the space come from, and ...
2
votes
0answers
224 views

How to reduce the space before and after minted text with captions (listing)?

I have to write an article with many blocks embedding equations and code and decided to use the package minted. I would like to reduce the spacing (margins) before and after each minted block, just ...
2
votes
1answer
121 views

Write Farsi in minted environment Latex

I'm using overleaf to write my document and I need to list some python code in minted environment that contains Farsi words as follows: \begin{minted}[bgcolor=bg]{python} >>> ...
0
votes
0answers
177 views

Minted; make text non selectable on output pdf?

Context: I want to build a coding exercice for some people. I use minted to render code. I don't want people to copy/paste the code but to write it down instead. Question: How could I say to minted to ...
1
vote
1answer
233 views

Using minted within a subfile to list a code in a subdirectory

I am using Windows as OS and TeXstudio as editor. My project has the following structure: -project -main.tex -chapter1 -chapter1.tex -bibgraf.bib -figures -...
0
votes
0answers
65 views

Incompatibility between import and minted?

minted doesn't seem to work with import using \subimport*. Is there a way to fix that because I'm becoming addicted to the package import? Main file \documentclass[12pt,a4paper]{article} \...
0
votes
1answer
110 views

Mint code inline reading from file

Is there a way to mint a line of code inline, where the code is read from a file? \mintinline can only typeset code that is passed directly to the command, in between two delimiters (e.g. \mintinline{...
0
votes
0answers
42 views

Listing inside table

I've tried to make table with minted listing inside using minipage, but my listing takes up more than one page and it turns out that part of the text is cut off, is it possible to make minipage for ...
0
votes
1answer
174 views

Using minted to highlight single word

for example, if I want to write: \usepackage{minted} My parents gave me some money. I walked in the shop and found some sweets that I liked. I decided to buy them. In the above text how do I used ...
0
votes
1answer
216 views

Using mdframed with inputminted

I was reading the documentation of minted and found out I could use mdframed to create a frame around my code listings using: \surroundwithmdframed{minted} However, I now need to create listings ...
0
votes
1answer
152 views

minted: Unicode characters in listing

MWE: \documentclass{article} \usepackage[a4paper]{geometry} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \usepackage{xcolor} \usepackage{minted} \begin{document} \begin{minted}[breaklines]{...
1
vote
0answers
44 views

How to force minted to hide any overflow?

minted package in LaTeX has a possibility to automatically wrap lines. But how to let the lines as they are and force the minted package to hide any possible overflow? This might be useful for a ...
6
votes
1answer
746 views

Which colors are these? (minted package)

I am using code Highlighting for Python 3.7 with the minted package. I am using the tango color scheme (you can see all the color schemes minted uses in this page). I want to know the hex/rgb/cymk ...

1 2
3
4 5
16