Last active
May 23, 2020 12:52
-
-
Save markvdw/c7d5e44dbb353e2b91a114eed744b1d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage[hyperref,style=authoryear-comp,natbib=true,maxbibnames=10,maxcitenames=2,useeditor=false,url=false,useprefix,giveninits=false,uniquelist=false,sortcites=false]{biblatex} | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% This makes all titles sentence case, while leaving journals as title case | |
\DeclareFieldFormat{sentencecase}{\MakeSentenceCase{#1}} | |
\renewbibmacro*{title}{% | |
\ifthenelse{\iffieldundef{title}\AND\iffieldundef{subtitle}} | |
{} | |
{\ifthenelse{\ifentrytype{article}\OR\ifentrytype{inbook}% | |
\OR\ifentrytype{incollection}\OR\ifentrytype{inproceedings}% | |
\OR\ifentrytype{inreference}\OR\ifentrytype{phdthesis}} | |
{\printtext[title]{% | |
\printfield[sentencecase]{title}% | |
\setunit{\subtitlepunct}% | |
\printfield[sentencecase]{subtitle}}}% | |
{\printtext[title]{% | |
\printfield[titlecase]{title}% | |
\setunit{\subtitlepunct}% | |
\printfield[titlecase]{subtitle}}}% | |
\newunit}% | |
\printfield{titleaddon}} | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Clean up the bibtex rather than editing it | |
\AtEveryBibitem{ | |
\clearlist{address} | |
\clearfield{date} | |
\clearfield{eprint} | |
\clearfield{isbn} | |
\clearfield{issn} | |
\clearlist{location} | |
\clearfield{month} | |
\clearfield{series} | |
\clearfield{pages} | |
\clearfield{volume} | |
\clearfield{number} | |
\ifentrytype{book}{}{% Remove publisher and editor except for books | |
\clearlist{publisher} | |
\clearname{editor} | |
} | |
} | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Square brackets | |
\newrobustcmd*{\parentexttrack}[1]{% | |
\begingroup | |
\blx@blxinit | |
\blx@setsfcodes | |
\blx@bibopenparen#1\blx@bibcloseparen | |
\endgroup} | |
\AtEveryCite{% | |
\let\parentext=\parentexttrack% | |
\let\bibopenparen=\bibopenbracket% | |
\let\bibcloseparen=\bibclosebracket} | |
% \makeatother | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% First names first, but sort by last name | |
\DeclareNameAlias{sortname}{given-family} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment