
eu estou procurando umasimplesmaneira de usar \label
e \section*
simultaneamente. Meu objetivo é ter umseção não numerada com um rótulopara poder fazer \autoref
isso.
O problema é: \label
não funciona ao usar \section*
. Claro, funciona ao usar \section
, mas a seção é numerada.
Eu tenho o seguinte em um documento:
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
\section*{Criterion} \label{sec:crit}
\section*{My new section}
Blah blah refers to \autoref{sec:crit}
EDITAR:
Estou usando este modelo do Overleaf:https://www.overleaf.com/latex/templates/template-for-data-descriptor-submissions-to-scientific-data/ygdzkjcqzmbp
eu estou procurando umasimplesmaneira de usar \label
e \section*
simultaneamente com este modelo.
O problema deve estar no arquivo "wlscirep.cls" porque este código independente funciona perfeitamente:
\documentclass[10pt]{article}
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
\begin{document}
\section*{Criterion} \label{sec:crit}
Here is section one
\section*{My new section}
Here is section two. This refers back to \hyperref[sec:crit]{Criterion~\ref*{sec:crit}}.
\end{document}
Mas \hyperref[sec:crit]{Criterion~\ref*{sec:crit}}
não funciona quando está nesse modelo.
Responder1
Adicionar trabalhos \phantomsection
acima \section*{Criterion} \label{sec:crit}
.
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
\begin{document}
\phantomsection
\section*{Criterion} \label{sec:crit}
Here is section one
\section*{My new section}
Here is section two. This refers back to \hyperref[sec:crit]{Criterion~\ref*{sec:crit}}.
\end{document}