From e41dcf8de0ff2f7cde962b8e480d173a83cd3c22 Mon Sep 17 00:00:00 2001 From: mirabilos <thorsten.glaser@teckids.org> Date: Thu, 21 Dec 2017 20:14:28 +0100 Subject: [PATCH] first cut at teckids2 style, for pubmat only for now --- teckids2style.sty | 366 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 366 insertions(+) create mode 100644 teckids2style.sty diff --git a/teckids2style.sty b/teckids2style.sty new file mode 100644 index 0000000..898178b --- /dev/null +++ b/teckids2style.sty @@ -0,0 +1,366 @@ +% Teckids e.V. - Allgemeine Vorlage, Version 2 +%- +% Copyright © 2013, 2015 +% Dominik George <dominik.george@teckids.org> +% Copyright © 2014, 2015, 2017 +% Thorsten “mirabilos†Glaser <thorsten.glaser@teckids.org> +% Copyright © 2015, 2016, 2017 +% Thorsten Glaser <t.glaser@tarent.de> +% Copyright © 2015 +% Niklas Bildhauer <niklas.bildhauer@teckids.org> +% with contributions by (among others) +% Steven B. Segletes <http://tex.stackexchange.com/users/25858> +% Enrico Gregorio <http://tex.stackexchange.com/users/4427> +% David Carlisle <http://tex.stackexchange.com/users/1090> +% +% Provided that these terms and disclaimer and all copyright notices +% are retained or reproduced in an accompanying document, permission +% is granted to deal in this work without restriction, including un†+% limited rights to use, publicly perform, distribute, sell, modify, +% merge, give away, or sublicence. +% +% This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to +% the utmost extent permitted by applicable law, neither express nor +% implied; without malicious intent or gross negligence. In no event +% may a licensor, author or contributor be held liable for indirect, +% direct, other damage, loss, or other issues arising in any way out +% of dealing in the work, even if advised of the possibility of such +% damage or existence of a defect, except proven that it results out +% of said person's immediate fault when using the work as intended. + +% Characters requiring escaping: +% • { } # & _ % $ ⇒ quote by prepending a backslash \ +% • \ → \textbackslash +% • ^ → \textasciicircum +% • ~ → \textasciitilde +% • (nbsp) → ~ +% • (em dash) → \dash + +\NeedsTeXFormat{LaTeX2e}% +\ProvidesPackage{teckids2style}% + +\RequirePackage{accsupp}% +\RequirePackage[utf8]{inputenc}% +\RequirePackage[british,ngerman,shorthands=off,safe=none,math=normal,main=ngerman,headfoot=ngerman,hyphenmap=other*]{babel}% +\RequirePackage[usenames,dvipsnames,table]{xcolor}% +\RequirePackage[LY1,TS1,T1]{fontenc}% +\RequirePackage{pdf14}% +\RequirePackage[paperwidth=21truecm,paperheight=29.728truecm,includeheadfoot,inner=1.9cm,outer=1.8cm,top=0.8cm,bottom=0.8cm,headheight=1cm,headsep=0.5cm,foot=1.2cm,marginparsep=2.5mm]{geometry}% twoside +\RequirePackage{fancybox}% +\linespread{1.15}% +\RequirePackage[varqu,varl]{inconsolata}% +\RequirePackage{longtable}% +\RequirePackage{tabu}% +\RequirePackage{multirow}% +\renewcommand{\multirowsetup}{}% +\RequirePackage{wrapfig}% +\RequirePackage{intcalc}% +\RequirePackage[writefile]{listings}% +\RequirePackage{tocloft}% +\RequirePackage{float}% +\RequirePackage[totpages,user]{zref}% +\RequirePackage{calc}% +\RequirePackage{ifthen}% +\RequirePackage[noadjust]{marginnote}% +\RequirePackage{unicodedomino}% +\RequirePackage{unicodepoints}% +\RequirePackage{framed}% +\RequirePackage[pdftex,unicode]{hyperref}% + +\definecolor{teckidsorangedark}{HTML}{FF6600}% +\definecolor{teckidsorangelight}{HTML}{FF9955}% +\definecolor{teckidswebsitebluelight}{HTML}{029AFA}% +\definecolor{teckidswebsitebluedark}{HTML}{1E61F7}% +\definecolor{teckidslogobluegradientlight}{HTML}{00CBFA}% +\definecolor{teckidslogobluegradientdark}{HTML}{0606FA}% +\definecolor{teckidslogobluestroke}{HTML}{005EBE}% + +\newcommand{\teckidslogo}[1][10cm]{\includegraphics[width=#1]{teckids_logo}}% + +\hypersetup{ + colorlinks = true, + linkcolor = blue, + urlcolor = blue, + citecolor = blue, + pdfauthor = {Teckids e.V.} +}% + +% Set default page style +\pagestyle{fancy}% +\addtokomafont{pageheadfoot}{\upshape}% +% Bitte gerne neudefinieren, zum Beispiel… +\newcommand{\dokumentLizenzlogo}{}% +\newcommand{\dokumentLizenztext}{% + Freies Material unter einer Freien Lizenz\linebreak% + Für Details kontaktieren Sie bitte den Teckids e.V.% +}% +% … hiermit: +\newcommand{\dokumentLizenzCCBYSAthreeDE}{% + \renewcommand{\dokumentLizenzlogo}{% + \includegraphics[width=3cm]{cc-by-sa}% + }% + \renewcommand{\dokumentLizenztext}{% + Veröffentlicht unter der \textit{Creative Commons Namensnennung \dash\linebreak% + Weitergabe unter gleichen Bedingungen 3.0 Deutschland} Lizenz.% + }% +}% +\newcommand{\dokumentLizenzCCBYSAfour}{% + \renewcommand{\dokumentLizenzlogo}{% + \includegraphics[width=3cm]{cc-by-sa}% + }% + \renewcommand{\dokumentLizenztext}{% + Veröffentlicht unter der \textit{Creative Commons Namensnennung \dash\linebreak% + Weitergabe unter gleichen Bedingungen 4.0 International} Lizenz.% + }% +}% +\newcommand{\dokumentLizenzMirOS}{% + \renewcommand{\dokumentLizenzlogo}{}% + \renewcommand{\dokumentLizenztext}{% + Veröffentlicht unter der MirOS-Lizenz.% + }% +}% +% Syntax: \teckidshdr[2017 Name,]{Dokumenttitel} +\newcommand{\teckidshdr}[2][]{% + \fancyhf{}% + \renewcommand{\headrulewidth}{0pt}% + \renewcommand{\footrulewidth}{0.6pt}% + \renewcommand*\pagemark{\leavevmode\usekomafont{pagenumber}\ifnum\ztotpages=1\else\thepage/\ztotpages\fi}% + \fancyhead[L]{\leavevmode\usekomafont{pageheadfoot}#2}% + \fancyhead[R]{\leavevmode\usekomafont{pageheadfoot}\pagemark}% + \fancyfoot[L]{\leavevmode\usekomafont{pageheadfoot}\dokumentLizenzlogo}% + \fancyfoot[C]{\leavevmode\usekomafont{pageheadfoot}{\footnotesize% + \textcopyright{} #1 Teckids e.V.\linebreak% + \dokumentLizenztext}}% + \fancyfoot[R]{\leavevmode\usekomafont{pageheadfoot}\teckidslogo[3cm]{}}% +}% +\teckidshdr{\headmark}% + +% Hurenkinder und Schusterjungen +\clubpenalty10000% +\widowpenalty10000% +\displaywidowpenalty=10000% +% Zu lange Zeilen +\emergencystretch 5em% + +% Allgemeine Einstellungen + +\DeclareGraphicsExtensions{.pdf,.eps,.png,.jpg}% + +\setlength{\parskip}{0.3cm plus 5mm minus 1mm}% +\setlength{\parindent}{0cm}% + +% Extra-Befehle + +\newcommand{\ankreuzen}{Bitte zum Beispiel so → \CheckedBox\hspace{0.05cm} ↠ankreuzen!}% +\newcommand{\angekreuzteskaestchen}{\CheckedBox\hspace{0.1cm}}% +\newcommand{\ankreuzkaestchen}{\Square\hspace{0.1cm}}% + +% Listings + +\makeatletter% +\newcounter{lstdumps}% +\setcounter{lstdumps}{0}% +\newcommand{\lstdumpname}{}% +\xdef\lstdumpsection{\@empty}% +\lstnewenvironment{lstdump}[3][]% + {\lst@TestEOLChar{#3}% + \lstset{#1}% + \csname\@lst @SetFirstNumber\endcsname% + \stepcounter{lstdumps}% + \marginnote{{\LARGE\color[HTML]{707070}\thelstdumps}}[4pt]% + \renewcommand{\lstdumpname}{ (#2)}% + \lst@BeginAlsoWriteFile{\jobname.lst}% + \ifx\lstdumpsection\@currentlabel\else% + \ifx\lstdumpsection\@empty% + \immediate\write\lst@WF{Listing dump for \jobname.tex}% + \immediate\write\lst@WF{}% + \fi% + \immediate\write\lst@WF{>>> (\@currentlabel) \@currentlabelname}% + \immediate\write\lst@WF{}% + \fi% + \immediate\write\lst@WF{-----BEGIN LISTING \thelstdumps\lstdumpname-----}% + }% + {% + \immediate\write\lst@WF{-----END LISTING \thelstdumps\lstdumpname-----}% + \immediate\write\lst@WF{}% + \endgroup% + \csname\@lst @SaveFirstNumber\endcsname% + \xdef\lstdumpsection{\@currentlabel}% + }% +\lstnewenvironment{lstdumpx}[2][]% + {\lst@TestEOLChar{#2}% + \lstset{#1}% + \csname\@lst @SetFirstNumber\endcsname% + \stepcounter{lstdumps}% + \marginnote{{\LARGE\color[HTML]{707070}\thelstdumps}}[4pt]% + \renewcommand{\lstdumpname}{ [unnamed]}% + \lst@BeginAlsoWriteFile{\jobname.lst}% + \ifx\lstdumpsection\@currentlabel\else% + \ifx\lstdumpsection\@empty% + \immediate\write\lst@WF{Listing dump for \jobname.tex}% + \immediate\write\lst@WF{}% + \fi% + \immediate\write\lst@WF{>>> (\@currentlabel) \@currentlabelname}% + \immediate\write\lst@WF{}% + \fi% + \immediate\write\lst@WF{-----BEGIN LISTING \thelstdumps\lstdumpname-----}% + }% + {% + \immediate\write\lst@WF{-----END LISTING \thelstdumps\lstdumpname-----}% + \immediate\write\lst@WF{}% + \endgroup% + \csname\@lst @SaveFirstNumber\endcsname% + \xdef\lstdumpsection{\@currentlabel}% + }% +% usage: \lstdumpesc[file]{pdf} or \lstdumpesc{bothfileandpdf} +\def\lstdumpesc{\@ifnextchar[{\lstdumpesc@two}{\lstdumpesc@one}}% +\def\lstdumpesc@one#1{\lst@WFAppend{#1}#1}% +\def\lstdumpesc@two[#1]#2{\lst@WFAppend{#1}#2}% + +\lstset{ + backgroundcolor=\color[HTML]{E6E6E6}, + breakatwhitespace=true, + rulecolor=\color{black}, + basicstyle=\ttfamily, + upquote=true, + keepspaces, + literate= + {á}{{\'a}}1 {é}{{\'e}}1 {Ã}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 + {Ã}{{\'A}}1 {É}{{\'E}}1 {Ã}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 + {à }{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\'E}}1 {ÃŒ}{{\`I}}1 {Ã’}{{\`O}}1 {Ù}{{\`U}}1 + {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 + {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ã}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 + {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 + {Â}{{\^A}}1 {Ê}{{\^E}}1 {ÃŽ}{{\^I}}1 {Ô}{{\^O}}1 {Û}{{\^U}}1 + {æ}{{\ae}}1 {Æ}{{\AE}}1 {ß}{{\ss}}1 {Å“}{{\oe}}1 {Å’}{{\OE}}1 + {Å‘}{{\H{o}}}1 {Å}{{\H{O}}}1 {ű}{{\H{u}}}1 {Ű}{{\H{U}}}1 + {Ã¥}{{\r a}}1 {Ã…}{{\r A}}1 {ç}{{\c c}}1 {Ç}{{\c C}}1 {ø}{{\o}}1 + {©}{{\textcopyright}}1 {â„¢}{\texttrademark}1 {–}{-}1 {§}{\S}1 + {£}{{\pounds}}1 {°}{\textdegree{}}1 {„}{{\quotedblbase}}1 + {“}{{\textquotedblleft}}1 {â€}{{\textquotedblright}}1 + {‘}{{\textquoteleft}}1 {’}{{\textquoteright}}1 + {«}{\guillemotleft}1 {»}{\guillemotright}1 + {€}{{\fontencoding{LY1}\selectfont\symbol{'001}}}1 + {…}{{\fontencoding{LY1}\selectfont\symbol{'205}}}1, + columns=flexible, + showstringspaces=false, + extendedchars=true, + breaklines=true, + prebreak=\unicodepoints@flipsym{\color{red}\ding{229}}, + frame=single, + showtabs=false, + showspaces=false, + showstringspaces=false, + escapeinside={〈}{〉}, + keywordstyle=\color[rgb]{0,0,1}, + commentstyle=\color{ForestGreen}, + stringstyle=\color{RedOrange}, + % für 〔Paßwörter〕 und 「variable Texte〠in Listings + moredelim=[is][\color{ForestGreen}]{〔}{〕}, + moredelim=*[is][\color{RedOrange}]{「}{ã€}, +}% +\makeatother% + +% Use pxfonts by default +\renewcommand{\sfdefault}{pxss}% +% sans-serif fonts should not use italic as emphasis +\renewcommand{\emph}[1]{\textbf{#1}}% +% Use Comic Sans MS as “roman†font, because we have to use the +% sans-serif font always, and like this, we spot errors easily +\renewcommand{\rmdefault}{comic}% +% default font is sans-serif, i.e. pxfonts +\renewcommand*{\familydefault}{\sfdefault}% + +% em dash +\def\dash{\unskip\kern.16667em\textemdash\penalty\exhyphenpenalty\hskip.16667em\relax}% +% for footnotes +\newcommand{\Hair}{\kern.16667em}% + +% for lead paragraph before IT-Mieze +\makeatletter% +\newcommand{\keinumbruch}{\par\nobreak\@afterheading}% +\makeatother% + +% for nice inline pictures in boxen with rounded corners +\makeatletter% +% fbox and ovalbox line will be inside the box +\setlength{\fboxsep}{-2\fboxrule}% +% to calculate horizontal padding inside the frame +\newdimen{\inlinebildsep}% +% to store dimensions of box without padding +\newsavebox{\inlinebildbox}% +\newcommand{\inlinebild}[2][\@empty]{% + % first, generate a box with square content and w/o padding + \savebox{\inlinebildbox}{\ovalbox{\strut\hspace{1.25ex}}}% + % get its real height (Teχ height + depth) + \inlinebildsep=\ht\inlinebildbox% + \advance\inlinebildsep by \dp\inlinebildbox% + % subtract its real width + \advance\inlinebildsep by -\wd\inlinebildbox% + % we want half of it on either side + \divide\inlinebildsep by 2% + % now render the actual box + \ovalbox{% + % left padding + \hspace{\inlinebildsep}% + % ensure standard height + \strut% + % the graphic + \resizebox{!}{1.25ex}{\includegraphics{#2}}% + % the text, if any + \ifx#1\@empty\else{ #1}\fi% + % right padding + \hspace{\inlinebildsep}% +}}% +\makeatother% + +% for nice inline boxen with square corners +\makeatletter% +\newcommand{\inlinekasten}[1]{% + % first, generate a box with square content and w/o padding + \savebox{\inlinebildbox}{\fbox{\strut\hspace{1.25ex}}}% + % get its real height (Teχ height + depth) + \inlinebildsep=\ht\inlinebildbox% + \advance\inlinebildsep by \dp\inlinebildbox% + % subtract its real width + \advance\inlinebildsep by -\wd\inlinebildbox% + % we want half of it on either side + \divide\inlinebildsep by 2% + % now render the actual box + \fbox{% + % left padding + \hspace{\inlinebildsep}% + % ensure standard height + \strut% + % the text + #1% + % right padding + \hspace{\inlinebildsep}% +}}% +\makeatother% + +\makeatletter% +% \hyperfootnotetext is what \footnotetext is supposed to be: +% like \footnote except not rendering anything (it will not +% generate a paragraph if you append % to all lines) +\newcommand\hyperfootnotetext[1]{% + % new local scope + {% + % temporarily redefine this macro to empty + \renewcommand{\@makefnmark}{}% + % temporarily prevent leaving vmode + \renewcommand{\leavevmode}{}% + % this also means we cannot create a(n empty) hyperlink + \renewcommand{\hyper@linkstart}[2]{}% + \renewcommand{\hyper@linkend}{}% + % call the original \footnote macro + \footnote{#1}% + % exit the local scope with the redefined macro + }% + % end of command +}% +\makeatother% + +% figure out overfull hbox +%\overfullrule=2cm -- GitLab