Skip to content

Instantly share code, notes, and snippets.

@moewew
Created September 2, 2021 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moewew/047760379b8a73fa7a148951a5c87fa5 to your computer and use it in GitHub Desktop.
Save moewew/047760379b8a73fa7a148951a5c87fa5 to your computer and use it in GitHub Desktop.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear]{biblatex}
\newrobustcmd*{\nextcitefullname}{%
\AtNextCite{\DeclareNameAlias{labelname}{given-family}}}
% Not sure if I should be using \DeclareCiteCommand here instead.
\NewDocumentCommand \citeauthorfullname { s } {
\nextcitefullname
\IfBooleanTF #1 { \citeauthor* } { \citeauthor }
}
\NewDocumentCommand \Citeauthorfullname { s } {
\nextcitefullname
\IfBooleanTF #1 { \Citeauthor* } { \Citeauthor }
}
\NewDocumentCommand \textcitefullname { } {
\nextcitefullname
\textcite
}
\NewDocumentCommand \Textcitefullname { } {
\nextcitefullname
\textcite
}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
\citeauthor{sigfridsson}
\citeauthorfullname{sigfridsson}
\printbibliography
\end{document}
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=authoryear, natbib]{biblatex}
\newrobustcmd*{\nextcitefullname}{%
\AtNextCite{\DeclareNameAlias{labelname}{given-family}}}
\newcommand\citeauthorfullname{%
\nextcitefullname\citeauthor}
\newcommand\Citeauthorfullname{%
\nextcitefullname
\Citeauthor}
\newcommand\textcitefullname{%
\nextcitefullname
\textcite}
\newcommand\Textcitefullname{%
\nextcitefullname
\textcite}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson}
\citeauthor{sigfridsson}
\citeauthorfullname{sigfridsson}
\citeauthor{aksin}
\citeauthor*{aksin}
\citeauthorfullname{aksin}
\citeauthorfullname*{aksin}
\printbibliography
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment