Generalcross-reference to the title of section*

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
carol
Posts: 105
Joined: Wed Dec 24, 2008 7:25 pm

cross-reference to the title of section*

Post by carol »

Hi,
How to cross-refer to a the title of section*? I used \refname but doesn't display only the title of section* as I want. In the example below, \refname{sec:my_section} displays Referencessec:my_section: instead of my_section.

Code: Select all

\section*{my_section}           \label{sec:my_section}
\refname{sec:my_section}
cheers,

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

cross-reference to the title of section*

Post by gmedina »

Hi,

perhaps you need something like the following:

Code: Select all

\documentclass{article}
\usepackage{hyperref}

\begin{document}

\phantomsection
\section*{mysection}\label{sec:mysection}

\nameref{sec:mysection}

\end{document}
Remarks: 1) Do not use the underscore character "_" outside math mode; this will produce errors. 2) The command \refname stores the predefined name for the bibliographycal section ("References" in the case of the article class).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply