I'm wondering if there is a way to name the label with the same name of a section automatically.
In the below example, instead of writing \label{page1}, I'd like to write something like \label{special_stuff} where special_stuff is a sort of a variable which assumes the value of the name of the first section before the command \label.
The only part of the code where it should be necessary to write page1 is \pageref{page1}.
\documentclass{article}
\begin{document}
\section{page1}
\label{page1}
page 1
\clearpage
\section{page2}
Here a reference to page \pageref{page1}.
\end{document}
\label{sec:explaining-duck-feeding}for a section maybe titled "The pro and cons of feeding wild ducks with bread". A good label is something you remember easily and you don't change (ever). My labels are often in Italian... even when writing an English document. – Rmano Nov 29 '23 at 11:06