# Syntax highlighting in minted - how does it work? [closed]

I want to customize the minted syntax highlighting, but neither the minted package documentation, nor the existing topics on syntax highlighting in minted on TeX.SX, nor google offer explanation on how to do this.

I'm not really convinced yet that minted is so superior to listings, an opinion that finds its inception mostly in the on-the-fly customizability of listings.

Therefore two questions:

1. Why should I use minted over another package if its flexibility and accessibility of customization leaves so much to be desired?
2. Where do I adjust the syntax highlighting colours for the minted package? Preferrably I'd like to be able to make my own colour scheme.

.

\documentclass{article}
\usepackage{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{listings}
\lstset{ %
backgroundcolor=\color{white},   % choose the background color; you must add \usepackage{color} or \usepackage{xcolor}
basicstyle=\ttfamily,        % the size of the fonts that are used for the code
breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace
breaklines=true,                 % sets automatic line breaking
captionpos=b,                    % sets the caption-position to bottom
deletekeywords={...},            % if you want to delete keywords from the given language
extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8
frame=single,                    % adds a frame around the code
keepspaces=true,                 % keeps spaces in text, useful for keeping indentation of code (possibly needs columns=flexible)
keywordstyle=\color{orange},       % keyword style
language=R,                 % the language of the code
morekeywords={*,...},            % if you want to add more keywords to the set
numbers=left,                    % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt,                   % how far the line-numbers are from the code
numberstyle=\tiny\color{purple}, % the style that is used for the line-numbers
rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'
showstringspaces=false,          % underline spaces within strings only
showtabs=false,                  % show tabs within strings adding particular underscores
stepnumber=2,                    % the step between two line-numbers. If it's 1, each line will be numbered
stringstyle=\color{green},     % string literal style
tabsize=1,                       % sets default tabsize to 2 spaces
title=\lstname                   % show the filename of files included with \lstinputlisting; also try caption instead of title
}
\usepackage{minted}
\usemintedstyle{fruity}
\begin{document}
\begin{lstlisting}
#include <stdio.h>
#define N 10
/* Block
* comment */
int main()
{
int i;
// Line comment.
puts("Hello world!");

for (i = 0; i < N; i++)
{
puts("LaTeX is also great for programmers!");
}
return 0;
}
\end{lstlisting}
\begin{minted}{python}
import numpy as np
def incmatrix(genl1,genl2):
m = len(genl1)
n = len(genl2)
M = None #to become the incidence matrix
VT = np.zeros((n*m,1), int)  #dummy variable
#compute the bitwise xor matrix
M1 = bitxormatrix(genl1)
M2 = np.triu(bitxormatrix(genl2),1)
...
\end{minted}
\end{document}

-

## closed as off-topic by 1010011010, dustin, Gonzalo Medina, barbara beeton, JesseMay 16 '14 at 2:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – 1010011010, dustin, Gonzalo Medina, barbara beeton, Jesse
If this question can be reworded to fit the rules in the help center, please edit the question.

minted works through Pygments; to see how to customise the highlighting with your own colour scheme, read its documentation. –  ChrisS May 14 '14 at 22:13
Customizing minted highlighting requires customizing Pygments. You would want to look at the documentation. Looking at some existing style extensions might also be useful (possibilities that a quick search revealed here and here). –  G. Poore May 14 '14 at 22:19