为什么在将语言传递给我的文档类和/或明确传递给 biblatex 时,我的 biblatex 语言没有改变?

为什么在将语言传递给我的文档类和/或明确传递给 biblatex 时,我的 biblatex 语言没有改变?

如果我创建以下文档,其语言设置为brazil

\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{koma-scrguien,
    author = {Markus Kohm},
    edition = {2017-04-13},
    howpublished = {\url{http://mirrors.ibiblio.org/CTAN/.../scrguien.pdf}},
    publisher = {Online Material; \url{https://www.ctan.org/pkg/koma-script}},
    title = {The Guide KOMA -Script},
    urlaccessdate = {2017-08-28},
    year = {2017},
}
\end{filecontents*}

% \PassOptionsToPackage{brazil,main=english,spanish,french}{babel}
\documentclass[12pt,a4paper,english]{abntex2}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\selectlanguage{english}

\usepackage[
style=abnt,repeatfields=true,backend=biber,backref=true,language=english]{biblatex}
\pdfstringdefDisableCommands{\let\uppercase\relax}
\addbibresource{\jobname.bib}

\begin{document}
Citing \cite{koma-scrguien}. \printbibliography
\end{document}

在此处输入图片描述


然而,其语言应该设置为,english因为:

  1. 在我的\documentclass,我通过english作为最后一类选项
  2. english选择biblatex \usagepackage

将文档语言设置为英语的唯一方法是取消注释该行\PassOptionsToPackage{brazil,main=english,spanish,french}{babel}

在此处输入图片描述

english为什么通过将语言作为最后一个选项传递给文档,文档语言没有更改为英语\documentclass

答案1

我刚刚放进\selectlanguage{english}\begin{document},它就起作用了。

\documentclass[english]{abntex2}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{koma-scrguien,
    author = {Markus Kohm},
    edition = {2017-04-13},
    howpublished = {\url{http://mirrors.ibiblio.org/CTAN/.../scrguien.pdf}},
    publisher = {Online Material; \url{https://www.ctan.org/pkg/koma-script}},
    title = {The Guide KOMA -Script},
    urlaccessdate = {2017-08-28},
    year = {2017},
}
\end{filecontents*}


\usepackage[
style=abnt,repeatfields=true,backend=biber,backref=true,language=english]{biblatex}
%\pdfstringdefDisableCommands{\let\uppercase\relax}
\addbibresource{\jobname.bib}

\begin{document}
\selectlanguage{english}
Citing \cite{koma-scrguien}. \printbibliography
\end{document}

相关内容