summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/labyrinth/lstlocal.cfg
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/labyrinth/lstlocal.cfg
Initial commit
Diffstat (limited to 'macros/latex/contrib/labyrinth/lstlocal.cfg')
-rw-r--r--macros/latex/contrib/labyrinth/lstlocal.cfg99
1 files changed, 99 insertions, 0 deletions
diff --git a/macros/latex/contrib/labyrinth/lstlocal.cfg b/macros/latex/contrib/labyrinth/lstlocal.cfg
new file mode 100644
index 0000000000..1933c0f01a
--- /dev/null
+++ b/macros/latex/contrib/labyrinth/lstlocal.cfg
@@ -0,0 +1,99 @@
+% Listing configuration file
+
+% !TeX encoding = utf8
+
+\makeatletter
+
+\let\scr@float@addtolists@warning\relax
+\definecolor{lightergray}{gray}{0.99}
+
+\lstset{%
+ language=[LaTeX]TeX,
+ basicstyle=\ttfamily,
+ keywordstyle=\color{RoyalBlue},
+ commentstyle=\color{darkgray},
+ backgroundcolor=\color{lightergray},
+ stringstyle=\rmfamily,
+ numbers=none,
+ showstringspaces=false,
+ breaklines=true,
+ %frameround=ftff,
+ frame=lines,
+ escapeinside={£*}{*£},
+ tabsize=2,
+ morekeywords={unless}}
+
+\lstnewenvironment{code}
+ {\lstset{columns=fullflexible,keepspaces=true,%
+ basicstyle=\ttfamily\small}}{}
+
+\lstnewenvironment{sidebyside}
+ {\global\let\lst@intname\@empty
+ \setbox\z@=\hbox\bgroup
+ \lstset{columns=fullflexible,%
+ linewidth=0.45\linewidth,keepspaces=true,%
+ breaklines=true,%
+ breakindent=0pt,%
+ boxpos=t,%
+ basicstyle=\ttfamily\small}%
+ \lst@BeginAlsoWriteFile{\jobname.tmp}}
+ {\lst@EndWriteFile\egroup
+ \begin{center}%
+ \begin{minipage}{0.45\linewidth}%
+ \hbox to\linewidth{\box\z@\hss}
+ \end{minipage}%
+ \qquad
+ \begin{minipage}{0.45\linewidth}%
+ \lstset{frame=none}%
+ \leavevmode \catcode`\^^M=5\relax
+ \small\input{\jobname.tmp}%
+ \end{minipage}%
+ \end{center}}
+
+\DeclareRobustCommand*{\clsname}{%
+ \texorpdfstring{\@ifstar\@clsname\@@clsname}{}}
+ \def\@clsname#1{{\normalfont\textsf{#1}}}
+ \def\@@clsname#1{{\normalfont\textsf{#1}\clsindex{#1}}}
+\DeclareRobustCommand*{\pkgname}{%
+ \texorpdfstring{\@ifstar\@pkgname\@@pkgname}{}}
+ \def\@pkgname#1{{\normalfont\textsf{#1}}}
+ \def\@@pkgname#1{{\normalfont\textsf{#1}\pkgindex{#1}}}
+\DeclareRobustCommand*{\optname}{%
+ \texorpdfstring{\@ifstar\@optname\@@optname}{}}
+ \def\@optname#1{{\normalfont\texttt{#1}}}
+ \def\@@optname#1{{\normalfont\texttt{#1}\optindex{#1}}}
+\DeclareRobustCommand*{\othname}{%
+ \texorpdfstring{\@ifstar\@othname\@@othname}{}}
+ \def\@othname#1{{\normalfont\texttt{#1}}}
+ \def\@@othname#1{{\normalfont\texttt{#1}\othindex{#1}}}
+\DeclareRobustCommand*{\envname}{%
+ \texorpdfstring{\@ifstar\@envname\@@envname}{}}
+ \def\@envname#1{{\normalfont\texttt{#1}}}
+ \def\@@envname#1{{\normalfont\texttt{#1}\envindex{#1}}}
+\DeclareRobustCommand*{\cmdname}{%
+ \texorpdfstring{\@ifstar\@cmdname\@@cmdname}{\textbackslash}}
+ \def\@cmdname#1{{\ttfamily\textbackslash\textcolor{RoyalBlue}{#1}}}
+ \def\@@cmdname#1{{\ttfamily\textbackslash\textcolor{RoyalBlue}{#1}}\cmdindex{#1}}
+
+\def\clsindex#1{\index{#1@\textsf{#1}}%
+ \index{#1@\textsf{#1} \textit{\textit{(class)}}}}
+\def\pkgindex#1{\index{Package!#1@\textsf{#1}}%
+ \index{#1@\textsf{#1} \textit{(pack.)}}}
+\def\optindex#1{\index{Option!#1@\texttt{#1}}%
+ \index{#1@\texttt{#1} \textit{(opt.)}}}
+\def\othindex#1{\index{#1@\texttt{#1}}}
+\def\envindex#1{\index{Environment!#1@\texttt{#1}}%
+ \index{#1@\texttt{#1} \textit{(env.)}}}
+\def\cmdindex#1{\index{#1@\texttt{\hspace*{-1.2ex}%
+ \textbackslash#1}}}
+
+\DeclareRobustCommand\meta[1]{%
+ $\langle${\normalfont\itshape#1}$\rangle$}
+\DeclareRobustCommand\mail[1]{\href{mailto:#1}{\texttt{#1}}}
+
+%\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
+%\def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
+%\def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
+% \dotfil~\ignorespaces}
+
+\makeatother \ No newline at end of file