To add cross references to a theorem, first add a label right after the theorem "title" (e.g. Theorem 1) with Insert --> Label or the
button on the toolbar. This places, well, a label at that point which you can refer to at other places in the document. The label refers to the last "active" counter, so when you place it right at the beginning of the theorem, you know you get the right one.
A cross reference is added via Insert --> Cross reference or the
button on the toolbar (right next to the insert label-button). You will get a list of all the labels in the document, and a choice of what kind of reference you would like. For example, <reference>
prints just the number.
To change the type of reference just right click the reference and choose from the menu that pops up.
\hyperref
One use of this command is to have a clickable link that consists of more that just the number. hyperref
provides a starred \ref
command that prints the relevant number without turning it into a clickable link. For example:
\hyperref[thm:ATheorem]{Theorem \ref*{thm:ATheorem}}
Summary of sorts
In the screenshot below I've tried to "sum up" some of this (click it to see larger). To point out the obvious, LyX on the left, PDF output on the right.
![enter image description here](https://i.stack.imgur.com/PMnq7.png)
If the "subtitle" attributes are to be the same from those of the title, and you want the information to appear right after the title, you can use the optional argument of the sectional units:
\documentclass{article}
\begin{document}
\tableofcontents
\section[Layout -- This section describes the layout]{Layout}
\subsection{Main Window}
\subsection{Footer}
\section[Navigation -- Here you will get information on foobar]{Navigation}
\subsection{Basic structure}
\subsection{Overview page}
\end{document}
![enter image description here](https://i.stack.imgur.com/ZnPKC.png)
As tohecz mentions in a comment this will also add this subtitle to the header marks.
Another sometimes used format is to write this "subtitle" right below the title for the sectional unit. The following code shows one way to achieve this; the idea is to define a new command \sectionsubtitle
which writes the information to the ToC, immitating the way section entries are typeset, but suppressing the sectional and page numbering, and the leading dots; additionally, with this approach the subtitles won't be added to the head marks:
\documentclass{article}
\usepackage{etoolbox}
\makeatletter
\let\@nodottedtocline\@dottedtocline
\patchcmd{\@nodottedtocline}{\hbox{.}}{\hbox{}}{}{}
\patchcmd{\@nodottedtocline}{\normalcolor #5}{\normalcolor}{}{}
\newcommand*\l@sectionsubtitle{\@nodottedtocline{1}{0em}{1.5em}}
\makeatother
\def\sectionsubtitle#1{%
\addcontentsline{toc}{sectionsubtitle}{\protect\numberline{}#1}%
}
\begin{document}
\tableofcontents
\section{Layout}
\sectionsubtitle{This section describes the layout}
\subsection{Main Window}
\subsection{Footer}
\section{Navigation}
\sectionsubtitle{Here you will get information on foobar}
\subsection{Basic structure}
\subsection{Overview page}
\end{document}
![enter image description here](https://i.stack.imgur.com/zt9mi.png)
Best Answer
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
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!