schleuderpackung/datenschleuder.cls

449 lines
13 KiB
OpenEdge ABL
Raw Permalink Normal View History

2013-07-19 20:34:58 +02:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright 2013 koeart, john, ben %
% %
% This program is free software: you can redistribute it and/or modify it %
% under the terms of the GNU General Public License as published by the %
% Free Software Foundation, either version 3 of the License, or (at your %
% option) any later version. %
% %
% This program is distributed in the hope that it will be useful, but %
% WITHOUT ANY WARRANTY; without even the implied warranty of %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %
% General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License along %
% with this program. If not, see <http://www.gnu.org/licenses/>. %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesClass{datenschleuder}[%
2013/07/19 v0.1 Datenschleuder
]
\LoadClass[%
pdftex,
a5paper,
twoside,
2013-07-23 01:08:27 +02:00
% twocolumn,
fontsize=8pt,
2013-07-19 20:34:58 +02:00
]{scrartcl}
2013-07-19 21:13:23 +02:00
2017-02-20 21:12:23 +01:00
\IfFileExists{luatex85.sty}{%
2017-02-20 20:39:20 +01:00
\RequirePackage{luatex85} % Fixes Problems with pdfxxx names [http://tex-live.tug.narkive.com/gc2DAmsJ/fwd-proble m-with-lualatex-in-lexlive-2016]
}{}
\RequirePackage{textcomp}
2013-08-02 23:57:01 +02:00
\RequirePackage{fixltx2e}
\AtBeginDocument{\RequirePackage{ellipsis}}
\RequirePackage{microtype}
\RequirePackage[paper=a5paper,inner=16mm, outer=12mm,top=20mm,bottom=30mm]{geometry}
2013-07-24 18:45:29 +02:00
%FIXME: do so only if specified in document or makefile:
%\RequirePackage[cam,a4,center]{crop}
2013-07-21 23:37:02 +02:00
\RequirePackage{multicol}
2013-07-19 21:13:23 +02:00
\RequirePackage{xkeyval}
\newcommand{\@volume}{}
\DeclareOptionX{volume}{\renewcommand{\@volume}{#1}}%
\newcommand{\@year}{}
\DeclareOptionX{year}{\renewcommand{\@year}{#1}}%
\newif\iffree\freetrue
\DeclareOptionX{non-free}{\freefalse}%
2013-07-19 21:13:23 +02:00
\ProcessOptionsX
2013-07-19 22:12:53 +02:00
\RequirePackage{ifluatex}
\ifluatex
\RequirePackage{luatextra}
\RequirePackage{lineno}
\RequirePackage[EU2]{fontenc}
2013-07-19 20:34:58 +02:00
\RequirePackage{fontspec}
\iffree
2013-08-02 02:10:49 +02:00
\newcommand{\DSLogoFont}{\fontspec[Scale=2.36]{Zepto}}
\setmainfont[Ligatures=TeX,Numbers={OldStyle}]{Linux Libertine O}
\setsansfont[Ligatures=TeX,Numbers={OldStyle}]{Linux Biolinum O}
%\setmonofont[Mapping=tex-text]{Courier Prime}
\else
2013-08-02 02:10:49 +02:00
\setmainfont[Ligatures=TeX,Numbers={OldStyle}]{FFScala}
\setsansfont[Ligatures=TeX,Numbers={OldStyle}]{ScalaSans}
\newcommand{\DSLogoFont}{\fontspec[Scale=2.93]{FFNetwork}}
\fi
\else
\ClassError{Datenschleuder}{%
You need LuaTeX in order to compile \MessageBreak
a Datenschleuder%
}{%
Instead of running "pdflatex \jobname" type:\MessageBreak
lualatex \jobname\MessageBreak
\MessageBreak
Remember to cross two fingers and praise Eris before compiling.\MessageBreak
Unpredictable things will happen with your computer otherwise...
}
2013-07-19 20:34:58 +02:00
\fi
2013-07-20 00:53:40 +02:00
\RequirePackage{fmtcount}
2013-07-19 20:34:58 +02:00
2017-02-21 01:06:00 +01:00
\RequirePackage{listings}
\lstset{%
upquote=true,
basicstyle=\ttfamily,
%backgroundcolor=\color{lightgray},
%frame=single,
stringstyle=\color{brown},
keywordstyle=\color{yellow},
% identifierstyle=\color{green},
commentstyle=\color{gray},
keywordstyle=[2]\color{darkgray},
keywordstyle=[3]\color{darkgray},
tabsize=2
}
2017-02-21 01:20:21 +01:00
\RequirePackage{booktabs}
\RequirePackage{colortbl}
2017-02-20 20:19:18 +01:00
\RequirePackage{scrlayer-scrpage}
2013-07-20 00:27:27 +02:00
\RequirePackage{graphicx}
\RequirePackage{tikz}
2017-02-21 00:24:27 +01:00
\RequirePackage{qrcode}
2017-02-20 23:05:50 +01:00
\RequirePackage[hyphens]{url}
2013-07-23 04:16:53 +02:00
\RequirePackage[pdftex,%
citebordercolor={0.9 0.9 1},%
filebordercolor={0.9 0.9 1},%
linkbordercolor={0.9 0.9 1},%
urlbordercolor={0.9 0.9 1},%
pdfborder={0.9 0.9 1},%
pagebackref,plainpages=false,pdfpagelabels=true]{hyperref}
2013-07-24 18:54:56 +02:00
\hypersetup{
2013-08-02 23:57:01 +02:00
pdfauthor={Chaos Computer Club},
pdftitle={datenschleuder},
pdfsubject={wissenschaftliches fackblatt fuer datenreisende},
pdfkeywords={Ausgabe\@volume, Jahr\@year},
breaklinks,
colorlinks,
linkcolor = black,
filecolor = black,
urlcolor = black,
citecolor = black,
2013-07-24 18:54:56 +02:00
}
2013-08-02 23:57:01 +02:00
% Disable single lines at the start of a paragraph (Schusterjungen) {{{
\clubpenalty = 10000
% Disable single lines at the end of a paragraph (Hurenkinder)
\widowpenalty = 10000
\displaywidowpenalty = 10000
%}}}
\RequirePackage{wallpaper}
2013-07-21 23:37:02 +02:00
\RequirePackage{float}
2017-02-20 20:39:33 +01:00
\pgfdeclareimage[height=5mm]{Pesthoernchen}{schleuderpackung/img/pesthoernchen}
2013-08-02 23:57:44 +02:00
\newcommand{\chaosknoten}[1]{%
\tikz[yscale=-#1,xscale=#1,every path/.style={fill=\DSPage@fg}]{\input{schleuderpackung/img/chaosknoten.tex}}%
}
2013-07-21 23:37:02 +02:00
\newfloat{impressum}{tpbh}{loi} %impressum als Float, damit kann Text fließen
2013-07-19 21:13:23 +02:00
\pagestyle{scrheadings}
2013-07-20 01:14:32 +02:00
\clearscrheadfoot
\setkomafont{pageheadfoot}{%
\normalfont\normalcolor\small
}
2013-07-23 01:17:29 +02:00
%FIXME: use pgfdeclared image for saving objects in pdf
2013-07-20 01:14:32 +02:00
2017-02-21 00:24:27 +01:00
\newcommand{\@qrpagecode}{\tikz[baseline=(foo.south)]{\node(foo)[inner sep=0]{\qrcode[height=.4cm,level=H]{\arabic{page}}}}}%
2013-08-02 23:57:44 +02:00
\rehead[]{\tikz[overlay]{\node[xshift=0.3mm,yshift=1.1mm]{\chaosknoten{0.017}};}}
\rohead[]{\tikz[overlay]{\node[xshift=0.3mm,yshift=1.1mm]{\chaosknoten{0.017}};}}
\chead{\textcolor{\DSPage@fg}{\directlua{tex.print(ruhetmp or "Bitte runninghead setzen")}}}
\setheadsepline{0.5pt}[\color{\DSPage@fg}]
2013-07-19 21:13:23 +02:00
2017-02-21 09:03:02 +01:00
\ifoot[]{\textcolor{\DSPage@fg}{\vphantom{\@qrpagecode}Datenschleuder. \@volume\ / \@year}}
2017-02-21 00:24:27 +01:00
\rofoot[]{\textcolor{\DSPage@fg}{\texttt{0x\ifthenelse{\value{page}>15}{}{0}\hexadecimal{page}} \@qrpagecode%
}}
\lefoot[]{\textcolor{\DSPage@fg}{\@qrpagecode\ \texttt{0x\ifthenelse{\value{page}>15}{}{0}\hexadecimal{page}}}}
2013-08-02 23:57:44 +02:00
\setfootsepline{0.5pt}[\color{\DSPage@fg}]
2013-07-19 21:13:23 +02:00
2013-07-19 20:34:58 +02:00
%FIXME: use abstract environment in prior of nasty DSabstract command
\renewenvironment{abstract}{%
\begin{center}
\bfseries
}{%
\end{center}
}
\newcommand{\@DSabstract}{}
\newcommand{\DSabstract}[1]{\renewcommand{\@DSabstract}{#1}}
2013-07-22 11:52:30 +02:00
\newtoks{\@DSauthorstok}
\@DSauthorstok={}%
\newcommand{\@addauthor}[1]{\@DSauthorstok=\expandafter{\the\@DSauthorstok #1 }}
2013-07-22 11:52:30 +02:00
\newcommand{\addauthor}[1]{\@addauthor{#1}}
2013-07-19 20:34:58 +02:00
\renewcommand{\maketitle}{%
2013-07-23 01:08:27 +02:00
% \twocolumn[
2013-07-20 02:09:13 +02:00
% \renewcommand{\@runninghead}{\@runningheadtmp}
2017-02-21 00:00:47 +01:00
\hypertarget{AR\directlua{tex.print(nxruhetmp)}}{\textsf{\Huge\@title}}\pdfbookmark[0]{\directlua{tex.print(nxruhetmp)}}{AR\directlua{tex.print(nxruhetmp)}}
2013-07-19 20:34:58 +02:00
\begin{center}%
\textsf{von \@author}%FIXME: implement mail and array of authors
\end{center}
2013-07-22 11:52:30 +02:00
\addauthor{Noch ein Test}
2013-07-19 20:34:58 +02:00
{\bfseries\@DSabstract}
\vspace*{3mm}
2013-07-23 01:08:27 +02:00
% ]
2013-07-20 02:37:44 +02:00
\directlua{ruhetmp=nxruhetmp nxruhetmp=nil}
2013-07-19 20:34:58 +02:00
\normalsize
}
2013-07-20 00:27:27 +02:00
\define@key{DSarticleKeys}{title}{\title{#1}}%
2013-07-19 20:34:58 +02:00
\define@key{DSarticleKeys}{author}{\author{#1}}
\define@key{DSarticleKeys}{DSabstract}{\renewcommand{\@DSabstract}{#1}}
2013-07-20 02:09:13 +02:00
%\newcommand{\@runninghead}{}
%\newcommand{\@runningheadtmp}{}
%\newcommand{\runninghead}[1]{\renewcommand{\@runningheadtmp}{#1}}
2013-07-20 02:37:44 +02:00
\newcommand{\runninghead}[1]{\directlua{nxruhetmp = "\luatexluaescapestring{#1}"}}
\newcommand{\manrunninghead}[1]{\directlua{ruhetmp = "\luatexluaescapestring{#1}"}}
2013-07-20 01:08:22 +02:00
\define@key{DSarticleKeys}{runninghead}[\@title]{\runninghead{#1}}
2013-07-19 20:34:58 +02:00
\newenvironment{DSarticle}[1][]{%
2013-07-23 01:08:27 +02:00
\newpage
2013-07-23 02:04:22 +02:00
\setcounter{section}{0}
2013-07-19 20:34:58 +02:00
\setkeys{DSarticleKeys}{#1}%
2013-07-23 02:04:22 +02:00
\newpage
2017-02-20 22:40:12 +01:00
\noindent\maketitle
2013-07-23 01:08:27 +02:00
\begin{multicols}{2}
2013-07-23 00:34:41 +02:00
}{%
2013-07-23 01:08:27 +02:00
\end{multicols}
2013-07-23 00:34:41 +02:00
}
2013-07-23 02:04:22 +02:00
\newenvironment{DSfigure}
{\par\medskip\noindent\minipage{\linewidth}
}{%
\endminipage\par\medskip}
2013-07-19 20:34:58 +02:00
2013-07-20 02:03:46 +02:00
\newcounter{NumOfLetters}
2013-07-23 02:29:26 +02:00
\newenvironment{DSletters}{%
\hypertarget{MARKLeserbriefe}{}
\pdfbookmark[0]{Leserbriefe}{MARKLesrbriefe}
2013-07-23 02:29:26 +02:00
\manrunninghead{Leserbriefe}
2013-07-20 02:03:46 +02:00
\setcounter{NumOfLetters}{0}
2013-07-23 02:29:26 +02:00
\begin{multicols}{2}
}
{%
\end{multicols}
}
2013-07-20 02:03:46 +02:00
\newenvironment{letter}{%
\setlength{\parskip}{2.5mm}%
\setlength{\parindent}{0mm}%
\ifthenelse{\equal{\arabic{NumOfLetters}}{0}}{}{%
\vspace{-3mm}%
\begin{center}%
\hfill%
\hfill%
2013-07-23 01:17:29 +02:00
%FIXME: use pgfdeclared image for saving objects in pdf
\pgfuseimage{Pesthoernchen}
2013-07-20 02:03:46 +02:00
\hfill%
\pgfuseimage{Pesthoernchen}
2013-07-20 02:03:46 +02:00
\hfill%
\pgfuseimage{Pesthoernchen}
2013-07-20 02:03:46 +02:00
\hfill%
\hfill\hspace*{0cm}%
\end{center}%
\vspace{-5mm}%
}%
\stepcounter{NumOfLetters}%
}{%
}
2017-02-21 00:34:17 +01:00
\newcommand{\@letterauthor}{}
\define@key{DSletterKeys}{author}{\renewcommand{\@letterauthor}{#1}}%
\newenvironment{question}[1][]{%
\setkeys{DSletterKeys}{#1}%
2013-07-20 02:03:46 +02:00
}{%
2017-02-21 00:34:17 +01:00
\ifthenelse{%
\equal{\@letterauthor}{}
}{%
}{%
\textit{<\@letterauthor>}%
}
2013-07-23 02:29:26 +02:00
\par
2013-07-20 02:03:46 +02:00
}
2017-02-21 00:34:17 +01:00
\newenvironment{answer}[1][]{%
\setkeys{DSletterKeys}{#1}%
2013-07-20 02:03:46 +02:00
\itshape%
}{%
2017-02-21 00:34:17 +01:00
\ifthenelse{%
\equal{\@letterauthor}{}
}{%
}{%
\textit{<\@letterauthor>}%
}
2013-07-20 02:03:46 +02:00
}
2013-07-21 23:37:02 +02:00
2013-07-22 17:49:16 +02:00
%%%%%%%%
% Die folgenden Kommandos können auch aus dem Dokument gesetzt werden. Evtl. als DSimpressum Keys machen
%%%%%%%%
2013-07-21 23:37:02 +02:00
\newcommand{\@DSherausgeber}{}
\newcommand{\DSherausgeber}[1]{\renewcommand{\@DSherausgeber}{#1}}
2013-07-22 17:49:16 +02:00
\newcommand{\@DSredaktion}{}
\newcommand{\DSredaktion}[1]{\renewcommand{\@DSredaktion}{#1}}
2013-07-21 23:37:02 +02:00
2013-07-22 17:49:16 +02:00
\newcommand{\@DSdruck}{}
\newcommand{\DSdruck}[1]{\renewcommand{\@DSdruck}{#1}}
\newcommand{\@DSvisdp}{}
\newcommand{\DSvisdp}[1]{\renewcommand{\@DSvisdp}{#1}}
2013-07-21 23:37:02 +02:00
2013-07-22 11:52:30 +02:00
\newcommand{\@DSauthors}{\textbf{Autoren }\\\the\@DSauthorstok}
\newcommand{\DSauthors}{\@DSauthors}
2013-07-21 23:37:02 +02:00
%\define@key{DSimpressumKeys}{ViSdP}{%
% \DSvisdp{#1}
%}
\newcommand{\DSimpressum}{%
2013-07-22 11:52:30 +02:00
\begin{impressum*}[b!]
2013-07-21 23:37:02 +02:00
%minipage: pos., höhe, textpos, breite
2013-07-22 11:52:30 +02:00
\colorbox{lightgray}{
\begin{minipage}[t]{1\linewidth}
\hypertarget{MARKImpressum}{ \large \textbf{Die Datenschleuder Nr. \@volume}}
\pdfbookmark[0]{Impressum}{MARKImpressum}
2013-07-22 11:52:30 +02:00
\begin{multicols}{2}
\normalsize
2013-07-22 17:49:16 +02:00
\@DSherausgeber\\
\@DSredaktion\\
\@DSdruck\\
\@DSvisdp\\
\DSauthors
2013-07-21 23:37:02 +02:00
\end{multicols}
2013-07-22 11:52:30 +02:00
\end{minipage}
}
2013-07-21 23:37:02 +02:00
\end{impressum*}
}
2013-08-02 02:10:49 +02:00
2017-02-21 01:20:21 +01:00
\RequirePackage{pgfplotstable}
2017-09-13 23:41:59 +02:00
\newcommand{\DSerfakreise}[1]{%
\definecolor{color0}{gray}{0.9}%
\definecolor{color1}{gray}{0.7}%
\pgfplotstableread[col sep=semicolon]{#1}\addresstable%
\pgfplotstablegetrowsof{\addresstable}%
\pgfmathparse{\pgfplotsretval-1}%
\foreach \index in {0,...,\pgfmathresult}{%
\pgfmathparse{int(mod(\index,2))}%
\definecolor{currentcolor}{named}{color\pgfmathresult}%
\noindent\tikz[baseline,outer sep=0]{\node[
text width=\textwidth,
anchor=base,
outer sep=0,
%inner sep=0,
fill=currentcolor
]{%
\pgfmathparse{int(mod(\index,2))}%
\pgfplotstablegetelem{\index}{Erfa}\of\addresstable%
\noindent\textbf{\pgfplotsretval}, %
\pgfplotstablegetelem{\index}{Ort}\of\addresstable%
\ifthenelse{\equal{\pgfplotsretval}{}}{}{\pgfplotsretval, }%
\pgfplotstablegetelem{\index}{Tag}\of\addresstable%
\pgfplotsretval, %
\pgfplotstablegetelem{\index}{Adresse}\of\addresstable%
\pgfplotsretval, %
\pgfplotstablegetelem{\index}{Bemerkung}\of\addresstable%
\url{\pgfplotsretval}%
}}%
\\[-1pt]
}
2017-02-21 01:20:21 +01:00
}
2013-08-02 02:10:49 +02:00
\RequirePackage{environ}
\RequirePackage{eurosym}
2013-08-02 23:57:44 +02:00
\newcommand{\DSPage@fg}{black}
\define@key{DSTitlePage}{fg}[]{\renewcommand{\DSPage@fg}{#1}}
2013-08-02 02:10:49 +02:00
\newcommand{\DSTitlePage@bg}{white}
\define@key{DSTitlePage}{bg}[]{\renewcommand{\DSTitlePage@bg}{#1}}
\newcommand{\DSTitlePage@price}{2,50\,\officialeuro}
\define@key{DSTitlePage}{price}[]{\renewcommand{\DSTitlePage@price}{#1}}
\usetikzlibrary{positioning}
\newlength{\bodywidth}\setlength{\bodywidth}{129mm}
\newlength{\logoXsep}\setlength{\logoXsep}{3mm}
\NewEnviron{DSTitlePage}[1][]{%
\setkeys{DSTitlePage}{#1}%
\thispagestyle{empty}
\begin{tikzpicture}[
remember picture,
overlay,
2013-08-02 23:57:44 +02:00
every node/.append style={color=\DSPage@fg},
color=\DSPage@fg,
2013-08-02 02:10:49 +02:00
]
\path[fill=\DSTitlePage@bg] (current page.north west) rectangle (current page.south east);
\node[
font=\DSLogoFont\Huge,
inner sep=\logoXsep,
below=6.5mm of current page.north,
](logo){%
die datenschleuder.%
};
\draw[line width=4pt] (logo.south west) -- +(\bodywidth,0);
\node[%
below right=\logoXsep of logo.south west,
text width=\columnwidth,
2017-02-20 20:19:18 +01:00
font=\textbf, %FIX for texlive 2016
2013-08-02 02:10:49 +02:00
inner xsep=0mm,
](DSsubtitle){%
das wissenschaftliche fachblatt für datenreisende\\
ein organ des chaos computer club
};
\node[
above left=0cm of logo.east|-current page.south,
](chaosknoten){%
2013-08-02 23:57:44 +02:00
\chaosknoten{0.035}
2013-08-02 02:10:49 +02:00
};
\node[
left=0cm of chaosknoten.north west,
anchor=north east,
2017-02-20 21:10:58 +01:00
]{\fontspec[Scale=3.9]{Linux Biolinum O}\#\@volume};
2013-08-02 02:10:49 +02:00
\node[
below right=0cm of logo.west|-chaosknoten.north,
inner xsep=0pt,
text width=\columnwidth,
2017-02-20 20:19:18 +01:00
font=\textbf,
2013-08-02 02:10:49 +02:00
] (issn) {%
ISSN 0930-1054 \textbullet\ \@year\\
\DSTitlePage@price
};
\draw[thick] ([yshift=1mm]issn.north west) -- ([yshift=1mm]chaosknoten.north east);
\node[%
below right=0mm of DSsubtitle.south-|logo.west,
inner xsep=0pt,
]{%
\begin{minipage}{\bodywidth}
\BODY
\end{minipage}
};
\end{tikzpicture}%
\normalfont
2013-08-02 23:57:44 +02:00
\clearpage
}
\define@key{DSFullImgPage}{fg}[]{\renewcommand{\DSPage@fg}{#1}}
\newcommand{\DSFullImgPage@running}{}
\define@key{DSFullImgPage}{runninghead}[]{\renewcommand{\DSFullImgPage@running}{#1}}
\define@key{DSFullImgPage}{picturepuzzle}[]{%
\renewcommand{\DSFullImgPage@running}{Das große Datenschleuder-Leser-Bilder-Rätsel}%
}
\newcommand{\DSFullImgPage}[2][runninghead=]{%
\setkeys{DSFullImgPage}{#1}
\clearpage
\manrunninghead{\DSFullImgPage@running}
\ifthenelse{\equal{\DSFullImgPage@running}{}}{\pagestyle{plain}}{}
\ThisCenterWallPaper{1}{#2}~
\clearpage
\renewcommand{\DSPage@fg}{black}
\pagestyle{scrheadings}
2013-08-02 02:10:49 +02:00
}