LaTeX forum ⇒ Graphics, Figures & TablesReferencing 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

Postby MarthaS92 » Sun Jul 10, 2022 9:17 pm

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 2021:

LaTeXguide.org • LaTeX-Cookbook.net
LaTeX Beginner's Guide LaTeX Cookbook
rais
Posts: 332
Joined: Sun Nov 16, 2014 8:51 pm

Referencing figure in different tex file

Postby rais » Mon Jul 11, 2022 9:48 am

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

Postby MarthaS92 » Wed Jul 13, 2022 9:20 pm

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?


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 4 guests