## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Referencing figure in different tex file

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

### Referencing figure in different tex file

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

LaTeXguide.org • LaTeX-Cookbook.net

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

### Referencing figure in different tex file

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

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?