Revert to biblatex alphabetic style

This commit is contained in:
2024-10-18 15:57:49 +02:00
parent 0298c2cd44
commit b4a3909bae

View File

@@ -1,38 +1,56 @@
\usepackage[ \usepackage[
backend=biber, backend=biber,
style=ext-authoryear-comp, style=ext-alphabetic,
backref=true,% Show page numbers where citations appear backref=true,% Show page numbers where citations appear
maxbibnames=99,% Show all authors in bibliography maxbibnames=99,% Show all authors in bibliography
maxalphanames=1,% Show only one author in citations keys maxalphanames=1,% Show only one author in citations keys
maxcitenames=1,% Show only one authors in citations in text maxcitenames=1,% Show only one authors in citations in text
uniquelist=false, % Force to show only one author in citations uniquelist=false,% Force to show only one author in citations
]{biblatex} ]{biblatex}
% Use square brackets instead of parentheses for citations (https://tex.stackexchange.com/a/499667) % Define citation style to be [Author, Year]
\DeclareOuterCiteDelims{cite}{\bibopenbracket}{\bibclosebracket} % From https://tex.stackexchange.com/a/176119
\DeclareInnerCiteDelims{textcite}{\bibopenbracket}{\bibclosebracket} \DeclareLabelalphaTemplate{
\DeclareOuterCiteDelims{parencite}{\bibopenbracket}{\bibclosebracket} \labelelement{% Author
\field[final]{shorthand}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space} % Add comma between author and year in citations \field{labelname}
\field{label}
% Include the author's name in the hyperlink to the reference (https://tex.stackexchange.com/a/499667) }
\DeclareFieldFormat{linkallcite}{% \labelelement{% Comma
\DeclareFieldFormat{bibhyperref}{##1}% \literal{,\addhighpenspace}
\bibhyperref{#1}% }
\labelelement{% Year
\field{year}
}
} }
\AtIntrocite{\DeclareFieldFormat{linkallcite}{#1}}
\letbibmacro{oldcite}{cite} % Use prefix + family name for 'Author' in citation keys
\renewbibmacro{cite}{% \DeclareLabelalphaNameTemplate{
\printtext[linkallcite]{\usebibmacro{oldcite}}% \namepart[use]{prefix}
\namepart{family}
} }
\renewcommand*{\labelalphaothers}{\ et~al.} % Remove "et al." in citation keys
% Define \textcite to be Author [Yeara] (magically defined by Copilot)
\DeclareCiteCommand{\textcite}
{\usebibmacro{prenote}}
{%
\ifciteindex{\indexnames{labelname}}{}%
\bibhyperref{\printnames{labelname}}% Author
\setunit{\addspace}% Space
\printtext[brackets]{\bibhyperref{\printdateextra}}% Year
}
{\multicitedelim}
{\usebibmacro{postnote}}
% Remove some fields from bibliography % Remove some fields from bibliography
\AtEveryBibitem{ \AtEveryBibitem{
\ifentrytype{book}{}{ % Keep ISBN only for books \ifentrytype{book}{}{ % Keep ISBN only for books
\clearfield{isbn}% \clearfield{isbn}%
} }
\clearfield{day}% \clearfield{day}%
\clearfield{doi}%
\clearlist{editor}% \clearlist{editor}%
\clearfield{extra}% \clearfield{extra}%
\clearfield{location}% \clearfield{location}%