Questions tagged [cross-referencing]

{cross-referencing} is about making connections from a point in a document to related information elsewhere, usually within the same document. Standard commands are \label and \ref. For questions about citing or bibliographies, use {bibliographies} instead.

is about making connections from a point in a document to related information elsewhere, usually within the same document.

LaTeX's standard commands for generating cross-references are \label and \ref.

There are many packages enhancing LaTeX's cross-referencing capabilities, for instance , prettyref, nameref, titleref, , xr and . The last two are outstanding: xr allows cross-referencing to other LaTeX documents and hyperref can produce hyperlinks in PDF documents. Since the latter is a very complex package for which we've got many question, please use the tag instead, if your question specifically concerns this package.

If your question is about these or related commands or packages, use . For questions about citing or bibliographies, use instead.

See also: Cross-reference in the Wikipedia.

4482 questions
143
votes
2 answers

Cross-Reference with custom text

Is there a way to make a cross reference to a label of a header with custom text? That is, its text should differ from the Header text, or its number or page (not like the predefined formats in Lyx). Something like the the hyperlinks or bookmarks in…
TMS
  • 2,193
120
votes
1 answer

\ref Chapter Name in LaTeX

Possible Duplicate: Get the title instead of number of a referenced chapter? Is it possible to use \ref{chap:conclusion} to refer to the actual name of the chapter instead of the chapter counter in LaTeX? So that I can do this: See the…
joec
101
votes
1 answer

Get the title instead of the number of a referenced chapter/section?

In my document I am referencing a section, e.g. \section{My Section}\label{test} Also see section\ref{test} This gives me, e.g. Also see section 1 but what I want is: Also see section My Section How can I do that? [Edit: comment moved to…
me.at.coding
  • 1,653
87
votes
2 answers

Understanding how references and labels work

I'm trying to understand why I cannot effectively reference figures or equations that I have defined with labels. For example: \begin{figure} \label{fig:area_Treasuries} \caption{Treasuries as a portion of total financial flows.} \centering …
zpesk
  • 1,035
83
votes
2 answers

What's the difference between \ref and \autoref?

I've always used \ref for referring to labelled items, but a LaTeX template I downloaded uses \autoref instead. What is the difference?
Ref
  • 831
  • 1
  • 6
  • 3
59
votes
9 answers

Chapter ref with LaTeX

In LaTeX, we can say something like: "See equation \ref{eq} on page \pageref{eq}..." Is there any way to do: "See equation \ref{eq} in chapter \chapterref{eq}..."
brian
  • 1,069
39
votes
8 answers

Defining custom labels

Is it possible to define a directive which creates a custom label which I can later reference on multiple locations with \ref{...}? For example: ... \createlabel{l-foo}{22} ... % later in document: In line \ref{l-foo} foo-bar. Furthermore, line…
axel22
  • 809
37
votes
3 answers

Referencing to "above" or "below"?

I would like to know if it is good practice, and if so how it can be achieved, to make references like: "as mentioned above...". Or am I going too far and should just type the word? I've read something about varioref, but it seems to produce page or…
Marnix
  • 1,597
  • 3
  • 17
  • 23
31
votes
4 answers

Figure reference \ref{fig:result} renders as ?? in PDF

I have an article with the following figure (there are 2 small charts near each other, horizontally): \begin{figure}[h] \centering \includegraphics{left-graph} \includegraphics{right-graph} \caption{My caption}\label{mylabel} \end{figure} I…
30
votes
3 answers

Automatically inserting "Section", "Subsection", etc

Is there a package that automatically inserts the ToC level of the reference I inserted? Section 1.1 \label{a} Subsection 1.1.1 \label{b} Subsection 1.1.2 \label{c} So that the text: Blah \superref{a} and \superref{b} and…
Chris
  • 4,055
30
votes
2 answers

How to link to a label using specific text

So I am writing a programming book and I have a code example in it that I have labeled \label{ex11}. How can I later in the document make a link to it using custom text? For example, I am writing somewhere later in the book, "As I mentioned in the…
user5177
23
votes
2 answers

Is there a way to have latex detect forward references?

I've got a very large document (which I've broken into "chapters" and such) which I've recently moved a few things around in. Is there a nice way to get latex to output a list of forward references? (like, things in chapter 5 that reference a…
23
votes
2 answers

Where will a theorem be used?

I have once seen a book (Graph Theory by Reinhard Diestel) where the author flags his theorems by adding on the left/right of the page the reference number of later theorems where said theorem will be applied. A truly bidirectional…
Delio
  • 344
  • 1
  • 8
22
votes
3 answers

How does LaTeX know the page number of a reference?

I am creating documents with various references, citations, an index, table of contents, and other linked elements. How does LaTeX know how to properly cross reference a page while properly formatting a page and keeping the page numbers correct? How…
Steve
  • 453
  • 3
  • 10
19
votes
1 answer

How to reference another document in LaTeX?

I want to compile sections of the article independently. Clearly, I can make their numbers right just by using something like \setcounter{section}{4}. How can I get something like \ref{VeryUsefulTheorem} working if the command…
fiktor
  • 1,953
1
2 3
34 35