APA 格式的问题

APA 格式的问题

apa我在 BibLaTeX 中使用样式时遇到了问题。

\documentclass[a4paper,14pt]{extarticle}

\usepackage{cmap}                   
\usepackage{mathtext}               
\usepackage[T2A]{fontenc}           
\usepackage[utf8]{inputenc}         
\usepackage[english,russian]{babel}

\usepackage{csquotes} 
\usepackage[style=apa,backend=biber,sorting=nyt]{biblatex}

\addbibresource{bibl1.bib}

\begin{document}

Text, text...
\nocite{*}
\printbibliography

\end{document}

错误信息:

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

我找到了其他语言的解决方案,但 TeXstudio 无法识别\DeclareLanguageMapping,而且我没有找到russian-apa.lbx

答案1

biblatex-apa在文件中定义一些必要的宏.lbx,因此对于文档中使用的每种语言,您都需要

\DeclareLanguageMapping{<lang>}{<lang>-apa}

biblatexv3.8/ biblatex-apav7.5 开始,不再需要手动\DeclareLanguageMappingbiblatex-apa现在使用 自动设置所有语言的映射。当然,这只有在文件存在\DeclareLanguageMappingSuffix{-apa}时才有效。<lang>-apa.lbx

不幸的是,没有,russian-apa.lbx所以这条线\DeclareLanguageMapping{russian}{russian-apa}不会真正有帮助,我们只会收到一条rusian-apa.lbx未找到的消息并且映射被忽略。

最好的解决方案是写russian-apa.lbx。你可以将任意...-apa.lbxs 作为起点并翻译该文件。请参阅配置 biblatex 以用于不受支持的语言的最合适方法是什么?。这里可能涉及复制english-apa.lbxrussian-apa.lbx、更改顶部的日期和 ID、翻译内容以及修改日期格式为俄语用法。


为了快速修复,您只需添加

\DefineBibliographyExtras{russian}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#1}%
      {}%
      {\iffieldbibstring{#1}{\biblcstring{\thefield{#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}%
      {}%
      {\iffieldbibstring{#1}{\biblcstring{\thefield{#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\mkbibdateapalongmdy#1#2#3{%
    \iffieldundef{#2}%
      {}%
      {\mkbibmonth{\thefield{#2}}}%
    \iffieldundef{#3}%
      {}%
      {\addspace}%
       \stripzeros{\thefield{#3}}%
    \iffieldundef{#1}%
      {}%
      {\ifthenelse{\iffieldundef{#3}}%
        {\ifthenelse{\iffieldundef{#2}}%
          {}%
          {\addspace}}%
        {\addcomma\addspace}%
       \iffieldbibstring{#1}{\biblcstring{\thefield{#1}}}{\thefield{#1}}}}}

到你的序言。(如果需要,可以将其修改为俄罗斯习俗。)

相关内容