如何让附录包在目录中打印西班牙语单词?

如何让附录包在目录中打印西班牙语单词?

我正在使用附录包,附录标题以西班牙语正确打印,但目录条目仍为英文。我该如何更改这种情况?

以下是 MWE:

\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{float}
\setlength{\parskip}{1em}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\graphicspath{ {images/} }
\newcommand{\degree}{\ensuremath{^\circ}}
\newcommand{\quotes}[1]{``#1''}
\setlength\parindent{0pt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{imakeidx}
\makeindex[columns=3, title=Alphabetical Index, intoc]
\usepackage[spanish,es-nodecimaldot]{babel}
\usepackage[sorting=none]{biblatex}
\addbibresource{Bibfile.bib}
\DeclareMathOperator\grad{grad}
\DeclareMathOperator\prima{'}
\DeclareMathOperator\sen{sen}
\usepackage{array}
\usepackage{tabularx}
\usepackage{lscape}
\usepackage{caption}
\captionsetup[table]{position=bottom}
\usepackage{booktabs}
\usepackage{mathptmx}
\usepackage[per-mode=symbol]{siunitx}
\usepackage{bm}
\usepackage{amsmath}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{longtable}
\interfootnotelinepenalty=10000
\usepackage[spanish]{minitoc}
\usepackage{hyperref}
\usepackage{siunitx}
\sisetup{group-digits=false}
\usepackage{mathtools, nccmath}
\usepackage[raggedright]{titlesec}
\mathchardef\mhyphen="2D
\usepackage{xltabular}
\usepackage[toc]{appendix}
\usepackage{etoolbox}
\makeatletter
\appto{\appendices}{\def\Hy@chapapp{Appendix}}
\makeatother

\begin{document}

\tableofcontents

\begin{appendices}
\chapter{Example}
\end{appendices}

\end{document}

答案1

使用\appendixtocname

这是您的 MWE 的简化版本。A

% !TeX TS-program = pdflatex

\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish,es-nodecimaldot]{babel}
\usepackage{hyperref}

\usepackage[toc]{appendix}

\renewcommand{\appendixtocname}{Apéndice} % added <<<<<<<<<<<<<<<<<<<<<

\begin{document}    
    \tableofcontents
    
    \begin{appendices}
        \chapter{Example I}     
    \end{appendices}
    
\end{document}

相关内容