I've designed a poster layout that will most likely be used again, so I decided to define a new document class using all the settings from my preamble. However, when I compile a document using my newly defined class, the page layout is not identical to the original. I am not a LaTeX beginner, however this is my first time making a document class. I've been stumped on this one for hours.
Original tex:
\documentclass{article}
% main packages
\usepackage{fancyhdr}
% core layout
\usepackage[paperwidth=48in,paperheight=36in,textwidth=112cm,
top=15cm,head=11cm,foot=2cm,bottom=6cm,hcentering]{geometry}
\pagenumbering{gobble}
% resize fonts and symbols
\usepackage{mathpazo}
\usepackage{textcomp}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\huge}{\fontsize{100pt}{120pt}\selectfont}
\renewcommand{\Large}{\fontsize{64pt}{72pt}\selectfont}
\renewcommand{\normalsize}{\fontsize{36pt}{44pt}\selectfont}
% header
\newcommand{\header}[2]{\fancyhead[C]{\begin{center}
\begin{sf}
{\textbf{{\huge {#1}}}}\\[1cm]
{\Large {#2}}\\[0.5cm]
{\Large UWEC}
\end{sf}
\end{center}}}
% footer
\newcommand{\footer}[2]{
\fancyfoot[L]{\vspace{1pt}\normalsize {#1}}
\fancyfoot[R]{\vspace{1pt}\normalsize {#2}}}
\renewcommand{\footrulewidth}{2pt}
\begin{document}
\header{title}{author}
\footer{advisor}{special thanks to...}
\pagestyle{fancy}
testing
testing
\end{document}
Which results in:
New document class:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{testclass}
\LoadClass{article}
% main packages
\usepackage{fancyhdr}
% core layout
\usepackage[paperwidth=48in,paperheight=36in,textwidth=112cm,
top=15cm,head=11cm,foot=2cm,bottom=6cm,hcentering]{geometry}
\pagenumbering{gobble}
% resize fonts and symbols
\usepackage{mathpazo}
\usepackage{textcomp}
\usepackage[scaled=0.95]{helvet}
\renewcommand{\huge}{\fontsize{100pt}{120pt}\selectfont}
\renewcommand{\Large}{\fontsize{64pt}{72pt}\selectfont}
\renewcommand{\normalsize}{\fontsize{36pt}{44pt}\selectfont}
% header
\newcommand{\header}[2]{\fancyhead[C]{\begin{center}
\begin{sf}
{\textbf{{\huge {#1}}}}\\[1cm]
{\Large {#2}}\\[0.5cm]
{\Large UWEC}
\end{sf}
\end{center}}}
% footer
\newcommand{\footer}[2]{
\fancyfoot[L]{\vspace{1pt}\normalsize {#1}}
\fancyfoot[R]{\vspace{1pt}\normalsize {#2}}}
\renewcommand{\footrulewidth}{2pt}
\endinput
and new tex:
\documentclass{testclass}
\begin{document}
\header{title}{author}
\footer{advisor}{special thanks to...}
\pagestyle{fancy}
testing
testing
\end{document}
that results in:
The preamble in example one is identical to the class description in example two, so why is there this spacing difference? Getting pretty frustrated. Thanks in advance.
Alright, so I discovered a workaround, but it makes no sense to me why it makes a difference and defeats the purpose of defining a new class.
If I include the line:
\renewcommand{\normalsize}{\fontsize{36pt}{44pt}\selectfont}
in the document preamble and not the .cls, the layout is identical as it should be.


fancyhdraboutheadheight, but only in the 'own class' case.) – Joseph Wright Jan 07 '15 at 13:10head=10cmthe otherhead=11cm. – Johannes_B Jan 07 '15 at 15:01\AtBeginDocument{...}in the.clsfile so that the code is not triggered in the class itself. What is\begin{sf}...\end{sf}supposed to do? If you mean to switch to sans, you need\sffamily.\sfis deprecated more than 20 years ago and it never was an environment. These are switches - effective until the end of the group.{\sffamily sans text} and serif. – cfr Jan 07 '15 at 21:26\AtBeginDocument{...}in the.clsfile. Kind of confused as to why exactly (I'm looking at several example classes that do not use\AtBeginDocument{...}for the exact same font sizing commands I use). Also thank you for correcting my usage of\sf. – magyar Jan 07 '15 at 22:00