1

I have two bibLaTex entry

@article{madeUp1,
  title = {MadeUPTitle},
  author = {MadeUp Author1 and MadeUp Author2 and MadeUp Author3 and MadeUp Author4},
  journal = {MadeUpJournal},
  volume = {0},
  issue = {0},
  pages = {000--001},
  numpages = {0},
  year = {2021},
  month = {April},
  publisher = {MadeUpPublisher},
  doi = {www.madeup.com/21321},
}

and

@article{madeUp2,
  title = {MadeUPTitle},
  author = {Author1, Madeup and Author2, Madeup and Author3, Madeup and Author4, Madeup},
  journal = {MadeUpJournal},
  volume = {0},
  issue = {0},
  pages = {000--001},
  numpages = {0},
  year = {2021},
  month = {April},
  publisher = {MadeUpPublisher},
  doi = {www.madeup.com/21321},
}.

I used biber with this style

\usepackage[backend=biber,style=alphabetic,sorting=nyt]{biblatex}.

Therefore, when I use \citeauthor{madeUp1} I get result "MadeUp Author1 and MadeUp Author2 and MadeUp Author3 and MadeUp Author4", which is what I want. However, I would like a command \citeauthorhyphenated to render only the surnames of the authors separated by the proper dash like

"Author1--Author2--Author3--Author4"

when I type \citeauthorhyphenated{madeup1}. Also it should render the same thing with \citeauthorhyphenated{madeUp2}. A search online does not render any results and hence I am stuck...

1 Answer 1

1

Funnily enough, there was a related question not too long ago (Biblatex - hyphen between author names when using citet), we can use the methods explained there. One easy solution is to pack \AtNextCite with suitable \DeclareDelimFormat definitions together with \citeauthor into a new command.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=alphabetic, sorting=nyt, maxcitenames=999]{biblatex}

\makeatletter
\newcommand*{\citeauthorattr}{%
  \AtNextCite{%
    \DeclareDelimFormat{multinamedelim}{\textendash\penalty\hyphenpenalty}%
    \DeclareDelimAlias{finalnamedelim}{multinamedelim}%
  }%
  \citeauthor}
\makeatother

\begin{filecontents}{\jobname.bib}
@article{madeUp1,
  title   = {MadeUPTitle},
  author  = {MadeUp Author1 and MadeUp Author2
             and MadeUp Author3 and MadeUp Author4},
  journal = {MadeUpJournal},
  volume  = {0},
  issue   = {0},
  pages   = {000--001},
  year    = {2021},
  month   = apr,
  doi     = {www.madeup.com/21321},
}
@article{madeUp2,
  title   = {MadeUPTitle},
  author  = {Author1, Madeup and Author2, Madeup
             and Author3, Madeup and Author4, Madeup},
  journal = {MadeUpJournal},
  volume  = {0},
  issue   = {0},
  pages   = {000--001},
  year    = {2021},
  month   = apr,
  doi     = {www.madeup.com/21321},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{madeUp1} ipsum \autocite{madeUp2}

Lorem \citeauthor{madeUp1} ipsum \citeauthor{madeUp2}

Lorem \citeauthorattr{madeUp1} ipsum \citeauthorattr{madeUp2}

\printbibliography
\end{document}

Lorem Author1–Author2–Author3–Author4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .