4

I am trying to somehow support multiple writings for names (romaji, kanji, hanzi, furigana, etc) of authors. Now this is not supported, and the experimental vform interface never made it into biblatex.

I came up with the idea to define a new entry type for authors, and reference these authors in books (some similar to related).

Here is a minimal version of the multiscript.dtx:

\DeclareDatamodelEntrytypes{person}
\DeclareDatamodelFields[type=field,datatype=literal]{
  kanji,
  furi,
}
\DeclareDatamodelFields[type=list,datatype=name]{
   romaji,
}
\DeclareDatamodelEntryfields[person]{
   kanji,
   furi,
   romaji,
}

and a little mwe.bib:

@person{n1,
   kanji = {kanji},
  furi  = {furi},
  romaji = "First Second",
}
@book{b1,
  author = {n1},
  title  = {A great book},
}

With these in hand the following mwe.tex compiles:

\documentclass[english]{article}
\usepackage{csquotes}
\usepackage[datamodel=multiscript,backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{\jobname.bib}

\newbibmacro*{romaji}{%
  \printnames{romaji}%
}
\newbibmacro*{kanji}{%
  [\printfield{kanji}]}
\newbibmacro*{furi}{%
  (\printfield{furi})}

\DeclareBibliographyDriver{person}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{romaji}%
  \addspace
  \usebibmacro{furi}%
  \addspace
  \usebibmacro{kanji}%
  \addspace
  \usebibmacro{finentry}}
\begin{document}
\nocite{*}
The author First Second \cite{n1} wrote book \cite{b1}.

\printbibliography
\end{document}

Now, what I would like to achieve is something that when the book is printed, there is a loop over the lastnames (which are just links to other entries), and then using

\entrydata{<lastname>}{%
  \printnames{romaji} ....

so that the linked entry is used to print the names.

I tried

\renewcommand\mkbibnamefamily[1]{%
  \message{[mkbibnamefamily] key = #1 ^^J}
  \entrydata{#1}{%
     \printnames{romaji} (\printfield{kanji}, \printfield{furi})}}

but that didn't work, no last name and no field whatsoever displayed. Also, the function would be used also for listing references to names (\cite{n1}, which is also useful in the current context).

Any suggestion how to implement this indirection?

Thanks

Norbert

  • 1
    I like your idea to export person infos. I don't have currently the time to test but imho in your current setup it is difficult to handle more than one author and also it could get difficult if not every author has a @person entry. Did you saw github.com/plk/biblatex/issues/416 which added extended possibilities to define author names? Imho it would be a good idea to ask there for a "crossref={key}" option – Ulrike Fischer Jul 6 '16 at 10:27
  • Thanks, yes I have seen that feature request. I guess one could check whether there is an entry and if not treat it as a normal name instead of a reference. Or one adds \refname{n1} in the author, would also be fine. – norbert Jul 6 '16 at 10:41
  • I'll think about this too . There are many difficulties with implenting multiscript support and I've also thought about using something like the related entries model. – PLK Jul 6 '16 at 14:41
  • Hi Phil, that would be great - but do you have a suggestion how to manage this for the above single case? Is it possible to make mkbibnamefamily only act on some entry types? – norbert Jul 7 '16 at 5:01
1

You need to stop the recursion into \mkbibnamefamily via \printnames when the argument is not a reference to another entry otherwise the \entrydata call will have nothing useful in it:

\renewcommand\mkbibnamefamily[1]{%
  \message{[mkbibnamefamily] key = #1 ^^J}%
  \ifentryinbib{#1}%
    {\entrydata{#1}{%
       \printnames{romaji} (\printfield{kanji}, \printfield{furi})}}
    {#1}}
  • Thanks indeed! The \ifentryinbib was what I was searching for. Great. – norbert Jul 8 '16 at 0:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.