From 61a1af4c7d1ee798a6f148a4828e67af11196e06 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Mon, 29 Dec 2014 15:14:27 -0500 Subject: proper switch of page layouts --- wmletterhead.cls | 92 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 69 insertions(+), 23 deletions(-) diff --git a/wmletterhead.cls b/wmletterhead.cls index 4ac2d7b..0323dc4 100644 --- a/wmletterhead.cls +++ b/wmletterhead.cls @@ -15,6 +15,13 @@ % Recomended use: % \documentclass[12pt,fullcolor]{wmletterhead} +\RequirePackage{xcolor} +\RequirePackage{ifthen} + +% -------------------------------------------------- +% Tagline color since December 2014 +\definecolor{WMgold}{rgb}{0.73,0.59,0.36} + % -------------------------------------------------- % New length to be used for WM specific things @@ -34,37 +41,99 @@ % internal use sizes to lineup logo and from (W&M) address \newlength{\wmaddressheight} % to be calculated at the opening +% -------------------------------------------------- +% set page layout for one-line template +\newcommand*{\setonelinelayout}[1]{ + % first parameter intended to be used for layout switch + \def\@layout{#1}% + + % -------------------------------------------------- + % logo related settings + \setlength{\wmlogoheight}{0.65in} + \setlength{\wmlogoWhpos}{0in}% same as above + \setlength{\wmlogoWvpos}{0in}% same as above + + % default page layout parameters + \setlength{\wmlogoseparation}{0.5in} % header text from main text separation + \setlength{\wmleftmargin}{1.0in} + \setlength{\wmrightmargin}{1.0in} + \setlength{\wmbottommargin}{1.0in} % guessed + \setlength{\wmtopmargin}{1.0in} + + \colorlet{wmtaglinecolor}{black} + + % -------------------------------------------------- + % Now let's define/modify a particular layout + % esssentially this programs a 'switch' construct + \ifthenelse{\equal{\@layout}{prior2014dec}}{ + %use defaults + }{ + % nothing to do in the else case + } + \ifthenelse{\equal{\@layout}{2014}}{ + % below are measured in the Word template + \setlength{\wmlogoheight}{0.65in} + \setlength{\wmlogoWhpos}{0.82in}% same as above + \setlength{\wmlogoWvpos}{.15in}% same as above + + % -------------------------------------------------- + % Required by WM + \setlength{\wmlogoseparation}{0.5in} % header text from main text separation + \setlength{\wmleftmargin}{1.64in} + \setlength{\wmrightmargin}{1.0in} + \setlength{\wmbottommargin}{1.0in} % guessed + \setlength{\wmtopmargin}{1.0in} + + \colorlet{wmtaglinecolor}{WMgold} + }{ + % nothing to do in the else case + } +} + +\setonelinelayout{default} % set page layout defaults + %-------------- define WM header logo file --------------------------------- \providecommand{\wmheaderlogo}{}% nologo +% this is prior December 2014 logo with Wren building +\DeclareOption{nologo}{% + \renewcommand{\wmheaderlogo}{}% nologo + \setonelinelayout{default}% +} + % this is prior December 2014 logo with Wren building \DeclareOption{prior2014dec}{% \renewcommand{\wmheaderlogo}% {wmlogos/wmheader2012}% + \setonelinelayout{prior2014dec}% } % full colored logo starting from December 2014 \DeclareOption{fullcolor}{% \renewcommand{\wmheaderlogo}% {wmlogos/wm_horizontal_single_line_full_color}% + \setonelinelayout{2014}% } % green logo starting from December 2014 \DeclareOption{green}{% \renewcommand{\wmheaderlogo}% {wmlogos/wm_horizontal_single_line_green}% + \setonelinelayout{2014}% } % black logo starting from December 2014 \DeclareOption{black}{% \renewcommand{\wmheaderlogo}% {wmlogos/wm_horizontal_single_line_black}% + \setonelinelayout{2014}% } % black logo starting from December 2014 \DeclareOption{white}{% \renewcommand{\wmheaderlogo}% {wmlogos/wm_horizontal_single_line_white}% + \setonelinelayout{2014}% } %-------------- end of define WM header logo file ------------------------------ @@ -81,7 +150,6 @@ \RequirePackage{graphicx} \RequirePackage{geometry} % easy page layout manipulation \RequirePackage{fancyhdr} % Headers ! -\RequirePackage{xcolor} \colorlet{wmtaglinecolor}{black} @@ -90,28 +158,6 @@ % Change the letter class default for signature indent \setlength{\longindentation}{0pt} % this is indent of signature -\newcommand*{\setonelinelayout}[1]{ - % first parameter intended to be used for template year - % -------------------------------------------------- - - % below are measured in the Word template - \setlength{\wmlogoheight}{0.65in} - \setlength{\wmlogoWhpos}{0.82in}% same as above - \setlength{\wmlogoWvpos}{.15in}% same as above - - % -------------------------------------------------- - % Required by WM - \setlength{\wmlogoseparation}{0.5in} % header text from main text separation - \setlength{\wmleftmargin}{1.64in} - \setlength{\wmrightmargin}{1.0in} - \setlength{\wmbottommargin}{1.0in} % guessed - \setlength{\wmtopmargin}{1.0in} - - \definecolor{WMgold}{rgb}{0.73,0.59,0.36} - \colorlet{wmtaglinecolor}{WMgold} -} - -\setonelinelayout{2014} % -------------------------------------------------- % Let's calculate/set page layout -- cgit v1.2.3