[texhax] Settings customs names for internal hyperlinks in text

Pascal pascal.bernhard at belug.de
Sat Mar 8 16:16:25 CET 2014


Am Saturday, den 08.03.2014, 07:17 -0500 schrieb Victor Ivrii:
> 
> 
> 
> On Sat, Mar 8, 2014 at 5:19 AM, Pascal <pascal.bernhard at belug.de>
> wrote:
>         Hi all,
>         
>         I would like to link to certain chapter, sections of my
>         document for
>         which I used the commands \autoref and \nameref in conjunction
>         with
>         labels.
>         
>         But do neither want the exact chapter title as the link text,
>         nor the
>         chapter version, but a customized text. And I have failed to
>         find a
>         solution for that problem so far.
>         
>         For example:
>         
>         As will be discussed in the section about FOO
>         (\reference-command{sec:FOO}{Here comes the custom text I want
>         to have
>         linked not the chapter number nor the exact chapter
>         title} ......
>         
>         
>         \section{The properties of FOO}\label{sec:FOO}
> 
> 
>  
>         
>         
>         I was not able to find a solution in the documentation for the
>         hyperref
>         package
>         (http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/), but
>         that is probably my own fault.
>         
>         I have the feeling that using \nameref and \autoref is the
>         completely
>         wrong approach, so please bear with me.
>         
>         Pascal
> 
> 
> 
> 
> Using documentclass  memoir one can specify
> 
> 
> \chapter[name1][name2]{name3}
> \label{mychapter}
> 
> 
> where name1 goes to \toc, bookmark and \nameref{mychapter}, name2 to
> pageheader and name3 is an "actual" chapter name
> 
> 
> If you want something else you can always \hyperlink{mychapter}{name4}
> which, however, is not automatic. Basically \hyperlink works also with
> \hypertarget{}{} copmmand
> 

Thanks Victor for your help,

that pretty much does the trick, as I also wanted shorter chapter
descriptions in my pageheaders. I use as document scrreprt, which I
forgot to mention. That only allows the options \chapter[name1]{name2} -
but that should suffice for now. 

I'll have a look into the \hypertarget command to link to a specific
word/place inside a paragraph, which I might use on some occasion.


Pascal





More information about the texhax mailing list