[Tex/LaTex] Spell out Volume and Edition # in words – Biblatex in German

biblatexbibliographies

Is it possible to make Biblatex output the word "Second" (in German) instead of the number 2?

For example here is my preamble:

\usepackage[utf8]{inputenc}
\usepackage[
    sorting=none,     
  backend=biber,
    babel=other]{biblatex}
\usepackage{csquotes}
\usepackage[german,american]{babel}
\addbibresource{references.bib}

and here is my bibliography entry:

@book{Cantor,
    author="Cantor, Moritz.",
    title="Vorlesungen über Geschichte der Mathematik.  (von 1200 - 1668).",
    language={German},
    volume={2},
    edition={2},
    address="Leipzig",
    publisher="Druck und Verlag von B.G. Teubner",
    date={1900},
    pagetotal="XII + 943 S.",
    hyphenation={ngerman},
    note="(in Germ.)",
}

However, when I run Babel+Biblatex on it, it outputs:

Moritz. Cantor. Vorlesungen uber Geschichte der Mathematik. (von 1200 - 1668). 
German. 2. Aufl. Bd. 2. (in Germ.) Leipzig: Druck und Verlag von B.G. Teubner, 
1900. XII + 943 S.

Whereis I want it to output "Zweite Auflage" and "Zweiter Band" instead of "2.Aufl." and "Bd. 2".

Does anyone know if this is this possible with biblatex?

Best Answer

You could use the fmtcount package for that purpose and redefine the field formats accordingly. For the edition, you can just redefine the \mkbibordedition macro. It is best to do this inside \DefineBibliographyExtras, since this is a language specific string:

\DefineBibliographyExtras{ngerman}{%
  \renewcommand*{\mkbibordedition}[1]{\Ordinalstringnum{#1}[f]}
}

For this to work, you need a bugfix for the current fmtcount version (the author of the package knows about this bug). See the minimal example below.

The volume is somewhat different, since the original definition (taken from biblatex.def) is

\DeclareFieldFormat{volume}{\bibstring{volume}~#1}% volume of a book

We need an auxiliary macro to have the integer transformed into an ordinal number, e.g. \mkbibordvolume, which we can then use in the “volume” field format:

\newcommand*{\mkbibordvolume}[1]{\Ordinalstringnum{#1}[m]}

Again, this is language specific, so the best would be to handle this as with \mkbibordedition. Thus, all in all, you get:

\newcommand*{\mkbibordvolume}{}
\usepackage{fmtcount}
\DefineBibliographyExtras{ngerman}{%
  \renewcommand*{\mkbibordedition}[1]{\Ordinalstringnum{#1}[f]}
  \renewcommand*{\mkbibordvolume}[1]{\Ordinalstringnum{#1}[m]}
}
\DeclareFieldFormat{volume}{\mkbibordvolume{#1}~\bibstring{volume}}

If you want to have “Band” instead of “Bd.” and “Auflage” instead of “Aufl.”, just use the option abbreviate=false (as in the example below). If you want everything else to be abbreviated, but not these two strings, use \DefineBibliographyStrings (see the manual for details).

I made a complete minimal working example from your code snippets:

\documentclass[german,ngerman]{scrartcl}
\listfiles
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Cantor,
    author={Cantor, Moritz},
    title={Vorlesungen über Geschichte der Mathematik (von 1200--1668)},
    language={german},
    volume={2},
    edition={2},
    address={Leipzig},
    publisher={Teubner},
    date={1900},
    hyphenation={german}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel,csquotes}

\usepackage[
  sorting=none,     
  backend=biber,
  babel=other,
  abbreviate=false
]{biblatex}
\addbibresource{\jobname.bib}

\newcommand*{\mkbibordvolume}{}

\usepackage{fmtcount}
\DefineBibliographyExtras{ngerman}{%
  \renewcommand*{\mkbibordedition}[1]{\Ordinalstringnum{#1}[f]}
  \renewcommand*{\mkbibordvolume}[1]{\Ordinalstringnum{#1}[m]}
}

\DeclareFieldFormat{volume}{\mkbibordvolume{#1}~\bibstring{volume}}

% Bugfix für fmtcount:
\makeatletter
\DeclareRobustCommand{\@OrdinalstringMgerman}[2]{%
   \@ordinalstringMgerman{#1}{\@@num@str}%
   \protected@edef#2{\protect\MakeUppercase\@@num@str}%
}
\DeclareRobustCommand{\@OrdinalstringFgerman}[2]{%
   \@ordinalstringFgerman{#1}{\@@num@str}%
   \protected@edef#2{\protect\MakeUppercase\@@num@str}%
}
\DeclareRobustCommand{\@OrdinalstringNgerman}[2]{%
   \@ordinalstringNgerman{#1}{\@@num@str}%
   \protected@edef#2{\protect\MakeUppercase\@@num@str}%
}
\makeatother

\begin{document}
\cite{Cantor}

\printbibliography
\end{document}
Related Question