From db9587bf14aa5e8e2b593e4d683fbb56918e7919 Mon Sep 17 00:00:00 2001 From: michaelpacer Date: Tue, 30 Dec 2014 16:28:21 -0800 Subject: [PATCH] Made Berkeley Work --- Dissertate.cls | 48 ++++++++++--------- README.md | 2 +- dissertation.tex | 2 +- frontmatter/personalize.tex | 6 ++- packages/Berkeley/reformatParaList.py | 1 + packages/Berkeley/style.sty | 67 ++++++++++++++------------- scripts/breakdown.command | 14 ++++++ 7 files changed, 83 insertions(+), 57 deletions(-) diff --git a/Dissertate.cls b/Dissertate.cls index 490d3c3..90b4c18 100644 --- a/Dissertate.cls +++ b/Dissertate.cls @@ -13,26 +13,29 @@ \ProvidesClass{Dissertate}[2014/01/24 v1.0 Dissertate Class] \LoadClass[12pt, oneside, letterpaper]{book} + +%\RequirePackage{packages/\Dissertate@School/parameterList} % some definitions -\def\degreeyear#1{\gdef\@degreeyear{#1}} -\def\degreemonth#1{\gdef\@degreemonth{#1}} -\def\degree#1{\gdef\@degree{#1}} -\def\advisor#1{\gdef\@advisor{#1}} -\def\department#1{\gdef\@department{#1}} -\def\field#1{\gdef\@field{#1}} -\def\university#1{\gdef\@university{#1}} -\def\universitycity#1{\gdef\@universitycity{#1}} -\def\universitystate#1{\gdef\@universitystate{#1}} -\def\programname#1{\gdef\@programname{#1}} -\def\pdOneName#1{\gdef\@pdOneName{#1}} -\def\pdOneSchool#1{\gdef\@pdOneSchool{#1}} -\def\pdOneYear#1{\gdef\@pdOneYear{#1}} -\def\pdTwoName#1{\gdef\@pdTwoName{#1}} -\def\pdTwoSchool#1{\gdef\@pdTwoSchool{#1}} -\def\pdTwoYear#1{\gdef\@pdTwoYear{#1}} +%\def\degreeyear#1{\gdef\@degreeyear{#1}} +%\def\degreemonth#1{\gdef\@degreemonth{#1}} +%\def\degree#1{\gdef\@degree{#1}} +%\def\advisor#1{\gdef\@advisor{#1}} +%\def\department#1{\gdef\@department{#1}} +%\def\field#1{\gdef\@field{#1}} +%\def\university#1{\gdef\@university{#1}} +%\def\universitycity#1{\gdef\@universitycity{#1}} +%\def\universitystate#1{\gdef\@universitystate{#1}} +%\def\programname#1{\gdef\@programname{#1}} +%\def\pdOneName#1{\gdef\@pdOneName{#1}} +%\def\pdOneSchool#1{\gdef\@pdOneSchool{#1}} +%\def\pdOneYear#1{\gdef\@pdOneYear{#1}} +%\def\pdTwoName#1{\gdef\@pdTwoName{#1}} +%\def\pdTwoSchool#1{\gdef\@pdTwoSchool{#1}} +%\def\pdTwoYear#1{\gdef\@pdTwoYear{#1}} \RequirePackage{color} +\RequirePackage{xcolor} \usepackage{hyperref} \RequirePackage[tiny, md, sc]{titlesec} \setlength{\headheight}{15pt} @@ -40,12 +43,6 @@ \RequirePackage{titling} \RequirePackage[palatino]{quotchap} -\RequirePackage{kvoptions} -\DeclareStringOption{School}[] -\ProcessKeyvalOptions* -\RequirePackage{packages/\Dissertate@School/style} -\RequirePackage{packages/\Dissertate@School/parameterList} - \RequirePackage{graphicx} \RequirePackage{amssymb} \RequirePackage{lettrine} @@ -79,6 +76,13 @@ \setmathsfont(Digits,Latin,Greek)[Numbers={Proportional}]{EB Garamond} \setmathrm{EB Garamond} +\RequirePackage{kvoptions} +\DeclareStringOption{School}[] +\ProcessKeyvalOptions* +\input{packages/\Dissertate@School/parameterList.txt} +\RequirePackage{packages/\Dissertate@School/style} + + \widowpenalty=300 \clubpenalty=300 diff --git a/README.md b/README.md index 107a740..9685ad0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Dissertate: a LaTeX dissertation template [![Build Status](https://travis-ci.org/suchow/Dissertate.svg?branch=master)](https://travis-ci.org/suchow/Dissertate) -This package provides all the files needed to support the production and typesetting of a PhD dissertation at Harvard, Princeton, and NYU, though it can easily be adapted to meet the requirements of other schools. The format and styling is based closely on the requirements published by each university's registrar. +This package provides all the files needed to support the production and typesetting of a PhD dissertation at Harvard, Princeton, NYU, and Berkeley, though it can easily be adapted to meet the requirements of other schools. The format and styling is based closely on the requirements published by each university's registrar. ## Getting started diff --git a/dissertation.tex b/dissertation.tex index 7ca1dc3..464aeba 100644 --- a/dissertation.tex +++ b/dissertation.tex @@ -3,7 +3,7 @@ % Modify the following line to match your school % Available options include `Harvard`, `Princeton`, and `NYU`. -\documentclass[School=Harvard]{Dissertate} +\documentclass[School=Berkeley]{Dissertate} \begin{document} diff --git a/frontmatter/personalize.tex b/frontmatter/personalize.tex index dca2f3f..dc83a10 100644 --- a/frontmatter/personalize.tex +++ b/frontmatter/personalize.tex @@ -3,13 +3,15 @@ \author{Firstname M. Lastname} \advisor{Bigname Scientist} \coadvisorOne{Delightful Researcher} -%\coadvisorTwo{Equally D. Researcher} +\coadvisorTwo{Equally D. Researcher} +\committeeInternal{Person Inside} +\committeeExternal{Person Outside} % ... about the degree. \degree{Doctor of Philosophy} \field{Psychology} \degreeyear{2024} -%\degreeterm{Spring} +\degreeterm{Spring} \degreemonth{May} \department{Psychology} diff --git a/packages/Berkeley/reformatParaList.py b/packages/Berkeley/reformatParaList.py index 3d66097..3e035be 100644 --- a/packages/Berkeley/reformatParaList.py +++ b/packages/Berkeley/reformatParaList.py @@ -27,6 +27,7 @@ def reformatParaList(text, num_arg): os.path.basename(os.getcwd()) + r"/filename}" + "\n\n" ) + for line in json_input_loaded: json_output1.write(reformatParaList(line, json_input_loaded[line])) json_output2.write(reformatParaList(line, json_input_loaded[line])) diff --git a/packages/Berkeley/style.sty b/packages/Berkeley/style.sty index cb28265..086eac7 100644 --- a/packages/Berkeley/style.sty +++ b/packages/Berkeley/style.sty @@ -33,7 +33,7 @@ \renewcommand{\maketitle}{ - \thispagestyle{empty} + %\thispagestyle{empty} \vspace*{\fill} \vspace{100pt} \begin{center} @@ -48,6 +48,7 @@ \@university\\ \vspace{50pt} Committee in charge:\\ + \vspace{20pt} Professor \@coadvisorOne, Co-chair\\ Professor \@coadvisorTwo, Co-chair\\ Professor \@committeeInternal\\ @@ -70,36 +71,38 @@ % The following conditional definition is derived from http://tex.stackexchange.com/questions/131726/conditional-content. This allows the inclusion of the co-advisor consideration. -\documentclass{article} +%\documentclass{article} % Display the argument if \cond is True/False -\newcommand{\IfCond}[2]{% - \ifnum\pdfstrcmp{\cond}{True}=0 - \ifnum\pdfstrcmp{}{#1}=0\unskip\else#1\fi% - \else - \ifnum\pdfstrcmp{}{#2}=0\unskip\else#2\fi% - \fi\ignorespaces} - -% Display the argument if \cond is False -\newcommand{\IfCondFalse}[1]{% - \ifnum\pdfstrcmp{\cond}{True}=0 \unskip\else #1\fi\ignorespaces} -\begin{document} -\def\cond{True}% Version control -This is fake \IfCond{text}{hooplah}. \par -This is fake \IfCond{}{hooplah}. - -\def\cond{False}% Version control -This is fake \IfCond{text}{hooplah}. \par -This is fake \IfCond{text}{}. -\end{document} +%\newcommand{\IfCond}[2]{% +% \ifnum\pdfstrcmp{\cond}{True}=0 +% \ifnum\pdfstrcmp{}{#1}=0\unskip\else#1\fi% +% \else +% \ifnum\pdfstrcmp{}{#2}=0\unskip\else#2\fi% +% \fi\ignorespaces} +% +%% Display the argument if \cond is False +%\newcommand{\IfCondFalse}[1]{% +% \ifnum\pdfstrcmp{\cond}{True}=0 \unskip\else #1\fi\ignorespaces} +%\begin{document} +%\def\cond{True}% Version control +%This is fake \IfCond{text}{hooplah}. \par +%This is fake \IfCond{}{hooplah}. +% +%\def\cond{False}% Version control +%This is fake \IfCond{text}{hooplah}. \par +%This is fake \IfCond{text}{}. +%\end{document} + \newcommand{\abstractpage}{ \newpage - \pagenumbering{roman} - \setcounter{page}{3} + \pagenumbering{arabic} + \setcounter{page}{1} \pagestyle{fancy} - \lhead{Thesis advisor: Professor \@advisor} \rhead{\@author} + \lhead{Co-advisors: Professors \@coadvisorOne {\textit \&} \@coadvisorTwo} + \rhead{\@author} \renewcommand{\headrulewidth}{0.0pt} \vspace*{35pt} \begin{center} @@ -113,17 +116,19 @@ This is fake \IfCond{text}{}. \cfoot{\thepage} } -\newcommand{\dedicationpage}{ - \newpage \thispagestyle{fancy} \vspace*{\fill} - \scshape \noindent \input{frontmatter/dedication} - \vspace*{\fill} \newpage \rm -} - \newcommand{\acknowledgments}{ \chapter*{Acknowledgments} \noindent \input{frontmatter/thanks} \vspace*{\fill} \newpage \setcounter{page}{1} - \pagenumbering{arabic} + \pagenumbering{roman} +} + +\newcommand{\dedicationpage}{ + \newpage \thispagestyle{fancy} \vspace*{\fill} + \scshape \noindent \input{frontmatter/dedication} + \vspace*{\fill} \newpage \rm } + + diff --git a/scripts/breakdown.command b/scripts/breakdown.command index e69de29..2df48bd 100644 --- a/scripts/breakdown.command +++ b/scripts/breakdown.command @@ -0,0 +1,14 @@ +#!/bin/sh +BASEDIR=$(dirname $0) +cd $BASEDIR +cd .. + +# Build the dissertation. +xelatex dissertation +bibtex dissertation +xelatex dissertation +xelatex dissertation + +# Hide the log. +mv "dissertation.log" ".logged" +