Document Structure » Historie » Version 14
Marcus Hottenroth, 21.10.2026 11:57
| 1 | 1 | Martin Kraetke | h1. Document Structure |
|---|---|---|---|
| 2 | |||
| 3 | 14 | Marcus Hottenroth | h2. Minimal TeX document |
| 4 | 1 | Martin Kraetke | |
| 5 | 14 | Marcus Hottenroth | A minimal TeX document that uses the CoCoTeX Framework has the following structure: |
| 6 | 1 | Martin Kraetke | |
| 7 | <pre><code class="text"> |
||
| 8 | 4 | Patrick Schulz | \documentclass[<options>]{cocotex} (1) |
| 9 | 5 | Patrick Schulz | \usepackage[<options>]{<publisher style>} (2) |
| 10 | 3 | Patrick Schulz | ... (3) |
| 11 | \begin{document} (4) |
||
| 12 | … (5) |
||
| 13 | \end{document} (6) |
||
| 14 | 1 | Martin Kraetke | </code></pre> |
| 15 | |||
| 16 | # Document class |
||
| 17 | 3 | Patrick Schulz | ** Document class name is *always* @cocotex@. |
| 18 | 6 | Patrick Schulz | ** Optional argument (stuff between @[@ and @]@, komma-separated) can be used to pass LaTeX-options such as @a4paper@, @openright@, @twoside@, etc. The available class options are exlained below. |
| 19 | 1 | Martin Kraetke | # Include the customer-specific style with the respective options |
| 20 | # the area between @\documentclass[…]{…}@ and @\begin{document}@ is the TeX preamble. Additional meta information (e.g. color definitions, parameters for the front cover, the @tpMeta@-Environment, ...) may inserted here |
||
| 21 | # @\begin{document}@ marks the start of the document |
||
| 22 | # Content |
||
| 23 | # anything after @\end{document}@ is ignored. |
||
| 24 | |||
| 25 | |||
| 26 | 14 | Marcus Hottenroth | h2. Extensive TeX document |
| 27 | |||
| 28 | Attached to this page you can find an "almost complete TeX template":https://redmine.le-tex.de/attachments/download/36801/Xeriftemplate.sty that can be used for any new Xerif project. It contains the most common and frequently needed structures as well as some important examples for special cases. |
||
| 29 | |||
| 30 | |||
| 31 | 6 | Patrick Schulz | h2. Class options |
| 32 | |||
| 33 | 14 | Marcus Hottenroth | h3. Publication type |
| 34 | 6 | Patrick Schulz | |
| 35 | The "publication type" is what the document class is in Standard LaTeX. It is set with the @pubtype@ option and allows one of the following values: |
||
| 36 | * @mono@ for monographs (i.e., books that are in its entirety written by the same Author(s)) |
||
| 37 | * @collection@ for books with contributions/chapters from various authors |
||
| 38 | * @article@ for journal articles |
||
| 39 | * @journal@ for entire journals, i.e., collection of articles |
||
| 40 | |||
| 41 | h3. Languages |
||
| 42 | |||
| 43 | The document's main language is set with the @main=<name>@ option. |
||
| 44 | |||
| 45 | Other languages that are used throughout the document need to be listed as simple komma-separated entries, e.g., @ngerman@ (German with new spelling rules), @french@, etc. |
||
| 46 | |||
| 47 | Langauges that use their own script systems need to be listed in @usescript={…}@, e.g., @usescript={hebrew,greek,chinese,syriac}@ |
||
| 48 | |||
| 49 | (Note: in previous versions, there was an additional @lang-id=@ option which set the document language for accessibility purposes. This is now determined automatically from the @main@ option.) |
||
| 50 | |||
| 51 | h3. Endnote and Footnote switches |
||
| 52 | |||
| 53 | If *endnotes* should be used instead of footnotes, use the @endnotes@ Option. |
||
| 54 | |||
| 55 | 7 | Patrick Schulz | If the name of the endnote section should *not* appear in the ToC, use @ennotoc@ |
| 56 | 6 | Patrick Schulz | |
| 57 | 7 | Patrick Schulz | If the chapter (or section) titles should be repeated as sections (subsections) inside the endnote chapter (section), use @endnoteswithchapters@ |
| 58 | 6 | Patrick Schulz | |
| 59 | If footnote and/or endnote counters should be reset with each chapter, set @resetnotesperchapter@ |
||
| 60 | |||
| 61 | h3. PDF Standard and Versions |
||
| 62 | |||
| 63 | The PDF Standard and PDF Version are set with the @pdf-standard=Z@ option, where @Z@ can be one of: |
||
| 64 | * @A-1B@, @ A-1A@, @ A-2B@, @ A-2A@, @ A-2U@, @ A-3B@, @ A-3A@, @ A-3U@, @ A-4@, |
||
| 65 | * @X-3@, @ X-4@, @ X-4P@, @ X-5G@, @ X-5N@, @ X-5PG@, @ X-6@, @ X-6N@, @ X-6P@, |
||
| 66 | * @UA-1@, or @UA-2@. |
||
| 67 | |||
| 68 | Those values are case insensitive, so @A-2a@ is the same as @a-2A@, @A-2A@, or @a-2a@. |
||
| 69 | |||
| 70 | The following table lists the PDF Version that is generated from each of the values |
||
| 71 | |||
| 72 | 1 | Martin Kraetke | |_.PDF standard|_.PDF version| |
| 73 | |UA-1 | 1.7| |
||
| 74 | |UA-2 | 2.0| |
||
| 75 | 5 | Patrick Schulz | |A-1.* | 1.4| |
| 76 | |A-[23].* | 1.7| |
||
| 77 | |A-4.* | 2.0| |
||
| 78 | |X-[123].* | 1.4| |
||
| 79 | |X-[45].* | 1.6| |
||
| 80 | |X-6.* | 2.0| |
||
| 81 | |||
| 82 | 6 | Patrick Schulz | |
| 83 | 12 | Maren Pufe | The values @UA-1@ and @UA-2@ enable the accessibility features. All other standards disable accessibility macros functionally, i.e. they can be used in the tex file, but they do nothing. Be careful when using the option @pdf-standard@ in combination with the @a11y@ or @a11y20@ option. cocoTeX evaluates those options not in the order typed in the @\documentclass{}@, but first processes the @pdf-standard@ option then the @a11y@ option. That means that @a11y@ would overwrite a @pdf-standard=X@ definition for example! |
| 84 | 6 | Patrick Schulz | |
| 85 | The @X@-Standards cause @hyperref@ macros (@\href@, @\url@, @\hyperlink@, etc.) to be functionally disabled, i.e., they can be used in the tex file but they cause no hyperlinks in the resulting PDF file. |
||
| 86 | 1 | Martin Kraetke | |
| 87 | 10 | Patrick Schulz | h3. Class Options per Makefile |
| 88 | |||
| 89 | Class options can also be set directly via the Makefile's LaTeX call: |
||
| 90 | <pre><code class="make">runtex: |
||
| 91 | $(TEX_BINARY) "\def\ccClassOptions{<options>}\input <filename>"</code></pre> |
||
| 92 | mit |
||
| 93 | 11 | Patrick Schulz | * @<options>@ is a comma separated @key=value@ list (exactly like in the optional argument of @\documentclass[<opions>]{cocotex}@) |
| 94 | * @<filename>@ is the name of the TeX file (with @.tex@ suffix!) |
||
| 95 | 10 | Patrick Schulz | |
| 96 | Options given this way via the command line override those in the .tex-file if they share the same key. |
||
| 97 | |||
| 98 | *Warning:* value-less flags in the options list cannot be overridden this way! |
||
| 99 | |||
| 100 | 1 | Martin Kraetke | h2. Compiling |
| 101 | |||
| 102 | The minimal order of the TeX files is shown below: |
||
| 103 | <pre><code class="ruby"> |
||
| 104 | 10 | Patrick Schulz | lualatex <main>.tex ## first run: collect |
| 105 | lualatex <main>.tex ## second run: read and apply aux, toc, lof, lot |
||
| 106 | lualatex <main>.tex ## third run: update page numbers after including toc, lof, etc. |
||
| 107 | 9 | Patrick Schulz | ./index.sh <main> ## script to generate the index |
| 108 | 10 | Patrick Schulz | lualatex <main>.tex ## fourth run: print index, update .aux, .toc, etc. |
| 109 | lualatex <main>.tex ## fifth run: print updated toc |
||
| 110 | 1 | Martin Kraetke | </code></pre> |