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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does LyX support \hyperlink and \hypertarget commands, or do I have to access them through ERTs?

Is there any other way to make text links without hyperlink/hypertarget that LyX supports? I want to have a sentence that I can click on to move to another part of the document.

share|improve this question

Linking document parts in LyX

In LyX, linking between points or parts inside a document, is done via cross-references. Quoting from The LyX User’s Guide, version 2.0.x, section 6. More Tools, sub-section 6.1. Cross-References:

You can reference every section, float, footnote, formula, and list in the document. To reference a document part, you have to insert a label into it. The label is used as an anchor and a name for the reference.

First, create a label (Insert > Label... ) for the part that is to be referenced. Second, create a cross-reference (Insert > Cross-Reference...) to make a clickable reference which will direct to the labeled part of the document.

One can define the color of the links by using hyperref's options. In Document > Settings > PDF Properties check the Use Hyperref Support and then define the link-color of interest in the Additional options field, i.e. linkcolor=magenta.

Making arbitrary text parts linkable

Currently there is no identical implementation of hyperref's \hyperlink and \hypertarget additional user macros (see also LaTeX/Hyperlinks at wikibooks.org) in form of an inset within LyX. A thread in lyx-devel's mailing list, titled Insets for hypertarget and hyperlinks, discusses the question of interest.

share|improve this answer
This doesn't actually answer the OPs question, which is about the \hyperlink and \hypertarget commands of hyperref. They allow you to add a link to any place in the document, and create a link to that location using any text as the link. With labels and cross references you're limited to numbered stuff as your targets, and whatever you can get from the cross reference commands as link text. – Torbjørn T. Apr 10 '13 at 19:57
@TorbjørnT. I think it actually answers the OPs real question, which is: how can I... ...click on to move to another part of the document. Best, – Nikos Alexandris Apr 10 '13 at 20:12
Hmmm... ok, give me a sec to re-review! – Nikos Alexandris Apr 10 '13 at 20:13
@TorbjørnT. I guess you are right. It does not answer completely -- though, the OP asked Is there any other way to make text links without hyperlink/hypertarget...? So, I think it is a valid answer. – Nikos Alexandris Apr 10 '13 at 20:16
Well, we'll see when the OP checks back. Making any text into a link is not straightforward with labels and cross references though, unless I've missed something. – Torbjørn T. Apr 10 '13 at 20:42

Your Answer


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.