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
This commit is contained in:
Alphrag
2023-12-22 00:45:16 +01:00
parent 2e9103c4af
commit 716aac3da1
6 changed files with 137 additions and 32 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,7 +27,7 @@
%%% ==== 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,8pt]{uoythesis}
\documentclass[foredge=*,margins={spine=3cm,foredge=2cm},draft,pagenb=foot,hyperoptions={colorlinks=true}]{uoythesis}
% Import the personal options for the class
\usepackage{thesisoptions}
@@ -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

@@ -87,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,7 +98,15 @@
]{biblatex}
\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

@@ -20,8 +20,8 @@
% https://git.tigrau.ovh/Ambroise/LaTeX-Templates/.
% Comments starting with FORMAT highlight requirements from the UoY thesis
% regulations, as of November 2023.
% 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}
@@ -29,73 +29,134 @@
\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}
\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
\PassOptionsToClass{twoside}{memoir}
\DeclareOptionX{oneside}{\uoyth@onesidedtrue \PassOptionsToClass{oneside}{memoir}}
\DeclareOptionX{twoside}{\uoyth@onesidedfalse \PassOptionsToClass{twoside}{memoir}}
% new available options: pagenbhead, pagenbfoot, noxr, nohyperref, hyperfinal, margins
% 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]{
\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{nohyperref}}
\define@boolkey+{uoythesis.cls}[uoyth@]{hyperfinal}[true]{}{\RaiseBooleanValueWarning{hyperfinal}}
\ExecuteOptionsX{hyperfinal}
\DeclareOptionX{hyperoptions}{
\ClassInfo{uoythesis.cls}{Passing options '#1' to package hyperref}
\ClassInfo{uoythesis}{Passing options '#1' to package hyperref}
\PassOptionsToPackage{#1}{hyperref}
}
%\ExecuteOptionsX{hyperoptions={}}
\ExecuteOptionsX{hyperoptions={}}
% FORMAT: Font size must be at least 11pt, with 12pt recommended
\newcommand{\uoyth@fontsize}{12pt}
\newcommand{\uoyth@setsmallfontsize}{
\renewcommand{\uoyth@fontsize}{11pt}
\PassOptionsToClass{11pt}{memoir}
\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'}}
}
\DeclareOptionX{8pt}{\uoyth@setsmallfontsize \RaiseFontSizeValueWarning{\CurrentOption}}
\DeclareOptionX{9pt}{\uoyth@setsmallfontsize \RaiseFontSizeValueWarning{\CurrentOption}}
\DeclareOptionX{10pt}{\uoyth@setsmallfontsize \RaiseFontSizeValueWarning{\CurrentOption}}
\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*{%
\PassOptionsToClass{\CurrentOption}{memoir}
\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}
}
}
% FORMAT: Avoid blank pages.
\PassOptionsToClass{openany}{memoir}
% FORMAT: The document must be on A4 paper.
\PassOptionsToClass{a4paper}{memoir}
\ProcessOptionsX
\LoadClass[\uoyth@fontsize]{memoir}
\ifuoyth@draft
\AddToClassOptionList{draft}
\else
\AddToClassOptionList{final}
\fi
\ifuoyth@onesided
\AddToClassOptionList{oneside}
\else
\AddToClassOptionList{twoside}
\fi
\disable@keys{uoythesis.cls}{draft,oneside,8pt,9pt,10pt}
\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