1

I'm writing a publication that requires me to highlight specific references for special interest. In the references list, the citation needs to have a asterisk like this: "[3] * Author, etc".

Based on some other answers on the internet (sorry, did this weeks ago, can't find the posts anymore) I wrote the code below. The command \bibnote allows me to do: \bibnote{citationkey}{Note about this particular article.}.

\makeatletter
\newcommand{\bibnote}[2]{\csdef{cbx@#1@bibnote}{#2}}
\renewbibmacro*{begentry}{%
  \ifcsdef{cbx@\thefield{entrykey}@bibnote}{%
    *%
}{}}
\renewbibmacro*{finentry}{%
  \ifcsdef{cbx@\thefield{entrykey}@bibnote}{%
    \\\textit{\csuse{cbx@\thefield{entrykey}@bibnote}}%
}{}}
\makeatother

The code works, with one annoying caveat: each reference in the list now ends with a newline and period, followed by the next entry:

[1] Author, Title, ...
.[2] Author, Title, ...
.[3] * Author, Title, ...

I've tried digging into the code of biblatex, but I wasn't able to remove the period. \renewcommand*{\finentrypunct}{\nopunct} does nothing. Anyone with enough knowledge of biblatex to help me solve this problem?

Another problem is that in the text, the citations of interest need to have an asterisk like this: "[3*]". I now solve that when citing, using post-notes, but that's quite error-prone. Is there a way to automatically add a post-note to every citation based on the citation key?

2
  • 1
    I deleted my suggestion as it is not appropriate for your situation, especially if changing the keywords will apply globally in your database. Hope someone else can help you out.
    – user245306
    Commented Aug 30, 2021 at 12:43
  • 1
    Thanks for your suggestion anyway, @LaccaseTVersicolor.
    – Peter
    Commented Aug 30, 2021 at 14:43

2 Answers 2

2

If you add the asterisk to the labelnumber field format, you can get it in citations and the bibliography at the same time.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=numeric]{biblatex}

\newcommand{\bibnote}[2]{\csdef{cbx@#1@bibnote}{#2}}

\renewbibmacro*{finentry}{%
  \ifcsundef{cbx@\thefield{entrykey}@bibnote}
    {}
    {\\\textit{\csuse{cbx@\thefield{entrykey}@bibnote}}}%
  \finentry
}

\DeclareFieldFormat{labelnumber}{%
  #1%
  \ifcsundef{cbx@\thefield{entrykey}@bibnote}
    {}
    {*}}

\bibnote{sigfridsson}{Note about this particular article.}


\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}
dolor \autocite{worman}
sit \autocite{nussbaum}

\printbibliography
\end{document}

Lorem [2*] dolor [3] sit [1]

1
  • Thank you for your suggestion. Unfortunately, this is not meet the requirements of the journal I'm submitting my paper to. The answer might help others with similar questions, though, so I would leave it here.
    – Peter
    Commented Aug 31, 2021 at 8:25
1

In proper fashion I figured out what was wrong myself. I'll let the post up for others to see.

The renewal of the bibmacro finentry was missing the call \finentry. The command \finentry is separate from the bibmacro finentry and calls \blx@initunit, which starts the next entry (I think).

My current solution is:

\renewbibmacro*{finentry}{%
  \ifcsdef{cbx@\thefield{entrykey}@bibnote}{%
    \\\textit{\csuse{cbx@\thefield{entrykey}@bibnote}}%
  }{}%
  \finentry%
}

My second question wasn't solved yet.

You must log in to answer this question.

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