=============================== Finishing a LaTeX publication =============================== In the XML workflow, the PDF version is still created with LaTeX. While it is possible to export and typeset directly from XXE (see :ref:`changing-models`), some modifications like the positioning of figures is better done with editing the LaTeX files directly. Export and rename ================= Normally, the contents of the ``output/latex`` directory will be overwritten with each new export. To make a version that is safe from overwriting, do an export and rename the directory to something like ``output/latex_manual``. Important: make a note to yourself and also inform your co-workers that the project has to entered a phase where the ``XML`` must not be altered until the changes have been written back (see :ref:`writethingsback`). A pro tip: use ``\include`` and ``\includeonly`` ================================================== The LaTeX export normally uses ``\input`` for splitting up publications into a main document and chapters. This is totally fine. However, when doing the image placing step, the ``\include`` method might come in handy. Using the ``\includeonly`` command somewhere before ``\begin{document}``, a selection of chapters or only one chapter can be typeset, but it will retain its original page numbers, also, all the chapters that are not to be typeset do not have to be commented out. See also https://en.wikibooks.org/wiki/TeX/includeonly. After the export to a manually editable version (see above), the following changes are necessary: - replace all the ``\input`` commands with ``\include`` and remove the extension ``.tex``. - because LaTeX will insert a new page before including a file, the ``\EOAchapter`` command needs to be placed into the file to be included. Originally, the file would look like this .. image:: /_static/latexinputexample.png :scale: 50 % :alt: LaTeX file using input command :align: center Manually changed to ``\include`` .. image:: /_static/latexincludeexample.png :scale: 50 % :alt: LaTeX file using include command :align: center The ``\EOAchapter`` and ``\EOAlabel`` command were written into the subordinate file (and moved to the same line for convenience) .. image:: /_static/latexchapterwitheoachapter.png :scale: 50 % :alt: include chapter with EOAchapter command :align: center Before excluding any files, compile the whole document once more to create ``.aux`` files for all the files to be included. Without these, selective compiling is not possible. With this structure in place, use a statement like ``\includeonly{texfiles/part2-chapter02}`` somewhere before ``\begin{document}`` to typeset just a fraction of a document. .. _writethingsback: Last step: Writing things back ============================== To preserve the changes made, the changes (like image size and position) have to be written back manually into the XML file. A tool for showing differences might come in handy: make a new export to LaTeX from the XML file and then compare the ``output/latex`` to ``output/latex_manual`` to see what actually did change. If you also made changes to the bibliography, also copy them back to the version in the root directory.