CJK 名称在使用的书目中仍然存在问题biblatex
:没有内置选项来区分音标名称和 CJK 字符名称,这有时会导致构造无法适应,例如
author = {{Wang Li 王力}}
用户写了一个很好的解决方案莫威对于包biblatex-chicago
:
CJK 书目问题,Biblatex-Chicago 作者日期样式
它允许您指定如下所示的名称,并将在脚注和参考书目中正确显示它们:
author = {family=Wang, given=Li, cjk=王力}
我自己还不够熟练,但它可以适应工作吗biblatex
?
答案1
来自的 CJK 代码CJK 书目问题,Biblatex-Chicago 作者日期样式主要基于biblatex
示例文档的作用93-nameparts.tex
(93-nameparts.tex
和93-nameparts.dbx
)。实际上,代码适用于biblatex-chicago
与biblatex
标准样式相同的格式化宏,因此
\documentclass[a4paper]{article}
\usepackage{libertinus-otf}
\usepackage[fallback]{xeCJK}
\begin{filecontents*}{morenameparts-cjk.dbx}
\ProvidesFile{cjk-names.dbx}[2016/07/24 extended name format for biblatex]
\DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given,cjk}
\end{filecontents*}
\usepackage[
backend=biber,
style=authoryear,
datamodel=morenameparts-cjk,
]{biblatex}
\DeclareSortingNamekeyTemplate[cjk]{
\keypart{
\namepart{family}
}
\keypart{
\namepart{given}
}
\keypart{
\namepart{cjk}
}
}
\DeclareUniquenameTemplate[cjk]{
\namepart[base=true]{family}
\namepart[disambiguation=full]{given}
\namepart[disambiguation=full]{cjk}
}
\newbibmacro*{name:cjk}[3]{%
\usebibmacro{name:delim}{#2#3#1}%
\usebibmacro{name:hook}{#2#3#1}%
\mkbibnamefamily{#1}%
\ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}}%
\ifdefvoid{#3}{}{\bibnamedelimd\mkbibnamecjk{#3}}}
\newbibmacro{labelname:western}{%
\ifcase\value{uniquename}%
\usebibmacro{name:family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\or
\ifuseprefix
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffixi}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefixi}
{\namepartsuffixi}}%
\or
\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}%
\fi
\usebibmacro{name:andothers}}
\newbibmacro{labelname:cjk}{%
\iffieldequalstr{uniquepart}{base}%
{\usebibmacro{name:cjk}
{\namepartfamily}
{\empty}
{\empty}}
{\iffieldequalstr{uniquepart}{given}%
{\usebibmacro{name:cjk}
{\namepartfamily}
{\namepartgiven}
{\empty}}
{\usebibmacro{name:cjk}
{\namepartfamily}
{\namepartgiven}
{\namepartcjk}}}}
\DeclareNameFormat{labelname}{%
\ifuniquenametemplatename{cjk}
{\usebibmacro{labelname:cjk}}
{\usebibmacro{labelname:western}}%
\usebibmacro{name:andothers}}
\DeclareNameFormat{family-given}{%
\ifsortingnamekeytemplatename{cjk}
{\usebibmacro{name:cjk}{\namepartfamily}{\namepartgiven}{\namepartcjk}}
{\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}%
\usebibmacro{name:andothers}}
\DeclareNameFormat{given-family}{%
\ifsortingnamekeytemplatename{cjk}
{\usebibmacro{name:cjk}{\namepartfamily}{\namepartgiven}{\namepartcjk}}
{\ifgiveninits
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}%
\usebibmacro{name:andothers}}
\DeclareNameFormat{family-given/given-family}{%
\ifsortingnamekeytemplatename{cjk}
{\usebibmacro{name:cjk}{\namepartfamily}{\namepartgiven}{\namepartcjk}}
{\ifnumequal{\value{listcount}}{1}
{\ifgiveninits
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:family-given}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}
\ifboolexpe{%
test {\ifdefvoid\namepartgiven}
and
test {\ifdefvoid\namepartprefix}}
{}
{\usebibmacro{name:revsdelim}}}
{\ifgiveninits
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiven}
{\namepartprefix}
{\namepartsuffix}}}}
\usebibmacro{name:andothers}}
\begin{filecontents*}{\jobname.bib}
@book{zhaos,
title = {A Nation-State by Construction},
subtitle = {Dynamics of Modern {Chinese} Nationalism},
author = {given=Suisheng, family=Zhao, cjk=趙歲升, nametemplates=cjk},
year = {2011},
address = {Stanford},
publisher = {Stanford University Press},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\begin{document}
\autocite{zhaos}
\printbibliography
\end{document}
应该管用。
(在我的计算机上,我无法显示 CJK 字符,但我对此还不够熟悉,无法xeCJK
调试这个问题。)