Permalink
Browse files

Changed consolidated print version into the same code as the on-screen

version.  Also switched to XeLaTeX and switched the primary font to
Linux Libertine.
  • Loading branch information...
1 parent ba7eec9 commit 0afed4682f649c82d9e565882e32baa41f021644 @godbyk godbyk committed Aug 12, 2011
Showing with 37 additions and 57 deletions.
  1. +8 −8 Makefile
  2. +25 −10 gitt.cls
  3. +4 −2 gitt.tex
  4. +0 −37 print.tex
View
16 Makefile
@@ -3,19 +3,19 @@ quick: quickpdf cleantmp
clean: cleantmp cleanpdf
print:
- pdflatex print
- makeindex print
- pdflatex print
- pdflatex print
+ xelatex '\def\mediaformat{print}\input{gitt}'
+ makeindex gitt
+ xelatex '\def\mediaformat{print}\input{gitt}'
+ xelatex '\def\mediaformat{print}\input{gitt}'
pdf:
- pdflatex gitt
+ xelatex '\def\mediaformat{screen}\input{gitt}'
makeindex gitt
- pdflatex gitt
- pdflatex gitt
+ xelatex '\def\mediaformat{screen}\input{gitt}'
+ xelatex '\def\mediaformat{screen}\input{gitt}'
quickpdf:
- pdflatex gitt
+ xelatex gitt
cleantmp:
rm -f *.aux *.log *.out *.toc *.idx *.ind *.ilg
View
35 gitt.cls
@@ -6,6 +6,14 @@
\ProvidesClass{gitt}[2011/05/15 v1.0.0 GITT book design]
+% The 'screen' option creates a PDF suitable for reading on a computer screen
+% The 'print' option creates a PDF suitable for printing
+\providecommand{\gitt@format}{screen}% default format
+\DeclareOption{screen}{\gdef\gitt@format{screen}}
+\DeclareOption{print}{\gdef\gitt@format{print}}
+
+
+% All other options are passed along to the base class
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{memoir}%
}
@@ -28,7 +36,7 @@
\renewcommand{\thefigure}{\arabic{figure}}
% Import packages
-\RequirePackage{pdfpages}
+\RequirePackage{xifthen}
\RequirePackage{graphicx}
\RequirePackage{color,fancyvrb,relsize}
\RequirePackage[final]{microtype}
@@ -38,9 +46,14 @@
\PassOptionsToPackage{usenames,dvipsnames,svgnames}{xcolor}
\makeindex
+
% Import a new font and use the sans-serif version by default
-\RequirePackage{lmodern}
-\renewcommand{\familydefault}{\sfdefault}
+%\RequirePackage{lmodern}
+%\renewcommand{\familydefault}{\sfdefault}
+
+% Font settings
+\RequirePackage{fontspec}
+\setmainfont[Mapping=tex-text,Numbers=OldStyle]{Linux Libertine O}
% Put chapters and sections in the toc, only number the chapter
\setcounter{tocdepth}{3}
@@ -110,13 +123,15 @@
% Inserts a full-page graphic.
\newcommand{\coverpage}[1]{%
- \thispagestyle{empty}%
- \IfFileExists{#1}{%
- \AddToShipoutPicture*{\put(0,0){\includegraphics[width=\paperwidth,height=\paperheight]{#1}}}%
- }{%
- \ClassWarningNoLine{gitt}{Missing cover page graphic:\MessageBreak #1}%
- }%
- \null\cleardoublepage%
+ \ifthenelse{\equal{\gitt@format}{screen}}{%
+ \thispagestyle{empty}%
+ \IfFileExists{#1}{%
+ \AddToShipoutPicture*{\put(0,0){\includegraphics[width=\paperwidth,height=\paperheight]{#1}}}%
+ }{%
+ \ClassWarningNoLine{gitt}{Missing cover page graphic:\MessageBreak #1}%
+ }%
+ \null\cleardoublepage%
+ }{}%
}
\newcommand{\indexref}[1]{%
View
6 gitt.tex
@@ -1,4 +1,5 @@
-\documentclass{gitt}
+\providecommand{\mediaformat}{screen}
+\documentclass[\mediaformat]{gitt}
% Title/author/date
\title{Git In the Trenches}
@@ -38,5 +39,6 @@
\newpage
\mbox{}
\newpage
-\includepdf{images/bcover-new.pdf}
+\coverpage{images/bcover-new.pdf}
\end{document}
+
View
37 print.tex
@@ -1,37 +0,0 @@
-\documentclass{gitt}
-
-% Title/author/date
-\title{Git In the Trenches}
-\author{Peter Savage}
-\date{August 2011}
-
-\begin{document}
-
-% Preamble stuff
-\maketitle
-\cleardoublepage
-\tableofcontents
-
-% Include all the individual chapters
-\include{intro}
-\include{setup}
-\include{chap1}
-\include{afterhours1}
-\include{chap2}
-\include{afterhours2}
-\include{chap3}
-\include{afterhours3}
-\include{chap4}
-\include{afterhours4}
-\include{chap5}
-\include{afterhours5}
-\include{chap6}
-\include{afterhours6}
-\include{chap7}
-\include{afterhours7}
-\include{chap8}
-\include{afterhours8}
-\include{chap9}
-\include{ack}
-\include{index}
-\end{document}

0 comments on commit 0afed46

Please sign in to comment.