# Finding cross references in Lyx

Is there any way to find all the cross references to a label in a LyX document?

One solution is to search through the source file, but I was wondering if there is anything provided in the GUI.

Your best bet here is to activate theOutline panel with View --> Outline Pane (Document --> Outline in older versions of LyX), and choose Labels and references. There you'll get a list of all labels, and you can expand each item to get links to the places where it is referenced.

It also shows the type of reference.

• This is works too. I think the two methods exposed here are complementary. Thanks – Bogdan Sep 4 '13 at 2:53
• Note that this feature is located under the View menu in later versions of LyX and is called Outline Pane. – Zero3 Jan 6 '16 at 17:39
• @Zero3 Thanks for the note, I updated my answer. – Torbjørn T. Jan 6 '16 at 20:49

Your best bet here is to use a LaTeX-based approach via showkeys. Just add the package to your LaTeX preamble:

\usepackage{showkeys}% http://ctan.org/pkg/showkeys


It highlights \labels in the margin, and \refs inline:

\documentclass{article}
\usepackage{showkeys}% http://ctan.org/pkg/showkeys
\begin{document}
\section{First section}\label{first}
See section~\ref{last}.
\section{Second section}\label{second}
See section~\ref{first}.
\section{Last section}\label{last}
See section~\ref{first}.
\end{document}

• Thanks. Works like a charm. There are some issues when the \ref(s) are too close together and the highlights overlap, but it does the job. – Bogdan Sep 3 '13 at 20:44
• @Bogdan: That's true - the setting of keys is made in such a way so as to not influence the document layout. From a technical point of view, this means that the keys have no vertical/horizontal length. As such, they overlap with other things. But that's why this would/should only be used as a debugging tool. – Werner Sep 3 '13 at 20:46