diff --git a/authesis.cls b/authesis.cls index cdbedcb..4299c43 100644 --- a/authesis.cls +++ b/authesis.cls @@ -28,6 +28,8 @@ \LoadClass[letterpaper,12pt,oneside]{report} +\RequirePackage{xkeyval} + \RequirePackage[english]{babel} \RequirePackage{geometry} \RequirePackage{setspace} @@ -37,16 +39,21 @@ % Dissertation (default) or thesis \newif\ifdissertation \dissertationtrue -\DeclareOption{thesis}{\dissertationfalse} +\DeclareOptionX{thesis}{\dissertationfalse} % Whether to print copyright notice \newif\ifcopyright \copyrighttrue -\DeclareOption{nocopyright}{\copyrightfalse} +\DeclareOptionX{nocopyright}{\copyrightfalse} % Whether to make the text ragged \newif\ifragged \raggedfalse -\DeclareOption{ragged}{\raggedtrue} -\ProcessOptions\relax +\DeclareOptionX{ragged}{\raggedtrue} +% Bibliography style +\PassOptionsToPackage{style=phys}{biblatex} +\DeclareOptionX{bibstyle}[phys]{ + \PassOptionsToPackage{style=#1}{biblatex} +} +\ProcessOptionsX\relax % Default formatting \newgeometry{margin=1in} @@ -232,3 +239,9 @@ \renewcommand*{\l@section}{\@dottedtocline{1}{1.5em}{2.5em}} \renewcommand*{\l@figure}{\@dottedtocline{0}{0em}{2.5em}} \renewcommand*{\l@table}{\@dottedtocline{0}{0em}{2.5em}} + +% bibliography +\RequirePackage[backend=biber, biblabel=brackets, defernumbers=true]{biblatex} +\DeclareCiteCommand{\citenum}{}{\bibhyperref{\printfield{labelnumber}}}{\multicitedelim}{} +\setlength{\bibitemsep}{\baselineskip} +\AtBeginBibliography{\singlespacing} \ No newline at end of file diff --git a/main.tex b/main.tex index dec92b2..ea4375d 100644 --- a/main.tex +++ b/main.tex @@ -13,6 +13,7 @@ % * thesis: Master's thesis rather than dissertation % * nocopyright: Disable copyright notice % * ragged: Use ragged right edge rather than justified text (better for accessibility) +% * bibstyle: biblatex bibliography style \documentclass{authesis} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -30,11 +31,12 @@ % \includegraphics[alt={Alt text...}]{image.png} \usepackage{graphicx} -% Bibliography. biber must be set as the backend, style can be changed. +% Bibliography (uses biblatex with biber as backend) +% Set the bibliography style using the bibstyle option of the class. +% Most other options can be changed here using +% \ExecuteBibliographyOptions{} \usepackage[hidelinks,pdfusetitle]{hyperref} \urlstyle{same} -\usepackage[backend=biber,style=phys,biblabel=brackets,defernumbers=true]{biblatex} -\DeclareCiteCommand{\citenum}{}{\bibhyperref{\printfield{labelnumber}}}{\multicitedelim}{} \addbibresource{./references.bib} % Footnotes