我收到警告:
Package babel Warning: Last declared language option is `english',(babel) but the last processed one was `brazil'.
因为我使用的类很糟糕并且对 babel 选项进行了硬编码:
\RequirePackage[brazil]{babel}
但我需要english
在文档上使用。正在执行:
\PassOptionsToPackage{english}{babel}
\documentclass[brazil,english]{abntex2}
似乎将选项传递给 babel 如下:
\RequirePackage[english,brazil]{babel}
代替:
\RequirePackage[brazil,english]{babel}
更新
添加 MWE:
\PassOptionsToPackage{english}{babel}
\documentclass[
10pt,
openright,
twoside,
a5paper,
brazil,
english
]{abntex2}
\begin{document}
Hello World!
\end{document}
答案1
使用
\PassOptionsToPackage{main=english}{babel}
如果你想让英语成为文档的主要语言,或者
\PassOptionsToPackage{english,main=brazil}{babel}
如果您希望巴西语言成为文档的主要语言,英语作为附加语言:
\PassOptionsToPackage{main=english}{babel}
\documentclass[
10pt,
openright,
twoside,
a5paper,
]{abntex2}
\begin{document}
Current language is \languagename.
\end{document}
结果是
和
\PassOptionsToPackage{english,main=brazil}{babel}
\documentclass[
10pt,
openright,
twoside,
a5paper,
]{abntex2}
\begin{document}
Current language is \languagename.
\end{document}
结果是
两种结果都没有任何预兆。