-1
$\begingroup$

I need a way to split output pdf-file (a book) into chapters on such a way that cross-references will survive.

A simple example with a solution (based on answers below) can be found here

$\endgroup$
2
  • $\begingroup$ This question is probably best asked on stackoverflow.com since there isn't anything about it which is specific to mathematics. $\endgroup$ Commented Nov 19, 2009 at 4:52
  • $\begingroup$ Right, sorry about that. $\endgroup$ Commented Nov 19, 2009 at 5:55

2 Answers 2

6
$\begingroup$

If you are using a book documentclass, then you can create a template file, with \include{chapter3} or \includeonly{chapter2}. I don't know if this works particularly. A hacky way to do it is to save your .aux file as say a .auk file, process, and then write over the .aux file with the saved version.

If you are on a mac, and have leopard or snow leopard, you can open files in preview and drag sets of pages into different preview windows, then you can save those files while editing others. Again it's a hack, but it works.

$\endgroup$
1
  • $\begingroup$ I agree that \include and \includeonly are the best way to go. This creates a separate .aux file for each included chapter -- so it maintains cross-references, page numbering, etc. -- but only outputs the chapter(s) selected with \includeonly. I used this recently when I had to output my list of references as a separate PDF file, and it worked like a charm. $\endgroup$
    – Ari
    Commented Nov 19, 2009 at 2:27
4
$\begingroup$

The standard way to have inter file references in (pdf)latex is to use the xr package or, nowadays, the xr-hyper package which comes with hyperref.sty. Searching comp.text.tex (at http://groups.google.com/group/comp.text.tex/, for example) should unearth information on how to do what you want.

$\endgroup$
2
  • $\begingroup$ Close, but not exactly what I need. This way can I generate chapter-files with xrefs, BUT I do not see how one can automatically to keep all numeration (pages sections theorems) as in the book. $\endgroup$ Commented Nov 19, 2009 at 2:11
  • 3
    $\begingroup$ If you put the chapters each in a separate .tex file, and include them in the main file using \include, latex will create one .aux file per included file. Process the main file as many times as you need to get it stabilize. Then edit the main file and add \includeonly{chapter-one}, for example, and re-run latex. It will use the .aux files for all included files, even though it will only process the one you told to process: that way, it will get all numeration counters correct. $\endgroup$ Commented Nov 19, 2009 at 2:20

Not the answer you're looking for? Browse other questions tagged .