xelatex 和 apa

xelatex 和 apa

我正在使用 biblatex 来格式化我的参考文献。
文档是一本书,用希腊语写成。
参考文献主要是英文,但也有一些是希腊文。

虽然作者年份风格很好,心理学家协会样式不适合我。下面是一个最小工作示例:

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{test.bib} 
@article{article01,
    Author = {LastName FirstName},
    Journal = {A journal name},
    Pages = {311--314},
    Title = {A title in greek (όπως αυτός)},
    Volume = {311},
    Number = {2},
    Year = {2011}}
\end{filecontents}
\usepackage[style=apa,backend=biber]{biblatex}
\usepackage{xgreek}
\usepackage{xltxtra}
\DeclareLanguageMapping{english}{greek} 

\setmainfont[Mapping=tex-text,Ligatures=Common]{Courier New}  
\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Courier New} 
\setmonofont[Scale=MatchLowercase]{Courier New} 
\def\refname{Βιβλιογραφία}


\bibliography{test.bib}
\begin{document}

I want to use  \fullcite{article01} as well.

\printbibliography
\end{document}

生成:

! Undefined control sequence.
<argument> \mkbibdateapalongextra 
                              {year}{month}{day}\iffieldundef {endyear}{...

输出如下:

FirstName,L.(年月日)。希腊语头衔(όπως αυτός)。期刊名称,311 (2),311—314。

任何帮助都将不胜感激!

PS:请注意,如果我更换风格=apa风格=作者年份一切顺利。

答案1

这是因为 biblatex-apa 没有希腊语 .lbx。如果您希望通过复制包中的 american-apa.lbx 来提供一个,请给我发邮件(我是 biblatex-apa 的作者)。同时,在 DeclareLanguageMapping 行之后将此添加到您的序言中:

\DefineBibliographyExtras{英语}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\添加逗号\添加空格}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}%
  \protected\def\mkbibdateapalongextra#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}\printfield{extrayear}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\添加逗号\添加空格}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}%
  \protected\def\mkbibdateapalongdmy#1#2#3{%
    \iffieldundef{#3}%
      {}%
      {\stripzeros{\thefield{#3}}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#3}%
        {}%
        {\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#1}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#3}}%
        {}%
        {\addspace}%
       \thefield{#1}}}

答案2

此解决方案隐藏了“原创作品已发表”并在参考文献中以粗体显示“origyear”。这是经过修改的 MWE。

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{test.bib} 
@Book{aristotle1523b,
  title        = {{Parva naturalia Augustini Niphi Medices Philosophi
                  Suessani}},
  year         = 1550,
  origdate     = 1523,
  address      = {Venice},
  publisher    = {Scoto},
  author       = {Aristotle}} 
\end{filecontents}
\usepackage[style=apa,backend=biber]{biblatex}
\usepackage{xgreek}
\usepackage{xltxtra}
\DeclareLanguageMapping{english}{greek} 
\DefineBibliographyExtras{english}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongextra#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\thefield{#1}\printfield{extrayear}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#1}%
        {}%
        {\addcomma\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#1}}%
        {}%
        {\addspace}%
       \stripzeros{\thefield{#3}}}}%
  \protected\def\mkbibdateapalongdmy#1#2#3{%
    \iffieldundef{#3}%
      {}%
      {\stripzeros{\thefield{#3}}}%
    \iffieldundef{#2}%
      {}%
      {\iffieldundef{#3}%
        {}%
        {\addspace}%
       \mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#1}%
      {}%
      {\ifthenelse{\iffieldundef{#2}\OR\iffieldundef{#3}}%
        {}%
        {\addspace}%
       \thefield{#1}}}}

\setmainfont[Mapping=tex-text,Ligatures=Common]{Courier New}  
\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Courier New} 
\setmonofont[Scale=MatchLowercase]{Courier New} 
\def\refname{Βιβλιογραφία}


\bibliography{test.bib}
\begin{document}

\textcite{aristotle1523b} says  \dots\ 

\printbibliography
\end{document}

相关内容