2

I would like to create a document with a bibliography using XeLaTeX with Biber. In the bibliography, there are Chinese books and articles, as well as English or German ones. Some of the authors have written articles (or books, what doesn’t really matter here) both in Chinese and English. In the Chinese articles, I would like to also give the authors Chinese name using Characters, whereas in his English articles there is no such need for it.

Below is an example taken of my bib file. The \zh{} function is used to prevent latex to print the characters in footnotes as well:

@article{Liu2008,
  author    = {Liu, {Guofu \zh{(刘国福)}}},
  title     = {The Latest Development of Immigration Law: On the Transformation of China's Emmigration and Immigration Administration Law (移民法的最新发展——兼论中国出入境管理法的改造和重塑)},
  journal   = {Journal of Henan Administrative Institute of Politics and Law (河南省政法管理干部学院学报)},
  year      = {2008},
  volume    = {5},
  pages     = {46--58},
  language  = {chinese},
  keywords  = {article,hani}
}

@book{Liu2011,
  author    = {Liu, {Guofu \zh{(刘国福)}}},
  title     = {Chinese Immigration Law},
  year      = {2011},
  publisher = {Ashgate},
  address   = {Farnham},
  language  = {english},
  keywords  = {monography,latn}
}

Now the point is: Biber of course only recognizes the author as being the same if the contents of the author fields are the same in both records. If I don’t use the Chinese characters in the English article as well, Biber will write the full name so as to make the “two” authors distinguishable, ignoring the fact that they are actually the same.

Now, I got everything as I wanted: In the Bibliography, the authors’ names have the pattern “LIU, Guofu (刘国福) (2008)”, and in the footnotes there is just “LIU 2008” (as long as there is no other author named Liu).

I did this with the following code-snippet in the preamble part of my tex file:

\providecommand{\zh}[1]{}
\AtBeginBibliography{%
 \renewcommand*{\zh}[1]{#1}
}

But: How do I tell LaTeX not to print the \zh{} part in the author field if the entry has not chinese set as language. Is there any such way to set this conditionally? Also, in the footnotes the Chinese characters should never appear. It would be nice if I could tell LaTeX how to do in the tex file directly.

There are also articles with multiple authors which should then have the pattern of “WANG, Liping (王丽萍); ZHANG, Ailing (张爱玲) (2008)” what makes the use of just another entry field for the Chinese characters somewhat complicated, I guess.


Edit (2014-03-22):

It seems that my problem has already been considered elsewhere:

How to create multilingual (English, Japanese) bibliographies with biblatex, biber and polyglossia

So, as of biblatex 3.0 and biber 2.0 (both versions are in experimental stage at the moment) there is a possibility to save transcriptions or translations for most fields and, even more amazing, there is a way to set the display mode (show original language, show translation, etc.) for each bib entry separately.

Edit (2014-03-23):

Another approach, using the name affix:

https://tex.stackexchange.com/a/66825/47927

This seems to be a working example of ienissei’s proposal.

  • 1
    Could you put the \zh command as a post-name thing, like "Junior" or "Senior" with American names? Then you could have two different name formats – one for the .bbx and one for the .cbx – ienissei Mar 13 '14 at 21:57
  • Interesting idea, but still I would have to check whether the bib entry is Chinese or not, since I would have to hide the \zh{} part when the entry’s language is not Chinese and show it when it is, because there might be authors with “Jr.” or “Sr.” among the non-Chinese ones, whose names I would like to print out completely. Still, I’ll give it a try. – Jasper Habicht Mar 14 '14 at 16:19
  • 1
    There is a langid field for that and hyphenation purposes, but that would mean the entire entry would be treated as Chinese unless you tweak with Babel. – ienissei Mar 15 '14 at 19:08
  • But, to come back to my initial question, isn’t there any possibility to check the contents of a bib-field and process the layout formatting based on its value? – Jasper Habicht Mar 16 '14 at 13:34
  • 1
    Thanks for your ideas! I guess I will indeed add another field, maybe for the author, to be printed when the entry is not Chinese. I will work on this an put my results here (as long as they work as intended). – Jasper Habicht Mar 19 '14 at 7:31
4

To finally give an comprehensive answer to my own question for future reference, the following will do what I initially wanted:

First of all, there is no need to use the \zh{} token, as this example will work with using the name affix as described here by Audrey: https://tex.stackexchange.com/a/66825/47927

I didn’t use the titleaddonpart of Audrey’s proposal, since I have no need for this. Also, I stuck to only using the last-first name order.

So, the bibliography entries should be like this (the keyword ‘latn’ or ‘hani’ representing the writing system of the respective article and being used to conditionally hide the Chinese part of the name):

@article{Liu2008,
  author    = {Liu, 刘国福, Guofu},
  title     = {The Latest Development of Immigration Law: On the Transformation of China's Emmigration and Immigration Administration Law (移民法的最新发展——兼论中国出入境管理法的改造和重塑)},
  journal   = {Journal of Henan Administrative Institute of Politics and Law (河南省政法管理干部学院学报)},
  year      = {2008},
  volume    = {5},
  pages     = {46--58},
  language  = {chinese},
  keywords  = {article,hani}
}

@book{Liu2011,
  author    = {Liu, 刘国福, Guofu},
  title     = {Chinese Immigration Law},
  year      = {2011},
  publisher = {Ashgate},
  address   = {Farnham},
  language  = {english},
  keywords  = {monography,latn}
}

Now the part for the .tex file (slightly edited from the above linked posting of Audrey):

% Keep name affixes for English names
\forcsvlist{\listadd\nameaffixlist}{Junior,Senior}
\newcommand{\ifnameaffix}[1]{%
 \ifboolexpr{test{\ifrmnum{#1}} or test{\ifinlist{#1}{\nameaffixlist}}}}

% Set label format using last-first order
\DeclareNameFormat{labelname}{%
 \ifboolexpr{test{\ifblank{#7}} or test{\ifnameaffix{#7}}}
  {\ifcase\value{uniquename}%
   \usebibmacro{name:last}{#1}{#3}{#5}{#7}\or
   \ifuseprefix
    {\usebibmacro{name:last-first}{#1}{#4}{#5}{#8}}
    {\usebibmacro{name:last-first}{#1}{#4}{#6}{#8}}\or
    \usebibmacro{name:last-first}{#1}{#3}{#5}{#7}\fi}%
  {\ifnumequal{\value{uniquename}}{0}%
   {\usebibmacro{name:cjk}{#1}{}{}}
   {\usebibmacro{name:cjk}{#1}{#3}{}}}%
 \usebibmacro{name:andothers}
}

% Set name field format also using last-first order
\DeclareNameFormat{last-first}{%
 \ifboolexpr{test{\ifblank{#7}} or test{\ifnameaffix{#7}}}
  {\iffirstinits
   {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}
   {\usebibmacro{name:last-first}{#1}{#3}{#5}{#7}}}
  {\usebibmacro{name:cjk}{#1}{#3}{#7}}%
 \usebibmacro{name:andothers}
}
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}

% Making Chinese name appear after first name in parentheses, but only if the keyword 'hani' exists (see bib entries above for reference)
\newbibmacro*{name:cjk}[3]{%
 \usebibmacro{name:delim}{#2#3#1}%
 \usebibmacro{name:hook}{#2#3#1}%
 \mkbibnamelast{#1}%
 \ifblank{#2}{}{\bibnamedelimd\mkbibnamefirst{#2}}%
 \ifkeyword{hani}{%
  \ifblank{#3}{}{\bibnamedelimd\mkbibnameaffix{\mkbibparens{#3}}}%
 }{}
}

\AtEveryBibitem{\clearlist{language}}
\AtBeginBibliography{%
 \renewcommand*{\multinamedelim}{\addsemicolon\space}
}

One thing to consider: If there is only the first appearance of the author shown in the bibliography and the following appearances replaced by a dash, this script will choose the first appearance depending of the language of the first entry. So, if the first entry is not Chinese but one of the following entries is, the Chinese name will not appear anywhere.


Edit (2018-01-22):

The macro names name:last and name:first have been changed to name:family and name:given, the macro \mkbibnamefirst has accordingly been renamed to \mkbibnamegiven and \iffirstinits to \ifgiveninits. Further, \ifblank should be changed into \ifdefvoid. I did not test this answer very recently. I guess, some other things have to be changed as the BibLaTeX packages have been updated several times in the meantime.

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.