Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

2
votes
2answers
165 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} \...
1
vote
1answer
154 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
1answer
36 views

Caption fontsize in a listing using minted

With listing and minted and a pycon lexer to emulate an IPython console, I'd like to change the caption font size to be footnotesize. Unfortunately, my code below does not change the fontsize of the ...
0
votes
1answer
82 views

Encoding problem?

I use a minimal code example with Julia \documentclass{article} \usepackage[cache=false]{minted} \begin{document} \inputminted{julia}{polynomial_regression.jl} \end{document} on # Polynomial ...
0
votes
1answer
355 views

breaklines doesn't work with \mintinline

I try to get line-wrapping to work with \mintinline, like so: \documentclass[11pt]{report} \usepackage{minted} \setmintedinline{ bgcolor=lightgray, } \begin{document}...
7
votes
0answers
70 views

Defining a two part environment using minted and listings

I am writing some programming instructions for students, and I am trying to format the code so that it looks like the cell input/output structure of a Jupyter or Google Colab notebook. So I want it ...
6
votes
0answers
856 views

\inputminted: distinct file parts in one listing (equivalent to linerange in listings)

I want to include code from a file into my document. However, several distinct line ranges should appear in the same listing. Also, I want to use gobbling, and it would be nice to include some blank ...
5
votes
0answers
48 views

Typesetting MAGMA code with minted?

I enjoy highlighting my Python code with minted. However I now would like to do the same with my Magma code (Magma is a commercial computer algebra system of broadly similar scope as GAP). However ...
5
votes
0answers
92 views

One tcbcolorbox 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{...
5
votes
0answers
409 views

Copyable tabs in minted

I'm preparing tutorial for students with code fragments that they will copy to a text editor. Is there a way to make syntax-highlighted code copyable to text editor so that indentation is preserved, ...
4
votes
0answers
107 views

In minted package the formatcom option ocure bottom marging

With the following MWE: \documentclass{article} \usepackage{xcolor} \usepackage{minted} \begin{document} \begin{minted}[bgcolor=black,formatcom=\color{white}]{bash} #! /bin/bash # script to turn ...
4
votes
0answers
335 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 ...
4
votes
0answers
356 views

How to you properly specify an alternative to the pygmentize external command for minted?

A while ago I asked how to extend minted to colour-highlight my chosen key words. The consensus was "make the changes in the external pygment program" -- so I did. The changes are small and the ...
4
votes
0answers
124 views

How can I use scintillua lexers to replace minted or listings with luatex?

Scintilla is a text editor. Scintillua adds dynamic Lua LPeg lexers to Scintilla for multiple languages. According to the documentation, Scintillua can be used as a library: Using Scintillua as a ...
4
votes
0answers
491 views

tcolorbox line numbers

I am trying to make a generic environment to use for all my boxes in my document. I want all my boxes to have line numbers. I can only get this to work some of the time. I don't get line numbers when ...
3
votes
0answers
50 views

Line numbers inside margin but outside frame in minted

I've been trying to make the line numbers appear outside the colored frame in my output code blocks, but I also want everything (numbers included) to be inside the margins specified by the geometry ...
3
votes
0answers
471 views

Minted & Fonts Types/Families

I am typesetting some code in my document. In my preamble I include some packages to make the font a Times style font. \documentclass[11pt,letterpaper]{article} \usepackage[utf8]{inputenc} \...
3
votes
0answers
89 views

How to Mimic Line Breaks from listings in minted

I'm like the syntax highlighting of minted but cannot get it to mimic the "more pleasing" line breaks for long code strings found in listings. In the example below, I have three snippets: the first ...
3
votes
0answers
660 views

minted doesn't seem to use cache when outputdir option given

I am building out-of-source so my build command looks like this pdflatex -shell-escape --halt-on-error -output-directory="/tmp/build" book.tex I have been using minted for syntax highlighting \...
3
votes
0answers
134 views

Highlight commands with @ (\@title) using minted

I'm writing a document which contains some code snippets such as: \newcommand\section{\@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% ...
2
votes
0answers
269 views

How to give the same height to side by side minipages?

I tried putting two minted environments next to each other. I decided to use minipage for that purpose. Each of the minted environments has a grey background. Unfortunately, the two code snippets do ...
2
votes
0answers
373 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 ...
2
votes
0answers
93 views

Red squares with minted and mathescape=true

Using the following code: \documentclass{article} \usepackage{minted} \usepackage{mathabx} \begin{document} \begin{minted}[escapeinside=||,mathescape=true]{http} POST /shop/28/Shop.aspx HTTP/1.1 ...
2
votes
0answers
315 views

How to put the caption of a listing on the right margin?

I am currently using the package floatrow to put the captions of my figures on the right margin. How to achieve the same result for the captions inside listing environment (provided by \usepackage[...
2
votes
0answers
81 views

suppress highlight around special characters in tcolorbox and minted

I am using tcolorbox for listing some (bash) code. I'd like to suppress the dimmed highlighting around special characters ($, { and }) in the following MWE: \documentclass{article} \usepackage{...
2
votes
0answers
213 views

Determine equal spacing before and after minted environment

I have some code in a minted-environment that I want to separate from the rest of the text by equal spacing before and after the environment. I successfully used the method described here for an ...
2
votes
0answers
232 views

minted or listings input a file between markers

Is it possible, using the minted or listings package to format a file between or till a certain textual marker automatically. E.g. consider a source file: code code //marker code ... //end marker ...
2
votes
0answers
351 views

Possible bug in minted package

(just now while typing the topic title I found possible related but my post is too long to discard it now :-) ) (the minipages is only to show side by side. I'll not use it) I'm using minted package ...
1
vote
0answers
51 views

minted environment with prefix

I would like to create a new environment using minted, inside which there is always a prefix string. For example, following this answer I have tried \documentclass{article} \usepackage{minted} \...
1
vote
0answers
37 views

Minted does not split code when reaching end of the page

I am trying do to a custom template for minted with background color, line number, title,... However I have an issue with the end of the page. The code are not splitting to a new page but just ...
1
vote
0answers
29 views

Remove selectable text from source code PDF output

I am writing my master thesis in LaTeX. For source code listings I use minted package. However, my thesis supervisor pointed out that the anti-plagiarism software that is now used in my country will ...
1
vote
0answers
35 views

minted + escapeinside: how to feed the result of the escape into the lexer?

The result of an escapeinside in minted is typeset as-is, and not fed into the lexer. This is by design, as I understand. How can I change minted's behavior so that the result of the escapeinside is ...
1
vote
0answers
47 views

How can I get consistent line spacing with highlighted, minted material in a paragraph?

I'm using a lot of inline minted material. To distinguish between code elements and text elements in my document, I'm giving everything a light background color. (The color used below is exaggerated ...
1
vote
0answers
69 views

mintinline inside environ

\mintinline inside of an environment created by \NewEnviron of environ package seems to be strange. There are some unintended blank spaces, after the macros followed by \. What should I do to fix it? ...
1
vote
0answers
58 views

tcolorbox listing in XeLaTex compiler

I want to write a document whose main language is Arabic with listings by using the package \usepackage{polyglossia} \documentclass[14pt]{extarticle} \usepackage[listings,minted,breakable,skins]{...
1
vote
0answers
113 views

Can the command \minted and \mintinline have rounded corners without depending on the package listings? Are tcolorbox and tikz needed?

I use XeLaTeX, but I can not use both or similar or duplicate packages, because someone said it is bad idea in XeLaTeX. I would like to use only minted. Here are two answers which offer inline code ...
1
vote
0answers
49 views

How to keep formating when copy-paste code sections with minted?

I am using the minted package for syntax highlighting code in my slides, but I have some problem to make this code easily copyable directly from the PDF to the console. it seems that the whitespaces ...
1
vote
0answers
762 views

Error compiling with minted package

I'm trying to use the minted package in a document. When I compile the document I get the following error: The minted package is installed under MiKTeX, and Pygemnts is also installed (when I -m pip ...
1
vote
0answers
178 views

minted background color from left to right page side

I use minted package to get syntax coloration with background color. I know it is highly printer-unfriendly but I use it. My goal is to make the background rectangle color take the wool page width. ...
1
vote
0answers
400 views

TEXINPUTS equivalent for inputminted to make relative paths work?

A while ago I griped about LaTeX not supporting relative paths by default. It turns out I can export the TEXINPUTS=/path/to/source environment variable to make \input{foo} look in /path/to/source/foo. ...
1
vote
0answers
649 views

minted is not working with Lyx but working with TeXstudio

As the title says: I have minted and pygments installed on my Macbook. When I try to use minted in TeXstudio, all things work well, but with Lyx I inserted this TeX code into my document: \begin{...
1
vote
0answers
147 views

Problem with `escapeinside` when implementing pascal code

Actually I’m working on some pascal documentation but I noticed that some features that need escapeinside option did not work well. Surprisingly, when I changed the language (to phyton or another) and ...
1
vote
0answers
878 views

Python console code with minted

I am using minted to highlight source code in my document. I have defined \definecolor{codeyellow}{RGB}{255,251,204} \newminted{python}{linenos,breaklines,frame=lines,bgcolor=codeyellow} in the ...
0
votes
0answers
22 views

\PYGdefault undefined error in TeXstudio - how to remove the __minted_* folder?

I installed TeXstudio and texlive with sudo apt install texlive-full afterwards I installed the pygments with sudo apt-get install python-pygments and I used the command % !TeX TXS-program:compile = ...
0
votes
0answers
147 views

Just started using Visual Studio Code, how do I use Minted and (optional) Asymptote?

I had been using TeXnicCenter for Windows with MikTeX for a while now and I decided to use a different IDE to check out better IDEs for LaTeX. I decided to download Visual Studio Code along with the ...
0
votes
0answers
42 views

Minted tango theme indentation

The following mwe shows the problem I am facing: \documentclass{article} \usepackage{minted} \begin{document} \usemintedstyle{tango} \begin{minted}{matlab} function test() i = 1; j = 1; end \...
0
votes
0answers
44 views

tcolorbox tcblinputlisting unexpected behavior when filenames have spaces and/or underscores

I'm not a Latex expert, so I reached the limit of my knowledge in the tracking down of this problem. If someone can shed some light into this problem I think it would be very useful. The Problem ...
0
votes
0answers
267 views

Same caption space

I want to have the same vertical spacing between figures/listings and their captions. Currently, the space between figure and caption is shorter than that between listing and caption. What should I do?...
-1
votes
0answers
336 views

How can I fill a page with a minted included json file?

I'm trying to add some huge json files to my document and have no idea how can I solve this two problems. Code: \linespread{1.0} \subsection{File xpto.json for X = 1} \label{ap:json_xpto1} \beCengin{...