如题,考虑如下MWE:
\documentclass[
lang=cn,fontset=fandol,
]{elegantbook}
\geometry{paperheight=8cm}
\addbibresource{xampl.bib}
% \AtBeginDocument{%
% \renewcommand{\bibname}{参考文献}
% }
\begin{document}
\chapter{第一章}
Hello\cite{article-minimal} World! 中文!
\printbibliography
% \printbibliography[title={参考文献}]
\end{document}在elegantbook.cls模板中,上述代码表现为:

注意到在elegantbook.cls中的:
% Line 21
\DeclareStringOption[en]{lang}设置了默认值为lang=en
且有:
% Line 411
\ifdefstring{\ELEGANT@lang}{cn}{
\renewcommand{\baselinestretch}{1.3}
\renewcommand{\contentsname}{目录}
\renewcommand{\figurename}{图}
\renewcommand{\tablename}{表}
\renewcommand{\partname}{\color{structurecolor}}
\renewcommand{\thepart}{第\zhnumber{\arabic{part}}部分}
\renewcommand{\listfigurename}{插图目录}
\renewcommand{\listtablename}{表格目录}
\renewcommand{\bibname}{参考文献}
\newcommand{\ebibname}{参考文献}
\renewcommand{\appendixname}{附录}
\renewcommand{\appendixtocname}{附录}
\renewcommand{\indexname}{索\hspace{2em}引}
\newcommand\figref[1]{\textbf{图}~\ref{#1}}
\newcommand\tabref[1]{\textbf{表}~\ref{#1}}
\newcommand{\authorname}{\citshape 作者:}
\newcommand{\institutename}{\citshape 组织:}
\newcommand{\datename}{\citshape 时间:}
\newcommand{\versionname}{\citshape 版本:}
\newcommand{\notename}{笔记}
\renewcommand*{\proofname}{证明}
\newcommand{\definitionname}{定义}
\newcommand{\theoremname}{定理}
\newcommand{\axiomname}{公理}
\newcommand{\postulatename}{公设}
\newcommand{\lemmaname}{引理}
\newcommand{\propositionname}{命题}
\newcommand{\corollaryname}{推论}
\newcommand{\examplename}{例题} %
\newcommand{\instancename}{示例} %
\newcommand{\problemname}{问题} % 问题
\newcommand{\exercisename}{练习} % 练习=习题
\newcommand{\remarkname}{注}
\newcommand{\assumptionname}{假设}
\newcommand{\conclusionname}{结论}
\newcommand{\solutionname}{解}
\newcommand{\propertyname}{性质}
\newcommand{\introductionname}{内容提要}
\newcommand\bioinfo[2]{\gdef\@bioinfo{{\citshape #1}:#2}}
\newcommand{\updatename}{更新:}
\newcommand{\historyname}{版本更新历史}
\newcommand{\beforechap}{第}
\newcommand{\afterchap}{章}
}{\relax}但在MWE中的表现却为:
\chaptername正确更改\bibname并未正确更改这是不是elegant-latex在lang=cn时的非预期行为呢?
BTW,使用:
\printbibliography[title={参考文献}]或者
\AtBeginDocument{%
\renewcommand{\bibname}{参考文献}
}都能满足需求,但不是问题的关键。
使用意大利语方案lang=it,似乎一切正常...
\documentclass[lang=it]{elegantbook}
\geometry{paperheight=8cm}
\addbibresource{xampl.bib}
\begin{document}
\chapter{Chapter Name}
Hello\cite{article-minimal} World!
\printbibliography
\end{document}