La referencia (con hiperreferencia) no funciona en el encabezado de la sección (solo muestra signos de interrogación)

La referencia (con hiperreferencia) no funciona en el encabezado de la sección (solo muestra signos de interrogación)

ingrese la descripción de la imagen aquíTengo el siguiente problema extraño. Creo que el ejemplo de trabajo mínimo a continuación se explica por sí mismo. Puedes encontrar el archivo de estilo imsart.aquí.

\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}

Respuesta1

La clase lo hace \MakeUppercase, lo que también transforma el argumento en \ref.

Usar textcasecon la overloadopción.

Tenga en cuenta que eliminé los archivos innecesarios \texorpdfstring. Tampoco appendixes un entorno, úselo \appendix.

También \RequirePackagedebería serlo \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}

ingrese la descripción de la imagen aquí

Puedes hacer que todo el “Teorema 1.1” sea un enlace usando \autoref, pero necesitas complementar textcasela lista de comandos exentos de escribir en mayúsculas su argumento.ypara cambiar el autorefnombre.

\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}

ingrese la descripción de la imagen aquí

información relacionada