0

I want to prevent biblatex using OldStyle figures for supercite indices.

MWE:

% !TEX engine=xelatex
\documentclass{scrreprt}

\usepackage{fontspec}
\setmainfont
     [ BoldFont       = texgyrepagella-bold.otf ,
       ItalicFont     = texgyrepagella-italic.otf ,
       BoldItalicFont = texgyrepagella-bolditalic.otf,
       Numbers = OldStyle ]
     {texgyrepagella-regular.otf}
 \linespread{1.05}

\newfontfamily\biblatexfont{texgyrepagella-regular.otf}

\usepackage{filecontents}
\begin{filecontents}{mwe.bib}
  @book{book_sze,
    title = {Physics of Semiconductor Devices},
    author = {Sze, S.M.},
    date = {1969},
    publisher = {{WILEY-INTERSCIENCE}},
    location = {{Bell Telephone Laboratories, Incorporated Murray Hill, New Jersey}},
  }
\end{filecontents}


\usepackage{biblatex}
\addbibresource{mwe.bib}

\DeclareCiteCommand{\supercite}[\mkbibsuperscript]
  {}{}{\biblatexfont\usebibmacro{citeindex}}
  {\supercitedelim}{}

\begin{document}
  Test sentence\supercite{book_sze} 1234567
\end{document}

I don't get any citeindex, the entry is just empty. I'm using XeLaTeX. Is it the wrong bibmacro? But if so, where can I find a list with valid bibmacros?

3
  • 1
    citeindex sends the author name and title to the index (with \index), but your document has no setup for an index, so that macro won't do anything useful for you. The original definition of \supercite for your setup can be found in numeric.cbx: github.com/plk/biblatex/blob/…. Basically you are missing the crucial bit \usebibmacro{cite} in your definition.
    – moewe
    Commented Apr 29, 2020 at 15:22
  • 1
    I am not aware of an exhaustive list of available bibmacros, but you should be able to find everything you need in biblatex.def, standard.bbx as well as <style>.bbx, <style>.cbx (and files loaded by those style files). (I usually grep the complete biblatex folder if I look for a definition.)
    – moewe
    Commented Apr 29, 2020 at 15:25
  • Thanks, that was the missing bit
    – ju.
    Commented Apr 29, 2020 at 16:20

1 Answer 1

2

citeindex sends the author name and title to the index (with \index), but your document has no setup for an index, so that macro won't do anything useful for you. You can find its definition in biblatex.def (ll. 2305-2309 in v3.14).

The original definition of \supercite in your setup (if you don't pass any style options to biblatex that is equivalent to style=numeric,) can be found in numeric.cbx (ll. 98-108 in v3.14)

\DeclareCiteCommand{\supercite}[\mkbibsuperscript]
  {\iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\supercitedelim}
  {}

If you compare that with the definition in the MWE you see that the MWE is missing the checks and warnings for pre- and postnote and more crucially, the MWE is missing

\usebibmacro{cite}

The bibmacro cite is responsible for printing the actual citation label in the numeric style (and most other styles), so that explains why you don't see anything if you leave it out.

I'd probably define your \supercite as follows

\newrobustcmd{\mkbibsuperscriptoldstyle}[1]{\mkbibsuperscript{{\biblatexfont#1}}}

\DeclareCiteCommand{\supercite}[\mkbibsuperscriptoldstyle]
  {\iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\supercitedelim}
  {}

(Technically speaking the double braces in \mkbibsuperscript{{\biblatexfont#1}} aren't necessary because \mkbibsuperscript already has an explicit group that would prevent the font change from leaking out, but I don't know if you want to rely on that implementation detail.)


There is no list of all defined bibmacros, but this list alone would probably be not that useful anyway as you would need to know the actual definitions of the bibmacros to make sense of things. You should be able to find everything you need to know in

  • biblatex.def (basic bibmacro and format definitions, always loaded by biblatex)
  • standard.bbx (defines the bibliography drivers and more complex bibmacros used by all biblatex standard styles and many contributed styles; not all contributed styles load this file, but most do)
  • <bibstyle>.bbx and <citestyle>.cbx where <bibstyle> and <citestyle> are the name of the bibliography and citation style you use. Note that these files may load other styles via \RequireBibliographyStyle and \RequireCitationStyle or other methods.

I usually just grep the whole biblatex directory (https://github.com/plk/biblatex/tree/master/tex/latex/biblatex) when I'm looking for a definition.

You must log in to answer this question.

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