From 981e19ff49e86e52de6d220fb67606f048eb0011 Mon Sep 17 00:00:00 2001 From: Peter Nerlich Date: Sat, 18 Sep 2021 00:02:46 +0200 Subject: [PATCH] =?UTF-8?q?put=20macros=20in=20separate=20command,=20intro?= =?UTF-8?q?duce=20\bafog=20=E2=86=92=20BAf=C3=B6G?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- macros.tex | 37 +++++++++++++++++++++++++++++++++++++ manual.tex | 37 ++----------------------------------- preamble.tex | 2 -- 3 files changed, 39 insertions(+), 37 deletions(-) create mode 100644 macros.tex diff --git a/macros.tex b/macros.tex new file mode 100644 index 0000000..440324d --- /dev/null +++ b/macros.tex @@ -0,0 +1,37 @@ +\newcommand{\ascii}{{\texttt{ascii}}} +\newcommand{\bafog}{BAföG} + +\newcounter{linkcounter} +\newcommand\linklist{} +\makeatletter +\def\@breaklinklistat{22} +\def\@breaklinklistandat{54} +\newcommand{\link}[1]{% + \edef\tmptoken{\detokenize{#1}}% + \@ifundefined{nopanic@link@\tmptoken}{% + \edef\@linknumber{\arabic{linkcounter}}% + \protected@edef\@tmpkey{{\fontsize{9pt}{0}\selectfont\keys{\@linknumber}}}% + \expandafter\global\expandafter\edef\csname nopanic@link@\tmptoken\endcsname{\arabic{linkcounter}}% + % + % Standard print output: + \expandafter\g@addto@macro\expandafter\linklist\expandafter{\@tmpkey & \url{#1}}% + \ifx\@breaklinklistat\@linknumber + \g@addto@macro\linklist{\\}% + \else + \ifx\@breaklinklistandat\@linknumber + \g@addto@macro\linklist{\\}% + \else + \g@addto@macro\linklist{\\*}% + \fi + \fi + % + % Link system output: + \immediate\write\linklistfile{RewriteRule "^\@linknumber$" "#1"}% + % + \stepcounter{linkcounter}% + }{% + \protected@edef\@tmpkey{{\fontsize{9pt}{0}\selectfont\keys{\csname nopanic@link@\tmptoken\endcsname}}}% + }% + \href{#1}{\@tmpkey}% +} +\makeatother diff --git a/manual.tex b/manual.tex index 64e39d2..5731bb2 100644 --- a/manual.tex +++ b/manual.tex @@ -17,44 +17,11 @@ \input{preamble.tex} +\input{macros.tex} + % we need this dummy counter to make a label at the spieleabendplakat \newcounter{dummy} -\newcounter{linkcounter} -\newcommand\linklist{} -\makeatletter -\def\@breaklinklistat{22} -\def\@breaklinklistandat{54} -\newcommand{\link}[1]{% - \edef\tmptoken{\detokenize{#1}}% - \@ifundefined{nopanic@link@\tmptoken}{% - \edef\@linknumber{\arabic{linkcounter}}% - \protected@edef\@tmpkey{{\fontsize{9pt}{0}\selectfont\keys{\@linknumber}}}% - \expandafter\global\expandafter\edef\csname nopanic@link@\tmptoken\endcsname{\arabic{linkcounter}}% - % - % Standard print output: - \expandafter\g@addto@macro\expandafter\linklist\expandafter{\@tmpkey & \url{#1}}% - \ifx\@breaklinklistat\@linknumber - \g@addto@macro\linklist{\\}% - \else - \ifx\@breaklinklistandat\@linknumber - \g@addto@macro\linklist{\\}% - \else - \g@addto@macro\linklist{\\*}% - \fi - \fi - % - % Link system output: - \immediate\write\linklistfile{RewriteRule "^\@linknumber$" "#1"}% - % - \stepcounter{linkcounter}% - }{% - \protected@edef\@tmpkey{{\fontsize{9pt}{0}\selectfont\keys{\csname nopanic@link@\tmptoken\endcsname}}}% - }% - \href{#1}{\@tmpkey}% -} -\makeatother - \sloppy % forces "ugly" line breaks \pagestyle{plain} diff --git a/preamble.tex b/preamble.tex index 664d44b..83a77ad 100644 --- a/preamble.tex +++ b/preamble.tex @@ -71,5 +71,3 @@ \addtokomafont{disposition}{\normalfont\fontspec{Open Sans}} \defaultfontfeatures{Ligatures=TeX} % enable ligatures (e.g. --) for new fonts - -\newcommand{\ascii}{{\texttt{ascii}}}