How to refer to sections in different files? [duplicate]

Possible Duplicate:
Cross-referencing between different files

I am new to LaTeX.

I am using \ref{sec:relat-work-import} to refer to sections in different places in the file. I would like to know how to refer to sections in different files in LaTeX.

-

migrated from stackoverflow.comJan 31 '12 at 15:13

This question came from our site for professional and enthusiast programmers.

marked as duplicate by lockstep, Werner, Stefan Kottwitz♦Feb 2 '12 at 21:15

seperate files make up a single document. Thanks –  bhasbhas Jun 25 '11 at 9:05
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jan 31 '12 at 15:19

If this is a single document, then references should just work without you having to worry which individual part file it is from or to.

Bear in mind that forward references will need two (or sometimes more) [Xe|Lua|Pdf][La]TeX runs to resolve correctly.

-
Thanks. But still it throws [ ?? ]instead of the reference when I run. –  bhasbhas Jun 26 '11 at 1:27
@bhasbhas: Oh. In the TeX log, it will tell you of any problems resolving. The, I think the first step is to check the exact spelling of your reference tags (sorry!), then, if that's correct, post a small example which fails, showing us the contents of at most two or three small files. –  Brent.Longborough Jun 26 '11 at 9:08