3

When editing a long document, it is tiring to recompile all of it. Usually you do not want a print-ready output, only a locally meaningful output, that you correctly entered formulae, your sentences are right and so on.

For that, a solution must start at saving the state of the TeX/LaTeX compiler into a file and reading it afterwards. Using this you could say you freeze your document up to a point and edit it only afterwards, let us say from a new page and generate only a few page of output, only to check basic things.

Is there a solution in this direction?

Gergely
  • 1,065
  • 1
  • 8
  • 17
  • 2
    I am not sure what you are after. But are you aware of \includeonlly to include only a bit of a document (i.e. a chapter). You can also always comment stuff out that you don't need. – Johannes_B Sep 15 '14 at 07:20

3 Answers3

6

There is a mechanism, you may include only parts of your document, the relevant commands are \include{}, \input{} and \includeonly. The difference has been explained here: When should I use \input vs. \include?

Keks Dose
  • 30,892
3

(Note: editor-specific answer.)

Using Emacs + AUCTeX, this is possible (see also this message -- which lists other possibilities I was unaware of).

Basically, if you mark a region, e.g., with C-SPC (= M-x set-mark-command; or C-@) to start the mark region, you can than partially compile the selected region via the command: C-c C-r. This will compile only the selected region, relying on the preamble of the master file. It can be useful if you quickly want to check something.

jon
  • 22,325
2

This is a supplement to Keks Dose's answer.

There are also packages you can use to manage parts of documents which are 'complete in themselves'. For example, diagrams and graphics often take a disproportionate time to compile so you don't want to re-compile them once you've got them right. Or you might want to be able to typeset a document as a chapter in a book or an independent article without maintaining separate versions.

Packages such as standalone, docmute, includex and others allow you to include the contents of complete documents, while maintaining the ability to compile those documents independently and/or to use pre-compiled versions of graphics etc. Some graphics packages such as TiKZ also offer a specialised option to 'externalise' graphics produced.

cfr
  • 198,882