aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2014-12-29 15:14:27 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2014-12-29 15:14:27 -0500
commit61a1af4c7d1ee798a6f148a4828e67af11196e06 (patch)
treecfc874c140d3dd2503364d40cd78b18a082318c9
parent362991042427deb9f6143686548416993fc16482 (diff)
downloadwmletterhead-61a1af4c7d1ee798a6f148a4828e67af11196e06.tar.gz
wmletterhead-61a1af4c7d1ee798a6f148a4828e67af11196e06.zip
proper switch of page layouts
-rw-r--r--wmletterhead.cls92
1 files 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