Skip to content

minted in Scissor LaTeX

The minted package works partly in Scissor LaTeX: \begin{minted}{python} and \mintinline work without Python or -shell-escape, with syntax colours from a fixed scheme; options such as linenos, \setminted, \usemintedstyle, the listing caption, \mint and \inputminted are not supported.

What the package does

minted colours source code with the Pygments library. You write \begin{minted}{python} ... \end{minted}, or \mintinline{python}{code} inside a sentence. Options such as linenos and frame=lines change the layout, \setminted sets them for the whole document, and \usemintedstyle picks a colour theme. In a TeX installation, minted needs Python with Pygments, and the document must be compiled with -shell-escape.

What works here

FeatureIn Scissor LaTeXNotes
\begin{minted}{lang} ... \end{minted}WorksColoured, without Python or shell escape.
\mintinline{lang}{code}WorksMonospaced, without colours.
Options: [linenos, frame=lines, bgcolor=...]Left outIgnored without a message.
\setminted{...}, \usemintedstyle{...}Left outIgnored without a message; the colours are fixed.
listing environment with \captionPartlyThe code is shown and the caption is printed as plain text, without "Listing 1"; a \ref to it shows "??".
\mint{lang}|code|Not supportedSkipped with a message; the language and code are printed as plain text.
\inputminted{lang}{file}Not supportedSkipped with a message.
\newminted, \newmintinlineNot supportedSkipped with a message, and the arguments are printed.

The language names are the same as for listings: Python, C, C++, Java, JavaScript, Rust, Go, R, MATLAB, SQL, Bash, HTML, TeX and many more, in upper or lower case.

Examples

A minted block with a language:

minted with JavaScript

LaTeXPreamble: \usepackage{minted}Open in editor (opens in a new tab)
\begin{minted}{javascript}
// greet a list of people
const people = ["Erika", "Hans", "John"];
for (const name of people) {
  console.log(`Hello, ${name}!`);
}
\end{minted}
Rendered by Scissor LaTeX: minted with JavaScript

Options are accepted and ignored, so this block has no line numbers or frame here:

linenos and frame are ignored

LaTeXPreamble: \usepackage{minted}Open in editor (opens in a new tab)
\begin{minted}[linenos, frame=lines]{rust}
fn main() {
    let total: u32 = (1..=8).sum();
    println!("{}", total + 8); // 44
}
\end{minted}
Rendered by Scissor LaTeX: linenos and frame are ignored

For a numbered caption, use a figure instead of minted's listing environment. Here the caption reads "Listing 1", and \ref gives the number:

A captioned minted block inside a figure

LaTeXPreamble: \usepackage{minted}Open in editor (opens in a new tab)
\begin{figure}[h]
\begin{minted}{python}
print(sum(range(44)))
\end{minted}
\caption{Adding the numbers below 44}
\label{lst:sum}
\end{figure}
Listing~\ref{lst:sum} prints 946.
Rendered by Scissor LaTeX: A captioned minted block inside a figure

Compatibility

  • From a TeX installation to here: every minted block is shown with colours. Options and styles are not applied; replace \mint with \mintinline and paste code from \inputminted files into the document.
  • From here to a TeX installation: minted blocks compile there when Python, Pygments and -shell-escape are available. A figure around a minted block is captioned "Figure 1" there.

The full manual is on CTAN: ctan.org/pkg/minted. See also Code listings in LaTeX.

Questions and answers

Does minted work without shell escape?

Here, yes. Scissor LaTeX colours minted blocks itself, so neither Python nor -shell-escape is needed. In a TeX installation both are still required.

Should I use minted or listings?

Both work the same here: the language is read and the other options are ignored. If the document must also compile elsewhere without shell escape, listings is the safer choice.

Every example on this page is typeset by Scissor LaTeX when the site is built. Last updated 2026-11-06.