1

Of course without creating a new subsection.

\documentclass{article}

\usepackage{blindtext}
\usepackage{hyperref}

\begin{document}
    \section{One}
    \label{sec:one1}
        \blindtext\\
        \phantomsection
        \label{sec:one2}
        \blindtext   
        \ref{sec:one2} % actually refers to same place as one1
\end{document}
  • Not really clear what you're asking here. What exactly are you trying to accomplish? You have already added a label that refers to that point; please let us know what you're trying to do, what you have tried, and how your attempts have failed to do what you want. Are you trying to get the label to produce a cross-reference different from the section number? – dgoodmaniii Nov 6 at 15:01
  • What exactly should the reference look like? If you reference something, the number that corresponds to the section will appear. So I do not understand how you want to reference in the middle of a text, if I have understood your intention correctly. – Michael Chatiskatzi Nov 6 at 16:20
  • This refers to text that is not on the section page. In fact the use of \ phantomsection \ label {sec: on2} works, it is just a matter of putting it in the right place in the text in relation to the page break. Thanks for your feedback. – Bernard Poulot Nov 7 at 16:14
1

I think that what you might be looking for is \pageref

\documentclass{article}

\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
    \section{One}
    \label{sec:one1}
        \blindtext\\
        \phantomsection
        \label{sec:one2}
        \blindtext   
%        \ref{sec:one2} % actually refers to same place as one1
         \pageref{sec:one2} % refers to the page where \label{sec:one2} occurs.
\end{document}

The \ref{label} macro refers to the section heading, figure caption, etc, where \label is put. The \pageref{label} macro returns the page number where the \label was placed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.