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.
Well, @SeanAllred answered the question in the comments section. Since it bugs me to leave a question unanswered I thought I'd just add it as an answer. (I'm not sure if that agrees with stack exchange etiquette, guess I'm about to find out)
The simple answer would be to copy these lines
\usepackage{titlesec}
\titleformat{\section}{\normalfont\Large\bfseries}{\S\thesection}{1em}{}
to the LaTeX preamble box under Document -> Settings -> LaTeX Preamble. I have tried it and it works well!
A different approach suggested by @scottkosty is to create a LyX module for this. I haven't tried it, so I wouldn't know.
Thanks for the help!
Best Answer
You seem to be mixing some general Terminology
In Lyx or word etc whilst editing there are ways to jump backwards and forwards from one cross reference to another those locations may be called bookmarks or labels etc which can be confused with other uses of those terms.
The key is these are internal links for convenience whilst editing.
A second form of link is the HYPER-link which will launch you into space outside the document (or equally could link you back in as if arriving from outside) a typical hyperlink in Lyx is shown as
And both applications use a hybrid form where you can jump to a document followed by an internal address.
This is where most confusion arises since the syntax for an external link may be different than for an internal link.
TeX has a number of packages that assist in adding these features and one package is hyperref that can handle both external and internal references.
You wish to cross reference from internal abc to internal label ABC that's only possible if the two use exactly the same label
So we label the section ABC and it is that cross reference we need to put in section XYZ to allow us to jump both ways forward or back.
This works for cross referencing in the editor but you will see nothing in the PDF the compiler has not been instructed to load Hyperref so going to Document > Settings > PDF Properties check the Use Hyperref Support and then define your preferred options.
Now when we compile we get red links by default![enter image description here](https://i.stack.imgur.com/1BuIP.png)