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

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

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