LaTex2Web logo

LaTeX2Web, a web authoring and publishing system

If you see this, something is wrong

Collapse and expand sections

To get acquainted with the document, the best thing to do is to select the "Collapse all sections" item from the "View" menu. This will leave visible only the titles of the top-level sections.

Clicking on a section title toggles the visibility of the section content. If you have collapsed all of the sections, this will let you discover the document progressively, from the top-level sections to the lower-level ones.

Cross-references and related material

Generally speaking, anything that is blue is clickable.

Clicking on a reference link (like an equation number, for instance) will display the reference as close as possible, without breaking the layout. Clicking on the displayed content or on the reference link hides the content. This is recursive: if the content includes a reference, clicking on it will have the same effect. These "links" are not necessarily numbers, as it is possible in LaTeX2Web to use full text for a reference.

Clicking on a bibliographical reference (i.e., a number within brackets) will display the reference.

Speech bubbles indicate a footnote. Click on the bubble to reveal the footnote (there is no page in a web document, so footnotes are placed inside the text flow). Acronyms work the same way as footnotes, except that you have the acronym instead of the speech bubble.

Discussions

By default, discussions are open in a document. Click on the discussion button below to reveal the discussion thread. However, you must be registered to participate in the discussion.

If a thread has been initialized, you can reply to it. Any modification to any comment, or a reply to it, in the discussion is signified by email to the owner of the document and to the author of the comment.

Publications

The blue button below that says "table of contents" is your tool to navigate in a publication.

The left arrow brings you to the previous document in the publication, and the right one brings you to the next. Both cycle over the publication list.

The middle button that says "table of contents" reveals the publication table of contents. This table is hierarchical structured. It has sections, and sections can be collapsed or expanded. If you are a registered user, you can save the layout of the table of contents.

Table of contents

First published on Wednesday, Aug 27, 2025 and last modified on Friday, Sep 12, 2025

I am normally hidden by the status bar

Cross references

François Chaplais

1 Introduction

Cross references are a way to point to a portion of a document elsewhere in the document.

In print, let us say that you want to reference the first section. A reference to this section will look like

as said in section 1

If you use the hyperref package, LaTeX references will act as hyperlinks in the resulting PDF file. This will kook like

as said in section 1

Clicking on the blue 1 digit will bring the focus of the PDF document to the first section of the document. Unfortunately, this is unpractical in complex/large documents because, when switching to the first section of the document, the reader will lose view of the context in which the reference was made. In practice, the reader has to memorize the context before going to the first section, which can be quite a strain in complex documents.

In LaTeX2Web, we do things differently.

But, before we detail the implementation of cross references in LaTeX2Web, let us first explain how cross references are created and used in the LaTeX language.

2 Creating and using cross references

To create a cross reference, you must add a label to the object you want to reference. You do this by using the \label command after the object declaration. Let us give an example with a theorem of type summary.

\begin{summary}\label{labelName}
... summary content ...
\end{summary}

To reference the summary elsewhere in running text, you use the \ref command. Here is an example.

Essentially, gnus behave as described in \ref{labelName}.

3 Example

We have assigned a label to the Introduction section 1. The reference is the blue number 1 in the previous sentence. If you click on it, the browser focus will not move to the introduction, but instead, the content of the introduction will be inserted below this very paragraph to let you see the reference in context.

To dismiss the content of the reference, click on it .

If you are not happy with a simple number to represent the reference, you can pass an optional parameter to the \ref command which will specify which text should be displayed as a pointer to the reference. Let us do this now.

We have assigned a label to the Introduction section. The code is

We have assigned a label to the \ref{intro}[Introduction section].

4 Site-wide cross references

The advantage of the LaTeX2Web ecosystem is that it supports site-wide cross references. As a example, we are going to implement a reference to the Introduction section of the “A LaTeX guide for web publishing” article, which is the the first article in this guide. Naturally, the first thing to do is to attribute a label to this section in the source code.

Assume that this has been done and that the label for the remote section is also intro. Next, we compile the corresponding article.

There remains to create a reference in this document. If we use \ref{intro}, the reference will point to the introduction of this document. So, obviously, we must proceed differently.

The right thing to do is to go to the introductory article and activate the “fetch labels” functionality. To do so, have a look at the black status bar at the bottom of the web page (it is hidden on mobile). There is a checkbox that says Fetch labels. Check it if it is unchecked.

This action modifies the effect of a click in the document (“A LaTeX guide for web publishing” here).

Click somewhere in the text of the introduction. A dialog appears below the text that lets you select the object for which you want to get the label. here the list is limited to one item. Select it, and the label for the introduction will be pasted to the clipboard. In this case, the clipboard says A-LaTeX-guide-for-web-publishing/intro.

Now return to edit this very document, insert a \ref command somewhere in the text, and paste the cross site label inside the curly braces. Let us do this now.

To have an overview of this guide, read the introduction of the guide.

The code is

To have an overview of this guide, read the \ref{A-LaTeX-guide-for-web-publishing/LaTeX-intro}[introduction of the guide].

5 Summary

Summary 1 (Cross references)

LaTeX objects can be referenced if they have a label (created by the \label command) attached to them.

To reference an object, use the \ref command with the label name as a parameter.

Objects can be referenced across multiple LaTeX2Web documents.