Permalink
Browse files

Better language handling. Rename logos dir.

- Babel is no longer required.

- If included, babel doesn't have to come before us.

- Rename logos to ruglogos to reduce the probability of a name clash.

- Improve the readability of the manual.
  • Loading branch information...
1 parent 2b4a34f commit 7a36460704f3a487edc3ab8793c43bf35c463d13 @ttencate committed Jan 2, 2011
View
@@ -2,10 +2,10 @@
all: rugscriptie.zip rugscriptie-example.pdf
clean:
- rm -f georgia.*pk georgia.afm georgia.tfm ttfonts.map rugscriptie-manual.aux rugscriptie-manual.dvi rugscriptie-manual.log rugscriptie-manual.pdf rugscriptie-manual.toc rugscriptie.zip
+ rm -f georgia.*pk georgia.afm georgia.tfm ttfonts.map *.aux *.log *.toc rugscriptie-manual.pdf rugscriptie-example.pdf rugscriptie.zip
rm -f *~ *.backup
-rugscriptie.zip: georgia.ttf georgia.afm georgia.tfm t1georgia.fd rugscriptie-manual.tex rugscriptie-manual.pdf rugscriptie.sty ttfonts.map logos
+rugscriptie.zip: georgia.ttf georgia.afm georgia.tfm t1georgia.fd rugscriptie-manual.tex rugscriptie-manual.pdf rugscriptie.sty ttfonts.map ruglogos
zip -r rugscriptie.zip $^
rugscriptie-manual.pdf: rugscriptie-manual.tex rugscriptie.sty
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -1,4 +1,4 @@
-\documentclass{report}
+\documentclass[a4paper]{report}
\usepackage[dutch]{babel}
\usepackage{rugscriptie}
@@ -8,10 +8,12 @@
\thesistype{Voorbeeldscriptie}
\author{T.~ten~Cate}
\supervisor{D.E.~Knuth}
-\supervisor{L.~Lamport}
+\supervisor{L.~Lamport\and J.~Braams}
\person{Schrijvers van Het Boek}{F.~Mittelbach\and M.~Goossens}
\date{2 januari 2011}
+\newcommand\secondarysupervisorname{Tweede begeleiders}
+
\begin{document}
\maketitle
\end{document}
View
@@ -1,56 +1,69 @@
\documentclass[a4paper]{article}
-\usepackage[british]{babel}
+\usepackage[dutch,british]{babel}
\usepackage[noredef]{rugscriptie}
\title{The \texttt{rugscriptie} package for \LaTeX}
-\author{Thomas ten Cate}
-\date{January 1, 2011}
+\author{Thomas ten Cate\thanks{\texttt{ttencate@gmail.com}}}
+\date{January 2, 2011}
\begin{document}
\maketitle
-\tableofcontents
-
\section{Introduction}
This \LaTeX{} package, \texttt{rugscriptie}, can be used to format the title page of your thesis (`scriptie') in the official style of the University of Groningen, Netherlands (Rijksuniversiteit Groningen, RUG). It was born out of annoyance with the RUG only providing a template in Word format.
This documentation, as well as the package source and commands, are completely in English to accommodate international students. However, the produced title page can optionally be shown in Dutch instead.
-\section{Requirements}
-
-This package requires the use \texttt{pdflatex}, and will \emph{not} work with normal \texttt{latex}.
+\section{Quick start}
-Furthermore, \texttt{rugscriptie} depends on the packages \texttt{babel}, \texttt{graphicx} and \texttt{fontenc}, which are probably already installed.
+In its simplest form, simply extract the package \texttt{rugscriptie.zip} into the same directory as your main thesis \texttt{.tex} file.
-\section{Usage}
-
-In its simplest form, simply extract the package \texttt{rugscriptie.zip} into the same directory as your main thesis \texttt{.tex} file. Then include the package in your document preamble:
+Then, the following example should get you started:
\begin{quote}
\begin{verbatim}
+ \documentclass[a4paper]{report} % a4paper option recommended
+
+ \usepackage[dutch]{babel} % Use dutch, british or english
\usepackage{rugscriptie}
-\end{verbatim}
-\end{quote}
-In addition to the commands \verb|\title| and \verb|\author|, this package adds the \emph{required} command \verb|\thesistype|, which will be typeset on the title page. Example usage:
+ \faculty{fwn} % Or feb, fgg, fgmw, fl, frg, frw, fw, umcg
+ \thesistype{Master's thesis} % Will be printed unmodified
+ \title{My wonderful thesis}
+ \author{Y.O.U.R.~Name}
+ \supervisor{Prof.~S.~Upervisor}
+ \supervisor{Dr.~S.~Econdary-Supervisor}
+ \date{January 1970}
-\begin{quote}
-\begin{verbatim}
- \thesistype{Master's Thesis Mathematics}
+ \begin{document}
+ \maketitle
+ ...
+ \end{document}
\end{verbatim}
\end{quote}
-To typeset the title page, use the \verb|\maketitle| command right at the start of your document, as usual:
+Run this through \texttt{pdflatex}, and it should give you a PDF file with a properly formatted title page, in Dutch, with the logo of the FWN faculty.
+
+\section{Requirements}
+
+The \texttt{rugscriptie} package depends on the packages \texttt{babel}, \texttt{ifthen}, \texttt{graphicx} and \texttt{fontenc}, which are probably already installed.
+
+The package works out of the box if you use \texttt{pdflatex}, but requires some work if you want to use it with \texttt{latex} and \texttt{dvips}. See Section \ref{sec:dvips} for details.
+
+\section{Reference}
+
+The main functionality of the package is to override the standard \verb|\maketitle| command. This typesets a title page in the RUG style. This section describes the available options to tweak the contents of that title page.
+
+\subsection{Thesis type}
+
+In addition to the commands \verb|\title| and \verb|\author|, this package adds the command \verb|\thesistype|, which will be typeset on the title page. Example usage:
\begin{quote}
\begin{verbatim}
- \begin{document}
- \maketitle
- ...
- \end{document}
+ \thesistype{Master's Thesis Mathematics}
\end{verbatim}
\end{quote}
@@ -123,7 +136,7 @@ \subsection{People}
\subsection{Language}
\label{sec:language}
-The text and logo on the title page can be in English or in Dutch. Which language is used depends on the setting of the \texttt{babel} package. The default is English; for a thesis in Dutch, set this up \emph{before} including the \texttt{rugscriptie} package:
+The text and logo on the title page can be in English or in Dutch. Which language is used depends on the setting of the \texttt{babel} package. The default language depends on the system that your document is compiled on, so it's best to set this up explicitly. For a thesis in Dutch:
\begin{quote}
\begin{verbatim}
@@ -136,24 +149,65 @@ \subsection{Language}
\medskip
-If you're unhappy about the labels ``Student'', ``Primary supervisor'' and ``Secondary supervisor'', you can redefine them. For example, if you don't want to be labelled at all, and prefer the word ``advisor'' instead:
+The package uses the language in effect at the time of \verb|\maketitle|; therefore, to get a thesis in Dutch, but with an English title page, you could do this:
\begin{quote}
\begin{verbatim}
- \renewcommand\studentname{}
- \renewcommand\primarysupervisorname{Primary advisor}
- \renewcommand\secondarysupervisorname{Secondary advisor}
+ \usepackage{rugscriptie}
+ \usepackage[british,dutch]{babel}
+ ...
+ \begin{document}
+ \maketitle
+ \selectlanguage{british}
+ ...
+ \end{document}
\end{verbatim}
\end{quote}
+\noindent (The \emph{last} language in the option list to \texttt{babel} will take effect.)
+
+\medskip
+
+If you're unhappy about the labels ``Student'', ``Primary supervisor'' and ``Secondary supervisor'', you can redefine them. For example, if you don't want your own name to be labelled at all, and prefer the word ``advisor'' instead:
+
+\begin{quote}
+\begin{verbatim}
+ \newcommand\studentname{}
+ \newcommand\primarysupervisorname{Primary advisor}
+ \newcommand\secondarysupervisorname{Secondary advisor}
+\end{verbatim}
+\end{quote}
+
+The package defines these commands at the time of the \verb|\maketitle|, but only if they are not yet defined; therefore, place these anywhere before that point.
+
+\subsection{If you're not using \texttt{pdflatex}}
+\label{sec:dvips}
+
+The recommended way to use this package is with \texttt{pdflatex}.
+
+\medskip
+
+If you can't or won't use \texttt{pdflatex}, but want to go through plain \texttt{latex}, \texttt{dvips}, and possibly \texttt{pstopdf}, you will have to convert the logo file to EPS format. (EPS versions are not included because of their file size.) To do so:
+
+\begin{enumerate}
+ \item
+ Run your manuscript through \texttt{latex}, and take note of the file that it cannot find, for example: \\
+ \verb|! LaTeX Error: File `ruglogos/RUGR_FWN_logoNL_zwart' not found.|
+ \item
+ Navigate to the \texttt{ruglogos} directory and convert that file to EPS using commands like the following: \\
+ \verb|pdf2ps RUGR_FWN_logoNL_zwart.pdf| \\
+ \verb|ps2eps RUGR_FWN_logoNL_zwart.eps| \\
+ You can remove the intermediate \verb|.ps| file, if you like.
+\end{enumerate}
+
\section{Limitations}
Nothing is perfect.
\begin{itemize}
\item The \verb|\thanks| command is not supported.
\item The \verb|[titlepage]| option to the document class is ignored. We always produce the title on a separate page.
- \item Because of the font encoding used for Georgia, and the PDF format of the logos, you \emph{must} use \texttt{pdflatex}. The old-fashioned \texttt{dvi}~$\rightarrow$~\texttt{ps}~$\rightarrow$~\texttt{pdf} route is not supported.
+ \item The UMCG logo could look better. It is currently set somewhat smaller than the others. If you need this logo, drop the author of this package an e-mail.
\end{itemize}
\section{Implementation notes}
@@ -179,9 +233,9 @@ \section{Thanks}
\section{Version history}
\begin{description}
- \item[v1.0.2] Consistently uses the word ``supervisor'' instead of ``advisor''.
- \item[v1.0.1] Fixes a critical bug introduced by working on the package at 2 AM.
- \item[v1.0] The first version.
+ \item[v1.0.2 (January 2, 2011)] Consistently uses the word ``supervisor'' instead of ``advisor''. No longer requires \texttt{babel} to be included first. Or at all (defaulting to English without it). Now with limited DVI/PS support (does not include EPS logos). Renames \texttt{logos} to \texttt{ruglogos} to reduce the possibility of a name clash. Improves the manual, providing a ``Quick start'' section at the beginning.
+ \item[v1.0.1 (January 2, 2011)] Fixes a critical bug introduced by working on the package at 2 AM.
+ \item[v1.0 (January 1, 2011)] The first version.
\end{description}
\section{Legal}
@@ -196,8 +250,6 @@ \section{Example}
The following page shows an example of the package output, mimicking the Word template.
-%\selectlanguage{dutch}
-
\makeatletter
\faculty{fwn}
\def\@title{Hier staat een titel die over meerdere regels kan lopen.}
@@ -208,9 +260,9 @@ \section{Example}
\def\@date{Maart 2008}
\makeatother
+\selectlanguage{dutch}
\rugmaketitle
-
-%\selectlanguage{british}
+\selectlanguage{british}
\end{document}
View
@@ -2,22 +2,16 @@
\ProvidesPackage{rugscriptie}[2010/01/02 v1.0.2 Package for title pages in the style of the University of Groningen]
+% For string comparisons.
+\RequirePackage{ifthen}
+
% Set up fonts.
\RequirePackage[T1]{fontenc}
\font\georgia georgia
% We need this for the logo.
\RequirePackage{graphicx}
-% Babel is required to check the language.
-% XXX This could be made optional through a [nobabel] package option,
-% or by explicitly setting the language through [dutch] or [english].
-\@ifundefined{bbl@main@language}
- {\PackageError{rugscriptie}{Include the `babel' package first,\MessageBreak specifying a language option}{You need to include the `babel' package (with a language option) before including the `rugscriptie' package}
- \endinput}
- {}
-\RequirePackage{babel}
-
% Package option to not override \maketitle.
\DeclareOption{noredef}{\gdef\ifredef{\iffalse}}
\def\ifredef{\iftrue}
@@ -26,21 +20,20 @@
\ProcessOptions
% Set up our language.
-\newcommand\ruglanguageen{
+% `default' is used if no matching command for the current \languagename exists,
+% and should be English (like the rest of LaTeX).
+\newcommand\ruglanguage@default{
\gdef\@logolang{EN}
- \gdef\studentname{Student}
- \gdef\primarysupervisorname{Primary supervisor}
- \gdef\secondarysupervisorname{Secondary supervisor}
+ \providecommand\studentname{Student}
+ \providecommand\primarysupervisorname{Primary supervisor}
+ \providecommand\secondarysupervisorname{Secondary supervisor}
}
-\newcommand\ruglanguagenl{
+\newcommand\ruglanguage@dutch{
\gdef\@logolang{NL}
- \gdef\studentname{Student}
- \gdef\primarysupervisorname{Eerste begeleider}
- \gdef\secondarysupervisorname{Tweede begeleider}
+ \providecommand\studentname{Student}
+ \providecommand\primarysupervisorname{Eerste begeleider}
+ \providecommand\secondarysupervisorname{Tweede begeleider}
}
-\iflanguage{dutch}
- {\ruglanguagenl}
- {\ruglanguageen}
% Command that sets the faculty, used for the logo.
% XXX Support creation of custom logos, built from the main RUG logo
@@ -88,7 +81,7 @@
\fi
% Typesets a logo.
-\newcommand\@makelogo[1]{\includegraphics[height=50pt]{logos/RUGR_#1_logo\@logolang_zwart}}
+\newcommand\@makelogo[1]{\includegraphics[height=50pt]{ruglogos/RUGR_#1_logo\@logolang_zwart}}
% An minipage-like environment that, when opened at the top of a page, spans the entire page, without margins.
\newenvironment{paperpage}{%
@@ -123,6 +116,15 @@
% Definition of the format of the main title page.
\newcommand\rugmaketitle{
{
+ \@ifundefined{languagename}{
+ \def\rug@setlang{\ruglanguage@default}
+ }{
+ \def\rug@setlang{\csname ruglanguage@\languagename\endcsname}
+ }
+ \if\rug@setlang\relax
+ \def\rug@setlang{\ruglanguage@default}
+ \fi
+ \rug@setlang
\begin{titlepage}
\begin{paperpage}
\newskip\leftmargin \leftmargin 112pt

0 comments on commit 7a36460

Please sign in to comment.