| 1 | % Listing configuration file |
| 2 | |
| 3 | % !TeX encoding = utf8 |
| 4 | |
| 5 | \makeatletter |
| 6 | |
| 7 | \let\scr@float@addtolists@warning\relax |
| 8 | \definecolor{lightergray}{gray}{0.99} |
| 9 | |
| 10 | \lstset{% |
| 11 | language=[LaTeX]TeX, |
| 12 | basicstyle=\ttfamily, |
| 13 | keywordstyle=\color{RoyalBlue}, |
| 14 | commentstyle=\color{darkgray}, |
| 15 | backgroundcolor=\color{lightergray}, |
| 16 | stringstyle=\rmfamily, |
| 17 | numbers=none, |
| 18 | showstringspaces=false, |
| 19 | breaklines=true, |
| 20 | %frameround=ftff, |
| 21 | frame=lines, |
| 22 | escapeinside={£*}{*£}, |
| 23 | tabsize=2, |
| 24 | morekeywords={unless}} |
| 25 | |
| 26 | \lstnewenvironment{code} |
| 27 | {\lstset{columns=fullflexible,keepspaces=true,% |
| 28 | basicstyle=\ttfamily\small}}{} |
| 29 | |
| 30 | \lstnewenvironment{sidebyside} |
| 31 | {\global\let\lst@intname\@empty |
| 32 | \setbox\z@=\hbox\bgroup |
| 33 | \lstset{columns=fullflexible,% |
| 34 | linewidth=0.45\linewidth,keepspaces=true,% |
| 35 | breaklines=true,% |
| 36 | breakindent=0pt,% |
| 37 | boxpos=t,% |
| 38 | basicstyle=\ttfamily\small}% |
| 39 | \lst@BeginAlsoWriteFile{\jobname.tmp}} |
| 40 | {\lst@EndWriteFile\egroup |
| 41 | \begin{center}% |
| 42 | \begin{minipage}{0.45\linewidth}% |
| 43 | \hbox to\linewidth{\box\z@\hss} |
| 44 | \end{minipage}% |
| 45 | \qquad |
| 46 | \begin{minipage}{0.45\linewidth}% |
| 47 | \lstset{frame=none}% |
| 48 | \leavevmode \catcode`\^^M=5\relax |
| 49 | \small\input{\jobname.tmp}% |
| 50 | \end{minipage}% |
| 51 | \end{center}} |
| 52 | |
| 53 | \DeclareRobustCommand*{\clsname}{% |
| 54 | \texorpdfstring{\@ifstar\@clsname\@@clsname}{}} |
| 55 | \def\@clsname#1{{\normalfont\textsf{#1}}} |
| 56 | \def\@@clsname#1{{\normalfont\textsf{#1}\clsindex{#1}}} |
| 57 | \DeclareRobustCommand*{\pkgname}{% |
| 58 | \texorpdfstring{\@ifstar\@pkgname\@@pkgname}{}} |
| 59 | \def\@pkgname#1{{\normalfont\textsf{#1}}} |
| 60 | \def\@@pkgname#1{{\normalfont\textsf{#1}\pkgindex{#1}}} |
| 61 | \DeclareRobustCommand*{\optname}{% |
| 62 | \texorpdfstring{\@ifstar\@optname\@@optname}{}} |
| 63 | \def\@optname#1{{\normalfont\texttt{#1}}} |
| 64 | \def\@@optname#1{{\normalfont\texttt{#1}\optindex{#1}}} |
| 65 | \DeclareRobustCommand*{\othname}{% |
| 66 | \texorpdfstring{\@ifstar\@othname\@@othname}{}} |
| 67 | \def\@othname#1{{\normalfont\texttt{#1}}} |
| 68 | \def\@@othname#1{{\normalfont\texttt{#1}\othindex{#1}}} |
| 69 | \DeclareRobustCommand*{\envname}{% |
| 70 | \texorpdfstring{\@ifstar\@envname\@@envname}{}} |
| 71 | \def\@envname#1{{\normalfont\texttt{#1}}} |
| 72 | \def\@@envname#1{{\normalfont\texttt{#1}\envindex{#1}}} |
| 73 | \DeclareRobustCommand*{\cmdname}{% |
| 74 | \texorpdfstring{\@ifstar\@cmdname\@@cmdname}{\textbackslash}} |
| 75 | \def\@cmdname#1{{\ttfamily\textbackslash\textcolor{RoyalBlue}{#1}}} |
| 76 | \def\@@cmdname#1{{\ttfamily\textbackslash\textcolor{RoyalBlue}{#1}}\cmdindex{#1}} |
| 77 | |
| 78 | \def\clsindex#1{\index{#1@\textsf{#1}}% |
| 79 | \index{#1@\textsf{#1} \textit{\textit{(class)}}}} |
| 80 | \def\pkgindex#1{\index{Package!#1@\textsf{#1}}% |
| 81 | \index{#1@\textsf{#1} \textit{(pack.)}}} |
| 82 | \def\optindex#1{\index{Option!#1@\texttt{#1}}% |
| 83 | \index{#1@\texttt{#1} \textit{(opt.)}}} |
| 84 | \def\othindex#1{\index{#1@\texttt{#1}}} |
| 85 | \def\envindex#1{\index{Environment!#1@\texttt{#1}}% |
| 86 | \index{#1@\texttt{#1} \textit{(env.)}}} |
| 87 | \def\cmdindex#1{\index{#1@\texttt{\hspace*{-1.2ex}% |
| 88 | \textbackslash#1}}} |
| 89 | |
| 90 | \DeclareRobustCommand\meta[1]{% |
| 91 | $\langle${\normalfont\itshape#1}$\rangle$} |
| 92 | \DeclareRobustCommand\mail[1]{\href{mailto:#1}{\texttt{#1}}} |
| 93 | |
| 94 | %\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}% |
| 95 | %\def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}% |
| 96 | %\def\pfill{\unskip~\dotfill\penalty500\strut\nobreak |
| 97 | % \dotfil~\ignorespaces} |
| 98 | |
| 99 | \makeatother |