%20%D0%BD%D0%B5%20%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D0%B5%D1%82%20%D0%B2%20%D0%B7%D0%B0%D0%B3%D0%BE%D0%BB%D0%BE%D0%B2%D0%BA%D0%B5%20%D1%80%D0%B0%D0%B7%D0%B4%D0%B5%D0%BB%D0%B0%20(%D0%BE%D1%82%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B0%D1%8E%D1%82%D1%81%D1%8F%20%D1%82%D0%BE%D0%BB%D1%8C%D0%BA%D0%BE%20%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5%20%D0%B7%D0%BD%D0%B0%D0%BA%D0%B8).png)
У меня возникла следующая странная проблема. Я думаю, что минимальный рабочий пример ниже говорит сам за себя. Вы можете найти файл imsart-styleздесь.
\documentclass[aop,preprint]{imsart}
\RequirePackage{amsthm,amsmath,amsfonts,amssymb}
\RequirePackage[numbers]{natbib}
\RequirePackage{mathtools}
\RequirePackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
\startlocaldefs
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\endlocaldefs
\begin{document}
\tableofcontents
\section{Introduction}
\begin{theorem} \label{theo} This is the first theorem.
\end{theorem}
\section{Proof of \texorpdfstring{\hyperref[theo]{Theorem \ref*{theo}}}{Theorem 1.1}}
In this section heading the reference does work.
\begin{appendix}
\section{Proof of \texorpdfstring{\hyperref[theo]{Theorem \ref*{theo}}}{Theorem 1.1}}
In this section heading the reference does not work. Surprisingly, in the table of contents both references work.
\end{appendix}
\end{document}
решение1
Класс делает это \MakeUppercase
, что также преобразует аргумент в \ref
.
Используйте textcase
с overload
опцией.
Обратите внимание, что я удалил ненужное \texorpdfstring
. Также appendix
не является средой, используйте \appendix
.
Также \RequirePackage
должно быть \usepackage
.
\documentclass[aop,preprint]{imsart}
\usepackage{amsthm,amsmath,amsfonts,amssymb}
\usepackage[numbers]{natbib}
\usepackage{mathtools}
\usepackage[overload]{textcase}
\usepackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
\startlocaldefs
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\endlocaldefs
\begin{document}
\tableofcontents
\section{Introduction}
\begin{theorem} \label{theo} This is the first theorem.
\end{theorem}
\section{Proof of Theorem \ref{theo}}
In this section heading the reference does work.
\appendix
\section{Proof of Theorem \ref{theo}}
In this section heading the reference does not work. Surprisingly, in the table of contents both references work.
\end{document}
Вы можете сделать всю «Теорему 1.1» ссылкой, используя \autoref
, но вам нужно дополнить textcase
список команд, освобожденных от необходимости преобразования аргументов в верхний регистриизменить autoref
имя.
\documentclass[aop,preprint]{imsart}
\usepackage{amsthm,amsmath,amsfonts,amssymb}
\usepackage[numbers]{natbib}
\usepackage{mathtools}
\usepackage[overload]{textcase}
\usepackage{etoolbox}
\usepackage[colorlinks,citecolor=blue,urlcolor=blue]{hyperref}
\startlocaldefs
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\makeatletter
\patchcmd{\@uclcnotmath}
{\ref}
{\ref\@nonchangecase\autoref}
{}{}
\makeatother
\endlocaldefs
\begin{document}
\tableofcontents
\section{Introduction}
\begin{theorem} \label{theo} This is the first theorem.
\end{theorem}
\section{Proof of \autoref{theo}}
In this section heading the reference does work.
\appendix
\renewcommand{\theoremautorefname}{THEOREM}
\section{Proof of \autoref{theo}}
In this section heading the reference does not work. Surprisingly,
in the table of contents both references work.
\end{document}