0

I am using a custom citation format based on biblatex:

\DeclareCiteCommand{\mycite}
      {\usebibmacro{prenote}}
      {\usebibmacro{author}
      \newunitpunct
        \usebibmacro{journal}
        \newunitpunct
        \usebibmacro{date}}
      {\multicitedelim}
      {\usebibmacro{postnote}}

This leads to entries such as (A. Einstein, Annalen der Physik, 1916).

Unfortunately if A. Einstein publishes two papers in the same year in the same journal, this is not a unique way to refer to each paper.

What would be the good way to obtain (A. Einstein, Annalen der Physik, 1916a) and (A. Einstein, Annalen der Physik, 1916b), if possible in an elegant way?

Thank you!


I have added a MNWE:

\documentclass{article}

\usepackage[backend=biber, sorting=ydnt, sortcites=true, defernumbers=true, maxbibnames=99, natbib=true, giveninits=true]{biblatex}

\usepackage{hyperref}

\DeclareCiteCommand{\mycite} {\usebibmacro{prenote}} {\usebibmacro{author} \newunitpunct \usebibmacro{journal} \newunitpunct \usebibmacro{date}} {\multicitedelim} {\usebibmacro{postnote}}

\usepackage{filecontents} \begin{filecontents}{\jobname.bib} @article{einstein_Elektrodynamik, author = {Albert Einstein}, title = {Zur Elektrodynamik bewegter Körper}, journal = {Annalen der Physik}, number = {322}, issue = {10}, pages = {891--921}, date = {1905}, } @article{einstein_Lichtes, author = {Albert Einstein}, title = {Über einen die Erzeugung und Verwandlung des Lichtes betreffenden heuristischen Gesichtspunkt}, journal = {Annalen der Physik}, number = {322}, issue = {6}, pages = {132--148}, date = {1905}, } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document}

\mycite{einstein_Elektrodynamik}

\mycite{einstein_Lichtes}

\printbibliography \end{document}

leparc
  • 163
  • The best solution here depends on the style you are using and the facilities it makes available. Please show us a small example document that embeds the code above into the biblatex context you intend to use it in. – moewe Sep 20 '22 at 16:50
  • Thank you @moewe, I have added a MNWE. – leparc Sep 21 '22 at 06:00
  • Just to be clear: You do not explicitly use biblatex's style option? This means that your normal citation style is numeric. Is that desired? Do you actually use numeric citations and the corresponding bibliography? (You could get much closer to what you have right now if you started from style=authoryear, or maybe style=authortitle,...) – moewe Sep 21 '22 at 06:09
  • No, I have not found a way to attain the citation I wish that way. – leparc Sep 21 '22 at 06:50
  • But you'd be closer. What exactly is your plan here? Do you want all citations to show author+journal+year? What about works that are not @articles i.e. that are not published in a journal. – moewe Sep 21 '22 at 07:02
  • My current command displays X. Author et al., Year for @inproceedings which I also have in the document. This is acceptable at this stage. – leparc Sep 21 '22 at 08:07

1 Answers1

0

Many thanks @moewe! I think I now have it:

\usepackage[backend=biber, sorting=ydnt, sortcites=true, style=authoryear,%
 maxbibnames=99, maxnames=1, minnames=1, natbib=true, giveninits=true,%
 defernumbers=true, uniquelist=false]{biblatex}

\renewbibmacro*{cite}{% \iffieldundef{shorthand} {\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}} {\usebibmacro{cite:label}} {\printnames[mynameformat]{labelname}}% \setunit{\addcomma\space}% \usebibmacro{journal}% \setunit{\addcomma\space}% \usebibmacro{cite:labeldate+extradate}} {\usebibmacro{cite:shorthand}}}

\renewbibmacro*{cite:labeldate+extradate}{% \iffieldundef{labelyear} {} { \printtext[bibhyperref]{% \printlabeldateextra}}}

\renewcommand{\mkbibnamefamily}[1]{\textsc{#1}}

\DeclareNameFormat{mynameformat}{% \usebibmacro{name:given-family} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffix}% \usebibmacro{name:andothers}}

\renewcommand{\multicitedelim}{\addsemicolon\space} \renewcommand{\newunitpunct}{\addcomma\addspace}

Also using this post: author-journal-(year) style for biblatex

leparc
  • 163