[OS X TeX] Referring to arbitrary labels?

Mohinish Shukla shukla at sissa.it
Sat Nov 20 19:00:21 CET 2004


Claus, Peter, Will,
	thanks all of you for the very helpful hints! I should be able to make 
something out of all these things put together :)

So I guess here's one more thesis that needs a TeX on Mac OS X in the 
acknowledgements ;)

-Mohinish



On 19 Nov 2004, at 8:43 PM, Claus Gerhardt wrote:

> The package nameref.sty is already part of Gerben's distribution. It 
> is also automatically loaded, if hyperref is used.
>
> I experimented a bit and noticed that for any label, e.g., 
> \label{whatever},\nameref{whatever} will return the optional title, if 
> one is present, otherwise the title of the section, the referred 
> object belongs to, regardless of its nature.
>
> Claus
>
> On 19.11.2004, at 16:39, peter.frings at agfa.com wrote:
>
>> on 2004/11/19 10:39, Mohinish Shukla wrote:
>>
>>> -> Is it possible to have a kind of \refer{sectionlabel} which, 
>>> instead
>>> of returning the section NUMBER, returns the section NAME or 
>>> SHORTNAME?
>>
>> \nameref seems to work for me. See
>>
>> http://www.tex.ac.uk/cgi-bin/texfaq2html?label=nameref
>>
>>
>> For example:
>> \newcommand{\seesec}[1]{%
>>   Section~\ref{sec:#1}:~\textsl{\nameref{sec:#1}}%
>> }
>>
>>
>> \subsection{A chapter somewhere} \label{sec:a-label}
>>
>> ... as explained in \seesec{a-label}.
>>
>>
>>
>> Cheers,
>> Peter.
>>
>>
>> --------------------- Info ---------------------
>> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>            & FAQ: http://latex.yauh.de/faq/
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>
>>
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list