
Estoy buscandosimpleforma de uso \label
y \section*
simultáneamente. Mi objetivo es tener unsección sin numerar con una etiquetapoder hacerlo \autoref
.
El problema es: \label
no funciona cuando se usa \section*
. Por supuesto, funciona cuando se usa \section
, pero luego la sección está numerada.
Tengo lo siguiente en un documento:
\RequirePackage[colorlinks=true, allcolors=blue]{hyperref}
\section*{Criterion} \label{sec:crit}
\section*{My new section}
Blah blah refers to \autoref{sec:crit}
EDITAR:
Estoy usando esta plantilla del dorso:https://www.overleaf.com/latex/templates/template-for-data-descriptor-submissions-to-scientific-data/ygdzkjcqzmbp
Estoy buscandosimpleforma de utilizar \label
y \section*
simultáneamente con esta plantilla.
El problema debe estar en el archivo "wlscirep.cls" porque este código independiente funciona bien:
\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}
Pero \hyperref[sec:crit]{Criterion~\ref*{sec:crit}}
no funciona cuando está en esa plantilla.
Respuesta1
Agregar \phantomsection
lo anterior \section*{Criterion} \label{sec:crit}
funciona.
\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}