如果我创建以下文档,其语言设置为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
因为:
- 在我的
\documentclass
,我通过english
作为最后一类选项 - 我
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}