%20funktioniert%20nicht%20in%20Abschnitts%C3%BCberschrift%20(zeigt%20nur%20Fragezeichen).png)
Ich habe das folgende seltsame Problem. Ich denke, das minimale funktionierende Beispiel unten ist selbsterklärend. Sie finden die imsart-style-DateiHier.
\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}
Antwort1
Die Klasse führt dies aus \MakeUppercase
, wodurch das Argument auch in umgewandelt wird \ref
.
textcase
Mit der Option verwenden overload
.
Beachten Sie, dass ich das Unnötige entfernt habe \texorpdfstring
. appendix
Ist auch keine Umgebung, verwenden Sie \appendix
.
Sollte auch \RequirePackage
sein \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}
Sie können den gesamten „Satz 1.1“ mit einem Link versehen \autoref
, aber Sie müssen textcase
die Liste der Befehle ergänzen, deren Argumente nicht in Großbuchstaben geschrieben werden müssen.Und, um den autoref
Namen zu ändern.
\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}