2 Commits

Author SHA1 Message Date
Alphrag
716aac3da1 Many changes and adding examples
- Fix use of sizes (maybe set exception for 13pt?)
- Prepare keys for margins
- Show example of bibfile modification on the go
- Show how to use `\xkvview` to check defined keys
2023-12-22 00:45:16 +01:00
Alphrag
2e9103c4af Modify things and test around
Options are always passed to memoir, even if I don't want them to, like 8pt...
2023-11-12 02:07:03 +00:00
7 changed files with 355 additions and 14 deletions

2
.gitignore vendored
View File

@@ -25,3 +25,5 @@
*.log
*.run.xml
*.tdo
*.bbl
*.blg

View File

@@ -2,5 +2,25 @@
author = {Donald E. Knuth},
year = {1986},
title = {The {\TeX} Book},
publisher = {Addison-Wesley Professional}
}
publisher = {Addison-Wesley Professional},
arXivId = {2307.11596}
},
@article{FalseGGJ,
author = {Victoria Gould and Ambroise Grau and Marianne Johnson},
journal = {Trying},
title = {The structure of {E}nd({E}nd($\mathcal{T}_n$))},
year = {2024},
month = jul,
arXivId = {2307.11596}
},
@article{GGJ23,
author = {Victoria Gould and Ambroise Grau and Marianne Johnson},
journal = {Submitted},
title = {The structure of {E}nd($\mathcal{T}_n$)},
year = {2023},
month = jul,
archiveprefix = {arXiv},
creationdate = {2023-08-05T16:13:02},
eprint = {2307.11596}
}

Binary file not shown.

View File

@@ -27,14 +27,14 @@
%%% ==== Begin file
% FORMAT: Font size must be at least 11pt, 12pt is set as default
% TODO: Change `draft` to `final` for the published version.
\documentclass[draft]{yorkthesis}
\documentclass[foredge=*,margins={spine=3cm,foredge=2cm},draft,pagenb=foot,hyperoptions={colorlinks=true}]{uoythesis}
% Import the personal options for the class
\usepackage{thesisoptions}
% Import the preamble with all the packages and macros
\input{mypreamble}
%%% ==== Thesis title page info
\title{Writing your maths thesis at UoY\todo{change title}}
\subtitle{A documented example on its structure and use\todo{change/remove subtitle}} % optional
@@ -44,6 +44,9 @@
% \submitdate{September 2020} % FORMAT: [month] [year].
% % Defaults to current month if unset.
\makeatletter
\newcommand{\displaysize}{Size: \f@size}
\makeatother
\begin{document}
% FORMAT: All pages should be numbered continuously.
@@ -107,6 +110,15 @@ I hope this will be useful to many others.}\todo[color=red!60, inline, size=foot
This section is where you thank your funding body, the department, your supervisor, your most loved campus geese, or whoever else you think is necessary and contributed to your achievement.
\displaysize\\
options: \makeatletter \@classoptionslist \makeatother\\
\showmargins
\uoythsetup{margins={spine=1cm}}
\showmargins
\xkvview{family=uoythesis}
\xkvview{family=uoythesis.cls}
\medskip
As for myself, I want to thank Alessandro for his template which makes the perfectionist inside me happy to pick up a well done job and to augment it at my wish.
@@ -129,6 +141,7 @@ This section should include a text similar to:
\end{verbatim}
If you have submitted a paper (either already published or currently under review), this should be explicitly mentioned in this section with a reference to its bibliography entry.
This is a test \cite{FalseGGJ,GGJ23}.
% WARNING: Any material included in the thesis that has been presented before
% should be mentioned here, with full references for papers published
% or under review.

View File

@@ -25,9 +25,8 @@
%%% ===== Folder structure
% Important packages to use in order to work with the subfiles
\usepackage{xr-hyper} % cross-referencing with use of hyperref
\usepackage{subfiles} % use file structure in subfolders
\externaldocument{\subfix{main}} % all refs available in subfiles by \ref{labelname} as usual
\externaldocument[XR-]{\subfix{main}} % all refs available in subfiles by \ref{labelname} as usual
%% NOTE: The following code make an additional paths search
%% search to simplify the calls to \subfile if you don't want
@@ -35,11 +34,11 @@
%% the folders' name appropriately to the list with the {dir/}
%% syntax (brackets and trailing slash).
%% WARNING: This slows down compilation time A LOT!!!
\makeatletter
\def\input@path{ %
{../Bibfiles/}{C-Begin/}{C-Middle/}{C-End/} % list of folders
}
\makeatother
%\makeatletter
%\def\input@path{ %
% {../Bibfiles/}{C-Begin/}{C-Middle/}{C-End/}{Bibfiles/} % list of folders
% }
%\makeatother
%%% ===== BEGIN OVERLEAF_EXTERNAL_DOC
@@ -68,7 +67,6 @@
%%% ===== List of recommended packages you need to include
\usepackage{amsmath, amsthm}
\usepackage{amssymb, amsfonts}
\usepackage[final]{hyperref} % links with final option to force them to appear even in draft mode
\usepackage{xspace} % for automatic spaces after text commands
\usepackage{xcolor} % to use colours in different parts
% NOTE: Package for the todo notes. Notice that it uses multiple packages such as
@@ -89,6 +87,7 @@
%%% ===== Bibliography setup
\usepackage[eprint, % Include information for pre-prints.
doi=false,
eprint=true,
url=false,
maxnames=10, % Truncate lists of more than 10 authors.
giveninits=true, % Only output the initials of an author's given
@@ -97,9 +96,17 @@
% (i.e. \u{}), see
% https://tex.stackexchange.com/a/170586/27664.
]{biblatex}
\addbibresource{\subfix{firstbib.bib}}
\addbibresource{\subfix{Bibfiles/firstbib.bib}}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\pertype{article}
\step[fieldsource=arXivId, fieldtarget=eprint, final]
\step[fieldset=archiveprefix, fieldvalue={arXiv}]
}
}
}
%%% ===== Styling for my theorems
\theoremstyle{plain} % the style for theorem, propositions and lemmas

View File

@@ -23,6 +23,13 @@
% https://git.tigrau.ovh/Ambroise/LaTeX-Templates/.
\ProvidesPackage{thesisoptions}[2022/07/08 v1.0 Options for the York Thesis class]
\@ifundefined{is@uoyth@classloaded}{
\PackageError{thesisoption}{
This package should only be used if the uoythesis class is used
}{
Verify that you are indeed using the uoythesis class, or remove the loading of this package
} % make error
}{ } % silently pass
%%% ==== Fonts
\usepackage[utf8]{inputenc} % Allow unicode input
@@ -118,3 +125,5 @@
%%%% ==== DEBUG
% If you want the version of the packages you use appear when they load in the log file, uncomment the following line:
\listfiles
\endinput

290
York-Thesis/uoythesis.cls Normal file
View File

@@ -0,0 +1,290 @@
%% uoythesis.cls
%% Copyright 2023 A. Grau
%
% This work may be distributed and/or modified under the conditions of the LaTeX
% Project Public License, either version 1.3 of this license or (at your option)
% any later version, with the exception that distribution of Derived Work is not
% subject to the requirements of section 6.2.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX version
% 2005/12/01 or later.
%
%
% This work has the LPPL maintenance status `maintained`.
%
% The Current Maintainer of this work is A. Grau.
%
% This work consists of all the files listed in the README.md,
% and provides a copy of the original hosted on
% https://git.tigrau.ovh/Ambroise/LaTeX-Templates/.
% Comments starting with `FORMAT` highlight requirements from the
% University of York thesis regulations, as of November 2023.
% See https://www.york.ac.uk/research/graduate-school/academic/thesis/format/#tab-2
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uoythesis}[2023/11/13 v1.0 UoY Thesis]
\providecommand{\is@uoyth@classloaded}{true}
\RequirePackage{xkeyval}
\RequirePackage{etoolbox}
\RequirePackage{xstring}
% To be able to check which keys are set
\RequirePackage{xkvview}
\let\tablename=\undefined % reset this which is defined in memoir
%%% Set class options
\newcommand{\uoyth@tmp@classoptionslist}{}
\newcommand{\AddToClassOptionList}[1]{\csappto{uoyth@tmp@classoptionslist}{, #1}}
%\newcommand{\changeoptions}[1]{\cspreto{@classoptionslist}{#1,}}
\newcommand{\RaiseBooleanValueWarning}[1]{
\ClassError{uoythesis}{The option {#1} must be set with either true or false}{Option #1 only accepts a boolean value}
}
\newcommand{\RaiseFontSizeValueWarning}[1]{
\ClassWarning{uoythesis}{You gave size '#1' which is too small according to the guidelines. Automatically changing to the smallest value accepted: 11pt. (Classoptions:\@classoptionslist )}
}
\newcommand{\uoyth@fontsize}{12pt}
\newcommand{\uoyth@SetFontSize}[1]{
\AddToClassOptionList{#1}
\renewcommand{\uoyth@fontsize}{#1}
\PassOptionsToClass{#1}{memoir}
}
% options passed onto memoir: draft, final, oneside, twoside
\newif\ifuoyth@draft
\uoyth@draftfalse
\DeclareOptionX{draft}{\uoyth@drafttrue \PassOptionsToClass{draft}{memoir}}
\DeclareOptionX{final}{\uoyth@draftfalse \PassOptionsToClass{final}{memoir}}
\newif\ifuoyth@onesided
\uoyth@onesidedfalse
\DeclareOptionX{oneside}{\uoyth@onesidedtrue \PassOptionsToClass{oneside}{memoir}}
\DeclareOptionX{twoside}{\uoyth@onesidedfalse \PassOptionsToClass{twoside}{memoir}}
% new available options: pagenb (head or foot), noxr, nohyperref, hyperfinal, margins
\newif\ifuoyth@pgnbhead
\uoyth@pgnbheadtrue
\define@choicekey*+{uoythesis.cls}{pagenb}[\userval\choiceval]{head,foot}[head]{
\ifcase\choiceval\relax
\uoyth@pgnbheadtrue
\or
\uoyth@pgnbheadfalse
\fi
}{
\ClassWarning{uoythesis}{The \texttt{pagenb} option must be set to either `head' or `foot', but you gave `#1'}
}
\ExecuteOptionsX{pagenb=head}
\define@boolkey+{uoythesis.cls}[uoyth@]{noxr}[true]{}{\RaiseBooleanValueWarning{noxr}}
\ExecuteOptionsX{noxr=false}
\define@boolkey+{uoythesis.cls}[uoyth@]{nohyperref}[true]{}{\RaiseBooleanValueWarning{nohyperref}}
\ExecuteOptionsX{nohyperref=false}
\define@boolkey+{uoythesis.cls}[uoyth@]{hyperfinal}[true]{}{\RaiseBooleanValueWarning{hyperfinal}}
\ExecuteOptionsX{hyperfinal}
\DeclareOptionX{hyperoptions}{
\ClassInfo{uoythesis}{Passing options '#1' to package hyperref}
\PassOptionsToPackage{#1}{hyperref}
}
\ExecuteOptionsX{hyperoptions={}}
\define@cmdkey{uoythesis.cls}[uoyth@]{spine}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{foredge}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{hratio}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{top}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{bottom}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{vratio}{}
\define@cmdkey{uoythesis.cls}[uoyth@]{margins}{\setkeys{uoythesis.cls}{#1}}
\newcommand{\showmargins}{
all margins=\key@ifundefined{uoythesis.cls}{margins}{undef}{`\uoyth@margins '};
spine=\key@ifundefined{uoythesis.cls}{spine}{undef}{`\uoyth@spine '};
foredge=\key@ifundefined{uoythesis.cls}{foredge}{undef}{\@ifundefined{uoyth@foredge}{unset}{`\uoyth@foredge'}}
}
\newcommand{\uoythsetup}[1]{\setkeys{uoythesis.cls}{#1}}
% FORMAT: Font size must be at least 11pt, so we disable small values
%\DeclareOptionX{8pt}{
% \RaiseFontSizeValueWarning{\CurrentOption}
% \changeoptions{11pt}
% \ChangeSizeToSmallest
% \ClassWarning{uoythesis}{Options passed are KV:\XKV@classoptionslist; and normal:\@classoptionslist}
%}
%\DeclareOptionX{9pt}{
% \RaiseFontSizeValueWarning{\CurrentOption} \ChangeSizeToSmallest
%}
%\DeclareOptionX{10pt}{
% \RaiseFontSizeValueWarning{\CurrentOption} \ChangeSizeToSmallest
%}
%\DeclareOptionX{13pt}{
% \ClassInfo{uoythesis}{Font size 13pt not available, downsizing to 12pt}
% \uoyth@SetFontSize{12pt}
%}
% Pass all remaining unknown options to memoir to deal with them
\DeclareOptionX*{%
\IfEndWith{\CurrentOption}{pt}{ % this is possibly a font size
\StrGobbleRight{\CurrentOption}{2}[\val]
\IfInteger{\val}{ % as a font size verifies if at least 11
\ifnum\val<12 % if too small, set to 11 and raise warning
\RaiseFontSizeValueWarning{\CurrentOption}
\uoyth@SetFontSize{11pt}
\else
\uoyth@SetFontSize{\CurrentOption}
\fi
}{
\PassOptionsToClass{\CurrentOption}{memoir}
}
}{
\PassOptionsToClass{\CurrentOption}{memoir}
}
}
\ProcessOptionsX
\ifuoyth@draft
\AddToClassOptionList{draft}
\else
\AddToClassOptionList{final}
\fi
\ifuoyth@onesided
\AddToClassOptionList{oneside}
\else
\AddToClassOptionList{twoside}
\fi
\renewcommand{\@classoptionslist}{\uoyth@tmp@classoptionslist}
% FORMAT: Document must be on A4 paper and avoid blank pages when starting new chapters
\LoadClass[a4paper,openany,\uoyth@fontsize]{memoir}
\disable@keys{uoythesis.cls}{draft,oneside}
\ifuoyth@hyperfinal
\newcommand{\uoyth@hyperoptions}{final}
\else
\newcommand{\uoyth@hyperoptions}{}
\fi
\ifuoyth@noxr
\ifuoyth@nohyperref
\else
\RequirePackage[\uoyth@hyperoptions]{hyperref}
\fi
\else
\ifuoyth@nohyperref
\RequirePackage{xr}
\else
\RequirePackage{xr-hyper}
\RequirePackage[\uoyth@hyperoptions]{hyperref}
\fi
\fi
\disable@keys{uoythesis.cls}{noxr,nohyperref,hyperfinal,hyperoptions}
%%% Formatting options
% FORMAT: Use 1.5 line spacing.
\OnehalfSpacing
% FORMAT: GRS states as a recommendation that:
% spine margin should be at least 40mm,
% other margins should be at least 15mm.
% In effect, their view is the following:
% "We would recommend that they stick with the guidance re. margin on binding edge merely because we still get examiners who prefer to make themselves a physical copy to mark up, rather than using the digital annotation."
% I have taken the stand to set the default value to 3cm on both sizes horizontally,
% while putting 4cm vertically. The implementation below prevents the use of setting
% the blocksize and then letting the margins be defined by a value relatively to that
% blocksize. If you want to use these instead, you need to delete the macros below.
% DOC: Check memoir package sec2.4.2 p.17-21
\newcommand{\horizontalmarginsvalue}[2][*]{\def\margin@spine{#2} \def\margin@foredge{#1}}
\newcommand{\horizontalmarginsratio}[2][*]{\def\margin@spine{#2} \def\margin@hratio{#1}}
\newcommand{\verticalmarginsvalue}[2][*]{\def\margin@up{#2} \def\margin@low{#1}}
\newcommand{\verticalmarginsratio}[2][*]{\def\margin@up{#2} \def\margin@vratio{#1}}
\@ifundefined{margin@spine}{ % none of the horizontal commands have been called
\setlrmarginsandblock{3cm}{*}{1} % default with 3cm each side
}{ % if margin@spine is defined, so is one of margin@foredge or margin@hratio
\@ifundefined{margin@foredge}{ % at least ratio value is defined
\setlrmarginsandblock{\margin@spine}{*}{\margin@hratio}
}{ % at least foredge value is defined; hratio value is discarded if defined
\setlrmarginsandblock{\margin@spine}{\margin@foredge}{*}
}
}
\@ifundefined{margin@up}{ % none of the vertical commands have been called
\setulmarginsandblock{4cm}{*}{1} % default with 3cm each side
}{ % if margin@up is defined, so is one of margin@low or margin@vratio
\@ifundefined{margin@low}{ % at least ratio value is defined
\setulmarginsandblock{\margin@up}{*}{\margin@vratio}
}{ % at least low value is defined; vratio value is discarded if defined
\setulmarginsandblock{\margin@up}{\margin@low}{*}
}
}
% Call the layout to respect the values set
\checkandfixthelayout
% FORMAT: Table of contents must include all document subdivisions.
% Do not go below subsubsections.
\settocdepth{subsubsection}
\setsecnumdepth{subsubsection}
% FORMAT: The font size of the headings should be smaller than the font size of
% the main text.
% NOTE: Hyperref messes up the capitalisation of headings containing a reference
% label, so we use small-caps headings as a workaround.
% See https://tex.stackexchange.com/q/562773/27664
\nouppercaseheads
\pagestyle{headings}
%\makeevenhead{headings}{\thepage}{}{\small\slshape\scshape\leftmark}
%\makeoddhead{headings}{\small\slshape\scshape\rightmark}{}{\thepage}
% FORMAT: A bibliography should contain every item consulted in writing the
% thesis, while a list of references only contains the items explicitly
% mentioned in the document.
\renewcommand{\bibname}{References}
%%% Title page
\newcommand{\department}[1]{\def\@department{#1}}
\newcommand{\qualification}[1]{\def\@qualification{#1}}
\newcommand{\submitdate}[1]{\def\@submitdate{#1}}
\newcommand{\subtitle}[1]{\gdef\cfg@subtitle{#1}}
% Empty submitdate defaults to the current month and year.
% Taken from the yorkThesis class by J H Pickering:
% https://www.york.ac.uk/language/current/resources/software-resources/latex/
\def\@submitdate{%
\ifcase\the\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space \number\the\year}
\newlength{\droplen}
\newcommand*{\makethesistitle}{\begingroup%
% FORMAT: The title page should have number 1 (not visible),
% hence the starred version of `titlingpage`.
\begin{titlingpage*}
% Centre the title with respect to the physical page, not the typeblock
\calccentering{\unitlength}
\begin{adjustwidth*}{\unitlength}{-\unitlength}
\droplen=0.1\textheight
\vspace*{\droplen}
\centering
{\Huge \@title}
\@ifundefined{cfg@subtitle}{}{\\[\baselineskip]{\large\scshape\cfg@subtitle}} \\[2\baselineskip]
{\Large \itshape \@author}\par
\begin{vplace}[2] % Split surrounding vertical space with a 2:1 ratio
{\large \scshape \@qualification}\\[2\baselineskip]
{\LARGE \scshape University of York}\\[.5\baselineskip]
{\LARGE \scshape \@department}
\end{vplace}
{\large \@submitdate}\par
\vspace*{\droplen}
\end{adjustwidth*}
% FORMAT: The abstract should be on page 2, so we prevent clearing to
% the next recto page.
\titlingpageend{\clearforchapter}{\clearforchapter}
\end{titlingpage*}
\endgroup}
\endinput