GeneralIs it possible to use \ref to refer other documents?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jazzgossen
Posts: 26
Joined: Mon Mar 09, 2009 3:19 pm

Is it possible to use \ref to refer other documents?

Post by jazzgossen »

I have two documents, and if possible I'd like to refer to a section or algorithm label in one document from the other.

Is this possible?

So document one might be

Code: Select all

\documentclass{article}

\begin{document}

\section{introduction}
\label{sec:intro}

\end{document}
and document two would be something like

Code: Select all

\documentclass{article}

\begin{document}

\section{introduction}
Refer to Section~\ref{sec:intro} in the other document.

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Is it possible to use \ref to refer other documents?

Post by meho_r »

Add in the Preamble of the second document:

Code: Select all

\usepackage{xr}
\externaldocument{first_document_name}
Infos about xr package can be found here.
jazzgossen
Posts: 26
Joined: Mon Mar 09, 2009 3:19 pm

Re: Is it possible to use \ref to refer other documents?

Post by jazzgossen »

Excellent, thanks.
Post Reply