|
@@ -1,7 +1,7 @@
|
1
|
1
|
\documentclass[]{scrartcl}
|
2
|
2
|
|
3
|
3
|
\makeatletter
|
4
|
|
-\newcommand*\py{\texttt{listings-ext.py}}
|
|
4
|
+\newcommand*\py{\texttt{listings-extx.py}}
|
5
|
5
|
\newcommand*\file{\texttt}
|
6
|
6
|
\newcommand*\pkg{\textsf}
|
7
|
7
|
\protected\def\meta#1{\texttt{$\langle$\textit{#1}$\rangle$}}
|
|
@@ -18,8 +18,8 @@
|
18
|
18
|
\usepackage{enumitem}
|
19
|
19
|
\usepackage{xcolor}
|
20
|
20
|
\usepackage[]{url}
|
21
|
|
-%% call listings-ext.py with:
|
22
|
|
-%% ./listings-ext.py -o example.lst example.c
|
|
21
|
+%% call listings-extx.py with:
|
|
22
|
+%% ./listings-extx.py -o example.lst example.c
|
23
|
23
|
\input{example.lst}
|
24
|
24
|
|
25
|
25
|
\lstdefinestyle{regex}
|
|
@@ -58,7 +58,7 @@ them. Line ranges are marked using formatted comments.
|
58
|
58
|
This script require Python3 to be installed, it contains a shebang
|
59
|
59
|
\lstinline|#!/bin/python3| which should run the correct Python version on most
|
60
|
60
|
Unix systems on which Python3 is installed. However this doesn't work on Windows
|
61
|
|
-where you'll have to call it with \lstinline|python listings-ext.py|.
|
|
61
|
+where you'll have to call it with \lstinline|python listings-extx.py|.
|
62
|
62
|
|
63
|
63
|
\section{File preparation}
|
64
|
64
|
To make use of this script you have to mark the lines you want to be extracted.
|
|
@@ -168,7 +168,7 @@ block.
|
168
|
168
|
\lstinputlisting[numbers=left,numberstyle=\tiny,language=c]{example.c}
|
169
|
169
|
The file is saved as \file{example.c} and \py\ is run using
|
170
|
170
|
\begin{lstlisting}[language=sh]
|
171
|
|
-listings-ext.py -o example.lst example.c
|
|
171
|
+listings-extx.py -o example.lst example.c
|
172
|
172
|
\end{lstlisting}
|
173
|
173
|
The following is the output in \file{example.lst}:
|
174
|
174
|
\lstinputlisting[language=TeX]{example.lst}
|