如何在 moderncv 中将意大利语设置为 hyperref 的 backref 选项的语言

如何在 moderncv 中将意大利语设置为 hyperref 的 backref 选项的语言

我正在使用文档中的moderncv一些包:\cite{}

\documentclass[11pt,a4paper]{moderncv}
\usepackage[italian]{babel}
\moderncvstyle{casual}
...
\usepackage{multibib}
\begin{document}
\section{\textbf{\textcolor{gray}{Section 1}}}
Text \cite{demo}
...
...
...
\section{\textbf{\textcolor{gray}{Section 2}}}
Other text \cite{demo}
...
\section{\textbf{\textcolor{gray}{Riferimenti}}}
\bibliographystyle{unsrt}
\bibliography{riferimenti}
\end{document}

moderncv.cls通过添加反向引用定制了该文件,如下所示:

\RequirePackage[unicode, pagebackref=true]{hyperref}
  %%%%  CUSTOM backref COMMAND: https://tex.stackexchange.com/a/183735
  \renewcommand*{\backref}[1]{}
  \renewcommand*{\backrefalt}[4]{[{%
      \ifcase #1 Nessuna citazione%
            \or Cit. a pagina~#2%
            \else Cit. alle pagine~#2%
      \fi%
      }]}

现在的问题是,当 \cite{} 命令在不同页面中重复时,E 连词(对于页面)仍为英语,而不是意大利语。所以我得到:

[1]......[引文。全部第 1 页3]

请注意,作为连词的是“AND”(英语),而不是“E”(意大利语)。

我认为原因可以在文件中找到backref.sty,其中似乎支持不同的语言,但不支持意大利语:

...
\def\backrefenglish{%
  \def\backrefpagesname{pages}%
  \def\backrefsectionsname{sections}%
  \def\backrefsep{, }%
  \def\backreftwosep{ and~}%
  \def\backreflastsep{, and~}%
}
\def\backrefgerman{%
  \def\backrefpagesname{Seiten}%
  \def\backrefsectionsname{Abschnitte}%
  \def\backrefsep{, }%
  \def\backreftwosep{ und~}%
  \def\backreflastsep{ und~}%
}
\def\backreffrench{%
  \def\backrefpagesname{pages}%
  \def\backrefsectionsname{sections}%
  \def\backrefsep{, }%
  \def\backreftwosep{ et~}%
  \def\backreflastsep{ et~}%
}
\def\backrefspanish{%
  \def\backrefpagesname{p\'aginas}%
  \def\backrefsectionsname{secciones}%
  \def\backrefsep{, }%
  \def\backreftwosep{ y~}%
  \def\backreflastsep{ y~}%
}
\def\backrefbrazil{%
  \def\backrefpagesname{p\'aginas}%
  \def\backrefsectionsname{se\c c\~oes}%
  \def\backrefsep{, }%
  \def\backreftwosep{ e~}%
  \def\backreflastsep{ e~}%
}
\def\backrefafrikaans{%
  \def\backrefpagesname{bladsye}%
  \def\backrefsectionsname{afdelings}%
  \def\backrefsep{, }%
  \def\backreftwosep{ en~}%
  \def\backreflastsep{ en~}%
}%
...
\BR@DeclareLang{english}{english}
\BR@DeclareLang{american}{english}
\BR@DeclareLang{australian}{english}
\BR@DeclareLang{british}{english}
\BR@DeclareLang{canadian}{english}
\BR@DeclareLang{newzealand}{english}
\BR@DeclareLang{UKenglish}{english}
\BR@DeclareLang{USenglish}{english}
\BR@DeclareLang{german}{german}
\BR@DeclareLang{ngerman}{german}
\BR@DeclareLang{austrian}{german}
\BR@DeclareLang{naustrian}{german}
\BR@DeclareLang{french}{french}
\BR@DeclareLang{acadian}{french}
\BR@DeclareLang{canadien}{french}
\BR@DeclareLang{frenchb}{french}
\BR@DeclareLang{francais}{french}
\BR@DeclareLang{spanish}{spanish}
\BR@DeclareLang{brazil}{brazil}
\BR@DeclareLang{brazilian}{brazil}
\BR@DeclareLang{afrikaans}{afrikaans}
...

我因此尝试添加:

...
\def\backrefafrikaans{%
  \def\backrefpagesname{bladsye}%
  \def\backrefsectionsname{afdelings}%
  \def\backrefsep{, }%
  \def\backreftwosep{ en~}%
  \def\backreflastsep{ en~}%
}
\def\backrefitalian{%
  \def\backrefpagesname{pagine}%
  \def\backrefsectionsname{sezioni}%
  \def\backrefsep{, }%
  \def\backreftwosep{ e~}%
  \def\backreflastsep{ e~}%
}%
...
\BR@DeclareLang{afrikaans}{afrikaans}
\BR@DeclareLang{italian}{italian}
...

但没有成功。

如何选择意大利语?唯一有效的方法是进行\def\backrefenglish以下更改:

\def\backrefenglish{%
  \def\backrefpagesname{pagine}%
  \def\backrefsectionsname{sezioni}%
  \def\backrefsep{, }%
  \def\backreftwosep{ e~}%
  \def\backreflastsep{, e~}%
}

谢谢

答案1

太好了,解决了:我只需要使用新创建的命令,\backrefitalian如下所示:

\section{\textbf{\textcolor{gray}{Riferimenti}}}
\backrefitalian
\bibliographystyle{unsrt}
\bibliography{riferimenti}

如何将意大利语添加到hyperref包中?

编辑: 我打开了最新帖子讨论一下这里给出的代码的重新排列。谢谢

相关内容