Preview a single child document while maintaining counters and references

Jürgen Spitzmüller spitz at
Thu Mar 12 07:51:26 UTC 2020

Am Mittwoch, den 11.03.2020, 22:44 +0100 schrieb Patrick De Visschere:
> With \includeonly{somechapter} in the preamble (of the master) one
> can limit the output to that chapter.
> But one must have compiled the complete document once before this
> will work, because the .aux files of all childs are needed.
> This works straight away with e.g. TexShop.

And with LyX

> With lyx one must first compile (only once I think) the complete
> document and then one can enter the \includeonly{name_used_by_lyx}
> command in the preamble of the master.
> You will have to look up the correct name in the master.tex file
> generated by lyx (in the temp directory) since the filenames are
> modified.

No. There is GUI support for it. Go to Document > Settings > Child
Documents (in your master file), select "Include only selected
children", select the chapters you want to include, and click "Maintain
counters and references" to have the complete document compiled once
before only the \includeonly documents are completed.

A drawback currently is that "Maintain counters and references" makes
LyX execute the extra compilation every time, which increases
compilation time.  Normally, you can uncheck it if the document has
been built once and if you only change the included document.

Ideally LyX should be smart enough to detect changes and do the
complete execution only if necessary.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the lyx-users mailing list