Generalreferences across multiple articles

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
textonic
Posts: 3
Joined: Tue Oct 07, 2008 10:10 am

references across multiple articles

Post by textonic »

Hi,

I am splitting a long paper latex into two parts. I intend to end up with two completely independent papers, possibly for different journals. However, the second will have many references to statements in the first, currently handled with

Code: Select all

\label
and

Code: Select all

 \ref
since it is still all one file.

I would like to have the second paper use the "aux" file of the first (or some such trick) in order to be able to keep references up-to-date as the first paper keeps being edited.

For instance, I was thinking of coding some sort of macro as follows -- but am hoping for better advice (or help coding this idea).

Let's say I have two papers "paper1.tex" and "paper2.tex". Let's assume further that in my bibtex database I gave the label

Code: Select all

my_paper1
to refer to the publication that will result of paper1. Now let's say "paper1.tex" contains somewhere

Code: Select all

\label{cool_theorem}
. I was envisioning a macro like

Code: Select all

\specialref{cool_theorem}
that would, if called in "paper2.tex", look up the file "paper1.aux", find that

Code: Select all

cool_theorem
refers to, say,

Code: Select all

3.14
and would then produce the effect of an ordinary

Code: Select all

\cite[3.14]{my_paper1}
Anybody can help me with that? Or with a better idea? Or better yet, is this already supported?

Many thanks!
P.S. this is my first post here :)

TexTonic

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

textonic
Posts: 3
Joined: Tue Oct 07, 2008 10:10 am

references across multiple articles

Post by textonic »

Follow-up: I figured out the following ad hoc fix; it is not great so suggestions are still welcome...

Code: Select all

\makeatletter
\input{paper1.aux}
\makeatother
\newcommand{\specialref}[1]{\ref{#1} in~\cite{my_paper1}}
(code in the preamble).
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

references across multiple articles

Post by Juanjo »

It seems that the xr package is what you are searching for.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
textonic
Posts: 3
Joined: Tue Oct 07, 2008 10:10 am

Re: references across multiple articles

Post by textonic »

Thank you very much!
Post Reply