From c0e54eff768ee33f7a0c65528e4f9da22abbdaef Mon Sep 17 00:00:00 2001 From: Daniil Belyakov Date: Sun, 18 Jun 2017 16:18:47 +0200 Subject: [PATCH] Version 1.2.0: add custom mac-friendly spacings (in fact, hack for A4) --- mcdowellcv.cls | 54 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/mcdowellcv.cls b/mcdowellcv.cls index fefe3b1..233affa 100644 --- a/mcdowellcv.cls +++ b/mcdowellcv.cls @@ -19,7 +19,7 @@ %% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, %% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE %% SOFTWARE. -\ProvidesClass{mcdowellcv}[2015/12/15 v1.1.0 McDowell CV class] +\ProvidesClass{mcdowellcv}[2017/06/18 v1.2.0 McDowell CV class] % Set up the fonts according to options \def\mainfontsize{11pt} @@ -66,28 +66,51 @@ Ligatures={TeX, NoCommon, NoDiscretionary}]{\mainfontface} % separation to a negative value to suppress a single parskip before lists \setlist{leftmargin=*, noitemsep, topsep=-1\parskip} +% For adjusting spacing based on the platform used +\usepackage{ifthen} +\usepackage{ifplatform} + % For spcaed small caps \usepackage{microtype} \DeclareMicrotypeSet*{smallcapsi} { encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}, - shape = {sc*,si,scit} + shape = {sc*,si,scit} } %-------------------------------------------------------------------------------- % Constants - %-------------------------------------------------------------------------------- -\def\afterheaderspace{3pt} -\def\beforesectionheaderspace{4.75pt} -\def\sectionheadermargin{6pt} -\def\aftersectionheaderspace{-4pt} -\def\sectionheaderhrlueheight{0.5pt} -\def\aftersinglelinesubsectionheaderspace{-18.5pt} -\def\afterdoublelinesubsectionheaderspace{-10pt} -\def\aftermultilinesubsectionheaderspace{-6pt} -\def\afteremptysubsectionheaderspace{3pt} -\def\subsectionmargin{9pt} -\def\aftersubsectionspace{4pt} + +\ifthenelse{\equal{\platformname}{\notwindowsname}}{ + \def\namespaceskip{0.575em} + \def\afterheaderspace{1.1pt} + \def\beforesectionheaderspace{5pt} + \def\sectionheadermargin{6pt} + \def\beforesectionheaderhrulespace{2.85pt} + \def\sectionheaderhrlueheight{0.518pt} + \def\aftersectionheaderspace{-5.8pt} + \def\aftersinglelinesubsectionheaderspace{-20.25pt} + \def\afterdoublelinesubsectionheaderspace{-11.75pt} + \def\aftermultilinesubsectionheaderspace{-7.75pt} + \def\afteremptysubsectionheaderspace{1.25pt} + \def\subsectionmargin{9pt} + \def\aftersubsectionspace{2.1pt} +}{ + \def\namespaceskip{0.4em} + \def\afterheaderspace{3pt} + \def\beforesectionheaderspace{4.75pt} + \def\sectionheadermargin{6pt} + \def\beforesectionheaderhrulespace{3pt} + \def\sectionheaderhrlueheight{0.5pt} + \def\aftersectionheaderspace{-4pt} + \def\aftersinglelinesubsectionheaderspace{-18.5pt} + \def\afterdoublelinesubsectionheaderspace{-10pt} + \def\aftermultilinesubsectionheaderspace{-6pt} + \def\afteremptysubsectionheaderspace{3pt} + \def\subsectionmargin{9pt} + \def\aftersubsectionspace{4pt} +} %-------------------------------------------------------------------------------- % Header Setup and Printing - @@ -112,6 +135,9 @@ Ligatures={TeX, NoCommon, NoDiscretionary}]{\mainfontface} \name{} \newcommand\printname{ + \typeout {kokoko} + \typeout \spaceskip + \spaceskip \namespaceskip \relax \textbf{\LARGE\textls[110]{\textsc{\@name}}} } @@ -152,7 +178,7 @@ Ligatures={TeX, NoCommon, NoDiscretionary}]{\mainfontface} \begin{adjustwidth}{\sectionheadermargin}{\sectionheadermargin} \textsc{\textbf{#1}} \end{adjustwidth} - \smallskip + \vspace*{\beforesectionheaderhrulespace} \hrule height \sectionheaderhrlueheight \vspace*{\aftersectionheaderspace} }{}