Discussion:
Customize label ref in hyperref (autoref, nameref)
(too old to reply)
csviks
2010-07-18 00:35:03 UTC
Permalink
Hi:

I am trying to accomplish something rather small, and am sure that
some package may already offer this. But I'm having a hard time
getting it to work. Any help much appreciated!

I define the following sections in the document
-----------------------------------------------------------------------------------------
\section{Great Idea 1: My First Section} \label{marker1}
blah blah blah blah blah

\section{Great Idea 2: My Second Section} \label{marker2}
blah blah blah
------------------------------------------------------------------------------------------
Now I have some text where I refer to the above sections:

In \ref{marker1} we showed this, and in \ref{marker2} we showed that.

*What I want to show up is*:
In Great Idea 1, we showed this, and in Great Idea 2 we showed that.

Which means that the \ref or \autoref or \nameref or \varioref etc
picks up only a specified part of the text from the section title. Any
way to accomplish this?

thanks!
as
2010-07-18 11:09:14 UTC
Permalink
Le Sat, 17 Jul 2010 17:35:03 -0700 (PDT),
Post by csviks
I am trying to accomplish something rather small, and am sure that
some package may already offer this.
Indeed, take a look at the titleref package

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{titleref}
\begin{document}
\section[Great Idea 1]{Great Idea 1: My First Section} \label{marker1}
blah blah blah blah blah

\section[Great Idea 2]{Great Idea 2: My Second Section} \label{marker2}
blah blah blah

Now I have some text where I refer to the above sections:

In \titleref{marker1} we showed this, and in \titleref{marker2} we
showed that.

*What I want to show up is*:\par
In Great Idea 1, we showed this, and in Great Idea 2 we showed that.
\end{document}
--
as
csviks
2010-07-18 18:16:00 UTC
Permalink
Post by as
Le Sat, 17 Jul 2010 17:35:03 -0700 (PDT),
Post by csviks
I am trying to accomplish something rather small, and am sure that
some package may already offer this.
Indeed, take a look at the titleref package
that was a fantastic suggestion, thanks!

titleref seems to work fine for this purpose. But it seems that it has
some problems with hyperref. I used nameref and its works exactly as I
want. thanks again!

Loading...