0

My coauthor and I have a tex file for the paper (main.tex), and another tex file for tables and figures (tables_and_figures.tex). Previously, we would compile main.tex, and then compile tables_and_figures.tex to start at the next page number. I'm curious if it is possible to refer to tables_and_figures.tex in main.tex so that we just have to compile main.tex, and it will start tables_and_figures.tex following the content. Importantly, tables_and_figures.tex has its own preambles, which seems to be incompatible with \include or \input (if my understanding of these commands based on the few postings is correct).

  • Do you need to \ref or anything similar to create references/links from main.tex to specific pages/elements of tables_and_figures.tex? If not, you could just add the compiled PDF for tables_and_figures.tex at the end of main.tex with the pdfpages package. If you need linked references, it's more difficult. – frabjous May 28 '22 at 22:19
  • If I understand, this approach will require me to manually check how many pages are in main.tex, and then manually set the page number from which tables_and_figures.tex needs to start? If possible, we want to automate this part. – John Kim May 28 '22 at 22:25
  • If you mean you want the the tables to appear in both documents (rather than reference the first document from the second) by far the simplest way is to put the body of the table document (with no preamble) into (say) shared.tex then \input that into each document. – David Carlisle May 28 '22 at 23:23
  • You could remove the page numbers from tables_and_figures.tex and just continue the page numbers from main.tex using pagecommand={}. I.e., \includepdf[pages=-,pagecommand={}]{tables_and_figures}. (pdfpages usually supresses the page numbers of the pages it adds, but this makes it not do so; see here). – frabjous May 29 '22 at 00:02

0 Answers0