Skip to content
Snippets Groups Projects
ptbposter.cls 8.49 KiB
Newer Older
% Rolf Niepraschk, Rolf.Niepraschk@ptb.de

\errorcontextlines=100 %

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ptbposter}
    [2015/03/18 v0.2c PTB-Poster-Klasse (RN)]

\PassOptionsToPackage{paper=a0paper}{geometry}

\newdimen\PTB@topmargin
\newdimen\PTB@leftmargin
\newdimen\PTB@default@fsize \setlength\PTB@default@fsize{41pt}
\newdimen\PTB@textsep \setlength\PTB@textsep{.5\PTB@default@fsize}

\newcommand\PTB@tempa{}
\newcommand\PTB@tempb{}
\newcommand\PTB@tempc{}

\DeclareOption{portrait}{%
  \setlength\PTB@leftmargin{0.5\dimexpr 841mm-780mm}
  \setlength\PTB@topmargin{228mm}
  \edef\PTB@tempa{\noexpand\PassOptionsToPackage{portrait,
    textwidth=\the\dimexpr780mm-2\PTB@textsep,
    textheight=\the\dimexpr880mm-2\PTB@textsep,hcentering,
    top=\the\dimexpr\PTB@topmargin-\PTB@textsep}{geometry}}
  \PTB@tempa
}
\DeclareOption{landscape}{%
  \setlength\PTB@leftmargin{0.5\dimexpr 1189mm-1130mm}
  \setlength\PTB@topmargin{228mm}
  \edef\PTB@tempa{\noexpand\PassOptionsToPackage{landscape,
    textwidth=\the\dimexpr1130mm-2\PTB@textsep,
    textheight=\the\dimexpr550mm-2\PTB@textsep,hcentering,
    top=\the\dimexpr\PTB@topmargin-\PTB@textsep}{geometry}}
  \PTB@tempa
}

\DeclareOption{sanserif}{% TODO!
  %\AtBeginDocument{\renewcommand\familydefault{\sfdefault}}
}
\DeclareOption{serif}{% TODO!
  %\AtBeginDocument{\renewcommand\familydefault{\rmdefault}}
}

\newcommand*\scaleFontSizes[1]{%
  \@ovri=\PTB@default@fsize %
  \changefontsizes{#1\@ovri}%
}

%%%\PassOptionsToClass{fontsize=\the\PTB@default@fsize}{scrartcl}

\ExecuteOptions{portrait,ngerman,serif}
\ProcessOptions\relax
\LoadClass{scrartcl}

\scaleFontSizes{1}% Werte nahe 1 sind empfohlen.

\RequirePackage[columnsep=2.5em]{geometry}

\RequirePackage[svgnames]{xcolor}
\RequirePackage[newcommands,newparameters]{ragged2e}% ???
\RequirePackage{multicol,graphicx}
\RequirePackage[
,factor=1500
,protrusion=true
,expansion=true
,verbose=true
,final=true
,letterspace=100
,babel=true
]{microtype}

% TODO: Optionen serif/sanserif
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage{textcomp}
\RequirePackage{lmodern}
\RequirePackage{tgpagella,qpxmath}
\RequirePackage{tgheros}

\RequirePackage{babel}

\def\reserved@a{%
  \shorthandon{"}%
    \defineshorthand{"`}{\guillemotright}%
    \defineshorthand{"'}{\guillemotleft}%
  \shorthandoff{"}%
}

\iflanguage{ngerman}{\reserved@a}{%
  \iflanguage{german}{\reserved@a}{}%
}

\newcommand\PTB@qrcode{}
\newcommand\QRcode[1]{\gdef\PTB@qrcode{#1}}
\newcommand*\PTB@location{38116~Braunschweig}
\newcommand*\location[1]{\gdef\PTB@location{#1}}
\newcommand*\PTB@street{Bundesallee~100}
\newcommand*\street[1]{\gdef\PTB@street{#1}}
\newcommand*\PTB@workingGroup{Arbeitsgruppe}
\newcommand*\workingGroup[1]{\gdef\PTB@workingGroup{#1}}
\newcommand*\PTB@department{Fachbereich}
\newcommand*\department[1]{\gdef\PTB@department{#1}}
\newcommand*\PTB@phone{}
\newcommand*\phone[1]{\gdef\PTB@phone{#1}}
\newcommand*\PTB@email{}
\newcommand*\email[1]{\gdef\PTB@email{#1}}
\newcommand*\PTB@fax{}
\newcommand*\fax[1]{\gdef\PTB@fax{#1}}

\newcommand*\first@author{}

\definecolor{PTBcolor}{rgb}{0,0.67451,0.87451}

\RequirePackage[texcoord]{eso-pic}
\RequirePackage{pict2e,picture,ifdraft,qrcode,booktabs}

\AddToShipoutPictureBG*{% === Kopf ===
  \put(\PTB@leftmargin,-95.4mm){\includegraphics[width=477mm]{ptbposter-logo.pdf}}%
  \put(\PTB@leftmargin,-160mm){\sffamily\titleFontSize\@title}%
  \def\and{, }%
  \put(\PTB@leftmargin,-190mm){\sffamily\authorFontSize\@author}%
  % hier wird auch \@thanks gefüllt
  \put(\PTB@leftmargin,-105mm){%
    \linethickness{2mm}\color{PTBcolor}\line(1,0){\dimexpr\paperwidth-2\PTB@leftmargin}}
  \linethickness{2mm}
  \AtTextLowerLeft{%
    \color{PTBcolor}%
    \put(-\PTB@textsep,-\PTB@textsep){\framebox(\dimexpr\textwidth+2\PTB@textsep,
      \dimexpr\textheight+2\PTB@textsep){}}
  }%
\AddToShipoutPictureBG*{% === Fuß ===
  \AtTextLowerLeft{%
    \linethickness{.5mm}%
    \put(-.5\@wholewidth-\PTB@textsep,-57mm){%
      \raisebox{19mm}{\qrcode[height=47mm,tight]{\PTB@qrcode}}%
      \color{PTBcolor}%
      \hspace{2mm}\raisebox{-.5mm}{\rule{47mm}{47mm}}%
      \hspace{2mm}\framebox(46mm,46mm){}%
      %\circle*{1mm}%
      \color{black}%
      \hspace{3mm}\raisebox{40.5mm}{{\parbox[t][47mm]{155mm}{%
        \footFontSize\sffamily
        Physikalisch-Technische Bundesanstalt \\
        Braunschweig und Berlin \par\vspace{1em}
        \textbf{\first@author} \\
        \PTB@department \\
        \PTB@workingGroup
        %\rule{\linewidth}{5mm}%
      }}}%
      \hspace{12mm}\raisebox{40.5mm}{{\parbox[t][47mm]{125mm}{%
        \footFontSize\sffamily
        \begin{tabular}[t]{@{}ll@{}}
          \ifx\PTB@street\@empty\else\PTB@street\\ \fi
          \ifx\PTB@location\@empty\else\PTB@location\\ \fi
          \ifx\PTB@phone\@empty\else Telefon:&\PTB@phone\\ \fi
          \ifx\PTB@fax\@empty\else Fax:&\PTB@fax\\ \fi
          \ifx\PTB@email\@empty\else E-Mail:&\PTB@email\\ \fi
          www.ptb.de
        \end{tabular}%
        %\rule{\linewidth}{5mm}%
      }}}%
      \hspace{12mm}\raisebox{40.5mm}{{\parbox[t][47mm]{175mm}{%
        \footFontSize\sffamily
        \@thanks % wurde bei der Ausführung von \@autor gefüllt.
% ===== Behandlung der Autoren (siehe ptb-abstracts.sty ) =====

\def\@author{}
\newcommand\PTB@address{}

\renewcommand\footnotetext[2][]{%
  \textsuperscript{#1}#2\\
}

\newcommand\PTB@dec@footnotemark[1][]{%
  \addtocounter{footnote}{-1}%
  \begingroup
    \edef\@tempa{#1}%
    \ifx\@tempa\@empty\footnotemark\else\footnotemark[#1]\fi
  \endgroup
}

\newcommand\PTB@fnmark[1]{%
  \begingroup
    \unrestored@protected@xdef\@thefnmark{#1}%
  \endgroup
  %\show\@thefnmark
  \@footnotemark}

\newcommand\Author{%
  \begingroup
    \@ifstar{\@tempswatrue\@Author}{\@tempswafalse\@Author}}

\newcommand\@Author[2][]{%     \@tempa=[footnotemark],\@tempb={Firstname}
  \def\@tempa{#1}\def\@tempb{#2}%
  \@@Author}

\newcommand\@@Author[2][]{%    \@tempc=[alt. Firstname],\@tempd={Surname}
  \def\@tempc{#1}\def\@tempd{#2}%
  \@@@Author}

\newcommand\@@@Author[1][]{%   \@tempe=[Address]
    \def\@tempe{#1}%
    \ifx\@tempd\@empty
      % Empty Surname = Addition to the previous author
      \g@addto@macro\@author{\PTB@fnmark{,}}%
    \else
      \ifx\@author\@empty
        \xdef\@author{\@tempb~\@tempd}%
        \xdef\first@author{\@tempb~\@tempd}%
      \else
        \expandafter\g@addto@macro\expandafter\@author
          \expandafter{\expandafter\and\@tempb~}%
        \expandafter\g@addto@macro\expandafter\@author
          \expandafter{\@tempd}% I like it ;-(
      \fi
    \fi
    \if@tempswa
      %                --> \Author*
      \g@addto@macro\@author{\PTB@dec@footnotemark}%
    \fi
    \ifx\@tempa\@empty\else
      \expandafter\g@addto@macro\expandafter\@author
        \expandafter{\expandafter\PTB@fnmark\expandafter{\@tempa}}%
    \fi
    \ifx\@tempe\@empty\else
      \if@tempswa
        \g@addto@macro\@author{\PTB@fnmark{,}}%
      \fi
      \expandafter\g@addto@macro\expandafter\@author
        \expandafter{\expandafter\thanks\expandafter{\@tempe}}%
    \fi
  \endgroup
}

\let\PTB@thanks\thanks
\renewcommand\thanks[2][]{%
  \begingroup
    \def\@tempa{#2}%
    \ifx\@tempa\@empty
      \footnotemark[\value{footnote}]%
    \else
      \PTB@thanks{#2}%
    \fi
  \endgroup
}%

%% Werte auf 41pt bezogen
\edef\large{\noexpand\@setfontsize\noexpand\large
  {\the\dimexpr1.3\PTB@default@fsize}{\the\dimexpr1.56\PTB@default@fsize}}
%% vorher: 1.2 * \PTB@default@fsize / 1.2 * 1.2 * \PTB@default@fsize
\edef\Huge{\noexpand\@setfontsize\noexpand\Huge
  {\the\dimexpr2.6\PTB@default@fsize}{\the\dimexpr3.12\PTB@default@fsize}}
%% vorher: 2.49 * \PTB@default@fsize / 2.49 * 1.2 * \PTB@default@fsize
\edef\tiny{\noexpand\@setfontsize\noexpand\tiny
  {\the\dimexpr0.47\PTB@default@fsize}{\the\dimexpr0.564\PTB@default@fsize}}
%% vorher: 0.5 * \PTB@default@fsize / 0.5 * 1.2 * \PTB@default@fsize
\fi

\edef\titleFontSize{\noexpand\@setfontsize\noexpand\titleFontSize{106.6}{127.92}}
\edef\authorFontSize{\noexpand\@setfontsize\noexpand\authorFontSize{53.3}{63.96}}
\edef\footFontSize{\noexpand\@setfontsize\noexpand\footFontSize{19.27}{23.124}}

\renewcommand*\labelitemi{$\m@th\circ$}
\renewcommand*\labelitemii{$\m@th\triangleright$}
\renewcommand*\labelitemiii{$\m@th\diamond$}
\renewcommand*\labelitemiv{\makebox[.5em]{\scalebox{1.5}{\textbullet}}}
\setlength\leftmargini{1.5em}
\setlength\leftmarginii{1.4em}
\setlength\leftmarginiii{1.3em}
\setlength\leftmarginiv{1.2em}

\setcounter{secnumdepth}{-2}
\renewcommand*\maketitle[1][1]{}
\renewcommand*\tableofcontents{}
\pagestyle{empty}

\endinput