| 1 |
``` |
| 2 |
Copyright 2017 Daniel Thomas Sank ([email protected]) |
| 3 |
|
| 4 |
This work may be distributed and/or modified under the conditions of the LaTeX |
| 5 |
Project Public License, either version 1.3 of this license or (at your option) |
| 6 |
any later version. The latest version of this license is in |
| 7 |
http://www.latex-project.org/lppl.txt |
| 8 |
and version 1.3 or later is part of all distributions of LaTeX version |
| 9 |
2005/12/01 or later. |
| 10 |
|
| 11 |
This work has the LPPL maintenance status `maintained'. |
| 12 |
|
| 13 |
The Current Maintainer of this work is Daniel Thomas Sank. |
| 14 |
|
| 15 |
This work consists of the files modular.sty and README.md. |
| 16 |
``` |
| 17 |
# modular |
| 18 |
|
| 19 |
## Abstract |
| 20 |
|
| 21 |
The `\chapter`, `\section`, etc. commands in LaTeX are great until you want to reuse document fragments in multiple containing documents where the heading levels need to be different. |
| 22 |
For example, suppose you write an article about octopuses containing `\section`'s "Habitat" and "Life cycle". |
| 23 |
Now suppose you want to write an article about sea animals with a `\section` for octopuses. |
| 24 |
Within that section, the parts about habitat and life cycle should be *sub*sections. |
| 25 |
The built-in LaTeX commands do not support this, but `modular` does! |
| 26 |
|
| 27 |
We need to make our headings relative rather than absolute, and we need a way to import document fragments at levels relative to the point from which they're imported. |
| 28 |
The [`coseoul`](https://www.ctan.org/pkg/coseoul?lang=en) package gives us relative headings, but it doesn't provide the import mechanism we need. |
| 29 |
This package builds on `coseoul` providing the `\subimportlevel` macro, which enables fully modular importing of sub-documents and gets the relative headings right. |
| 30 |
|
| 31 |
## Documentation |
| 32 |
|
| 33 |
See `doc/modular.pdf` distributed with this package. |
| 34 |
It's source is `modular.tex`. |
| 35 |
The source for the examples shown there are in the `documentation/example` and `documentation/example/octopus` directories. |
| 36 |
You can build the files there yourself to experiment with the package. |
| 37 |
See `documentation/README.md` for more information. |
| 38 |
|
| 39 |
## References |
| 40 |
|
| 41 |
See the package documentation for a more complete description of the problem this package solves and how to use the `subimportlevel` macro. |
| 42 |
For an extended discussion of the modularity problem, a detailed review of failed attempts using only the `import` and `coseoul` packages, and a step-by-step explanation of how the `\subimportlevel` macro provided by this package works, see [this post](https://danielsank.github.io/tex_modularity/). |
| 43 |
|
| 44 |
This package is developed on [github](https://github.com/DanielSank/tex-modular). |
| 45 |
|