summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/hvpygmentex/hvpygmentex.tex
blob: 6850c477a748fedf82c1d9b3e1b3d67931a1cace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
\errorcontextlines=100
\documentclass[DIV=12]{scrartcl}

\usepackage{libertinus-otf}
\usepackage[force]{hvpygmentex}
\usepackage{url}
\title{Typeset highlited sourcecode}
\author{Herbert Voß}
\begin{document}
\maketitle

\section{Introduction}
This package is fully compatible to package \texttt{pygmentex}. Read
the package documentation (\url{http://ctan.org/pkg/pygmentex}) for the
supported languages a.s.o.  

\begin{verbatim}
usepackage[options]{hvpygmentex}
\end{verbatim}



With \texttt{hvpygmentex} one do not needs the external Python run to
create the formatted tex snippets  which are inserted into the document.
With the optional argument \texttt{--shell-escape} for the \LaTeX\ run
\TeX\ is allowed to run the external program \texttt{pygmentize} from within the document and
no additional action by the user is required.

This package itself has an additional option \texttt{force} which is
preset to \texttt{true}. Without using it  the external
formatted \TeX\ snippets for the listings will not be recreated by following \LaTeX\ runs. This
may speed up the \LaTeX\ runs and, of course,  makes only sense, if you are sure that there
are no changes in the source code listings.


\section{Example}

\begin{pygmented}[lang=tex,font=\ttfamily\small]
\bgroup
\initcatcodetable1
\aftergroup{\global\catcode`¡=12}%
\catcode`\_=12 \catcode`\^=12 \catcode`\$=12 \catcode`\%=12 \catcode`\#=12 
\catcode`\&=12 \catcode`\{=12 \catcode`\}=12 \catcode`\~=12 \catcode`¡=0   
\catcode`\\=12
¡savecatcodetable1
¡egroup
\end{pygmented}


This document was run with

\begin{verbatim}
lualatex --shell-escape hvpygmentex.tex
\end{verbatim}

In the terminal output you'll find something like

\begin{verbatim}
[...]
>>>> running pygmentex (option force=true) ...
>>>> ... done.
[...]
\end{verbatim}



\end{document}