Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In my document I am referencing a section, e.g.

\section{My Section}\label{test}
Also see section\ref{test}

This gives me, e.g.

Also see section 1

but what I want is:

Also see section My Section

How can I do that?

share|improve this question
    
of course it makes more sense to have something like chapter 1 My Section, therefore mentioning chapter number and title. Anyways, this is just an example and you can easily combine both :) –  stefan.at.wpf Nov 30 '10 at 15:29
add comment

1 Answer

up vote 29 down vote accepted

The nameref package does what you want (and cooperates well with hyperref).

\documentclass{article}

\usepackage{nameref}% Only if hyperref isn't loaded
% \usepackage{hyperref}

\begin{document}

\section{foo}\label{test}

Some text.

\section{bar}

Some text. Also see section \nameref{test}.

\end{document}

enter image description here

share|improve this answer
    
thank you very much, works without any problems :-) –  stefan.at.wpf Nov 30 '10 at 15:28
4  
It is worth noting that for this to work, it is not necessary for section numbering to be enabled. I.e. one can use \section*. –  Faheem Mitha Aug 13 '11 at 21:25
3  
An alternative is package titleref. –  Heiko Oberdiek Nov 12 '12 at 23:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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