我有以下 MWE,问题是参考书目标题不会按预期修改为“参考文献”。
\documentclass[12pt]{book}
\usepackage[spanish,es-nodecimaldot,es-lcroman,es-noquoting]{babel} %Hyphen
\addto\captionsspanish{\renewcommand\contentsname{ÍNDICE GENERAL}}
\addto\captionsspanish{\renewcommand\listfigurename{ÍNDICE DE FIGURAS}}
\addto\captionsspanish{\renewcommand{\listtablename}{ÍNDICE DE TABLAS}}
\addto\captionsspanish{\renewcommand{\figurename}{Figura}}
\addto\captionsspanish{\renewcommand{\tablename}{Tabla}}
\addto\captionsspanish{%
\renewcommand\appendixname{ANEXO}
\renewcommand\appendixpagename{Anexos}
}
\addto\captionsspanish{\renewcommand{\refname}{REFERENCIAS}}
\usepackage{wrapfig} %Texto alrededor de imágenes.
\usepackage{fancyhdr} %Encabezado.
%\usepackage[nottoc]{tocbibind} %Referencias no aparece numerada
\usepackage[titletoc,title]{appendix} %Simple modificacion apendices
\renewcommand{\addappheadtotoc}{%
\phantomsection\addcontentsline{toc}{chapter}{\appendixtocname}%
}
\usepackage{float} %Posiciona figuras en lugar deseado.
\setlength{\intextsep}{10pt} %Float environment spacing before and after.
\usepackage{etoolbox} %For Appendix page number A.1...D.1
\usepackage{tocloft}
\renewcommand\cftsubsecafterpnum{\vskip1pt}
\renewcommand\cftsecafterpnum{\vskip2pt}
\renewcommand\cftchapafterpnum{\vskip2pt}
\setlength{\cftbeforesecskip}{2pt}
\setlength{\cftbeforesubsecskip}{1pt}
\renewcommand\cftloftitlefont{\Large \bfseries}
\renewcommand\cftlottitlefont{\Large \bfseries}
\renewcommand\cfttoctitlefont{\Large \bfseries}
\setlength{\cftbeforetoctitleskip}{0em}
\setlength{\cftbeforelottitleskip}{0em}
\setlength{\cftbeforeloftitleskip}{0em}
\setlength{\cftaftertoctitleskip}{1.5em}
\setlength{\cftafterlottitleskip}{1.5em}
\setlength{\cftafterloftitleskip}{1.5em}
\cftsetindents{figure}{0em}{3.3em}
\cftsetindents{table}{0em}{3.3em}
%%% Patching the kernel \@sect command
\usepackage{regexpatch}
\makeatletter
\xpatchcmd*{\@sect}{\fi#7}{\fi\@nameuse{format#1}{#7}}{}{}
%%% for sections and subsections we want uppercase
\protected\def\formatsection{\MakeUppercase}
\protected\def\formatsubsection{\MakeUppercase}
%%% the other titles are left unchanged
\let\formatsubsubsection\@firstofone
\let\formatparagraph\@firstofone
\let\formatsubparagraph\@firstofone
%%% the following is necessary only if hyperref is used
\AtBeginDocument{%
\pdfstringdefDisableCommands{%
\let\formatsection\@firstofone
\let\formatsubsection\@firstofone
}%
}
\makeatother
%\renewcommand{\cfttoctitlefont}{\normalfont\normalsize\bfseries\MakeUppercase}
\usepackage[export]{adjustbox}
%\newcommand{\appendixpagenumbering}{
% \break
% \pagenumbering{arabic}
% \renewcommand{\thepage}{\thechapter-\arabic{page}}}
\usepackage{amsmath} %To write equations and math symbols.
\let\hbar\relax %Conflicting issue with fontspec and mtpro2.
\usepackage[mtpcal,subscriptcorrection,slantedGreek,nofontinfo,amssymbols]{mtpro2} %MathTime Professional 2 for fluency with Times font and Times math.
\usepackage{mathtools} %For equation with cases.
\usepackage{siunitx} %For SI units
\usepackage{caption} %All lines left aligned.
\captionsetup{format=hang}
\usepackage[bibstyle=apa,citestyle=authoryear-comp,maxcitenames=2,uniquelist=false,giveninits=true,uniquename=init,doi=false,isbn=false,url=false,dashed=true,sorting=nyt,backend=biber]{biblatex}
\DeclareNameAlias{sortname}{last-first}
\DeclareLanguageMapping{spanish}{spanish-apa}
\AtEveryBibitem{\clearfield{month}}
\usepackage{csquotes}
%\addbibresource{R.bib}
\DefineBibliographyStrings{spanish}{%
andothers = {et\addabbrvspace al\adddot}
}
\DeclareCiteCommand{\citeyearpar} %Use hyperef with citeryearpar command.
{}
{\mkbibparens{\bibhyperref{\printdate}}}
{\multicitedelim}
{}
\DefineBibliographyExtras{spanish}{\protected\def\bibrangedash{\textendash}}
\usepackage{rotating, booktabs} %Better hline commands.
\usepackage{enumitem} %Spacing in list items.
\renewcommand{\labelitemi}{$\circ$}
\usepackage{scrextend} %Margin indentation.
\usepackage{multicol,multirow} %Can make cells in tables with multiple rows or columns.
\usepackage{sectsty} %Hooks to change section header styles.
\sectionfont{\normalsize}
\subsectionfont{\normalsize}
%\paragraphfont{\small \MakeUppercase}
\usepackage{subcaption}
\newtheorem{theorem}{Teorema}
\usepackage[numbered,framed]{matlab-prettifier}
\usepackage{arydshln}
\usepackage{chngcntr} %Per-section numbering in article class.
\counterwithin{figure}{section}
\counterwithin{table}{section}
\counterwithin{equation}{section}
\renewcommand{\theequation}{\arabic{chapter}.\arabic{section}.\arabic{equation}}
\usepackage{tablefootnote} %Footnotes in table environments
\usepackage{titlesec}
\titleformat{\chapter}[hang]
{\normalfont\Large\bfseries}{\chaptertitlename\ \thechapter:}{1em}{}
\titlespacing*{\chapter}{0pt}{-15pt}{25pt}
\setlength\parindent{0.5in} %Paragraph indentation.
\captionsetup{belowskip=1pt,aboveskip=4pt}
\usepackage[bookmarks,hypertexnames=false,debug]{hyperref}
\usepackage[letterpaper,margin=1in,footskip=1.2cm,headheight=2cm,headsep=0.5cm]{geometry}
\usepackage{fancyhdr} %Encabezado.
\pagestyle{fancy}
\fancyhf{} % clear all header and footer fields
\fancyhead[LO,RE]{Some graphics}
\fancyhead[LE]{{\small \textsc{Uni}}}
\fancyhead[RO]{{\small \textsc{Dep}}}
\fancyfoot[LO,RE]{\small \thepage}
\fancyfoot[RO]{{\footnotesize \MakeLowercase{\leftmark}}}
\fancyfoot[LE]{{\footnotesize \MakeLowercase{\rightmark}}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\fancypagestyle{plain}{ % the preset of fancyhdr
\fancyhf{}
\fancyhead[LO]{Some graphic}
\fancyhead[RO]{\textsc{Uni\\Dep}}
\fancyfoot[C]{\small \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}}
\usepackage[spanish,tight]{minitoc} %Table of Contents per Chapter
%\addto{\captionsspanish}{\renewcommand{\mtctitle}{Another Title}}
\usepackage{bookmark}
\hypersetup{linkcolor=black}
\usepackage{fontspec} %Set a main font.
\setmainfont{Times New Roman}[SmallCapsFont=TeX Gyre Termes,SmallCapsFeatures={Letters=SmallCaps}]
\usepackage[spanish]{cleveref} %Fancy pantsy ref.
\Crefname{section}{Sección}{Secciones}
\Crefname{chapter}{Capítulo}{Capítulos}
\Crefname{table}{Tabla}{Tablas}
\Crefname{app}{Anexo}{Anexos}
\Crefname{graph}{Gráfico}{Gráficos}
%Hyphenation not included
\tolerance=1
\emergencystretch=\maxdimen
\hyphenpenalty=10000
\hbadness=10000
\begin{document}
\begin{equation}
p_{\textrm{f}}=\Phi (-\beta)
\end{equation}
\end{document}
请帮忙。
答案1
对于book
(和report
) 类biblatex
(和 确实thebibliography
),使用\bibname
和 而不是\refname
作为参考书目标题。因此您需要重新定义\bibname
和 而不是\refname
。
如果你加载biblatex
,biblatex
接管\bibname
和的控制\refname
,因此使用它的接口来控制这些命令的值比一个精心计时的
\AtEndPreamble{\appto\extrasspanish{\renewcommand*{\bibname}{REFERENCIAS}}}
来反击。这将通过重新定义bibstring 来biblatex
实现bibliography
\DefineBibliographyStrings
\documentclass[12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish,es-nodecimaldot,es-lcroman,es-noquoting]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber]{biblatex}
\addbibresource{biblatex-examples.bib}
\DefineBibliographyStrings{spanish}{
bibliography = {REFERENCIAS},
}
\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}