0

I am writing a paper by splitting it to several subfiles and editing each subfile once a time.

For each subfile, it has the code:

\documentclass[../../main.tex]{subfiles} \begin{document} Content of the paper \end{document}

(In the main file, I use packages \usepackage{amsfonts, amssymb, amscd} \usepackage{amssymb} \usepackage{mathrsfs} \usepackage{subfiles})

This enables me to compile the subfile and edit it. However, I met a problem that each time when I cite something in this subfile, it will not show up properly -- it just shows "[??]" (but it will show properly if I compile the main file).

My question is: is there any way that the subfile can show references properly (even better, it contains a list of reference at the end just as the main file)?

I know that I can add the .bib file to each folder where the subfile is kept, but this method is very inconvenient as I need to update my .bib file ocasionally.

Li Yutong
  • 287
  • 1
    are you using xr package ? – Elad Den Dec 12 '17 at 13:47
  • I am using subfiles package. – Li Yutong Dec 12 '17 at 13:57
  • 1
    You could do something similar to https://tex.stackexchange.com/a/358429/36296 – samcarter_is_at_topanswers.xyz Dec 12 '17 at 14:38
  • I just reread your question... you want to \cite{} a reference using bibtex ? or do you want to reference something like a figure with \ref{} ? if it is the latter I suggest you look into xr. If it is the first, then do you want each chapter to have its own bibliography ? a MWE would be helpful here... – Elad Den Dec 12 '17 at 14:56
  • @EladDen I want to \cite{} a reference so that it can show up in my subfile after compiling, or even better, listed as a reference at the end of the subfile. – Li Yutong Dec 12 '17 at 14:59
  • 1
    If you want to use real literature references from other files, you should use the xcite package, which extends the citing mechanism 'the same way' (well ;-)) like xr does for the real cross-references –  Dec 12 '17 at 22:46

0 Answers0