How to achieve having modular title pages in latex (xelatex), to only have to change one word in the .tex file and have it changed?
All the files must be defined in the project's directory, not somewhere else on the system (the project is versioned and shared).
I am defining my class on top of book called yapbook.
The relevant piece of the class:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{yapbook}[2010/10/04 Yet Another Project''s book class]
%------------------------------------------------------------------------------
% useful for tex programming
%------------------------------------------------------------------------------
\RequirePackage{needspace}
\RequirePackage[usenames,dvipsnames]{color}
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=YAPBOOK,
prefix=YAPBOOK@
}
\DeclareStringOption[phpro]{titlepagestyle}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessKeyvalOptions*
\ProcessOptions
\LoadClass{book}
% here more code
\def\@maketitle{
\RequirePackage{titlepage-\YAPBOOK@titlepagestyle}
}
\renewcommand*{\maketitle}{
\@maketitle
%here more stuff
}
And the class titlepage-phpro looks like this:
\begin{titlepage}
\thispagestyle{empty}
\null
\vskip 2em%
\begin{center}%
\textsc{\huge \@title}
\vspace{1em}
%\hrule
\vspace{3em}
\textit{\textbf{\shorttitle}}
\vspace{3em}
\hrule
\vspace{8em}
\authors \\
\vspace{3em}
\@date
\end{center}
\vfill
\begin{flushright}
O iniţiativă \emph{Yet Another Project}\\
Homepage: \url{http://yet-another-project.github.com/}
\end{flushright}
\end{titlepage}
Now I do realize, that this is completely wrong, but I don't know how to wire these pieces correctly so that it works. The individual chucks of latex code used to work. It is a requirement to have the definition of title pages in individual files, to have it modularized, and to not have to specify too many things in the "client code" (the .tex master file).
Another very important requirement is to make the usage of this infrastructure semantic, so there should be no \include in the client code.
The complete code can be found at https://github.com/yet-another-project/booktemplate
