schleuderpackung/datenschleuder.cls

261 lines
7.5 KiB
OpenEdge ABL
Raw 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
\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}
\setmainfont[Mapping=tex-text,Numbers={OldStyle}]{Linux Libertine O}
\setsansfont[Mapping=tex-text,Numbers={OldStyle}]{Linux Biolinum O}
2013-07-20 00:27:27 +02:00
% \setmonofont[Mapping=tex-text]{Courier Prime}
\iffree
\newcommand{\DSLogoFont}{\fontspec[Scale=2]{Zepto}}
\else
\newcommand{\DSLogoFont}{\fontspec{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
2013-07-19 21:13:23 +02:00
\RequirePackage{scrpage2}
2013-07-20 00:27:27 +02:00
\RequirePackage{graphicx}
\RequirePackage{tikz}
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},%
pagebordercolor={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{
pdfauthor={Chaos Computer Club},
pdftitle={datenschleuder},
pdfsubject={wissenschaftliches fackblatt fuer datenreisende},
pdfkeywords={Ausgabe\@volume, Jahr\@year}
}
2013-07-21 23:37:02 +02:00
\RequirePackage{float}
\pgfdeclareimage[height=5mm]{Pesthoernchen}{pesthoernchen.pdf}
\pgfdeclareimage[width=10mm]{CCCLogo}{Logo_CCC}
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
\rehead[]{\tikz[overlay]{\node[xshift=0.3mm,yshift=0.9mm]{\pgfuseimage{CCCLogo}};}}
\rohead[]{\tikz[overlay]{\node[xshift=0.3mm,yshift=0.9mm]{\pgfuseimage{CCCLogo}};}}
2013-07-20 02:37:44 +02:00
\chead{\directlua{tex.print(ruhetmp or "Bitte runninghead setzen")}}
2013-07-19 21:13:23 +02:00
\setheadsepline{0.5pt}
\ifoot[]{Datenschleuder. \@volume / \@year}
2013-07-20 00:53:40 +02:00
\ofoot[]{\texttt{0x\ifthenelse{\value{page}>15}{}{0}\hexadecimal{page}}}
2013-07-19 21:13:23 +02:00
\setfootsepline{0.5pt}
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}
\hypertarget{AR\@title}{\textsf{\Huge\@title}}
\pdfbookmark[0]{\@title}{AR\@title}
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
2013-07-22 11:52:30 +02:00
\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}%
}{%
}
\newenvironment{question}{%
}{%
2013-07-23 02:29:26 +02:00
\par
2013-07-20 02:03:46 +02:00
}
\newenvironment{answer}{%
\itshape%
}{%
}
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*}
}