%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This package defines a TU/e style. % It is written by Marko Boon (marko@win.tue.nl) % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version: 1.0 % % Version history and Modifications: % % Version 1.0 (19-06-2002) % % Creation of tuestyle.sty % Commands: % \hidetocdots - use this command before \tableofcontents % It will hide the dots between % section title and page number % \showtocdots - shows table of contents dots (default) % % \tuerulewidth - a length (default: 0.2mm). % The width of the TU/e rule. % % \pageheaders - puts page titles and/or images on the left and/or % right side of the TU/e rule. Use the commands below % to specify only one title or image. The header will be % removed after one page % (not completely bug free yet... always check!!!) % % \pagetitleleft - puts a page title on the left side of the TU/e rule. % \pagetitleright - puts a page title on the right side of the TU/e rule. % \pagetitle - calls \pagetitleleft on even pages, % and \pagetitleright on odd pages. % \pageimageleft, % \pageimageright, - the same as pagetitle, but puts an image on the rule % \pageimage % % \pagetuelogo - puts a TU/e logo on the left side of the TU/e rule. % % \permanentpageheaders, \permanentpagetitleleft, \permanentpagetitleright, % \permanentpagetitle, \permanentpageimageleft, \permanentpageimageright, % \permanentpageimage, \permanentpagetuelogo % - these commands are the same, but the page header will stay until the user % sets another page header. % - all these commands also have an odd and an even version, e.g. \permanentoddpageheaders % that make sure only on odd (or even) pages these headers will be shown. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} \def\fileversion{v.1.0}\def\filedate{2002/06/19} \ProvidesPackage{tuestyle} [\filedate\space\fileversion\space TU/e style] \RequirePackage[T1]{fontenc} \RequirePackage{fancyhdr,afterpage,graphicx,ifthen} %%% % TU/e fonts %%% \renewcommand{\sfdefault}{phv} \renewcommand{\rmdefault}{zsc} \renewcommand{\ttdefault}{pcr} % % SansSerif fonts in sections, subsections and subsubsections % \renewcommand\section{\@startsection {section}{1}{\z@}% {-3.5ex \@plus -1ex \@minus -.2ex}% {2.3ex \@plus.2ex}% {\normalfont\Large\sf}} \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% {\normalfont\large\sf}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-3.25ex\@plus -1ex \@minus -.2ex}% {1.5ex \@plus .2ex}% {\normalfont\normalsize\sf}} % % Moving the 'Table of Contents' title above the TU/e line % SansSerif font % \renewcommand\tableofcontents{% \pagetitleleft{\contentsname \@mkboth{% \MakeUppercase\contentsname}{\MakeUppercase\contentsname}} \sffamily \if@twocolumn \@restonecoltrue\onecolumn \else \@restonecolfalse \fi \@starttoc{toc}% \if@restonecol\twocolumn\fi \rmfamily } \newif\if@showtocdots \@showtocdotstrue % % Enables you to show or hide the Table of Contents dots. % Call this command BEFORE you call \tableofcontents % \newcommand{\hidetocdots}{\@showtocdotsfalse} \newcommand{\showtocdots}{\@showtocdotstrue} \renewcommand{\@dottedtocline}[5]{% \ifnum #1>\c@tocdepth \else \vskip \z@ \@plus.2\p@ {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip \parindent #2\relax\@afterindenttrue \interlinepenalty\@M \leavevmode \@tempdima #3\relax \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip {#4}\nobreak \leaders\hbox{ \if@showtocdots $\m@th \mkern \@dotsep mu\hbox{.}\mkern \@dotsep mu$ \fi } \hfill \nobreak \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}% \par}% \fi} % % Some lengths that are needed for the page title % \newlength{\translationleft} \setlength{\translationleft}{1in} \addtolength{\translationleft}{\hoffset} \renewcommand{\headrulewidth}{0pt} \newlength{\headerheight} \setlength{\headerheight}{0.8cm} \newlength{\tuerulewidth} \setlength{\tuerulewidth}{0.2mm} \newlength{\imgheight} \setlength{\imgheight}{1in} \addtolength{\imgheight}{\headerheight} \newlength{\rightboxwidth} % % The commands below put text or an image on the TU/e rule % on top of the page. You can put it at the left or the right side. % It is allowed to put more than just one title or image, just % remember that they will be put in this order: % pagetitleleft, pageimageleft, pagetitleright, pageimageright % % 4 shortcuts are created in case you want only 1 image or title. % So use \pageheaders if you want more than just 1 image or 1 title, % and use \pageimageleft, \pageimageright, \pagetitleleft or % \pagetitleright if you want only 1 title or image. % % The parameter for titles is a line of text that will appear in % the page header. % The parameter for images is the file name of the image % WITHOUT the extension!!! LaTeX will choose the EPS file, % PDFLaTeX will choose the PDF file. Use epstopdf to convert % EPS files to PDF files % \newcommand{\pageheaders}[4]{ %% for odd pages \renewcommand{\theoddpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showoddimageleftfalse}{\@showoddimagelefttrue\renewcommand{\theoddpageimageleft}{#2}} \renewcommand{\theoddpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showoddimagerightfalse}{\@showoddimagerighttrue\renewcommand{\theoddpageimageright}{#4}} %% for even pages \renewcommand{\theevenpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showevenimageleftfalse}{\@showevenimagelefttrue\renewcommand{\theevenpageimageleft}{#2}} \renewcommand{\theevenpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showevenimagerightfalse}{\@showevenimagerighttrue\renewcommand{\theevenpageimageright}{#4}} %% \createheader } \newcommand{\pageimageleft}[1]{ \pageheaders{}{#1}{}{} } \newcommand{\pageimageright}[1]{ \pageheaders{}{}{}{#1} } \newcommand{\pagetitleleft}[1]{ \pageheaders{#1}{}{}{} } \newcommand{\pagetitleright}[1]{ \pageheaders{}{}{#1}{} } % % These two commands are the same, but create permanent headers % that will stay until they are overruled by the user. % \newcommand{\permanentpageheaders}[4]{ %% odd pages \renewcommand{\theoddpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showoddimageleftfalse}{\@showoddimagelefttrue\renewcommand{\theoddpageimageleft}{#2}} \renewcommand{\theoddpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showoddimagerightfalse}{\@showoddimagerighttrue\renewcommand{\theoddpageimageright}{#4}} %% even pages \renewcommand{\theevenpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showevenimageleftfalse}{\@showevenimagelefttrue\renewcommand{\theevenpageimageleft}{#2}} \renewcommand{\theevenpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showevenimagerightfalse}{\@showevenimagerighttrue\renewcommand{\theevenpageimageright}{#4}} %% \createpermanentheader } \newcommand{\permanentoddpageheaders}[4]{ %% odd pages \renewcommand{\theoddpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showoddimageleftfalse}{\@showoddimagelefttrue\renewcommand{\theoddpageimageleft}{#2}} \renewcommand{\theoddpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showoddimagerightfalse}{\@showoddimagerighttrue\renewcommand{\theoddpageimageright}{#4}} %% \createpermanentoddheader } \newcommand{\permanentevenpageheaders}[4]{ %% even pages \renewcommand{\theevenpagetitleleft}{#1} \ifthenelse{\equal{#2}{}}{\@showevenimageleftfalse}{\@showevenimagelefttrue\renewcommand{\theevenpageimageleft}{#2}} \renewcommand{\theevenpagetitleright}{#3} \ifthenelse{\equal{#4}{}}{\@showevenimagerightfalse}{\@showevenimagerighttrue\renewcommand{\theevenpageimageright}{#4}} %% \createpermanentevenheader } \newcommand{\permanentpageimageleft}[1]{ \permanentpageheaders{}{#1}{}{} } \newcommand{\permanentpageimageright}[1]{ \permanentpageheaders{}{}{}{#1} } \newcommand{\permanentpagetitleleft}[1]{ \permanentpageheaders{#1}{}{}{} } \newcommand{\permanentpagetitleright}[1]{ \permanentpageheaders{}{}{#1}{} } %% odd \newcommand{\permanentoddpageimageleft}[1]{ \permanentoddpageheaders{}{#1}{}{} } \newcommand{\permanentoddpageimageright}[1]{ \permanentoddpageheaders{}{}{}{#1} } \newcommand{\permanentoddpagetitleleft}[1]{ \permanentoddpageheaders{#1}{}{}{} } \newcommand{\permanentoddpagetitleright}[1]{ \permanentoddpageheaders{}{}{#1}{} } %% even \newcommand{\permanentevenpageimageleft}[1]{ \permanentevenpageheaders{}{#1}{}{} } \newcommand{\permanentevenpageimageright}[1]{ \permanentevenpageheaders{}{}{}{#1} } \newcommand{\permanentevenpagetitleleft}[1]{ \permanentevenpageheaders{#1}{}{}{} } \newcommand{\permanentevenpagetitleright}[1]{ \permanentevenpageheaders{}{}{#1}{} } % % These two commands check whether the page number is odd or even. % If it is odd, the image or title will be put on the right side. % It will be put on the left side otherwise. % \newcommand{\pagetitle}[1]{ \if@twoside \ifthenelse{\isodd{\thepage}}{\pagetitleright{#1}}{\pagetitleleft{#1}} \else \pagetitleleft{#1} \fi } \newcommand{\pageimage}[1]{ \if@twoside \ifthenelse{\isodd{\thepage}}{\pageimageright{#1}}{\pageimageleft{#1}} \else \pageimageleft{#1} \fi } % % These two commands are the same, but create permanent headers % that will stay until they are overruled by the user. % \newcommand{\permanentpagetitle}[1]{ \if@twoside \permanentoddpagetitleright{#1} \permanentevenpagetitleleft{#1} \else \permanentpagetitleleft{#1} \fi } \newcommand{\permanentpageimage}[1]{ \if@twoside \permanentoddpageimageright{#1} \permanentevenpageimageleft{#1} \else \permanentpageimageleft{#1} \fi } %% odd \newcommand{\permanentoddpagetitle}[1]{ \if@twoside \permanentoddpagetitleright{#1} \else \permanentpagetitleleft{#1} \fi } \newcommand{\permanentoddpageimage}[1]{ \if@twoside \permanentoddpageimageright{#1} \else \permanentpageimageleft{#1} \fi } %% even \newcommand{\permanentevenpagetitle}[1]{ \if@twoside \permanentevenpagetitleleft{#1} \else \permanentpagetitleleft{#1} \fi } \newcommand{\permanentevenpageimage}[1]{ \if@twoside \permanentevenpageimageleft{#1} \else \permanentpageimageleft{#1} \fi } \newcommand{\theoddpagetitleleft}{} \newcommand{\theoddpagetitleright}{} \newcommand{\theoddpageimageleft}{} \newcommand{\theoddpageimageright}{} \newcommand{\theevenpagetitleleft}{} \newcommand{\theevenpagetitleright}{} \newcommand{\theevenpageimageleft}{} \newcommand{\theevenpageimageright}{} \newif\if@showoddimageleft \@showoddimageleftfalse \newif\if@showoddimageright \@showoddimagerightfalse \newif\if@showevenimageleft \@showevenimageleftfalse \newif\if@showevenimageright \@showevenimagerightfalse % % Creates the header. You probably don't want to use this command, % but use \pagetitleleft, \pagetitleright, \pageimageleft or \pageimageright. % \newcommand{\createheader}{ \fancyhead[OL] { \addtolength{\translationleft}{\oddsidemargin} \headertextandimages } \fancyhead[EL] { \addtolength{\translationleft}{\evensidemargin} \headertextandimages } \afterpage{ % Change the page header back after the page \@showoddimageleftfalse \@showoddimagerightfalse \@showevenimageleftfalse \@showevenimagerightfalse \renewcommand{\theoddpagetitleleft}{} \renewcommand{\theoddpagetitleright}{} \renewcommand{\theevenpagetitleleft}{} \renewcommand{\theevenpagetitleright}{} \fancyhead[OL]{ \addtolength{\translationleft}{\oddsidemargin} \makebox[0cm][l]{\hspace{-\translationleft}\rule{\paperwidth}{\tuerulewidth}} \hfill\rule{0cm}{\headerheight} } \fancyhead[EL]{ \addtolength{\translationleft}{\evensidemargin} \makebox[0cm][l]{\hspace{-\translationleft}\rule{\paperwidth}{\tuerulewidth}} \hfill\rule{0cm}{\headerheight} } } } \newcommand{\createpermanentheader}{ \createpermanentoddheader \createpermanentevenheader } \newcommand{\createpermanentoddheader}{ \fancyhead[OL] { \addtolength{\translationleft}{\oddsidemargin} \oddheadertextandimages } } \newcommand{\createpermanentevenheader}{ \fancyhead[EL] { \addtolength{\translationleft}{\evensidemargin} \evenheadertextandimages } } \newcommand{\headertextandimages}{ %% if everythink is ok, it would not matter which one to call: odd or even %% Images and titles should be the same. \oddheadertextandimages } \newcommand{\oddheadertextandimages}{ \makebox[0cm][l]{\hspace{-\translationleft}\rule{\paperwidth}{\tuerulewidth}} \rule{0cm}{\headerheight} \hspace{-2mm} \sf\Large \theoddpagetitleleft \hspace{-3mm} \setlength{\unitlength}{\textwidth} \if@showoddimageleft \begin{picture}(0,0)(0,0) \put(0,0){\includegraphics[height=\imgheight]{\theoddpageimageleft}} \end{picture} \fi \hfill \begin{picture}(0,0)(0,0) \setlength{\rightboxwidth}{0mm}% \if@showoddimageright% \setlength{\rightboxwidth}{1mm}% \fi% \put(0,0){ \makebox[\rightboxwidth][r]{ \theoddpagetitleright \if@showoddimageright \includegraphics[height=\imgheight]{\theoddpageimageright} \fi } } \end{picture} } \newcommand{\evenheadertextandimages}{ \makebox[0cm][l]{\hspace{-\translationleft}\rule{\paperwidth}{\tuerulewidth}} \rule{0cm}{\headerheight} \hspace{-2mm} \sf\Large \theevenpagetitleleft \hspace{-3mm} \setlength{\unitlength}{\textwidth} \if@showevenimageleft \begin{picture}(0,0)(0,0) \put(0,0){\includegraphics[height=\imgheight]{\theevenpageimageleft}} \end{picture} \fi \hfill \begin{picture}(0,0)(0,0) \setlength{\rightboxwidth}{0mm}% \if@showevenimageright% \setlength{\rightboxwidth}{1mm}% \fi% \put(0,0){ \makebox[\rightboxwidth][r]{ \theevenpagetitleright \if@showevenimageright \includegraphics[height=\imgheight]{\theevenpageimageright} \fi } } \end{picture} } % % New command: \pagetuelogo % This will put the TU/e logo on the TU/e line, for 1 page only. % \newcommand{\pagetuelogo}{ \thispagestyle{fancy} \pagetitleleft{\fontfamily{zlo}\fontsize{11}{9.5pt}\selectfont12} } \newcommand{\permanentpagetuelogo}{ \thispagestyle{fancy} \permanentpagetitleleft{\fontfamily{zlo}\fontsize{11}{9.5pt}\selectfont12} } % % Put the page numbering on the side of the page % \pagestyle{fancy} \fancyhf{} \fancyfoot[RO,LE]{\thepage} %\pagetitle{}{} \pageheaders{}{}{}{} \endinput