Graphics, Figures & TablesReferencing figure in different tex file

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
MarthaS92
Posts: 13
Joined: Wed May 12, 2021 11:31 am

Referencing figure in different tex file

Post by MarthaS92 »

Hello!

I am dealing with a problem connected with referencing figures in different *.tex file.
I have a few *.tex files which are pointed (included) in the main.tex file.
One of these files (AppendixA.tex) has few figures which I want to make reference to in another file (i.e. A.tex).

I have tried using xr package and in A.tex file I added this command: \externaldocument[05-]{AppendixA} but I am receiving ?? in a place where the number of reference should be.

Does anyone have any idea how to solve this issue :?:

Marta

Recommended reading 2024:

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

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

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Referencing figure in different tex file

Post by rais »

The xr package works with the .aux file of the external document. If there's no "AppendixA.aux", e.g., if you used \input for including AppendixA in main.tex, then use \externaldocument[05-]{main} in A.tex, instead.

KR
Rainer
MarthaS92
Posts: 13
Joined: Wed May 12, 2021 11:31 am

Referencing figure in different tex file

Post by MarthaS92 »

There is an "AppendixA.aux" file of the external document but I have this external document in different folder. Also the "A.tex" file is in another folder and "main.tex" file is in another folder.

Maybe this is the reason why it doesn't work?
Post Reply