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

\setcounter{errorcontextlines}{100}

\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesClass{ptbposter}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
    [2015/03/19 v0.2e PTB-Poster-Klasse (RN)]

\PassOptionsToPackage{paper=a0paper}{geometry}

\newdimen\PTB@topmargin
\newdimen\PTB@leftmargin
\newdimen\PTB@default@fsize
\newdimen\PTB@textsep

\setlength\PTB@default@fsize{41pt}
\setlength\PTB@topmargin{230mm}
\setlength\PTB@textsep{.5\PTB@default@fsize}

\newcommand\PTB@tempa{}
\newcommand\PTB@tempb{}
\newcommand\PTB@tempc{}
\newcommand\PTB@tempd{}
\newcommand\PTB@tempe{}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\let\PTB@tempdima=\@ovxx
\let\PTB@tempdimb=\@ovyy

\DeclareOption{portrait}{%
  \setlength\PTB@leftmargin{0.5\dimexpr 841mm-780mm}
  \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}
  \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
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\DeclareOption{sanserif}{% noch experimentell! Besser: luaTeX/xeTeX + OTF
  \AtEndOfClass{%
    \renewcommand\familydefault{\sfdefault}
    \RequirePackage{sfmath}
  }
\DeclareOption{serif}{%
  \AtEndOfClass{%
    \renewcommand\familydefault{\rmdefault}
  }
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}

%%%\PassOptionsToClass{fontsize=\the\PTB@default@fsize}{scrartcl}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\ExecuteOptions{portrait,serif}
\ProcessOptions\relax
\RequirePackage{hyphsubst}% Trennregeln austauschen
\HyphSubstIfExists{ngerman-x-latest}{%
  \HyphSubstLet{ngerman}{ngerman-x-latest}}{}
\HyphSubstIfExists{german-x-latest}{%
  \HyphSubstLet{german}{german-x-latest}}{}

Rolf Niepraschk's avatar
Rolf Niepraschk committed
\RequirePackage{etoolbox}
\preto\@classoptionslist{ngerman,}
% Ohne Sprachangabe "deutsch" verwenden. Bessere Lösung?

% TODO: Auf OTF-Fonts wechseln (XeLaTeX / LuaLaTeX)
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\RequirePackage{textcomp}
\RequirePackage{lmodern}
\RequirePackage{tgpagella,qpxmath}
\RequirePackage{tgheros}

\LoadClass[%
,parskip=half
]{scrartcl}
\newcommand*\scaleFontSizes[1]{%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  \PTB@tempdima=\PTB@default@fsize %
  \changefontsizes{#1\PTB@tempdima}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\scaleFontSizes{1}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\RequirePackage[columnsep=2em]{geometry}

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

\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}

\RequirePackage{babel}

Rolf Niepraschk's avatar
Rolf Niepraschk committed
\AtEndOfClass{%
  \shorthandon{"}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  \@tempswafalse
  \iflanguage{ngerman}{\@tempswatrue}{%
    \iflanguage{german}{\@tempswatrue}{}%
  }
  \if@tempswa
    \defineshorthand{"`}{\guillemotright}%
    \defineshorthand{"'}{\guillemotleft}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  \fi
  \RequirePackage[final,pdfpagelabels=false,%
    plainpages=false,hypertexnames=true,hyperfootnotes=false]{hyperref}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\RequirePackage
  [autostyle=true,babel=once,german=guillemets,maxlevel=3]{csquotes}%
\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}}

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

\RequirePackage[texcoord]{eso-pic}
\RequirePackage{pict2e,picture,ifdraft,booktabs}
\RequirePackage{qrcode}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\AddToShipoutPictureBG*{% Kopf (relativ zur oberen Blattkante)
  \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}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  % hier wird \@thanks gefüllt
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  \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){}}
  }%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\AddToShipoutPictureBG*{% Fuß (relativ zur unteren Kante des Textbereichs)
  \AtTextLowerLeft{%
    \linethickness{.5mm}%
    \put(-.5\@wholewidth-\PTB@textsep,-57mm){%
      \ifx\PTB@qrcode\@empty
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        \color{PTBcolor}\framebox(46mm,46mm){}%
      \else
        \raisebox{19mm}{\qrcode[height=47mm,tight]{\PTB@qrcode}}%
      \fi
Rolf Niepraschk's avatar
Rolf Niepraschk committed
      \color{PTBcolor}
      \hspace{2mm}\raisebox{-.5mm}{\rule{47mm}{47mm}}%
      \hspace{2mm}\framebox(46mm,46mm){}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
    }
    \footFontSize\sffamily\color{black}%
    \put(140mm,-17mm){%
      \begin{tabular}[t]{@{}l@{}}
        Physikalisch-Technische Bundesanstalt \\
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        Braunschweig und Berlin \\[\f@baselineskip]
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        \ifx\first@author\@empty\else \textbf{\first@author}\\\fi
        \ifx\PTB@department\@empty\else \PTB@department\\\fi
        \ifx\PTB@workingGroup\@empty\else \PTB@workingGroup\\\fi
Rolf Niepraschk's avatar
Rolf Niepraschk committed
      \end{tabular}%
    }
    \put(307mm,-17mm){%
      \begin{tabular}[t]{@{}ll@{}}
        \ifx\PTB@street\@empty\else\multicolumn{2}{@{}l@{}}{\PTB@street}\\\fi
        \ifx\PTB@location\@empty\else\multicolumn{2}{@{}l@{}}{\PTB@location}\\\fi
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        \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:&\href{mailto:\PTB@email}{\PTB@email}\\\fi
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        \multicolumn{2}{@{}l@{}}{www.ptb.de}
      \end{tabular}%
    }
    \put(444mm,-17mm){%
      \begin{tabular}[t]{@{}l@{}}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
        \@thanks % wurde bei der Ausführung von \@author gefüllt.
Rolf Niepraschk's avatar
Rolf Niepraschk committed
      \end{tabular}%
% ===== Behandlung der Autoren (siehe ptb-abstracts.sty ) =====

\newcommand*\first@author{}
\def\author#1{}
\def\@author{}

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

\newcommand\PTB@dec@footnotemark[1][]{%
  \addtocounter{footnote}{-1}%
  \begingroup
    \edef\PTB@tempa{#1}%
    \ifx\PTB@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][]{%     \PTB@tempa=[footnotemark],\PTB@tempb={Firstname}
  \def\PTB@tempa{#1}\def\PTB@tempb{#2}%
\newcommand\@@Author[2][]{%    \PTB@tempc=[alt. Firstname],\PTB@tempd={Surname}
  \def\PTB@tempc{#1}\def\PTB@tempd{#2}%
\newcommand\@@@Author[1][]{%   \PTB@tempe=[Address]
    \def\PTB@tempe{#1}%
    \ifx\PTB@tempd\@empty
      % Empty Surname = Addition to the previous author
      \g@addto@macro\@author{\PTB@fnmark{,}}%
    \else
      \ifx\@author\@empty
        \xdef\@author{\PTB@tempb~\PTB@tempd}%
        \xdef\first@author{\PTB@tempb~\PTB@tempd}%
      \else
        \expandafter\g@addto@macro\expandafter\@author
          \expandafter{\expandafter\and\PTB@tempb~}%
        \expandafter\g@addto@macro\expandafter\@author
          \expandafter{\PTB@tempd}% I like it ;-(
      \fi
    \fi
    \if@tempswa
      %                --> \Author*
      \g@addto@macro\@author{\PTB@dec@footnotemark}%
    \fi
    \ifx\PTB@tempa\@empty\else
      \expandafter\g@addto@macro\expandafter\@author
        \expandafter{\expandafter\PTB@fnmark\expandafter{\PTB@tempa}}%
    \ifx\PTB@tempe\@empty\else
      \if@tempswa
        \g@addto@macro\@author{\PTB@fnmark{,}}%
      \fi
      \expandafter\g@addto@macro\expandafter\@author
        \expandafter{\expandafter\thanks\expandafter{\PTB@tempe}}%
    \fi
  \endgroup
}

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

\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

\newcommand*\authorFontSize{}
\newcommand*\footFontSize{}
\newcommand*\titleFontSize{}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\def\authorFontSize{\@setfontsize\authorFontSize{53.3}{63.96}}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\def\footFontSize{\@setfontsize\footFontSize{19.2}{23.04}}
\newcommand*\scaleTitleFontSize[1]{%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  \PTB@tempdima=106.6pt %
  \PTB@tempdima=#1\PTB@tempdima
  \PTB@tempdimb=1.2\PTB@tempdima
  \xdef\titleFontSize{\noexpand\@setfontsize\noexpand{}
    \titleFontSize{\the\PTB@tempdima}{\the\PTB@tempdimb}}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
\scaleTitleFontSize{1}
\renewcommand*\labelitemi{$\m@th\circ$}
\renewcommand*\labelitemii{$\m@th\triangleright$}
\renewcommand*\labelitemiii{$\m@th\diamond$}
Rolf Niepraschk's avatar
Rolf Niepraschk committed
%\renewcommand*\labelitemiv{\makebox[.5em]{\scalebox{1.5}{\textbullet}}}%
\renewcommand*\labelitemiv{\textbullet}%
\setlength\leftmargini{1.5em}
\setlength\leftmarginii{1.4em}
\setlength\leftmarginiii{1.3em}
\setlength\leftmarginiv{1.2em}
\renewcommand\section{\@startsection{section}{1}{\z@}%
  {-1.5ex \@plus -.5ex \@minus -.2ex}%
Rolf Niepraschk's avatar
Rolf Niepraschk committed
  {.8ex \@plus .2ex}%
  {\raggedsection\normalfont\sectfont\size@section}%
}

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

\endinput