From b37bc967c4cb838d23e920391eb7fd57301af7fd Mon Sep 17 00:00:00 2001 From: alanlujan91 Date: Mon, 4 Mar 2024 20:40:09 -0500 Subject: [PATCH] move to docs --- .../ConsPortfolioModel.ipynb | 1 - .../GenIncProcessModel.ipynb | 1 - .../Gentle-Intro-To-HARK.ipynb | 1 - .../example_notebooks/HARK-struct-2.png | 1 - .../example_notebooks/HARK-struct-3.png | 1 - .../example_notebooks/HARK-struct-4.png | 1 - .../HowWeSolveIndShockConsumerType.ipynb | 1 - .../IndShockConsumerType.ipynb | 1 - .../example_notebooks/Journey-PhD.ipynb | 1 - .../example_notebooks/JourneyPhDparam.py | 1 - .../KinkedRconsumerType.ipynb | 1 - .../example_notebooks/LifecycleModel.ipynb | 1 - .../PerfForesightConsumerType.ipynb | 1 - {Documentation => docs}/CHANGELOG.md | 0 .../ConsumptionSavingModels.pdf | Bin {Documentation => docs}/Makefile | 0 .../NARK/LaTeX/NARK-Add.bib | 0 {Documentation => docs}/NARK/LaTeX/NARK.bib | 0 {Documentation => docs}/NARK/LaTeX/NARK.dep | 0 {Documentation => docs}/NARK/LaTeX/NARK.pdf | Bin .../NARK/LaTeX/economics.bib | 0 {Documentation => docs}/NARK/NARK.pdf | Bin {Documentation => docs}/NARK/NARK.tex | 744 ++--- .../NARK/Resources/.git-public-commit | 0 .../NARK/Resources/.git-source-commit | 0 .../LaTeXInputs/BufferStockTheory-tikz.sty | 0 .../LaTeXInputs/BufferStockTheory.sty | 0 .../LaTeXInputs/econtex_onlyinsubfile.tex | 0 .../NARK/Resources/PoweredByEconARK.pdf | Bin .../NARK/Resources/PoweredByEconARK.svg | 0 .../NARK/Resources/econ-ark-logo-small.png | Bin .../NARK/Resources/econ-ark-logo-small.xbb | 0 .../NARK/Resources/econtexPaths.tex | 0 .../NARK/Resources/owner.tex | 0 .../NARK/Resources/texmf-local/README.md | 0 .../texmf-local/bibtex/bib/economics.bib | 0 .../texmf-local/bibtex/bst/econtex.bst | 0 .../texmf-local/bibtex/bst/handout.bst | 0 .../bibtex/bst/unsrtnatTitlesFirst.bst | 0 .../NARK/Resources/texmf-local/ls-R | 0 .../texmf-local/tex/latex/ReadMe.texmf | 0 .../tex/latex/articleNoRefHead.cls | 0 .../texmf-local/tex/latex/bibMake.tex | 0 .../texmf-local/tex/latex/cvBibMake.tex | 0 .../texmf-local/tex/latex/econtex.cls | 0 .../texmf-local/tex/latex/econtex.sty | 0 .../texmf-local/tex/latex/econtexBibMake.tex | 0 .../texmf-local/tex/latex/econtexSetup.sty | 0 .../tex/latex/econtexShortcuts.sty | 0 .../texmf-local/tex/latex/handout.cls | 0 .../texmf-local/tex/latex/handout.sty | 0 .../texmf-local/tex/latex/handoutBibMake.tex | 0 .../texmf-local/tex/latex/handoutSetup.sty | 0 .../tex/latex/handoutShortcuts.sty | 0 .../tex/latex/makePostHandoutsStart.tex | 0 .../texmf-local/tex/latex/printvrb.sty | 222 +- .../texmf-local/tex/latex/snapshot.sty | 682 ++--- .../tex/latex/tex4ht/pictureenv.4ht | 0 .../tex4ht/svg-math-and-subfigures-README.md | 0 .../latex/tex4ht/svg-math-and-subfigures.cfg | 0 .../latex/tex4ht/svg-math-and-subfigures.tex | 0 .../tex/latex/tex4ht/svg-set-size-to-1p0.mk4 | 0 .../tex/latex/tex4ht/svg-set-size-to-1p1.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 | 0 .../tex/latex/tex4ht/svg-set-size-to-1p2.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 | 0 .../texmf-local/tex/latex/tex4htMakeCFG.sh | 0 .../texmf-local/tex/latex/titlesec.sty | 2700 ++++++++--------- .../texmf-local/texmf-local/README.md | 0 .../texmf-local/bibtex/bib/economics.bib | 0 .../texmf-local/bibtex/bst/econtex.bst | 0 .../texmf-local/bibtex/bst/handout.bst | 0 .../bibtex/bst/unsrtnatTitlesFirst.bst | 0 .../Resources/texmf-local/texmf-local/ls-R | 0 .../texmf-local/tex/latex/ReadMe.texmf | 0 .../tex/latex/articleNoRefHead.cls | 0 .../texmf-local/tex/latex/bibMake.tex | 0 .../texmf-local/tex/latex/cvBibMake.tex | 0 .../texmf-local/tex/latex/econtex.cls | 0 .../texmf-local/tex/latex/econtex.sty | 0 .../texmf-local/tex/latex/econtexBibMake.tex | 0 .../texmf-local/tex/latex/econtexSetup.sty | 0 .../tex/latex/econtexShortcuts.sty | 0 .../texmf-local/tex/latex/handout.cls | 0 .../texmf-local/tex/latex/handout.sty | 0 .../texmf-local/tex/latex/handoutBibMake.tex | 0 .../texmf-local/tex/latex/handoutSetup.sty | 0 .../tex/latex/handoutShortcuts.sty | 0 .../tex/latex/makePostHandoutsStart.tex | 0 .../texmf-local/tex/latex/printvrb.sty | 222 +- .../texmf-local/tex/latex/snapshot.sty | 682 ++--- .../tex/latex/tex4ht/pictureenv.4ht | 0 .../tex4ht/svg-math-and-subfigures-README.md | 0 .../latex/tex4ht/svg-math-and-subfigures.cfg | 0 .../latex/tex4ht/svg-math-and-subfigures.tex | 0 .../tex/latex/tex4ht/svg-set-size-to-1p0.mk4 | 0 .../tex/latex/tex4ht/svg-set-size-to-1p1.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 | 0 .../tex/latex/tex4ht/svg-set-size-to-1p2.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 | 0 .../latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 | 0 .../texmf-local/tex/latex/tex4htMakeCFG.sh | 0 .../texmf-local/tex/latex/titlesec.sty | 2700 ++++++++--------- .../texmf-local/texmf-local/web2c/texmf.cnf | 0 .../Resources/texmf-local/web2c/texmf.cnf | 0 {Documentation => docs}/NARK/econtexRoot.tex | 0 .../_static/override-nbsphinx-gallery.css | 0 {Documentation => docs}/conf.py | 0 .../ConsPortfolioModel.ipynb | 1 + .../GenIncProcessModel.ipynb | 1 + .../example_notebooks/GenIncProcessModel.py | 0 .../Gentle-Intro-To-HARK.ipynb | 1 + docs/example_notebooks/HARK-struct-2.png | 1 + docs/example_notebooks/HARK-struct-3.png | 1 + docs/example_notebooks/HARK-struct-4.png | 1 + .../HowWeSolveIndShockConsumerType.ipynb | 1 + .../IndShockConsumerType.ipynb | 1 + docs/example_notebooks/Journey-PhD.ipynb | 1 + docs/example_notebooks/JourneyPhDparam.py | 1 + .../KinkedRconsumerType.ipynb | 1 + docs/example_notebooks/LifecycleModel.ipynb | 1 + .../PerfForesightConsumerType.ipynb | 1 + .../guides/contributing.md | 0 {Documentation => docs}/guides/index.rst | 0 .../guides/installation.md | 0 {Documentation => docs}/guides/quick_start.md | 0 .../images/econ-ark-logo.png | Bin .../images/numfocus-logo.png | Bin .../usage-agent-problem-bellman-form.png | Bin .../images/usage-crra-utility-function.png | Bin {Documentation => docs}/index.md | 0 {Documentation => docs}/index.rst | 0 {Documentation => docs}/license.md | 0 {Documentation => docs}/make.bat | 562 ++-- .../overview/ARKitecture.md | 0 {Documentation => docs}/overview/index.rst | 0 .../overview/introduction.md | 0 .../ConsumptionSaving/ConsAggShockModel.rst | 0 .../ConsGenIncProcessModel.rst | 0 .../ConsumptionSaving/ConsIndShockModel.rst | 0 .../ConsIndShockModelFast.rst | 0 .../ConsumptionSaving/ConsLaborModel.rst | 0 .../ConsumptionSaving/ConsMarkovModel.rst | 0 .../ConsumptionSaving/ConsMedModel.rst | 0 .../ConsPortfolioFrameModel.rst | 0 .../ConsumptionSaving/ConsPortfolioModel.rst | 0 .../ConsumptionSaving/ConsPrefShochModel.rst | 0 .../ConsumptionSaving/ConsRepAgentModel.rst | 0 .../ConsumptionSaving/ConsRiskyAssetModel.rst | 0 .../ConsRiskyContribModel.rst | 0 .../TractableBufferStockModel.rst | 0 .../reference/ConsumptionSaving/index.rst | 0 {Documentation => docs}/reference/index.rst | 0 .../reference/tools/core.rst | 0 .../reference/tools/dcegm.rst | 0 .../reference/tools/distribution.rst | 0 .../reference/tools/econforgeinterp.rst | 0 .../reference/tools/estimation.rst | 0 .../reference/tools/frame.rst | 0 .../reference/tools/helpers.rst | 0 .../reference/tools/index.rst | 0 .../reference/tools/interpolation.rst | 0 .../reference/tools/model.rst | 0 .../reference/tools/numba_tools.rst | 0 .../reference/tools/parallel.rst | 0 .../reference/tools/rewards.rst | 0 .../reference/tools/simulation.rst | 0 .../reference/tools/utilities.rst | 0 .../reference/tools/validators.rst | 0 .../texmf-local/bibtex/bib/economics-UTF8.bib | 0 .../texmf-local/bibtex/bib/economics.bib | 0 .../texmf-local/bibtex/bst/econtex.bst | 0 .../texmf-local/bibtex/bst/handout.bst | 0 .../bibtex/bst/unsrtnatTitlesFirst.bst | 0 {Documentation => docs}/texmf-local/ls-R | 0 .../texmf-local/tex/latex/ReadMe.texmf | 0 .../tex/latex/articleNoRefHead.cls | 0 .../texmf-local/tex/latex/bibMake.tex | 0 .../texmf-local/tex/latex/cvBibMake.tex | 0 .../texmf-local/tex/latex/econtex.cls | 0 .../texmf-local/tex/latex/econtex.sty | 0 .../texmf-local/tex/latex/econtexBibMake.tex | 0 .../texmf-local/tex/latex/econtexSetup.sty | 0 .../tex/latex/econtexShortcuts.sty | 0 .../texmf-local/tex/latex/handout.cls | 0 .../texmf-local/tex/latex/handout.sty | 0 .../texmf-local/tex/latex/handoutBibMake.tex | 0 .../texmf-local/tex/latex/handoutSetup.sty | 0 .../tex/latex/handoutshortcuts.sty | 0 .../tex/latex/makePostHandoutsStart.tex | 0 .../texmf-local/tex/latex/printvrb.sty | 222 +- .../texmf-local/tex/latex/snapshot.sty | 682 ++--- .../tex/latex/tex4ht/pictureenv.4ht | 0 .../latex/tex4ht/svg-math-and-subfigures.cfg | 0 .../tex/latex/tex4ht/svg-set-size-to-1p0.mk4 | 0 .../texmf-local/tex/latex/tex4htMakeCFG.sh | 0 .../latex/texmf-local/tex/latex/econtex.cls | 0 .../latex/texmf-local/tex/latex/econtex.sty | 0 .../texmf-local/tex/latex/econtexBibMake.tex | 0 .../texmf-local/tex/latex/econtexSetup.sty | 0 .../tex/latex/econtexShortcuts.sty | 0 .../latex/texmf-local/tex/latex/handout.cls | 0 .../texmf-local/tex/latex/handoutSetup.sty | 0 .../tex/latex/handoutShortcuts.sty | 0 .../texmf-local/tex/latex/titlesec.sty | 2700 ++++++++--------- .../texmf-local/web2c/texmf.cnf | 0 207 files changed, 6072 insertions(+), 6072 deletions(-) delete mode 120000 Documentation/example_notebooks/ConsPortfolioModel.ipynb delete mode 120000 Documentation/example_notebooks/GenIncProcessModel.ipynb delete mode 120000 Documentation/example_notebooks/Gentle-Intro-To-HARK.ipynb delete mode 120000 Documentation/example_notebooks/HARK-struct-2.png delete mode 120000 Documentation/example_notebooks/HARK-struct-3.png delete mode 120000 Documentation/example_notebooks/HARK-struct-4.png delete mode 120000 Documentation/example_notebooks/HowWeSolveIndShockConsumerType.ipynb delete mode 120000 Documentation/example_notebooks/IndShockConsumerType.ipynb delete mode 120000 Documentation/example_notebooks/Journey-PhD.ipynb delete mode 120000 Documentation/example_notebooks/JourneyPhDparam.py delete mode 120000 Documentation/example_notebooks/KinkedRconsumerType.ipynb delete mode 120000 Documentation/example_notebooks/LifecycleModel.ipynb delete mode 120000 Documentation/example_notebooks/PerfForesightConsumerType.ipynb rename {Documentation => docs}/CHANGELOG.md (100%) rename {Documentation => docs}/ConsumptionSavingModels.pdf (100%) rename {Documentation => docs}/Makefile (100%) rename {Documentation => docs}/NARK/LaTeX/NARK-Add.bib (100%) rename {Documentation => docs}/NARK/LaTeX/NARK.bib (100%) rename {Documentation => docs}/NARK/LaTeX/NARK.dep (100%) rename {Documentation => docs}/NARK/LaTeX/NARK.pdf (100%) rename {Documentation => docs}/NARK/LaTeX/economics.bib (100%) rename {Documentation => docs}/NARK/NARK.pdf (100%) rename {Documentation => docs}/NARK/NARK.tex (98%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/.git-public-commit (100%) rename {Documentation => docs}/NARK/Resources/.git-source-commit (100%) rename {Documentation => docs}/NARK/Resources/LaTeXInputs/BufferStockTheory-tikz.sty (100%) rename {Documentation => docs}/NARK/Resources/LaTeXInputs/BufferStockTheory.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/LaTeXInputs/econtex_onlyinsubfile.tex (100%) rename {Documentation => docs}/NARK/Resources/PoweredByEconARK.pdf (100%) rename {Documentation => docs}/NARK/Resources/PoweredByEconARK.svg (100%) rename {Documentation => docs}/NARK/Resources/econ-ark-logo-small.png (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/econ-ark-logo-small.xbb (100%) rename {Documentation => docs}/NARK/Resources/econtexPaths.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/owner.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/README.md (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/bibtex/bib/economics.bib (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/bibtex/bst/econtex.bst (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/bibtex/bst/handout.bst (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/ls-R (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/ReadMe.texmf (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/articleNoRefHead.cls (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/bibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/cvBibMake.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/econtex.cls (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/econtex.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/econtexBibMake.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/econtexSetup.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/econtexShortcuts.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/handout.cls (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/handout.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/handoutBibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/handoutSetup.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/handoutShortcuts.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/makePostHandoutsStart.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/printvrb.sty (96%) mode change 100755 => 100644 rename {Documentation/NARK/Resources/texmf-local => docs/NARK/Resources}/texmf-local/tex/latex/snapshot.sty (97%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/pictureenv.4ht (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/tex/latex/tex4htMakeCFG.sh (100%) mode change 100755 => 100644 rename {Documentation/NARK/Resources/texmf-local => docs/NARK/Resources}/texmf-local/tex/latex/titlesec.sty (96%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/README.md (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/bibtex/bib/economics.bib (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/bibtex/bst/econtex.bst (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/bibtex/bst/handout.bst (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/ls-R (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/ReadMe.texmf (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/articleNoRefHead.cls (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/bibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/cvBibMake.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.cls (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexBibMake.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexSetup.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexShortcuts.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.cls (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutBibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutSetup.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutShortcuts.sty (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/makePostHandoutsStart.tex (100%) rename {Documentation => docs/NARK/Resources/texmf-local}/texmf-local/tex/latex/printvrb.sty (96%) mode change 100755 => 100644 rename {Documentation/NARK/Resources => docs/NARK/Resources/texmf-local}/texmf-local/tex/latex/snapshot.sty (97%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/pictureenv.4ht (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4htMakeCFG.sh (100%) mode change 100755 => 100644 rename {Documentation => docs/NARK/Resources/texmf-local}/texmf-local/tex/latex/titlesec.sty (96%) rename {Documentation => docs}/NARK/Resources/texmf-local/texmf-local/web2c/texmf.cnf (100%) rename {Documentation => docs}/NARK/Resources/texmf-local/web2c/texmf.cnf (100%) rename {Documentation => docs}/NARK/econtexRoot.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/_static/override-nbsphinx-gallery.css (100%) rename {Documentation => docs}/conf.py (100%) create mode 100644 docs/example_notebooks/ConsPortfolioModel.ipynb create mode 100644 docs/example_notebooks/GenIncProcessModel.ipynb rename {Documentation => docs}/example_notebooks/GenIncProcessModel.py (100%) create mode 100644 docs/example_notebooks/Gentle-Intro-To-HARK.ipynb create mode 100644 docs/example_notebooks/HARK-struct-2.png create mode 100644 docs/example_notebooks/HARK-struct-3.png create mode 100644 docs/example_notebooks/HARK-struct-4.png create mode 100644 docs/example_notebooks/HowWeSolveIndShockConsumerType.ipynb create mode 100644 docs/example_notebooks/IndShockConsumerType.ipynb create mode 100644 docs/example_notebooks/Journey-PhD.ipynb create mode 100644 docs/example_notebooks/JourneyPhDparam.py create mode 100644 docs/example_notebooks/KinkedRconsumerType.ipynb create mode 100644 docs/example_notebooks/LifecycleModel.ipynb create mode 100644 docs/example_notebooks/PerfForesightConsumerType.ipynb rename {Documentation => docs}/guides/contributing.md (100%) rename {Documentation => docs}/guides/index.rst (100%) rename {Documentation => docs}/guides/installation.md (100%) rename {Documentation => docs}/guides/quick_start.md (100%) rename {Documentation => docs}/images/econ-ark-logo.png (100%) rename {Documentation => docs}/images/numfocus-logo.png (100%) rename {Documentation => docs}/images/usage-agent-problem-bellman-form.png (100%) rename {Documentation => docs}/images/usage-crra-utility-function.png (100%) rename {Documentation => docs}/index.md (100%) rename {Documentation => docs}/index.rst (100%) rename {Documentation => docs}/license.md (100%) rename {Documentation => docs}/make.bat (96%) rename {Documentation => docs}/overview/ARKitecture.md (100%) rename {Documentation => docs}/overview/index.rst (100%) rename {Documentation => docs}/overview/introduction.md (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsAggShockModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsGenIncProcessModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsIndShockModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsIndShockModelFast.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsLaborModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsMarkovModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsMedModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsPortfolioModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsPrefShochModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsRepAgentModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsRiskyAssetModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/ConsRiskyContribModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/TractableBufferStockModel.rst (100%) rename {Documentation => docs}/reference/ConsumptionSaving/index.rst (100%) rename {Documentation => docs}/reference/index.rst (100%) rename {Documentation => docs}/reference/tools/core.rst (100%) rename {Documentation => docs}/reference/tools/dcegm.rst (100%) rename {Documentation => docs}/reference/tools/distribution.rst (100%) rename {Documentation => docs}/reference/tools/econforgeinterp.rst (100%) rename {Documentation => docs}/reference/tools/estimation.rst (100%) rename {Documentation => docs}/reference/tools/frame.rst (100%) rename {Documentation => docs}/reference/tools/helpers.rst (100%) rename {Documentation => docs}/reference/tools/index.rst (100%) rename {Documentation => docs}/reference/tools/interpolation.rst (100%) rename {Documentation => docs}/reference/tools/model.rst (100%) rename {Documentation => docs}/reference/tools/numba_tools.rst (100%) rename {Documentation => docs}/reference/tools/parallel.rst (100%) rename {Documentation => docs}/reference/tools/rewards.rst (100%) rename {Documentation => docs}/reference/tools/simulation.rst (100%) rename {Documentation => docs}/reference/tools/utilities.rst (100%) rename {Documentation => docs}/reference/tools/validators.rst (100%) rename {Documentation => docs}/texmf-local/bibtex/bib/economics-UTF8.bib (100%) rename {Documentation => docs}/texmf-local/bibtex/bib/economics.bib (100%) rename {Documentation => docs}/texmf-local/bibtex/bst/econtex.bst (100%) rename {Documentation => docs}/texmf-local/bibtex/bst/handout.bst (100%) rename {Documentation => docs}/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/ls-R (100%) rename {Documentation => docs}/texmf-local/tex/latex/ReadMe.texmf (100%) rename {Documentation => docs}/texmf-local/tex/latex/articleNoRefHead.cls (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/bibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/cvBibMake.tex (100%) rename {Documentation => docs}/texmf-local/tex/latex/econtex.cls (100%) rename {Documentation => docs}/texmf-local/tex/latex/econtex.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/econtexBibMake.tex (100%) rename {Documentation => docs}/texmf-local/tex/latex/econtexSetup.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/econtexShortcuts.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/handout.cls (100%) rename {Documentation => docs}/texmf-local/tex/latex/handout.sty (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/handoutBibMake.tex (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/handoutSetup.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/handoutshortcuts.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/makePostHandoutsStart.tex (100%) rename {Documentation/NARK/Resources/texmf-local => docs}/texmf-local/tex/latex/printvrb.sty (96%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/snapshot.sty (97%) rename {Documentation => docs}/texmf-local/tex/latex/tex4ht/pictureenv.4ht (100%) rename {Documentation => docs}/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg (100%) rename {Documentation => docs}/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 (100%) rename {Documentation => docs}/texmf-local/tex/latex/tex4htMakeCFG.sh (100%) mode change 100755 => 100644 rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/econtex.cls (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/econtex.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/econtexBibMake.tex (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/econtexSetup.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/econtexShortcuts.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/handout.cls (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/handoutSetup.sty (100%) rename {Documentation => docs}/texmf-local/tex/latex/texmf-local/tex/latex/handoutShortcuts.sty (100%) rename {Documentation/NARK/Resources => docs}/texmf-local/tex/latex/titlesec.sty (96%) rename {Documentation => docs}/texmf-local/web2c/texmf.cnf (100%) diff --git a/Documentation/example_notebooks/ConsPortfolioModel.ipynb b/Documentation/example_notebooks/ConsPortfolioModel.ipynb deleted file mode 120000 index 6e388f23f..000000000 --- a/Documentation/example_notebooks/ConsPortfolioModel.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/ConsPortfolioModel/example_ConsPortfolioModel.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/GenIncProcessModel.ipynb b/Documentation/example_notebooks/GenIncProcessModel.ipynb deleted file mode 120000 index 95382b26a..000000000 --- a/Documentation/example_notebooks/GenIncProcessModel.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/GenIncProcessModel/GenIncProcessModel.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/Gentle-Intro-To-HARK.ipynb b/Documentation/example_notebooks/Gentle-Intro-To-HARK.ipynb deleted file mode 120000 index 85e84e64c..000000000 --- a/Documentation/example_notebooks/Gentle-Intro-To-HARK.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/HARK-struct-2.png b/Documentation/example_notebooks/HARK-struct-2.png deleted file mode 120000 index e17a1e20a..000000000 --- a/Documentation/example_notebooks/HARK-struct-2.png +++ /dev/null @@ -1 +0,0 @@ -../../examples/Journeys/HARK-struct-2.png \ No newline at end of file diff --git a/Documentation/example_notebooks/HARK-struct-3.png b/Documentation/example_notebooks/HARK-struct-3.png deleted file mode 120000 index cf5661e64..000000000 --- a/Documentation/example_notebooks/HARK-struct-3.png +++ /dev/null @@ -1 +0,0 @@ -../../examples/Journeys/HARK-struct-3.png \ No newline at end of file diff --git a/Documentation/example_notebooks/HARK-struct-4.png b/Documentation/example_notebooks/HARK-struct-4.png deleted file mode 120000 index a607c7d0c..000000000 --- a/Documentation/example_notebooks/HARK-struct-4.png +++ /dev/null @@ -1 +0,0 @@ -../../examples/Journeys/HARK-struct-4.png \ No newline at end of file diff --git a/Documentation/example_notebooks/HowWeSolveIndShockConsumerType.ipynb b/Documentation/example_notebooks/HowWeSolveIndShockConsumerType.ipynb deleted file mode 120000 index 3d43a3c53..000000000 --- a/Documentation/example_notebooks/HowWeSolveIndShockConsumerType.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/IndShockConsumerType.ipynb b/Documentation/example_notebooks/IndShockConsumerType.ipynb deleted file mode 120000 index 2bc279db3..000000000 --- a/Documentation/example_notebooks/IndShockConsumerType.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/ConsIndShockModel/IndShockConsumerType.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/Journey-PhD.ipynb b/Documentation/example_notebooks/Journey-PhD.ipynb deleted file mode 120000 index 550352740..000000000 --- a/Documentation/example_notebooks/Journey-PhD.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/Journeys/Journey-PhD.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/JourneyPhDparam.py b/Documentation/example_notebooks/JourneyPhDparam.py deleted file mode 120000 index 44f05c3fe..000000000 --- a/Documentation/example_notebooks/JourneyPhDparam.py +++ /dev/null @@ -1 +0,0 @@ -../../examples/Journeys/JourneyPhDparam.py \ No newline at end of file diff --git a/Documentation/example_notebooks/KinkedRconsumerType.ipynb b/Documentation/example_notebooks/KinkedRconsumerType.ipynb deleted file mode 120000 index fd9844aa1..000000000 --- a/Documentation/example_notebooks/KinkedRconsumerType.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/ConsIndShockModel/KinkedRconsumerType.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/LifecycleModel.ipynb b/Documentation/example_notebooks/LifecycleModel.ipynb deleted file mode 120000 index af569e35a..000000000 --- a/Documentation/example_notebooks/LifecycleModel.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/LifecycleModel/LifecycleModel.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/PerfForesightConsumerType.ipynb b/Documentation/example_notebooks/PerfForesightConsumerType.ipynb deleted file mode 120000 index 23345c01c..000000000 --- a/Documentation/example_notebooks/PerfForesightConsumerType.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../examples/ConsIndShockModel/PerfForesightConsumerType.ipynb \ No newline at end of file diff --git a/Documentation/CHANGELOG.md b/docs/CHANGELOG.md similarity index 100% rename from Documentation/CHANGELOG.md rename to docs/CHANGELOG.md diff --git a/Documentation/ConsumptionSavingModels.pdf b/docs/ConsumptionSavingModels.pdf similarity index 100% rename from Documentation/ConsumptionSavingModels.pdf rename to docs/ConsumptionSavingModels.pdf diff --git a/Documentation/Makefile b/docs/Makefile similarity index 100% rename from Documentation/Makefile rename to docs/Makefile diff --git a/Documentation/NARK/LaTeX/NARK-Add.bib b/docs/NARK/LaTeX/NARK-Add.bib similarity index 100% rename from Documentation/NARK/LaTeX/NARK-Add.bib rename to docs/NARK/LaTeX/NARK-Add.bib diff --git a/Documentation/NARK/LaTeX/NARK.bib b/docs/NARK/LaTeX/NARK.bib similarity index 100% rename from Documentation/NARK/LaTeX/NARK.bib rename to docs/NARK/LaTeX/NARK.bib diff --git a/Documentation/NARK/LaTeX/NARK.dep b/docs/NARK/LaTeX/NARK.dep similarity index 100% rename from Documentation/NARK/LaTeX/NARK.dep rename to docs/NARK/LaTeX/NARK.dep diff --git a/Documentation/NARK/LaTeX/NARK.pdf b/docs/NARK/LaTeX/NARK.pdf similarity index 100% rename from Documentation/NARK/LaTeX/NARK.pdf rename to docs/NARK/LaTeX/NARK.pdf diff --git a/Documentation/NARK/LaTeX/economics.bib b/docs/NARK/LaTeX/economics.bib similarity index 100% rename from Documentation/NARK/LaTeX/economics.bib rename to docs/NARK/LaTeX/economics.bib diff --git a/Documentation/NARK/NARK.pdf b/docs/NARK/NARK.pdf similarity index 100% rename from Documentation/NARK/NARK.pdf rename to docs/NARK/NARK.pdf diff --git a/Documentation/NARK/NARK.tex b/docs/NARK/NARK.tex old mode 100755 new mode 100644 similarity index 98% rename from Documentation/NARK/NARK.tex rename to docs/NARK/NARK.tex index 120a57ace..a92818d44 --- a/Documentation/NARK/NARK.tex +++ b/docs/NARK/NARK.tex @@ -1,372 +1,372 @@ -\input{./econtexRoot} -\documentclass[12pt]{\econtex} -\usepackage{\econtexSetup} -\usepackage{\econtexShortcuts} - -\usepackage{cancel} - -\begin{document}\bibliographystyle{\econtexBibStyle} - - -\title{Suggested Variable Naming Conventions \\ in the Econ-ARK Toolkit} - -% \forcedate{2021-02-25} % Updates for HARK 1.0 release -% \forcedate{2020-02-26} % Add sav, modl; other tweaks -% \forcedate{2020-06-29} % Update date; shorten ALevBF; add -% \forcedate{2020-06-30} % NARK: Minor tweaks -% \forcedate{2020-07-01} % Version posted by doEvertyhing.sh -\forcedate{2020-07-02} % Add conventions for marginal value and utility - -\vspace{2in} - -\keywords{ARK, Variable, Function, Object, Operator, Naming, Guidelines, Conventions} -\jelclass{None} - - -\maketitle - - -\begin{abstract} - Sharing code is easier when different contributors use similar names for similar objects. While we will not enforce the - recommendations below, contributors can make their code more attractive to others - by using names consistent with our guidelines. -\end{abstract} - -\centerline{html version at \url{https://econ-ark.github.io/HARK/Documentation/NARK}} - -% \thanks{The \texttt{NARK} repo that generates this document also contains \LaTeX~configuration files that permit you to use the same name for an object in your writing (your \texttt{paper.tex} file) and in your code (helping to minimize confusion in translating between paper and code).} - - -\pagebreak - -\section{Principles} -Our aim has been to balance: -\begin{itemize} -\item Brevity -\item Mnemonic quality -\item Uniqueness (enabling global search-and-replace) -\item Ubiquity (definitions useful for many projects) -\item Combinatoriality (which encourages mashups) -\end{itemize} - - -\pagebreak - -\section{Variables} - -\subsection{Single-Letter} - -We strongly discourage the use of single-letter variable names. Reasons are presented \textit{ad nauseum} in introductory CS texts (which, we know, few economists consult); here we will note only that the extent to which your code will be influential depends upon the extent to which someone else can easily read it, which is harder if you have used variable names which could mean almost anything. (We have made careful choices for the `default' meanings of each Roman letter (see below); hence, in the context of the toolkit, use of a single-letter name for any meaning other than the designated one will be doubly confusing). - -It is only slightly less objectionable to name a variable after a familiar letter in another commonly used alphabet (say, \texttt{delta}). Your future self (and other users) will not know which of the many possible meanings of $\delta$ you had in mind. - -But, because brevity is a virtue, a single letter \textit{in combination with a modifier or two} (`\texttt{hMin}' as the value of minimum human wealth, say) is fine -- so long as the reader has some reason to expect that the lower-case letter \texttt{h} signifies human wealth (as they will, if they consult Table~\ref{table:RomanLetters}). - -That is the spirit in which we offer preferred interpretations for the Roman letters below. The upper case version is an aggregated version of the variable (at the level of the whole economy, say, or of the whole market being studied), while the lower case indicates the level of an individual consumer or firm or other subaggregate entity. - -A few exceptions to these rules are explicitly noted below the table. - -When an alternative is needed with a meaning similar to, but distinct from, the definitions below, please use a multi-letter name to represent it. For example, please do not use $W$ for wealth (if some measure of wealth that differs from $\ALev$, $\BLev$, $\HLev$, or $\NLev$ is needed); instead use, say, \texttt{Wlth} or \texttt{Wealth}. (Some examples follow in a subsequent section). - -Finally, a few of the definitions below are actually prohibitions; these are based on many years of experience which have shown that use of the prohibited variable name generates more confusion than clarity. - -\hypertarget{RomanLetters}{} -\begin{table}[ht] - \centering - \begin{tabular}{|lcl|} \hline - Letter & & Meaning - \\ \hline - \ALev & & \textit{A}ssets \textit{A}fter \textit{A}ll \textit{A}ctions \textit{A}re \textit{A}ccomplished (end of period) - \\ \BLev & & \textit{B}eginning \textit{B}ank \textit{B}alances \textit{B}efore any \textit{B}ehavior (\textit{b}eginning-of-period) - \\ \CLev & & \textit{C}onsumption \textit{C}hoice \textit{C}onnects $B$ to $A$ - \\ \DLev & & \textit{D}ebt - \\ \ELev & & PROHIBITED: Too many possible meanings (expectations, effort, expenses) - \\ \FLev & & Production \textit{F}unction - \\ \GLev & & \textit{G}rowth - \\ \HLev & & \textit{H}uman wealth - \\ \ILev & & \textit{I}nvestment - \\ \JLev & & Ad\textit{J}ustment costs (e.g., in a $Q$ model) - \\ \KLev & & Capital or beginning of period nonhuman assets - \\ \LLev & & PROHIBITED: Is it Labor or Leisure or Land or ...? - \\ \MLev & & \textit{M}arket resources (the sum of capital, capital income, and labor income) - \\ \NLev & & \textit{N}et wealth including human wealth ($=B + H$) - \\ \OLev & & PROHIBITED: Too similar to the number 0; too many possible meanings - \\ \PLev & & PROHIBITED: Is it prices, permanent income, present value, profits, ...? - \\ \QLev & & Hayashi/Abel $Q$ (or similar asset price) - \\ \RLev & & \textit{R}eturn (see the variants articulated below) - \\ \SLev & & PROHIBITED: ``saving'' (flow)? ``savings'' (stock)? or the ``saving rate'' (ratio)? - \\ \TLev & & This is a tough one. See the discussion below. - \\ \ULev & & \textit{U}tility - \\ \VLev & & \textit{V}alue - \\ \WLev & & \textit{W}age - \\ \XLev & & e\textit{X}penditures (as distinct from consumption; e.g., for durables) - \\ \YLev & & Noncapital income (usually, the sum of transfer and labor income) - \\ \ZLev & & Lei\textit{Z}ure in consumption/leisure tradeoff - \\ \hline - \end{tabular} - \caption{Preferred Usages of Roman Letters} - \label{table:RomanLetters} -\end{table} - -\subsection{Exceptions to the Rules} - -The letter $\TLev$ is an exception to the rule that lower- and upper-case versions of variables are individual and aggregate quantities. We reserve the capital letter to designate the end of the horizon (death, or the end of the economy, occurs at the end of period $\TLev$). The lower case version $t$ is so ubiquitiously used as the current time period that we follow that convention here. - -Finally, the following are exempted from the prohibition on single-letter variable names because they are used so frequently that the prohibition would be more trouble than it is worth: $a$, $b$, $c$, $m$. - -\pagebreak - -\subsection{Standard Variable Names} - -There are more objects that are likely to be used extensively in ARK projects than there are Roman letters. We present preferred usages for some of those commonly-needed variables here. - -\hypertarget{Standard-Variable-Names}{} -\begin{table}[ht] - \centering - \begin{tabular}{|rcl|} - \hline - Name & - & Description - \\ \hline - \texttt{CND} & - & Consumption of Nondurable Good - \\ \texttt{CNS} & - & Consumption of Nondurables and Services - \\ \texttt{Cst} & - & Cost of something - \\ \texttt{Dgd} & - & Stock of durable good - \\ \texttt{Dvd} & - & Dividends - \\ \texttt{Hse} & - & Quantity of housing (\textit{not} value, which is quantity $\times$ price) - \\ \texttt{Inc} & - & Income - \\ \texttt{Nlq} & - & Quantity that is \textbf{N}ot \textbf{l}i\textbf{q}uid (e.g., $\mathtt{aNlq}$ is illiquid financial) - \\ \texttt{Lbr} & - & Quantity of labor (hours) - \\ \texttt{Pop} & - & Size of population - \\ \texttt{Sav} & - & Saving (=Income Minus Consumption) - \\ \texttt{Tax} & - & Tax -- should be modified by \texttt{Rte} or \texttt{Amt} articulated below - \\ \texttt{Perm} & - & Permanent (labor; or at least, noncapital) income - \\ \texttt{Tran} & - & Transitory (labor; or at least, noncapital) income - \\ \hline - \end{tabular} - \caption{String Variables} - \label{table:Standard-Variable-Names} -\end{table} - - - -\section{Factors and Rates} -When measuring change over time, lower-case variables reflect rates -while the corresponding upper-case variable connects adjacent discrete periods.\footnote{This - convention rarely conflicts with the usage we endorse elsewhere of - indicating individual-level variables by the lower and aggregate - variables by the upper case.}$^{,}$\footnote{If there is a need for the continuous-time - representation, we endorse use of the discrete-time rate defined below. Any - author who needs a continuous-time rate, a discrete-time rate, and a discrete-time factor - is invited to invent their own notation.} So, for example, if the time interval is a year and the annual interest rate is $\rfree=0.03$ or three percent, then -the annual interest factor is $\Rfree=1.03$.\footnote{In the rare cases where it is necessary to distinguish between a continuous-time rate and a discrete-time rate -- for example, when there is an analytical result available in continuous time -- the variable in question can be modified by \texttt{Cnt} or \texttt{Dsc}.} - - -\begin{table}[ht] - \centering - \begin{tabular}{|ccc|} - \hline - Code & Output & Description - \\ \hline - \verb|\Rfree| & $\Rfree$ & Riskfree interest factor - \\ \verb|\rfree| & $\rfree$ & Riskfree interest rate - \\ \verb|\Risky| & $\Risky$ & The return factor on a risky asset - \\ \verb|\risky| & $\risky$ & The return rate on a risky asset - \\ \verb|\Rport| & $\Rport$ & The return factor on the entire portfolio - \\ \verb|\rport| & $\rport$ & The return rate on the entire portfolio - \\ \verb|\RSave| & $\RSave$ & Return factor earned on positive end-of-period assets - \\ \verb|\rsave| & $\rsave$ & Return rate earned on positive end-of-period assets - \\ \verb|\RBoro| & $\RBoro$ & Return factor paid on debts - \\ \verb|\rboro| & $\rboro$ & Return rate paid on debts - \\ \hline - \end{tabular} - \caption{Factors and Rates} - \label{table:Factors} -\end{table} - -We depart from the upper-lower case scheme when the natural letter to use has an even more urgent use elsewhere in our scheme. -A particularly common example occurs in the case of models like \cite{blanchardFinite} in which -individual agents are subject to a Poisson probability of death. Because death was common in the -middle ages, we use the archaic Gothic font for the death rate; and the probability of survival is the cancellation of the probability of death: -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}cccl|} - \hline - Code & \LaTeX & Description & \\ - \hline - \verb|\DiePrb| & $\DiePrb$ & Probabilty of death & - \\ \verb|\LivPrb| & $\LivPrb$ & Probability to not die $=(1-\DiePrb)$ & - \\ \hline - \end{tabular} - \caption{Special Cases: Factors and Rates} - \label{table:SpecialFactors} -\end{table} - -\section{Parameters} -Some parameters are worth defining because they are likely to be -used in a high proportion of models; others are subject to enough -constraints when used (such as the need for similar-looking upper- -and lower-case Greek representations), as to be worth standardizing. - -Programmers should -use the corresponding variable name without the backslash as the name of the corresponding object -in their code. For example, the Coefficient of Relative Risk Aversion is $\verb|\CRRA|$ in a \LaTeX -document and \texttt{CRRA} in a software module. - -\hypertarget{Parameters}{} -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}rcll|} - \hline - Name & \LaTeX & Description & Illustration - \\ \hline - \verb|\CARA| & $\CARA$ & Coefficient of Absolute Risk Aversion &$\uFunc(\bullet)=-\CARA^{-1} e^{-\CARA \bullet}$ - \\ \verb|\CRRA| & $\CRRA$ & Coefficient of Relative Risk Aversion & $\uFunc(\bullet)=(1-\CRRA)^{-1}\bullet^{1-\CRRA}$ - \\ \verb|\DiscFac| & $\DiscFac$ & Time Discount Factor & $\uFunc^{\prime}(\cLev_{t}) = \Rfree \DiscFac \uFunc^{\prime}(\cLev_{t+1})$ - \\ \verb|\discRte| & $\discRte$ & Time Discount rate & $\discRte=\DiscFac^{-1}-1$ - \\ \verb|\DeprFac| & $\DeprFac$ & Depreciation Factor (Hebrew \texttt{daleth}) & $\Kap_{t+1} = \DeprFac \Kap_{t}+\ILev_{t}$ - \\ \verb|\deprRte| & $\deprRte$ & Depreciation Rate & $\DeprFac = 1-\deprRte$ - \\ \verb|\TranShkAgg| & $\TranShkAgg$ & Transitory shock (aggregate) & $\Ex_{t}[\TranShkAgg_{t+n}]=1$ if $\TranShkAgg$ iid - \\ \verb|\tranShkInd| & $\tranShkInd$ & Transitory shock (individual) & $\Ex_{t}[\tranShkInd_{t+n}]=1$ if $\tranShkInd$ iid - \\ \verb|\PermShkAgg| & $\PermShkAgg$ & Permanent shock (aggregate) & $\Ex_{t}[\PermShkAgg_{t+n}]=1$ if $\PermShkAgg$ iid - \\ \verb|\permShkInd| & $\permShkInd$ & Permanent shock (individual) & $\Ex_{t}[\permShkInd_{t+n}]=1$ if $\permShkInd$ iid - \\ \verb|\PopGro| & $\PopGro$ & Population Growth Factor & $\mathtt{Pop}_{t+1} = \PopGro \mathtt{Pop}_{t}$ - \\ \verb|\popGro| & $\popGro$ & Population Growth rate & $\PopGro = 1 + \popGro$ - \\ \verb|\PtyGro| & $\PtyGro$ & Productivity Growth Factor & $\GLev = \PtyGro \PopGro$ - \\ \verb|\ptyGro| & $\ptyGro$ & Productivity Growth rate & $\PtyGro = (1+\ptyGro)$ - \\ \verb|\leiShare| & $\leiShare$ & Leisure share, Cobb-Douglas utility & $\uFunc(c,z)=(1-\CRRA)^{-1}(c^{1-\leiShare}z^{\leiShare})^{1-\CRRA}$ - \\ \verb|\MPC| & $\MPC$ & Marginal Propensity to Consume & $\cFunc^{\prime}(\mRat)=\partial c/\partial m$ - \\ \verb|\Pat| & $\Pat$ & Absolute Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA} $ - \\ \verb|\PatPGro| & $\PatPGro$ & Growth Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA}/\PtyGro $ - \\ \verb|\PatR| & $\PatR$ & Return Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA}/\Rfree $ - \\ \verb|\pat| & $\pat$ & Absolute Patience rate (\texttt{thorn}) & $\pat = (\Rfree \DiscFac)^{1/\CRRA}-1 \approx \CRRA^{-1}(\rfree-\discRte) $ - \\ \verb|\patpGro| & $\patpGro$ & Growth Patience rate (\texttt{thorn}) & $\patpGro = \pat -\ptyGro $ - \\ \verb|\patr| & $\patr$ & Return Patience rate (\texttt{thorn}) & $\patr =\pat -\rfree $ - \\ \verb|\riskyshare| & $\riskyshare$ & Portfolio share in risky assets & $\Rport_{t+1}=(1-\riskyshare)\Rfree+\riskyshare\Risky_{t+1}$ - \\ \hline - \end{tabular} - \caption{Parameters} - \label{table:Parameters} -\end{table} - -Mnemonics: -\begin{itemize} -\item Hebrew \texttt{daleth} is the fourth letter of the Hebrew alphabet (as d and $\delta$ are of the Roman and Greek) and is an etymological and linguistic cousin of those letters -\item $\discRte$ is the lower case Greek letter \texttt{omega}, because people say ``OMG, I've got to think about the future.'' -\item You are invited to scrutinize $\Xi$ yourself to imagine reasons it could represent something to do with population growth. -\item The glorious letter $\Pat$ (pronounced `\href{https://en.wikipedia.org/wiki/Thorn_(letter)}{thorn}') enriched Old English, Gothic, and some other defunct alphabets; sadly, it remains in use today only in Iceland. It is useful because having to type the many symbols in the object $(\Rfree \DiscFac)^{1/\CRRA}$ over and over again is a \textit{thorn} in the side of economists working with dynamic models! (It is the `absolute patience factor' because if it is less than one the consumer wants to bring resources from the future to the present and is therefore absolutely impatient; for a fuller discussion of this terminology, see \cite{carrollTractable}.) -\end{itemize} - - -\hypertarget{Operators}{} -\section{Operators} -A few operators are so universally used that it will be useful to define them. - -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}rccll|} - \hline - Name & \LaTeX & Code & Description & Illustration - \\ \hline - \verb|\Ex| & $\Ex$ & \texttt{Ex\_} & The expectation as of date $t$ & $\Ex_{t}[\uFunc^{\prime}(\cRat_{t+1})]$ - \\ \verb|\PDV| & $\PDV$ & \texttt{PDV\_} & Present Discounted Value & $\PDV_{t}^{T}(y)$ is human wealth - \\ \hline - \end{tabular} - \caption{Operators} - \label{table:Operators} -\end{table} - - - -\hypertarget{Modifiers}{} -\section{Modifiers} -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}lcl|} - \hline - \textit{[object]}\texttt{P} & - & ``Prime'' means derivative, e.g.\ \texttt{vPP} is the second derivative of value: $\vFunc^{\prime\prime}$ -\\ \hline - \textit{[object]}\texttt{Agg} & - & Value of something at the aggregate level (as opposed to \texttt{Ind}) - \\ \textit{[object]}\texttt{Ind} & - & Value of something at the level of an individual (as opposed to \texttt{Agg}) - \\ \textit{[object]}\texttt{Lvl} & - & Level - \\ \textit{[object]}\texttt{Rto} & - & Ratio - \\ \textit{[object]}\texttt{Bot} & - & Lower value in some range - \\ \textit{[object]}\texttt{Top} & - & Upper value in some range - \\ \textit{[object]}\texttt{Min} & - & Minimum possible value - \\ \textit{[object]}\texttt{Max} & - & Maximum possible value - \\ \textit{[object]}\texttt{Cnt} & - & Continuous-time value - \\ \textit{[object]}\texttt{Dsc} & - & Discrete-time value - \\ \textit{[object]}\texttt{Shk} & - & Shock - \\ \textit{[object]}\texttt{StE} & - & Steady-state Equilibrium value of a variable - \\ \textit{[object]}\texttt{Trg} & - & The `target' value of a variable - \\ \textit{[object]}\texttt{Rte} & - & A `rate' variable like the discount rate $\discRte$ - \\ \textit{[object]}\texttt{Fac} & - & A factor variable like the discount factor $\DiscFac$ - \\ \textit{[object]}\texttt{Amt} & - & An amount, like \texttt{TaxAmt} which might be lump-sum - \\ \textit{[object]}\texttt{Nrm} & - & A normalized quantity; ex: \texttt{RNrm}=$\Rfree/\PGro$ - \\ \hline - \\ \textit{[object]}\texttt{Abve} & - & Range of points ABOvE some boundary - \\ \textit{[object]}\texttt{Belw} & - & Range of points BELoW some boundary - \\ \textit{[object]}\texttt{Grid} & - & Points to be used as a grid for interpolations - \\ \textit{[object]}\texttt{Xtra} & - & An ``extra'' set of points to be added to some existing set - \end{tabular} - \caption{General Purpose Modifiers} - \label{table:General} -\end{table} - -\medskip\medskip -\hypertarget{Shocks}{} -Shocks will generally be represented by finite vectors of outcomes and their probabilities. For example, permanent income is called \texttt{Perm} and shocks are designated \texttt{PermShk} -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}ccl|} - \hline - \textit{[object]}\texttt{Dstn} & - & Representation of a probability distribution (includes both Prbs and Vals) - \\ \textit{[object]}\texttt{Prbs} & - & Probabilities of outcomes (e.g. \texttt{PermShkPrbs} for permanent shocks) - \\ \textit{[object]}\texttt{Vals} & - & Values (e.g., for mean one shock \texttt{PermShkVals} . \texttt{PermShkPrbs} = 1) - \\ \hline - \end{tabular} - \caption{Probabilities} - \label{table:Probabilities} -\end{table} - -\hypertarget{Timing}{} -Timing can be confusing because there can be multiple ordered steps -within a `period.' We will use \texttt{Prev}, \texttt{Curr}, \texttt{Next} to refer -to steps relative to the local moment within a period, and $t$ variables to refer to succeeding periods: -\begin{table}[ht] - \centering - \begin{tabular}{|>{\ttfamily}lcl|} - \hline - \textit{[object]}tmn & - & object in period $t$ minus $n$ - \\ \textit{[object]}tm1 & - & object in period $t$ minus 1 - \\ \textit{[object]}Now & - & object in period $t$ - \\ \textit{[object]}t\phantom{p1} & - & object in period $t$ (alternative definition) - \\ \textit{[object]}tp1 & - & object in $t$ plus 1 - \\ \textit{[object]}tpn & - & object in $t$ plus $n$ - \\ \textit{[object]}Prev & - & object in previous subperiod - \\ \textit{[object]}Curr & - & object in current subperiod - \\ \textit{[object]}Next & - & object in next subperiod - \\ \hline - \end{tabular} - \caption{Timing} - \label{table:Timing} -\end{table} - -\section{Model Imports} - -A convention in python is that when a tool is imported it is given a convenient short name, -e.g. \texttt{import numpy as np}. - -Here are the preferred shortnames for some of our models: - -\begin{quote} - \texttt{import ConsIndShockModel as cisMdl} -\end{quote} - -\clearpage - -\vfill\eject\pagebreak\newpage - - -\bibliography{NARK-Add,economics} - -\end{document} +\input{./econtexRoot} +\documentclass[12pt]{\econtex} +\usepackage{\econtexSetup} +\usepackage{\econtexShortcuts} + +\usepackage{cancel} + +\begin{document}\bibliographystyle{\econtexBibStyle} + + +\title{Suggested Variable Naming Conventions \\ in the Econ-ARK Toolkit} + +% \forcedate{2021-02-25} % Updates for HARK 1.0 release +% \forcedate{2020-02-26} % Add sav, modl; other tweaks +% \forcedate{2020-06-29} % Update date; shorten ALevBF; add +% \forcedate{2020-06-30} % NARK: Minor tweaks +% \forcedate{2020-07-01} % Version posted by doEvertyhing.sh +\forcedate{2020-07-02} % Add conventions for marginal value and utility + +\vspace{2in} + +\keywords{ARK, Variable, Function, Object, Operator, Naming, Guidelines, Conventions} +\jelclass{None} + + +\maketitle + + +\begin{abstract} + Sharing code is easier when different contributors use similar names for similar objects. While we will not enforce the + recommendations below, contributors can make their code more attractive to others + by using names consistent with our guidelines. +\end{abstract} + +\centerline{html version at \url{https://econ-ark.github.io/HARK/Documentation/NARK}} + +% \thanks{The \texttt{NARK} repo that generates this document also contains \LaTeX~configuration files that permit you to use the same name for an object in your writing (your \texttt{paper.tex} file) and in your code (helping to minimize confusion in translating between paper and code).} + + +\pagebreak + +\section{Principles} +Our aim has been to balance: +\begin{itemize} +\item Brevity +\item Mnemonic quality +\item Uniqueness (enabling global search-and-replace) +\item Ubiquity (definitions useful for many projects) +\item Combinatoriality (which encourages mashups) +\end{itemize} + + +\pagebreak + +\section{Variables} + +\subsection{Single-Letter} + +We strongly discourage the use of single-letter variable names. Reasons are presented \textit{ad nauseum} in introductory CS texts (which, we know, few economists consult); here we will note only that the extent to which your code will be influential depends upon the extent to which someone else can easily read it, which is harder if you have used variable names which could mean almost anything. (We have made careful choices for the `default' meanings of each Roman letter (see below); hence, in the context of the toolkit, use of a single-letter name for any meaning other than the designated one will be doubly confusing). + +It is only slightly less objectionable to name a variable after a familiar letter in another commonly used alphabet (say, \texttt{delta}). Your future self (and other users) will not know which of the many possible meanings of $\delta$ you had in mind. + +But, because brevity is a virtue, a single letter \textit{in combination with a modifier or two} (`\texttt{hMin}' as the value of minimum human wealth, say) is fine -- so long as the reader has some reason to expect that the lower-case letter \texttt{h} signifies human wealth (as they will, if they consult Table~\ref{table:RomanLetters}). + +That is the spirit in which we offer preferred interpretations for the Roman letters below. The upper case version is an aggregated version of the variable (at the level of the whole economy, say, or of the whole market being studied), while the lower case indicates the level of an individual consumer or firm or other subaggregate entity. + +A few exceptions to these rules are explicitly noted below the table. + +When an alternative is needed with a meaning similar to, but distinct from, the definitions below, please use a multi-letter name to represent it. For example, please do not use $W$ for wealth (if some measure of wealth that differs from $\ALev$, $\BLev$, $\HLev$, or $\NLev$ is needed); instead use, say, \texttt{Wlth} or \texttt{Wealth}. (Some examples follow in a subsequent section). + +Finally, a few of the definitions below are actually prohibitions; these are based on many years of experience which have shown that use of the prohibited variable name generates more confusion than clarity. + +\hypertarget{RomanLetters}{} +\begin{table}[ht] + \centering + \begin{tabular}{|lcl|} \hline + Letter & & Meaning + \\ \hline + \ALev & & \textit{A}ssets \textit{A}fter \textit{A}ll \textit{A}ctions \textit{A}re \textit{A}ccomplished (end of period) + \\ \BLev & & \textit{B}eginning \textit{B}ank \textit{B}alances \textit{B}efore any \textit{B}ehavior (\textit{b}eginning-of-period) + \\ \CLev & & \textit{C}onsumption \textit{C}hoice \textit{C}onnects $B$ to $A$ + \\ \DLev & & \textit{D}ebt + \\ \ELev & & PROHIBITED: Too many possible meanings (expectations, effort, expenses) + \\ \FLev & & Production \textit{F}unction + \\ \GLev & & \textit{G}rowth + \\ \HLev & & \textit{H}uman wealth + \\ \ILev & & \textit{I}nvestment + \\ \JLev & & Ad\textit{J}ustment costs (e.g., in a $Q$ model) + \\ \KLev & & Capital or beginning of period nonhuman assets + \\ \LLev & & PROHIBITED: Is it Labor or Leisure or Land or ...? + \\ \MLev & & \textit{M}arket resources (the sum of capital, capital income, and labor income) + \\ \NLev & & \textit{N}et wealth including human wealth ($=B + H$) + \\ \OLev & & PROHIBITED: Too similar to the number 0; too many possible meanings + \\ \PLev & & PROHIBITED: Is it prices, permanent income, present value, profits, ...? + \\ \QLev & & Hayashi/Abel $Q$ (or similar asset price) + \\ \RLev & & \textit{R}eturn (see the variants articulated below) + \\ \SLev & & PROHIBITED: ``saving'' (flow)? ``savings'' (stock)? or the ``saving rate'' (ratio)? + \\ \TLev & & This is a tough one. See the discussion below. + \\ \ULev & & \textit{U}tility + \\ \VLev & & \textit{V}alue + \\ \WLev & & \textit{W}age + \\ \XLev & & e\textit{X}penditures (as distinct from consumption; e.g., for durables) + \\ \YLev & & Noncapital income (usually, the sum of transfer and labor income) + \\ \ZLev & & Lei\textit{Z}ure in consumption/leisure tradeoff + \\ \hline + \end{tabular} + \caption{Preferred Usages of Roman Letters} + \label{table:RomanLetters} +\end{table} + +\subsection{Exceptions to the Rules} + +The letter $\TLev$ is an exception to the rule that lower- and upper-case versions of variables are individual and aggregate quantities. We reserve the capital letter to designate the end of the horizon (death, or the end of the economy, occurs at the end of period $\TLev$). The lower case version $t$ is so ubiquitiously used as the current time period that we follow that convention here. + +Finally, the following are exempted from the prohibition on single-letter variable names because they are used so frequently that the prohibition would be more trouble than it is worth: $a$, $b$, $c$, $m$. + +\pagebreak + +\subsection{Standard Variable Names} + +There are more objects that are likely to be used extensively in ARK projects than there are Roman letters. We present preferred usages for some of those commonly-needed variables here. + +\hypertarget{Standard-Variable-Names}{} +\begin{table}[ht] + \centering + \begin{tabular}{|rcl|} + \hline + Name & - & Description + \\ \hline + \texttt{CND} & - & Consumption of Nondurable Good + \\ \texttt{CNS} & - & Consumption of Nondurables and Services + \\ \texttt{Cst} & - & Cost of something + \\ \texttt{Dgd} & - & Stock of durable good + \\ \texttt{Dvd} & - & Dividends + \\ \texttt{Hse} & - & Quantity of housing (\textit{not} value, which is quantity $\times$ price) + \\ \texttt{Inc} & - & Income + \\ \texttt{Nlq} & - & Quantity that is \textbf{N}ot \textbf{l}i\textbf{q}uid (e.g., $\mathtt{aNlq}$ is illiquid financial) + \\ \texttt{Lbr} & - & Quantity of labor (hours) + \\ \texttt{Pop} & - & Size of population + \\ \texttt{Sav} & - & Saving (=Income Minus Consumption) + \\ \texttt{Tax} & - & Tax -- should be modified by \texttt{Rte} or \texttt{Amt} articulated below + \\ \texttt{Perm} & - & Permanent (labor; or at least, noncapital) income + \\ \texttt{Tran} & - & Transitory (labor; or at least, noncapital) income + \\ \hline + \end{tabular} + \caption{String Variables} + \label{table:Standard-Variable-Names} +\end{table} + + + +\section{Factors and Rates} +When measuring change over time, lower-case variables reflect rates +while the corresponding upper-case variable connects adjacent discrete periods.\footnote{This + convention rarely conflicts with the usage we endorse elsewhere of + indicating individual-level variables by the lower and aggregate + variables by the upper case.}$^{,}$\footnote{If there is a need for the continuous-time + representation, we endorse use of the discrete-time rate defined below. Any + author who needs a continuous-time rate, a discrete-time rate, and a discrete-time factor + is invited to invent their own notation.} So, for example, if the time interval is a year and the annual interest rate is $\rfree=0.03$ or three percent, then +the annual interest factor is $\Rfree=1.03$.\footnote{In the rare cases where it is necessary to distinguish between a continuous-time rate and a discrete-time rate -- for example, when there is an analytical result available in continuous time -- the variable in question can be modified by \texttt{Cnt} or \texttt{Dsc}.} + + +\begin{table}[ht] + \centering + \begin{tabular}{|ccc|} + \hline + Code & Output & Description + \\ \hline + \verb|\Rfree| & $\Rfree$ & Riskfree interest factor + \\ \verb|\rfree| & $\rfree$ & Riskfree interest rate + \\ \verb|\Risky| & $\Risky$ & The return factor on a risky asset + \\ \verb|\risky| & $\risky$ & The return rate on a risky asset + \\ \verb|\Rport| & $\Rport$ & The return factor on the entire portfolio + \\ \verb|\rport| & $\rport$ & The return rate on the entire portfolio + \\ \verb|\RSave| & $\RSave$ & Return factor earned on positive end-of-period assets + \\ \verb|\rsave| & $\rsave$ & Return rate earned on positive end-of-period assets + \\ \verb|\RBoro| & $\RBoro$ & Return factor paid on debts + \\ \verb|\rboro| & $\rboro$ & Return rate paid on debts + \\ \hline + \end{tabular} + \caption{Factors and Rates} + \label{table:Factors} +\end{table} + +We depart from the upper-lower case scheme when the natural letter to use has an even more urgent use elsewhere in our scheme. +A particularly common example occurs in the case of models like \cite{blanchardFinite} in which +individual agents are subject to a Poisson probability of death. Because death was common in the +middle ages, we use the archaic Gothic font for the death rate; and the probability of survival is the cancellation of the probability of death: +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}cccl|} + \hline + Code & \LaTeX & Description & \\ + \hline + \verb|\DiePrb| & $\DiePrb$ & Probabilty of death & + \\ \verb|\LivPrb| & $\LivPrb$ & Probability to not die $=(1-\DiePrb)$ & + \\ \hline + \end{tabular} + \caption{Special Cases: Factors and Rates} + \label{table:SpecialFactors} +\end{table} + +\section{Parameters} +Some parameters are worth defining because they are likely to be +used in a high proportion of models; others are subject to enough +constraints when used (such as the need for similar-looking upper- +and lower-case Greek representations), as to be worth standardizing. + +Programmers should +use the corresponding variable name without the backslash as the name of the corresponding object +in their code. For example, the Coefficient of Relative Risk Aversion is $\verb|\CRRA|$ in a \LaTeX +document and \texttt{CRRA} in a software module. + +\hypertarget{Parameters}{} +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}rcll|} + \hline + Name & \LaTeX & Description & Illustration + \\ \hline + \verb|\CARA| & $\CARA$ & Coefficient of Absolute Risk Aversion &$\uFunc(\bullet)=-\CARA^{-1} e^{-\CARA \bullet}$ + \\ \verb|\CRRA| & $\CRRA$ & Coefficient of Relative Risk Aversion & $\uFunc(\bullet)=(1-\CRRA)^{-1}\bullet^{1-\CRRA}$ + \\ \verb|\DiscFac| & $\DiscFac$ & Time Discount Factor & $\uFunc^{\prime}(\cLev_{t}) = \Rfree \DiscFac \uFunc^{\prime}(\cLev_{t+1})$ + \\ \verb|\discRte| & $\discRte$ & Time Discount rate & $\discRte=\DiscFac^{-1}-1$ + \\ \verb|\DeprFac| & $\DeprFac$ & Depreciation Factor (Hebrew \texttt{daleth}) & $\Kap_{t+1} = \DeprFac \Kap_{t}+\ILev_{t}$ + \\ \verb|\deprRte| & $\deprRte$ & Depreciation Rate & $\DeprFac = 1-\deprRte$ + \\ \verb|\TranShkAgg| & $\TranShkAgg$ & Transitory shock (aggregate) & $\Ex_{t}[\TranShkAgg_{t+n}]=1$ if $\TranShkAgg$ iid + \\ \verb|\tranShkInd| & $\tranShkInd$ & Transitory shock (individual) & $\Ex_{t}[\tranShkInd_{t+n}]=1$ if $\tranShkInd$ iid + \\ \verb|\PermShkAgg| & $\PermShkAgg$ & Permanent shock (aggregate) & $\Ex_{t}[\PermShkAgg_{t+n}]=1$ if $\PermShkAgg$ iid + \\ \verb|\permShkInd| & $\permShkInd$ & Permanent shock (individual) & $\Ex_{t}[\permShkInd_{t+n}]=1$ if $\permShkInd$ iid + \\ \verb|\PopGro| & $\PopGro$ & Population Growth Factor & $\mathtt{Pop}_{t+1} = \PopGro \mathtt{Pop}_{t}$ + \\ \verb|\popGro| & $\popGro$ & Population Growth rate & $\PopGro = 1 + \popGro$ + \\ \verb|\PtyGro| & $\PtyGro$ & Productivity Growth Factor & $\GLev = \PtyGro \PopGro$ + \\ \verb|\ptyGro| & $\ptyGro$ & Productivity Growth rate & $\PtyGro = (1+\ptyGro)$ + \\ \verb|\leiShare| & $\leiShare$ & Leisure share, Cobb-Douglas utility & $\uFunc(c,z)=(1-\CRRA)^{-1}(c^{1-\leiShare}z^{\leiShare})^{1-\CRRA}$ + \\ \verb|\MPC| & $\MPC$ & Marginal Propensity to Consume & $\cFunc^{\prime}(\mRat)=\partial c/\partial m$ + \\ \verb|\Pat| & $\Pat$ & Absolute Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA} $ + \\ \verb|\PatPGro| & $\PatPGro$ & Growth Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA}/\PtyGro $ + \\ \verb|\PatR| & $\PatR$ & Return Patience Factor (\texttt{Thorn}) & $\Pat = (\Rfree \DiscFac)^{1/\CRRA}/\Rfree $ + \\ \verb|\pat| & $\pat$ & Absolute Patience rate (\texttt{thorn}) & $\pat = (\Rfree \DiscFac)^{1/\CRRA}-1 \approx \CRRA^{-1}(\rfree-\discRte) $ + \\ \verb|\patpGro| & $\patpGro$ & Growth Patience rate (\texttt{thorn}) & $\patpGro = \pat -\ptyGro $ + \\ \verb|\patr| & $\patr$ & Return Patience rate (\texttt{thorn}) & $\patr =\pat -\rfree $ + \\ \verb|\riskyshare| & $\riskyshare$ & Portfolio share in risky assets & $\Rport_{t+1}=(1-\riskyshare)\Rfree+\riskyshare\Risky_{t+1}$ + \\ \hline + \end{tabular} + \caption{Parameters} + \label{table:Parameters} +\end{table} + +Mnemonics: +\begin{itemize} +\item Hebrew \texttt{daleth} is the fourth letter of the Hebrew alphabet (as d and $\delta$ are of the Roman and Greek) and is an etymological and linguistic cousin of those letters +\item $\discRte$ is the lower case Greek letter \texttt{omega}, because people say ``OMG, I've got to think about the future.'' +\item You are invited to scrutinize $\Xi$ yourself to imagine reasons it could represent something to do with population growth. +\item The glorious letter $\Pat$ (pronounced `\href{https://en.wikipedia.org/wiki/Thorn_(letter)}{thorn}') enriched Old English, Gothic, and some other defunct alphabets; sadly, it remains in use today only in Iceland. It is useful because having to type the many symbols in the object $(\Rfree \DiscFac)^{1/\CRRA}$ over and over again is a \textit{thorn} in the side of economists working with dynamic models! (It is the `absolute patience factor' because if it is less than one the consumer wants to bring resources from the future to the present and is therefore absolutely impatient; for a fuller discussion of this terminology, see \cite{carrollTractable}.) +\end{itemize} + + +\hypertarget{Operators}{} +\section{Operators} +A few operators are so universally used that it will be useful to define them. + +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}rccll|} + \hline + Name & \LaTeX & Code & Description & Illustration + \\ \hline + \verb|\Ex| & $\Ex$ & \texttt{Ex\_} & The expectation as of date $t$ & $\Ex_{t}[\uFunc^{\prime}(\cRat_{t+1})]$ + \\ \verb|\PDV| & $\PDV$ & \texttt{PDV\_} & Present Discounted Value & $\PDV_{t}^{T}(y)$ is human wealth + \\ \hline + \end{tabular} + \caption{Operators} + \label{table:Operators} +\end{table} + + + +\hypertarget{Modifiers}{} +\section{Modifiers} +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}lcl|} + \hline + \textit{[object]}\texttt{P} & - & ``Prime'' means derivative, e.g.\ \texttt{vPP} is the second derivative of value: $\vFunc^{\prime\prime}$ +\\ \hline + \textit{[object]}\texttt{Agg} & - & Value of something at the aggregate level (as opposed to \texttt{Ind}) + \\ \textit{[object]}\texttt{Ind} & - & Value of something at the level of an individual (as opposed to \texttt{Agg}) + \\ \textit{[object]}\texttt{Lvl} & - & Level + \\ \textit{[object]}\texttt{Rto} & - & Ratio + \\ \textit{[object]}\texttt{Bot} & - & Lower value in some range + \\ \textit{[object]}\texttt{Top} & - & Upper value in some range + \\ \textit{[object]}\texttt{Min} & - & Minimum possible value + \\ \textit{[object]}\texttt{Max} & - & Maximum possible value + \\ \textit{[object]}\texttt{Cnt} & - & Continuous-time value + \\ \textit{[object]}\texttt{Dsc} & - & Discrete-time value + \\ \textit{[object]}\texttt{Shk} & - & Shock + \\ \textit{[object]}\texttt{StE} & - & Steady-state Equilibrium value of a variable + \\ \textit{[object]}\texttt{Trg} & - & The `target' value of a variable + \\ \textit{[object]}\texttt{Rte} & - & A `rate' variable like the discount rate $\discRte$ + \\ \textit{[object]}\texttt{Fac} & - & A factor variable like the discount factor $\DiscFac$ + \\ \textit{[object]}\texttt{Amt} & - & An amount, like \texttt{TaxAmt} which might be lump-sum + \\ \textit{[object]}\texttt{Nrm} & - & A normalized quantity; ex: \texttt{RNrm}=$\Rfree/\PGro$ + \\ \hline + \\ \textit{[object]}\texttt{Abve} & - & Range of points ABOvE some boundary + \\ \textit{[object]}\texttt{Belw} & - & Range of points BELoW some boundary + \\ \textit{[object]}\texttt{Grid} & - & Points to be used as a grid for interpolations + \\ \textit{[object]}\texttt{Xtra} & - & An ``extra'' set of points to be added to some existing set + \end{tabular} + \caption{General Purpose Modifiers} + \label{table:General} +\end{table} + +\medskip\medskip +\hypertarget{Shocks}{} +Shocks will generally be represented by finite vectors of outcomes and their probabilities. For example, permanent income is called \texttt{Perm} and shocks are designated \texttt{PermShk} +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}ccl|} + \hline + \textit{[object]}\texttt{Dstn} & - & Representation of a probability distribution (includes both Prbs and Vals) + \\ \textit{[object]}\texttt{Prbs} & - & Probabilities of outcomes (e.g. \texttt{PermShkPrbs} for permanent shocks) + \\ \textit{[object]}\texttt{Vals} & - & Values (e.g., for mean one shock \texttt{PermShkVals} . \texttt{PermShkPrbs} = 1) + \\ \hline + \end{tabular} + \caption{Probabilities} + \label{table:Probabilities} +\end{table} + +\hypertarget{Timing}{} +Timing can be confusing because there can be multiple ordered steps +within a `period.' We will use \texttt{Prev}, \texttt{Curr}, \texttt{Next} to refer +to steps relative to the local moment within a period, and $t$ variables to refer to succeeding periods: +\begin{table}[ht] + \centering + \begin{tabular}{|>{\ttfamily}lcl|} + \hline + \textit{[object]}tmn & - & object in period $t$ minus $n$ + \\ \textit{[object]}tm1 & - & object in period $t$ minus 1 + \\ \textit{[object]}Now & - & object in period $t$ + \\ \textit{[object]}t\phantom{p1} & - & object in period $t$ (alternative definition) + \\ \textit{[object]}tp1 & - & object in $t$ plus 1 + \\ \textit{[object]}tpn & - & object in $t$ plus $n$ + \\ \textit{[object]}Prev & - & object in previous subperiod + \\ \textit{[object]}Curr & - & object in current subperiod + \\ \textit{[object]}Next & - & object in next subperiod + \\ \hline + \end{tabular} + \caption{Timing} + \label{table:Timing} +\end{table} + +\section{Model Imports} + +A convention in python is that when a tool is imported it is given a convenient short name, +e.g. \texttt{import numpy as np}. + +Here are the preferred shortnames for some of our models: + +\begin{quote} + \texttt{import ConsIndShockModel as cisMdl} +\end{quote} + +\clearpage + +\vfill\eject\pagebreak\newpage + + +\bibliography{NARK-Add,economics} + +\end{document} diff --git a/Documentation/NARK/Resources/.git-public-commit b/docs/NARK/Resources/.git-public-commit similarity index 100% rename from Documentation/NARK/Resources/.git-public-commit rename to docs/NARK/Resources/.git-public-commit diff --git a/Documentation/NARK/Resources/.git-source-commit b/docs/NARK/Resources/.git-source-commit similarity index 100% rename from Documentation/NARK/Resources/.git-source-commit rename to docs/NARK/Resources/.git-source-commit diff --git a/Documentation/NARK/Resources/LaTeXInputs/BufferStockTheory-tikz.sty b/docs/NARK/Resources/LaTeXInputs/BufferStockTheory-tikz.sty similarity index 100% rename from Documentation/NARK/Resources/LaTeXInputs/BufferStockTheory-tikz.sty rename to docs/NARK/Resources/LaTeXInputs/BufferStockTheory-tikz.sty diff --git a/Documentation/NARK/Resources/LaTeXInputs/BufferStockTheory.sty b/docs/NARK/Resources/LaTeXInputs/BufferStockTheory.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/LaTeXInputs/BufferStockTheory.sty rename to docs/NARK/Resources/LaTeXInputs/BufferStockTheory.sty diff --git a/Documentation/NARK/Resources/LaTeXInputs/econtex_onlyinsubfile.tex b/docs/NARK/Resources/LaTeXInputs/econtex_onlyinsubfile.tex similarity index 100% rename from Documentation/NARK/Resources/LaTeXInputs/econtex_onlyinsubfile.tex rename to docs/NARK/Resources/LaTeXInputs/econtex_onlyinsubfile.tex diff --git a/Documentation/NARK/Resources/PoweredByEconARK.pdf b/docs/NARK/Resources/PoweredByEconARK.pdf similarity index 100% rename from Documentation/NARK/Resources/PoweredByEconARK.pdf rename to docs/NARK/Resources/PoweredByEconARK.pdf diff --git a/Documentation/NARK/Resources/PoweredByEconARK.svg b/docs/NARK/Resources/PoweredByEconARK.svg similarity index 100% rename from Documentation/NARK/Resources/PoweredByEconARK.svg rename to docs/NARK/Resources/PoweredByEconARK.svg diff --git a/Documentation/NARK/Resources/econ-ark-logo-small.png b/docs/NARK/Resources/econ-ark-logo-small.png old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/econ-ark-logo-small.png rename to docs/NARK/Resources/econ-ark-logo-small.png diff --git a/Documentation/NARK/Resources/econ-ark-logo-small.xbb b/docs/NARK/Resources/econ-ark-logo-small.xbb similarity index 100% rename from Documentation/NARK/Resources/econ-ark-logo-small.xbb rename to docs/NARK/Resources/econ-ark-logo-small.xbb diff --git a/Documentation/NARK/Resources/econtexPaths.tex b/docs/NARK/Resources/econtexPaths.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/econtexPaths.tex rename to docs/NARK/Resources/econtexPaths.tex diff --git a/Documentation/NARK/Resources/owner.tex b/docs/NARK/Resources/owner.tex similarity index 100% rename from Documentation/NARK/Resources/owner.tex rename to docs/NARK/Resources/owner.tex diff --git a/Documentation/NARK/Resources/texmf-local/README.md b/docs/NARK/Resources/texmf-local/README.md similarity index 100% rename from Documentation/NARK/Resources/texmf-local/README.md rename to docs/NARK/Resources/texmf-local/README.md diff --git a/Documentation/NARK/Resources/texmf-local/bibtex/bib/economics.bib b/docs/NARK/Resources/texmf-local/bibtex/bib/economics.bib similarity index 100% rename from Documentation/NARK/Resources/texmf-local/bibtex/bib/economics.bib rename to docs/NARK/Resources/texmf-local/bibtex/bib/economics.bib diff --git a/Documentation/NARK/Resources/texmf-local/bibtex/bst/econtex.bst b/docs/NARK/Resources/texmf-local/bibtex/bst/econtex.bst similarity index 100% rename from Documentation/NARK/Resources/texmf-local/bibtex/bst/econtex.bst rename to docs/NARK/Resources/texmf-local/bibtex/bst/econtex.bst diff --git a/Documentation/NARK/Resources/texmf-local/bibtex/bst/handout.bst b/docs/NARK/Resources/texmf-local/bibtex/bst/handout.bst similarity index 100% rename from Documentation/NARK/Resources/texmf-local/bibtex/bst/handout.bst rename to docs/NARK/Resources/texmf-local/bibtex/bst/handout.bst diff --git a/Documentation/NARK/Resources/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst b/docs/NARK/Resources/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst rename to docs/NARK/Resources/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst diff --git a/Documentation/NARK/Resources/texmf-local/ls-R b/docs/NARK/Resources/texmf-local/ls-R similarity index 100% rename from Documentation/NARK/Resources/texmf-local/ls-R rename to docs/NARK/Resources/texmf-local/ls-R diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/ReadMe.texmf b/docs/NARK/Resources/texmf-local/tex/latex/ReadMe.texmf similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/ReadMe.texmf rename to docs/NARK/Resources/texmf-local/tex/latex/ReadMe.texmf diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/articleNoRefHead.cls b/docs/NARK/Resources/texmf-local/tex/latex/articleNoRefHead.cls old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/articleNoRefHead.cls rename to docs/NARK/Resources/texmf-local/tex/latex/articleNoRefHead.cls diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/bibMake.tex b/docs/NARK/Resources/texmf-local/tex/latex/bibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/bibMake.tex rename to docs/NARK/Resources/texmf-local/tex/latex/bibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/cvBibMake.tex b/docs/NARK/Resources/texmf-local/tex/latex/cvBibMake.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/cvBibMake.tex rename to docs/NARK/Resources/texmf-local/tex/latex/cvBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/econtex.cls b/docs/NARK/Resources/texmf-local/tex/latex/econtex.cls similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/econtex.cls rename to docs/NARK/Resources/texmf-local/tex/latex/econtex.cls diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/econtex.sty b/docs/NARK/Resources/texmf-local/tex/latex/econtex.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/econtex.sty rename to docs/NARK/Resources/texmf-local/tex/latex/econtex.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/econtexBibMake.tex b/docs/NARK/Resources/texmf-local/tex/latex/econtexBibMake.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/econtexBibMake.tex rename to docs/NARK/Resources/texmf-local/tex/latex/econtexBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/econtexSetup.sty b/docs/NARK/Resources/texmf-local/tex/latex/econtexSetup.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/econtexSetup.sty rename to docs/NARK/Resources/texmf-local/tex/latex/econtexSetup.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/econtexShortcuts.sty b/docs/NARK/Resources/texmf-local/tex/latex/econtexShortcuts.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/econtexShortcuts.sty rename to docs/NARK/Resources/texmf-local/tex/latex/econtexShortcuts.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/handout.cls b/docs/NARK/Resources/texmf-local/tex/latex/handout.cls similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/handout.cls rename to docs/NARK/Resources/texmf-local/tex/latex/handout.cls diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/handout.sty b/docs/NARK/Resources/texmf-local/tex/latex/handout.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/handout.sty rename to docs/NARK/Resources/texmf-local/tex/latex/handout.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/handoutBibMake.tex b/docs/NARK/Resources/texmf-local/tex/latex/handoutBibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/handoutBibMake.tex rename to docs/NARK/Resources/texmf-local/tex/latex/handoutBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/handoutSetup.sty b/docs/NARK/Resources/texmf-local/tex/latex/handoutSetup.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/handoutSetup.sty rename to docs/NARK/Resources/texmf-local/tex/latex/handoutSetup.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/handoutShortcuts.sty b/docs/NARK/Resources/texmf-local/tex/latex/handoutShortcuts.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/handoutShortcuts.sty rename to docs/NARK/Resources/texmf-local/tex/latex/handoutShortcuts.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/makePostHandoutsStart.tex b/docs/NARK/Resources/texmf-local/tex/latex/makePostHandoutsStart.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/makePostHandoutsStart.tex rename to docs/NARK/Resources/texmf-local/tex/latex/makePostHandoutsStart.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/printvrb.sty b/docs/NARK/Resources/texmf-local/tex/latex/printvrb.sty old mode 100755 new mode 100644 similarity index 96% rename from Documentation/NARK/Resources/texmf-local/tex/latex/printvrb.sty rename to docs/NARK/Resources/texmf-local/tex/latex/printvrb.sty index b8757b3d4..47f13792a --- a/Documentation/NARK/Resources/texmf-local/tex/latex/printvrb.sty +++ b/docs/NARK/Resources/texmf-local/tex/latex/printvrb.sty @@ -1,112 +1,112 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% printvrb.sty %%%%%%%%%%%%%%%%%% -%%% Amy Hendrickson -%%% TeXnology Inc. -%%% http://www.texnology.com -%%% revised version, April 8, 2011 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Uses moreverb.sty, Rainer Schopf author, -%%% as method to send verbatim text to -%%% another file, - -%%% These commands allow user to type in text or math and -%%% have it print in more than one document, -%%% for example, print in an article and also in slides. - -%%% This is done by sending fragments to a jobname.vrb file. -%%% Each fragment will have a unique name given as an argument -%%% to writetofile. - -%%% -\usepackage{moreverb} - -\newwrite\verbatimout - -%% The fragments will be sent to a new file called -%% the same name as the file they are found in with a -%% .vrb filename ending. (ie., test.tex ==> test.vrb) -%% They will also print in the originating .tex file -%% when LaTeX is run on the file twice (like the \tableofcontents -%% and cross-references). - - -%%% \begin{writetofile}{name}{your text}\end{writetofile} -%%% Notice that there are curly brackets surrounding the -%%% text you enter. These are necessary. - -%%% (Name can include numbers or any symbols you want) - -%%% Used: -%%% \begin{writetofile}{name} -%%% {my text} -%%% \end{writetofile} - -\newcount\definitionnumber - -%%% \namesinmargin will make name of fragment appear in margin. -%%% If this command isn't there, there will be no names in the margin. - -\newif\ifnamesinmargin -\def\namesinmargin{\global\namesinmargintrue} - -\def\writetofile#1{% -\vskip1sp -\ifnum\definitionnumber=0 -\expandafter\openin1 \jobname.vrb -\ifeof1 -\else -\input \jobname.vrb -\fi%% to get the previous definitions -\immediate\openout\verbatimout=\jobname.vrb -\fi -%% -\global\advance\definitionnumber by 1 -\gdef\currname{#1}% -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% -\fi% -%% -\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space -\currname\string\endcsname} - \@bsphack - \let\do\@makeother\dospecials - \catcode`\^^M\active \catcode`\^^I=12 - \def\verbatim@processline{% - \immediate\write\verbatimout - {\the\verbatim@line}}% -\verbatim@start} - -\def\endwritetofile{% - \@esphack -\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on -file one more time!\else -\ifnamesinmargin\vskip-\baselineskip\fi -\noindent\expandafter\csname \currname\endcsname\relax\fi -} - -\makeatother - -%%%%%%%%%%%%%%%%%%%%% -%%% Using fragments in new file: - -%%% \input jobname.vrb will bring in the definitions -%%% for the fragments. -%%% (jobname is the same as the filename of the source document) - -%%% \namesinmargin will make names print as well as as printing -%%% the fragment. - -%%% \printfrag{name} will bring in fragment defined in source file, -%%% and sent to jobname.vrb. - -%%% \printfrag will save the problem of remembering to use -%%% \csname ...\endcsname, and will check to see if fragment is defined - -\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt -\noindent(!! There is -no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% -\csname #1\endcsname\fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% printvrb.sty %%%%%%%%%%%%%%%%%% +%%% Amy Hendrickson +%%% TeXnology Inc. +%%% http://www.texnology.com +%%% revised version, April 8, 2011 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%% Uses moreverb.sty, Rainer Schopf author, +%%% as method to send verbatim text to +%%% another file, + +%%% These commands allow user to type in text or math and +%%% have it print in more than one document, +%%% for example, print in an article and also in slides. + +%%% This is done by sending fragments to a jobname.vrb file. +%%% Each fragment will have a unique name given as an argument +%%% to writetofile. + +%%% +\usepackage{moreverb} + +\newwrite\verbatimout + +%% The fragments will be sent to a new file called +%% the same name as the file they are found in with a +%% .vrb filename ending. (ie., test.tex ==> test.vrb) +%% They will also print in the originating .tex file +%% when LaTeX is run on the file twice (like the \tableofcontents +%% and cross-references). + + +%%% \begin{writetofile}{name}{your text}\end{writetofile} +%%% Notice that there are curly brackets surrounding the +%%% text you enter. These are necessary. + +%%% (Name can include numbers or any symbols you want) + +%%% Used: +%%% \begin{writetofile}{name} +%%% {my text} +%%% \end{writetofile} + +\newcount\definitionnumber + +%%% \namesinmargin will make name of fragment appear in margin. +%%% If this command isn't there, there will be no names in the margin. + +\newif\ifnamesinmargin +\def\namesinmargin{\global\namesinmargintrue} + +\def\writetofile#1{% +\vskip1sp +\ifnum\definitionnumber=0 +\expandafter\openin1 \jobname.vrb +\ifeof1 +\else +\input \jobname.vrb +\fi%% to get the previous definitions +\immediate\openout\verbatimout=\jobname.vrb +\fi +%% +\global\advance\definitionnumber by 1 +\gdef\currname{#1}% +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% +\fi% +%% +\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space +\currname\string\endcsname} + \@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatimout + {\the\verbatim@line}}% +\verbatim@start} + +\def\endwritetofile{% + \@esphack +\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on +file one more time!\else +\ifnamesinmargin\vskip-\baselineskip\fi +\noindent\expandafter\csname \currname\endcsname\relax\fi +} + +\makeatother + +%%%%%%%%%%%%%%%%%%%%% +%%% Using fragments in new file: + +%%% \input jobname.vrb will bring in the definitions +%%% for the fragments. +%%% (jobname is the same as the filename of the source document) + +%%% \namesinmargin will make names print as well as as printing +%%% the fragment. + +%%% \printfrag{name} will bring in fragment defined in source file, +%%% and sent to jobname.vrb. + +%%% \printfrag will save the problem of remembering to use +%%% \csname ...\endcsname, and will check to see if fragment is defined + +\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt +\noindent(!! There is +no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% +\csname #1\endcsname\fi } diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty b/docs/NARK/Resources/texmf-local/tex/latex/snapshot.sty similarity index 97% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty rename to docs/NARK/Resources/texmf-local/tex/latex/snapshot.sty index 311018ebe..92b5bc57e 100644 --- a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty +++ b/docs/NARK/Resources/texmf-local/tex/latex/snapshot.sty @@ -1,341 +1,341 @@ -%% -%% This is file `snapshot.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% snapshot.dtx -%% -%%% ==================================================================== -%%% @LaTeX-doc-source-file{ -%%% filename = "snapshot.dtx", -%%% version = "1.14", -%%% date = "2002/03/05", -%%% time = "15:29:00 EST", -%%% checksum = "39090 807 3449 29761", -%%% author = "American Mathematical Society", -%%% copyright = "Copyright 2001 American Mathematical Society, -%%% all rights reserved. Copying of this file is -%%% authorized only if either: -%%% (1) you make absolutely no changes to your copy, -%%% including name; OR -%%% (2) if you do make changes, you first rename it -%%% to some other name.", -%%% address = "American Mathematical Society, -%%% Electronic Products and Services, -%%% PO Box 6248, -%%% Providence, RI 02940, -%%% USA", -%%% email = "tech-support@ams.org", -%%% URL = "http://www.ams.org/", -%%% supported = "yes", -%%% keywords = "version, compatibility, dependencies, LaTeX", -%%% abstract = "This package provides a way for a LaTeX -%%% document to specify, for each external file -%%% on which the document depends, which version -%%% is required to guarantee output fidelity.", -%%% docstring = "The checksum field above contains a CRC-16 -%%% checksum as the first value, followed by the -%%% equivalent of the standard UNIX wc (word -%%% count) utility output of lines, words, and -%%% characters. This is produced by Robert -%%% Solovay's checksum utility.", -%%% } -%%% ==================================================================== -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{snapshot}[2002/03/05 v1.14] -\let\@xp\expandafter \let\@nx\noexpand -\newcommand{\RequireVersions}[2][]{% - \let\snap@check\snap@compare@versions - \let\snap@selfcheck\snap@selfcheck@a - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% -} -\@onlypreamble\RequireVersions -\def\snap@store@error#1{% - \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc -} -\@onlypreamble\snap@store@error -\def\snap@store@version #1#2#3#4{% - \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% -} -\@onlypreamble\snap@store@version -\def\@fmtextension{fmt} -\def\@tfmextension{tfm} -\edef\snapx@package{.\@pkgextension} -\edef\snapx@class{.\@clsextension} -\edef\snapx@format{.\@fmtextension} -\edef\snapx@tfm{.\@tfmextension} -\long\def\snapx@application{} -\let\snap@file=\@empty -\let\snapx@end\@@end -\def\snap@store@b#1#2#3#4{% - \ifx#1\snapx@end - \@xp\@gobblefour - \else - \ifx#1\relax \let#1\@empty\fi - \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% - \ifx#1\snapx@application - \else - \xdef\rqv@list{\rqv@list - \ifx\@empty\rqv@list\else,\fi - #3#1% - }% - \fi - \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% - \ifx#1\snapx@format \snap@check{#3.fmt}% - \else \snap@selfcheck{#3.sty}% - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\@onlypreamble\snap@store@b -\def\snap@write{\immediate\write\snap@out} -\let\snap@out\sixt@@n % fallback, probably never used -\DeclareOption{dep}{% - \def\snap@write{\immediate\write\snap@out}% -} -\DeclareOption{log}{% - \let\snap@write\typeout -} -\let\snap@fake@b\relax -\DeclareOption{test}{% - \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% -} -\DeclareOption{tfm}{% - \typeout{Option 'tfm' not implemented yet [1999/09/23]}% -} -\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} -\def\snap@mismatch{\snap@mismatch@warning} -\DeclareOption{error}{% - \def\snap@mismatch{\PackageError}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\DeclareOption{warning}{% - \def\snap@mismatch{\snap@mismatch@warning}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} -\let\snap@select\@empty -\DeclareOption{date}{% - \def\snap@select#1#2 #3\@nil{#1#2}% -} -\def\snap@select@version#1{% - \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi -} -\def\snap@sva#1.#2 #3\@nil{#1.#2} -\def\snap@select@major#1{% - \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi -} -\def\snap@svm#1.#2\@nil{#1} -\DeclareOption{version}{% - \def\snap@select#1#2 #3{\snap@select@version #3}% -} -\DeclareOption{major-version}{% - \def\snap@select#1#2 #3{\snap@select@major #3}% -} -\ProcessOptions\par -\edef\snap@restore@extensions{% - \def\@nx\@pkgextension{\@pkgextension}% - \def\@nx\@clsextension{\@clsextension}% -} -\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} -\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} -\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} -\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} -\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} -\def\snap@trim@c#1#2 #3\@nil{#2} -\let\rqv@list=\@empty -\edef\@tempc#1\fmtname{#1\fmtname}\@tempc -\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} -\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} -\if ?\@tempb?\@nil - \edef\@filelist{\fmtname.fmt,\@filelist}% - \def\@tempc{LaTeX2e}% - \@xp\edef\csname ver@\fmtname.fmt\endcsname{% - \fmtversion\space - v\ifx\@tempc\fmtname 2.e\else ?.?\fi - }% -\fi -\listfiles -\def\@dofilelist{% - \snap@restore@extensions - \ifx\rqv@list\@empty - \else \rqv@compare@lists - \fi - \ifx\snap@write\typeout - \else - \newwrite\snap@out - \immediate\openout\snap@out=\jobname.dep \relax - \fi - \snap@write{\string\RequireVersions\@charlb}% - \snap@write{\space\space *{application}{TeX}% - \space\space\space\space\space{1990/03/25 v3.x}}% - \@for\@currname:=\@filelist\do{% - \filename@parse\@currname - \ifx\filename@ext\relax - \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% - \def\@tempb{~~~}% - \else\ifx\filename@ext\@pkgextension - \def\@tempa{package}\let\@tempd\@empty - \def\@tempb{}% - \else\ifx\filename@ext\@clsextension - \def\@tempa{class}\let\@tempd\@empty - \def\@tempb{~~}% - \else\ifx\filename@ext\@fmtextension - \def\@tempa{format}\let\@tempd\@empty - \def\@tempb{~}% - \else\ifx\filename@ext\@tfmextension - \def\@tempa{tfm}\let\@tempd\@empty - \def\@tempb{~~~~}% - \else - \def\@tempa{file}\edef\@tempd{.\filename@ext}% - \def\@tempb{~~~}% - \fi\fi\fi\fi\fi - \@xp\let\@xp\@tempe - \csname ver@\filename@base.\filename@ext\endcsname - \ifx\@tempe\@empty \let\@tempe\relax \fi - \edef\@tempe{% - \ifx\@tempe\relax 0000/00/00 v0.0% - \else - \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil - \fi - }% - \edef\@tempc{\filename@area\filename@base\@tempd}% full file name - \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd - \begingroup \let~\space - \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% - \endgroup - }% - \snap@write{\@charrb}% - \ifx\snap@write\typeout - \else \immediate\closeout\snap@out - \typeout{Dependency list written on \jobname.dep.}% - \fi -}% -\def\rqv@condense#1,{% - \if ,#1,% - \else - \@xp\ifx\csname ver@#1\endcsname\N - \else - \edef\L{\L,#1}% - \@xp\let\csname ver@#1\endcsname=\N - \fi - \fi - \rqv@condense -} -\def\rqv@compare@lists{% - \begingroup - \def\N{1}\let\L=\@gobble - \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \let\rqv@list=\L - \let\L=\@gobble - \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space loaded though not in - \noexpand\RequireVersions list% - }\@ehc - }% - \def\N{2}\let\L=\@gobble - \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \let\L=\@gobble - \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space [\csname rqv@\@currname\endcsname] - required but not loaded% - }\@ehc - }% - \endgroup -} -\begingroup \catcode\endlinechar=12\relax % -\long\gdef\snap@ignoline#1 -{}\endgroup % -\def\snap@fake@input#1#2#3#4{% - \ifx#1\snapx@end - \aftergroup\@@end \@xp\@gobblefour - \else - \ifx#1\snapx@format - \else - \message{^^J}% - \@xp\snap@fake@b\@@input #3#1\relax - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\newcommand{\rqvTest}[2][]{% - \begingroup \catcode\endlinechar=12 - \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax - \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% - \endgroup -} -\@ifundefined{snap@fake@b}{}{% - \let\snap@store@b\snap@fake@input - \let\RequireVersions\rqvTest -} -\AtBeginDocument{% - \@ifundefined{ver@amsgen}{}{% - \@xp\let\csname ver@amsgen.sty\@xp\endcsname - \csname ver@amsgen\endcsname - }% -} -\let\snap@compare@versions\@gobble \let\snap@check\@gobble -\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble -\ifx\snap@select\@empty \endinput \fi -\begingroup \catcode`\.=11\relax -\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} -\gdef\snap@selfcheck@a#1{% - \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% - \rqv@snapshot.sty F\@nil - \snap@check{#1}% - \fi -} -\endgroup -\def\@nofmt#1.fmt.#2 {#1 } -\def\snap@mismatch@a#1#2#3{% - \snap@mismatch{snapshot}{^^J% - \space\space Required version #2 of \@nofmt#1.fmt. and^^J% - \space\space provided version #3 do not match% - }\@ehc -} -\def\snap@compare@versions#1{% - \begingroup - \@ifundefined{rqv@#1}{}{% - \edef\0{\csname rqv@#1\endcsname}% - \edef\1{\csname ver@#1\endcsname}% - \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% - \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% - \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% - \ifx\@tempa\@tempb - \else - \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% - \@xp\@tempd - \fi - }% - \endgroup -} -\def\ProvidesFile#1{% - \def\snap@checker{\snap@check{#1}}% - \begingroup - \aftergroup\snap@checker - \catcode`\ 10\catcode\endlinechar 10 % - \@makeother\/% - \@makeother\&% - \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% -} -\def\@pr@videpackage[#1]{% - \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% - \ifx\@currext\@clsextension - \typeout{Document Class: \@gtempa\space#1}% - \else - \wlog{Package: \@gtempa\space#1}% - \fi - \snap@check{\@currname.\@currext}% -} -\endinput -%% -%% End of file `snapshot.sty'. +%% +%% This is file `snapshot.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% snapshot.dtx +%% +%%% ==================================================================== +%%% @LaTeX-doc-source-file{ +%%% filename = "snapshot.dtx", +%%% version = "1.14", +%%% date = "2002/03/05", +%%% time = "15:29:00 EST", +%%% checksum = "39090 807 3449 29761", +%%% author = "American Mathematical Society", +%%% copyright = "Copyright 2001 American Mathematical Society, +%%% all rights reserved. Copying of this file is +%%% authorized only if either: +%%% (1) you make absolutely no changes to your copy, +%%% including name; OR +%%% (2) if you do make changes, you first rename it +%%% to some other name.", +%%% address = "American Mathematical Society, +%%% Electronic Products and Services, +%%% PO Box 6248, +%%% Providence, RI 02940, +%%% USA", +%%% email = "tech-support@ams.org", +%%% URL = "http://www.ams.org/", +%%% supported = "yes", +%%% keywords = "version, compatibility, dependencies, LaTeX", +%%% abstract = "This package provides a way for a LaTeX +%%% document to specify, for each external file +%%% on which the document depends, which version +%%% is required to guarantee output fidelity.", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{snapshot}[2002/03/05 v1.14] +\let\@xp\expandafter \let\@nx\noexpand +\newcommand{\RequireVersions}[2][]{% + \let\snap@check\snap@compare@versions + \let\snap@selfcheck\snap@selfcheck@a + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% +} +\@onlypreamble\RequireVersions +\def\snap@store@error#1{% + \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc +} +\@onlypreamble\snap@store@error +\def\snap@store@version #1#2#3#4{% + \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% +} +\@onlypreamble\snap@store@version +\def\@fmtextension{fmt} +\def\@tfmextension{tfm} +\edef\snapx@package{.\@pkgextension} +\edef\snapx@class{.\@clsextension} +\edef\snapx@format{.\@fmtextension} +\edef\snapx@tfm{.\@tfmextension} +\long\def\snapx@application{} +\let\snap@file=\@empty +\let\snapx@end\@@end +\def\snap@store@b#1#2#3#4{% + \ifx#1\snapx@end + \@xp\@gobblefour + \else + \ifx#1\relax \let#1\@empty\fi + \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% + \ifx#1\snapx@application + \else + \xdef\rqv@list{\rqv@list + \ifx\@empty\rqv@list\else,\fi + #3#1% + }% + \fi + \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% + \ifx#1\snapx@format \snap@check{#3.fmt}% + \else \snap@selfcheck{#3.sty}% + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\@onlypreamble\snap@store@b +\def\snap@write{\immediate\write\snap@out} +\let\snap@out\sixt@@n % fallback, probably never used +\DeclareOption{dep}{% + \def\snap@write{\immediate\write\snap@out}% +} +\DeclareOption{log}{% + \let\snap@write\typeout +} +\let\snap@fake@b\relax +\DeclareOption{test}{% + \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% +} +\DeclareOption{tfm}{% + \typeout{Option 'tfm' not implemented yet [1999/09/23]}% +} +\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} +\def\snap@mismatch{\snap@mismatch@warning} +\DeclareOption{error}{% + \def\snap@mismatch{\PackageError}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\DeclareOption{warning}{% + \def\snap@mismatch{\snap@mismatch@warning}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} +\let\snap@select\@empty +\DeclareOption{date}{% + \def\snap@select#1#2 #3\@nil{#1#2}% +} +\def\snap@select@version#1{% + \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi +} +\def\snap@sva#1.#2 #3\@nil{#1.#2} +\def\snap@select@major#1{% + \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi +} +\def\snap@svm#1.#2\@nil{#1} +\DeclareOption{version}{% + \def\snap@select#1#2 #3{\snap@select@version #3}% +} +\DeclareOption{major-version}{% + \def\snap@select#1#2 #3{\snap@select@major #3}% +} +\ProcessOptions\par +\edef\snap@restore@extensions{% + \def\@nx\@pkgextension{\@pkgextension}% + \def\@nx\@clsextension{\@clsextension}% +} +\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} +\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} +\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} +\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} +\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} +\def\snap@trim@c#1#2 #3\@nil{#2} +\let\rqv@list=\@empty +\edef\@tempc#1\fmtname{#1\fmtname}\@tempc +\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} +\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} +\if ?\@tempb?\@nil + \edef\@filelist{\fmtname.fmt,\@filelist}% + \def\@tempc{LaTeX2e}% + \@xp\edef\csname ver@\fmtname.fmt\endcsname{% + \fmtversion\space + v\ifx\@tempc\fmtname 2.e\else ?.?\fi + }% +\fi +\listfiles +\def\@dofilelist{% + \snap@restore@extensions + \ifx\rqv@list\@empty + \else \rqv@compare@lists + \fi + \ifx\snap@write\typeout + \else + \newwrite\snap@out + \immediate\openout\snap@out=\jobname.dep \relax + \fi + \snap@write{\string\RequireVersions\@charlb}% + \snap@write{\space\space *{application}{TeX}% + \space\space\space\space\space{1990/03/25 v3.x}}% + \@for\@currname:=\@filelist\do{% + \filename@parse\@currname + \ifx\filename@ext\relax + \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% + \def\@tempb{~~~}% + \else\ifx\filename@ext\@pkgextension + \def\@tempa{package}\let\@tempd\@empty + \def\@tempb{}% + \else\ifx\filename@ext\@clsextension + \def\@tempa{class}\let\@tempd\@empty + \def\@tempb{~~}% + \else\ifx\filename@ext\@fmtextension + \def\@tempa{format}\let\@tempd\@empty + \def\@tempb{~}% + \else\ifx\filename@ext\@tfmextension + \def\@tempa{tfm}\let\@tempd\@empty + \def\@tempb{~~~~}% + \else + \def\@tempa{file}\edef\@tempd{.\filename@ext}% + \def\@tempb{~~~}% + \fi\fi\fi\fi\fi + \@xp\let\@xp\@tempe + \csname ver@\filename@base.\filename@ext\endcsname + \ifx\@tempe\@empty \let\@tempe\relax \fi + \edef\@tempe{% + \ifx\@tempe\relax 0000/00/00 v0.0% + \else + \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil + \fi + }% + \edef\@tempc{\filename@area\filename@base\@tempd}% full file name + \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd + \begingroup \let~\space + \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% + \endgroup + }% + \snap@write{\@charrb}% + \ifx\snap@write\typeout + \else \immediate\closeout\snap@out + \typeout{Dependency list written on \jobname.dep.}% + \fi +}% +\def\rqv@condense#1,{% + \if ,#1,% + \else + \@xp\ifx\csname ver@#1\endcsname\N + \else + \edef\L{\L,#1}% + \@xp\let\csname ver@#1\endcsname=\N + \fi + \fi + \rqv@condense +} +\def\rqv@compare@lists{% + \begingroup + \def\N{1}\let\L=\@gobble + \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \let\rqv@list=\L + \let\L=\@gobble + \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space loaded though not in + \noexpand\RequireVersions list% + }\@ehc + }% + \def\N{2}\let\L=\@gobble + \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \let\L=\@gobble + \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space [\csname rqv@\@currname\endcsname] + required but not loaded% + }\@ehc + }% + \endgroup +} +\begingroup \catcode\endlinechar=12\relax % +\long\gdef\snap@ignoline#1 +{}\endgroup % +\def\snap@fake@input#1#2#3#4{% + \ifx#1\snapx@end + \aftergroup\@@end \@xp\@gobblefour + \else + \ifx#1\snapx@format + \else + \message{^^J}% + \@xp\snap@fake@b\@@input #3#1\relax + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\newcommand{\rqvTest}[2][]{% + \begingroup \catcode\endlinechar=12 + \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax + \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% + \endgroup +} +\@ifundefined{snap@fake@b}{}{% + \let\snap@store@b\snap@fake@input + \let\RequireVersions\rqvTest +} +\AtBeginDocument{% + \@ifundefined{ver@amsgen}{}{% + \@xp\let\csname ver@amsgen.sty\@xp\endcsname + \csname ver@amsgen\endcsname + }% +} +\let\snap@compare@versions\@gobble \let\snap@check\@gobble +\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble +\ifx\snap@select\@empty \endinput \fi +\begingroup \catcode`\.=11\relax +\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} +\gdef\snap@selfcheck@a#1{% + \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% + \rqv@snapshot.sty F\@nil + \snap@check{#1}% + \fi +} +\endgroup +\def\@nofmt#1.fmt.#2 {#1 } +\def\snap@mismatch@a#1#2#3{% + \snap@mismatch{snapshot}{^^J% + \space\space Required version #2 of \@nofmt#1.fmt. and^^J% + \space\space provided version #3 do not match% + }\@ehc +} +\def\snap@compare@versions#1{% + \begingroup + \@ifundefined{rqv@#1}{}{% + \edef\0{\csname rqv@#1\endcsname}% + \edef\1{\csname ver@#1\endcsname}% + \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% + \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% + \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% + \ifx\@tempa\@tempb + \else + \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% + \@xp\@tempd + \fi + }% + \endgroup +} +\def\ProvidesFile#1{% + \def\snap@checker{\snap@check{#1}}% + \begingroup + \aftergroup\snap@checker + \catcode`\ 10\catcode\endlinechar 10 % + \@makeother\/% + \@makeother\&% + \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% +} +\def\@pr@videpackage[#1]{% + \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% + \ifx\@currext\@clsextension + \typeout{Document Class: \@gtempa\space#1}% + \else + \wlog{Package: \@gtempa\space#1}% + \fi + \snap@check{\@currname.\@currext}% +} +\endinput +%% +%% End of file `snapshot.sty'. diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/pictureenv.4ht b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/pictureenv.4ht similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/pictureenv.4ht rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/pictureenv.4ht diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 b/docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 rename to docs/NARK/Resources/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/tex4htMakeCFG.sh b/docs/NARK/Resources/texmf-local/tex/latex/tex4htMakeCFG.sh old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/tex/latex/tex4htMakeCFG.sh rename to docs/NARK/Resources/texmf-local/tex/latex/tex4htMakeCFG.sh diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty b/docs/NARK/Resources/texmf-local/tex/latex/titlesec.sty similarity index 96% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty rename to docs/NARK/Resources/texmf-local/tex/latex/titlesec.sty index f588cad6a..fb7f24e2b 100644 --- a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty +++ b/docs/NARK/Resources/texmf-local/tex/latex/titlesec.sty @@ -1,1350 +1,1350 @@ -% +--------------------------------------------------+ -% | Typeset titlesec.tex to get the documentation. | -% +--------------------------------------------------+ -% -% Copyright (c) 1998-2016 by Javier Bezos. -% All Rights Reserved. -% -% This file is part of the titlesec distribution release 2.10.2 -% ----------------------------------------------------------- -% -% It may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2003/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainer of this work is Javier Bezos. -% -% Notes -% ~~~~~ -% -% The following tags are used: -% ttl@ : the generic tag used through the style -% ttlh@ : a shape definition -% ttlf@ : a macro containing the title format -% ttls@ : id. the title space -% ttlp@ : page key related macros -% ttll@ : level number -% -% The ttlf@ and ttls@ contains data in the form {..}{..}. -% Perhaps in future releases they should be converted -% to a prop-like list, similar to that proposed by the -% latex team. -% -% Admittedly, the current implementation seems too -% complicated, but that's necessary in order to provide -% certain compatibility with the sections as defined by the -% used class. Other packages opt for providing the sections -% as defined by standard classes ignoring the class; for -% instance sectsty which does a simple task in a simple and -% nice way. However, that was not my goal. -% -% Release -% ~~~~~~~ - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] - -% Initialization -% ~~~~~~~~~~~~~~ - -\newif\ifttl@ps -\ttl@psfalse - -% The \ttl@label switch is used when printing the label in titles. -% A numberless variant makes it to true. -% There is a \ttl@toclabel as well, which is true iff the -% title is numbered; used in toc entries (except default part -% and chapter) and marks (only in titlesec pagestyles). - -\newif\ifttl@label -\newif\ifttl@toclabel - -\newbox\ttl@box - -% A provision for the report style: - -\@ifundefined{if@mainmatter} - {\let\if@mainmatter\iftrue}{} - -\@ifundefined{if@openright} - {\let\if@openright\iftrue}{} - -% and the ams styles as well - -\@ifundefined{@chapapp} - {\let\@chapapp\chaptername}{} - -\def\ttl@trylist{\ttl@try{}} - -\def\ttl@getkeys#1#2{% - \if\expandafter @\@gobble#1@\@empty - \edef\ttl@b{\expandafter\@gobble\string#1}% - \let\ttl@a\ttl@b - \else - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlkeys.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \ttl@getkeys{#1}{#2}% - \fi} - -% A more meaningful error for \@notdefinable - -\expandafter\AtEndOfPackage\expandafter{\expandafter - \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} - -\def\@notdefinable{% - \PackageError{titlesec}% - {Incompatible package}% - {Titlesec cannot continue defining its own macros - because\MessageBreak - \@backslashchar\reserved@a\space is already used by other package, - the class\MessageBreak - or the document.}} - -% +-----------------+ -% | C L A S S E S | -% +-----------------+ - -\def\ttl@useclass#1#2{% - \@ifstar - {\ttl@labelfalse#1{#2}[]}% - {\ttl@labeltrue\@dblarg{#1{#2}}}} - -\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} -\def\ttl@partclass{\ttl@useclass\ttl@part@i} -\def\ttl@topclass{\ttl@useclass\ttl@top@i} -\def\ttl@pageclass{\ttl@useclass\ttl@page@i} - -% Here \scantokens is used to make sure the unescaped name -% has `letters' and no `others'. Mainly for hyperref, so there -% should be no problems. - -\newcommand\titleclass[1]{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \ifx\scantokens\@undefined\else - \scantokens\expandafter{\expandafter - \def\expandafter\ttl@a\expandafter{\ttl@a}}% - \fi - \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% - {\@tempswafalse\ttl@class@ii{#1}}} - -\def\ttl@class@i#1[#2]{% - \@namedef{ttll@\ttl@a}{#2}% - \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% - \@ifundefined{ttl@toplevel}{}% - {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@toplevel\endcsname}% - \edef\ttl@toplevel{\ttl@a}% - \ttl@class@ii{#1}} - -\def\ttl@class@ii#1#2{% - \@ifundefined{ttl@#2class}% - {\PackageError{titlesec}{Unknown sectioning class}% - {Valid names are top, page and straight}}% - {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax - \@ifundefined{\ttl@a mark}% - {\@namedef{\ttl@a mark}{\@gobble}}% - {}% - \edef#1{% - \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% - \if@tempswa - \expandafter\@gobble - \else - \expandafter\@firstofone - \fi - {\@ifnextchar[% - {\ttl@class@iii}% - {\@ifundefined{ttll@\ttl@a}% - {\PackageError{titlesec}{Unknown sectioning level}% - {\string\titleclass\space with no optional arguments\MessageBreak - only changes the class of an *existing* level}}}}} - -\def\ttl@class@iii[#1]{% - \edef\ttl@b{\expandafter\@gobble\string#1}% - \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@b\endcsname - \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% - \let\ttl@a\ttl@toplevel - \count@\csname ttll@\ttl@toplevel\endcsname - \ttl@class@iv} - -\def\ttl@class@iv{% - \@ifundefined{ttlss@\ttl@a}{}% - {\advance\count@\@ne - \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% - \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% - \ttl@class@iv}} - -% Typesetting Classes: General tools -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% The following command handles the *n spacing -% Some tricks are necessary to multiply a -% skip by a non integer number - -\newskip\beforetitleunit -\beforetitleunit=1ex\@plus.3ex\@minus.06ex -\newskip\aftertitleunit -\aftertitleunit=1ex\@plus.1ex - -\newdimen\ttl@plus -\newdimen\ttl@minus - -\def\ttl@assign#1{% - \@ifstar - {\ttl@assign@i{#1}}% - {\ttl@assign@d{#1}}} - -\def\ttl@assign@i#1#2\relax#3{% - \ttl@plus\z@ - \ttl@minus\z@ - \afterassignment\ttl@assign@ii - \dimen@\the#3, % <- space - #1 = #2\dimen@ - plus #2\ttl@plus - minus #2\ttl@minus} - -\def\ttl@assign@ii#1 {% <- space - \if#1,\else\afterassignment\ttl@assign@ii\fi - \csname ttl@\string#1\endcsname} - -\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} - -% To be used with \v/vspace to make them calc-savvy - -\def\ttl@calc#1#2{% - {\setlength\@tempskipa{#2}% - #1\@tempskipa}} - -\def\ttl@calcneg#1#2{% - {\setlength\@tempskipa{#2}% - #1{-\@tempskipa}}} - -% Gets from ttls@ and passes the spacing parameters: - -\def\ttl@startargs#1#2{% Get the first arguments, with the spacing - \@ifundefined{ttlp@#2}% - {\let\ttl@key@page\@empty}% - {\ttlp@fetch{#2}}% - \begingroup - \def\ttl@b{ttls@#2}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \xdef\ttl@b{\ttl@c}% - \endgroup - \ifx\ttl@b\@empty - \PackageError{titlesec}{Format/spacing not found}% - {I was unable to find the format corresponding to #2.\MessageBreak - Maybe you haven't set it with \string\titleformat\space and - \string\titlespacing} - \fi - \expandafter#1\ttl@b{#2}} - -% Used in ttl@select - -\def\ttl@savefn#1[#2]#3{% - \ifcase#1% - \footnotemark[#2]% - \gdef\ttl@fn{\footnotetext[#2]{#3}}% - \else - \footnotemark - \gdef\ttl@fn{\footnotetext{#3}}% - \fi} - -\def\ttl@nest@error{% - \PackageError{titlesec}{Nested titles}{Titles must not be nested}} - -\def\ttl@hmode@error{% - \PackageError{titlesec}{Entered in horizontal mode} - {The argument cannot contain horizontal material\MessageBreak - such as text, \string\noindent, \string\makebox, etc.}} - -% \ttl@select not only selects the right version to be -% used. It also take steps to ensure that a mark -% is not lost inside a box by saving it into \ttl@mk, -% which in turn is used by the sect and chap commands. - -\newif\ifttl@explicit - -\def\ttl@gmk#1{\gdef\ttl@mk{#1}} - -\def\ttl@select#1#2#3#4{% - \ttl@Hy@saveanchor - \global\let\ttl@mk\@empty % global because of rigidchapters - \global\let\ttl@fn\@empty - \begingroup - \if@inlabel\else % Keep item's \everypar - \everypar{\setbox\z@\lastbox\strut}% - \fi - \let\ttl@straight@i\ttl@nest@error - \let\ttl@top@i \ttl@nest@error - \let\ttl@part@i \ttl@nest@error - \let\ttl@page@i \ttl@nest@error - \let\ttl@newpage\newpage - \def\newpage{\ttl@savewrite\ttl@newpage}% - \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% - \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% - \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% - \def\footnote{\@ifnextchar[% - {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@b{ttlf@#1}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \ifttl@explicit - \def\ttl@passexplicit{\ttl@case{#4}}% - \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... - \else - \let\ttl@passexplicit\ttl@case - \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... - \fi - \endgroup} - -\let\ttl@savewrite\@empty - -\def\ttl@finmarks{% - \ttl@savewrite - \ttl@mk % Contains a possible mark, returned by \ttl@select - \ttl@fn} % And a footnote - -\def\ttl@try#1{% - \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} - \@ifundefined{\ttl@b\ttl@c}{}{% - \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% - \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% - #1% - \let\ttl@try\@gobble}} % locally modified to `break' testings - -% \ttl@write writes marks and toc. tocdepth is taken care of when -% the toc is typesetted and not here. Used always through -% ttl@savewrite, which is reset to \@empty to avoid duplicated -% calls. - -\def\ttl@write#1#2{% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% - \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a - \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a - \ttl@elinemarks - \global\ttl@toclabelfalse - \global\let\ttl@savewrite\@empty} - -\newif\ifttl@premark % to be used in ttlps.def -\ttl@premarkfalse - -\def\ttl@premark#1#2{% - \protected@xdef\ttl@prevmarks{\ttl@marks}% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \ttl@elinemarks - \gdef\ttl@prevmarks{\ttl@marks}} - -% Must be preceded by a default \ttl@savewrite, which is used -% in starred variants--\@empty in top and straight classes. -% In straight class, it is preceded by the setting of -% prev marks to provide a "fixed" top mark. Otherwise, -% the default prev mark (= curr mark) is used (restored -% after ttl@labelling in straight). This is the command -% to be hacked if you want to change the behaviour of -% starred variants. - -\def\ttl@labelling#1#2{% - \let\ttl@Hy@saveanchor\@empty - \ifttl@label % 1st - if star - \def\ttl@savewrite{\ttl@write{#1}{#2}}% - \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. - \ifttl@label % 2nd - eg, if not main matter - \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax - \ttl@labelfalse % 3rd - if too deep - \else - \ttl@Hy@refstepcounter{#1}% - \@nameuse{ttl@#1out}% - \fi - \fi - \fi - \let\ifttl@toclabel\ifttl@label - \ifx\ttl@savewrite\@empty\else % If marks - \ifttl@ps - \ifttl@premark - \global\ttl@premarkfalse - \else % if no \pretitlemark - \ttl@premark{#1}{#2}% - \fi - \fi - \ifttl@label\else\ttl@Hy@steplink{#1}\fi - \fi} - -% Executed by ttl@labelling if the name of section is chapter: - -\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} - -% Executed by ttl@labelling if chapter has a number. Note -% you can define messages for other sectioning levels (eg, -% \ttl@sectionout). - -\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} - -% Straight class -% ~~~~~~~~~~~~~ -% Default for nobottomtitles. Changed by nobottomtitles* - -\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} - -% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title -% The second argument of ttl@sect is the level, which -% is empty if the star version is used. In this case -% neither the toc nor the marks are written. - -\def\ttl@straight@i#1[#2]#3{% - \def\@currentlabelname{#2}% for nameref - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \gdef\thetitle{\csname the#1\endcsname}% - \if@noskipsec \leavevmode \fi - \par - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@straight@ii{#1}{#3}} - -% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title - -\def\ttl@straight@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in straight class ignored}}% - \if@nobreak - \ttl@titlespace{\@tempskipa}% - \else - \@ifundefined{#6break}% - {\addpenalty{\@secpenalty}}% - {\csname#6break\endcsname}% - \addvspace{\@tempskipa}% - \ifdim\bottomtitlespace<\z@ - \else - \begingroup - \@tempskipb\pagegoal - \@tempskipa\pagegoal - \ttl@addstretch % \relax if nobottomtitle* - \advance\@tempskipa-\bottomtitlespace\relax % not a register - \pagegoal\@tempskipa - \def\@textbottom{\vskip\z@\@plus.0001fil}% - \penalty9999 - \pagegoal\@tempskipb - \endgroup - \fi - \fi - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \if@noskipsec - \global\@nobreakfalse - \everypar{% - \if@noskipsec - \global\@noskipsecfalse - \clubpenalty\@M - \hskip-\parindent - \begingroup - \@svsechd\unskip{\hspace{\@tempskipb}}% - \endgroup - \else - \clubpenalty\@clubpenalty\everypar{}% - \fi}% - \else - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading - \fi - \ignorespaces} - -% Part class -% ~~~~~~~~~~ - -\providecommand\partmark[1]{\markboth{}{}} - -\def\ttl@part@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@part@ii{#1}{#3}} - -\def\ttl@part@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in part class ignored}}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse \fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading} - -% Page class -% ~~~~~~~~~~ - -\def\ttl@page@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@page@ii{#1}{#3}} - -\def\ttl@page@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \if@openright - \cleardoublepage - \else - \clearpage - \fi - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \if@twocolumn - \onecolumn - \@tempswatrue - \else - \@tempswafalse - \fi - \vspace*{\@tempskipa}% - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \vspace{\@tempskipb}% - \newpage - \if@twoside - \if@openright - \null - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{empty}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \newpage - \fi - \fi - \if@tempswa - \twocolumn - \fi - \ignorespaces} - -% Top class and some makechapterhead stuff -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% -% \ttl@mkchap is the new make(s)chapterhead. - -\def\ttl@mkchap#1#2#3#4#5#6#7{% - \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% - \let\ttl@savewrite\@empty - \let\ttl@Hy@saveanchor\@empty - \@ifundefined{ttl@ps@#6}{}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \let\ifttl@toclabel\ifttl@label - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} - -% But \ttl@mkchap@i is used by both makechapterhead and -% the top class. - -\def\ttl@mkchap@i#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@topmode{\@tempskipb}{% - \ttl@select{#6}{#1}{#2}{#7}}% - \ttl@finmarks % Outside the box! - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} - -\def\ttl@top@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@top@ii{#1}{#3}} - -\def\ttl@top@ii#1#2#3#4#5#6#7{% - \@ifundefined{#6break}% - {\if@openright - \cleardoublepage - \else - \clearpage - \fi}% - {\csname#6break\endcsname}% - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \global\@topnum\z@ - \@ifundefined{#6tolists}% - {\addtocontents{lof}{\protect\ttl@tocsep}% - \addtocontents{lot}{\protect\ttl@tocsep}} - {\@nameuse{#6tolists}}% - \if@twocolumn - \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% - \else - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% - \@afterheading - \fi - \ignorespaces} - - -% \def\ttl@noskipsectrue{% -% \if@noskipsec -% \PackageError{titlesec}{Invalid shape for top class}% -% {The selected shape only makes sense when merged into\MessageBreak -% a paragraph. That is impossible in the top class}% -% \else - -\newcommand\chaptertitlename{\@chapapp} -\def\ttl@tocsep{\addvspace{10\p@}} - -% +-----------------+ -% | S H A P E S | -% +-----------------+ -% -% % Reformatting Titles: Interface -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -% The surrounding space is stored in a macro -% named \ttls@
whose content is -% {left}{right}{before}{after}{afterindent}. -% But if there is the page key, the name is -% \ttls@
/ - -\newcommand\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} - -\def\ttl@spacing@i#1#2#3#4#5{% - \ttl@getkeys{#2}{titlesec}% - \@ifnextchar[{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}% - }{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} - -\def\ttl@spacing@ii#1#2#3#4[#5]{% - \expandafter\def\csname ttls@\ttl@a\endcsname - {{#2}{#5}{#3}{#4}{#1}}} - -% The section name is built in \ttl@a. -% The format is stored in a macro named \ttlf@
, -% or \ttlf@
/ if there is the page spec, -% or \ttlf@.../* if numberless is true -% whose content is -% \ttl@{format}{label}{sep}{before}{after} - -\newtoks\ttl@toksa - -\newcommand\titleformat{% - \@ifstar{\ttl@format@s}% - {\ttl@format@i}} - -\def\ttl@format@s#1#2{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \@ifundefined{ttlf@\ttl@a}% - {\PackageError{titlesec}{Not allowed in `easy' settings} - {The sectiong command you are trying to redefine\MessageBreak - is not handled by the starred variant (eg, \string\part)}}{} - \expandafter\expandafter\expandafter - \ttl@format@si\csname ttlf@\ttl@a \endcsname - {#2}} - -\def\ttl@format@si#1#2#3#4#5#6#7{% - \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} - -\def\ttl@format@i#1{% - \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} - -\def\ttl@format@ii#1[#2]#3#4#5#6{% - \ttl@getkeys{#1}{titlesec}% - \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments - \@ifnextchar[{% - \ttl@format@iii{#2}% - }{% - \ttl@format@iii{#2}[]}} - -% First, we get the shape -- if not defined it loads -% the corresponding file. - -\def\ttl@format@iii#1[#2]{% - \@ifundefined{ttlh@#1}{% - \begingroup - \makeatletter - \InputIfFileExists{#1.tss}{}{% - \PackageError{titlesec}{Unknown shape}% - {Shapes are defined in files with extension tss\MessageBreak - Either you have misspelled the shape\MessageBreak - or there is no a #1.tss file}}% - \endgroup}{}% - \@temptokena{#2}% - \ifttl@explicit - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \else - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \fi - \ttl@b - \csname ttl@compat\ttl@a\endcsname} - -% Styles -% ~~~~~~ - -% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title -% \ttl@ and \ttlh@ take the following eight -% arguments: -% {format}{label}{sep}{before}{after}{left}{right}{title} -% where before and after refer to the format. -% With the option explicit, #4 contains the title and #8 is -% empty. - -\def\ttlh@display#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \ifttl@label - {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% - \fi - #4{#8}% - \kern\z@\strut\@@par - \nobreak\ttl@midlongest#5\@@par - \ttl@endlongest} - -\def\ttlh@hang#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1{\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \begingroup - \ifttl@label - \noindent - \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% - \hangindent\wd\z@ - \box\z@ - \fi - #4{#8}% - \kern\z@\strut\@@par - \endgroup - \nobreak\ttl@midlongest#5\@@par}% - \ttl@endlongest} - -\def\ttlh@runin#1#2#3#4#5#6#7#8{% - \global\@noskipsectrue - \gdef\ttl@makeline##1{##1}% - \ttl@changecentercr - #1{\ifhmode\ttl@hmode@error\fi - \global\sbox\ttl@box{% - \ttl@calc\hspace{#6}% - \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi - #4{#8}#5\unskip}}% - \gdef\@svsechd{\unhbox\ttl@box}} - -% +-----------------+ -% | T O O L S | -% +-----------------+ -% -% calcwidth -% ~~~~~~~~~ -% Implemented after code from soul (but much modified...) - -\newdimen\titlewidth -\newdimen\titlewidthlast -\newdimen\titlewidthfirst - -\let\ttl@glcmds\relax -\let\ttl@beginlongest\@empty -\let\ttl@midlongest\@empty -\let\ttl@endlongest\@empty -\let\iftitlemeasuring\@secondoftwo - -\def\ttl@xbeginlongest#1\ttl@endlongest{% - \titlewidth\z@ - \titlewidthlast\z@ - \let\iftitlemeasuring\@firstoftwo - \setbox\ttl@box\vbox{% - \def\ttl@glcmds{% - \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% - {\@ifnextchar[{\ttl@bs}{\newline}}}% - \def\ttl@bs[####1]{\newline}% - \let\@centercr\\% - \def\ttl@midlongest####1\@@par{}% Very dirty... - \advance\rightskip 1\leftskip plus 1fil - \leftskip=\z@}% - #1}% - \let\iftitlemeasuring\@secondoftwo - \ttl@boxprocess - #1} - -\def\ttl@boxprocess{% - \setbox\ttl@box=\vbox{% - \unvcopy\ttl@box - \unskip\unpenalty - \global\setbox\@ne=\lastbox}% - \ifvoid\@ne - \else - \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% - \titlewidthfirst\wd\tw@ - \ifdim\titlewidth<\titlewidthfirst - \titlewidth\titlewidthfirst - \fi - \ifdim\titlewidthlast=\z@ - \titlewidthlast\titlewidthfirst - \fi - \expandafter\ttl@boxprocess - \fi} - -% Rules -% ~~~~~ - -\providecommand\titleline{% - \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% - {\ttl@line@i{}}} - -\def\ttl@line@i#1{% - \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} - -\def\ttl@line#1[#2]#3{% - \vskip\topskip - \hrule \@height \z@ - \nobreak - \vskip-\topskip - \begingroup - \parindent\z@ - \everypar{}% - \leftskip\z@ - \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: - \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% - \par - \endgroup - \hrule height \z@ - \nobreak} - -\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} - -\let\ttl@leaders\xleaders % For titletoc compatibility - -\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} -\def\ttl@row@i[#1]#2{% - \ifvmode\expandafter\titleline\fi - {\sbox\z@{#2}% - \ttl@calcneg\hspace{#1}% - \hskip\wd\z@ - \ttl@leaders\hb@xt@#1{\hss\box\z@}% - \hfill\kern\z@}} - -\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} -\def\ttl@rule@i[#1]{% - \ifvmode\expandafter\titleline\fi - {\leaders\hrule height #1\hfill\kern\z@}} - -% Par shapes and space -% ~~~~~~~~~~~~~~~~~~~~ - -\providecommand\filright{% - \gdef\ttl@filleft##1{\hskip##1}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \advance\rightskip\z@ \@plus 1fil\relax} -\providecommand\filleft{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hskip##1}% - \let\\\@centercr - \advance\leftskip\z@ \@plus 1fil - \parfillskip\z@} -\providecommand\filcenter{\filleft\filright - \gdef\ttl@filleft##1{\hfill}} -\providecommand\fillast{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \filleft\advance\rightskip\z@ \@plus -1fil - \parfillskip\z@ \@plus 2fil\relax} -\newcommand\filinner{% - \if@twoside - \ifodd\count\z@\filleft\else\filright\fi - \else - \filleft - \fi} -\newcommand\filouter{% - \if@twoside - \ifodd\count\z@\filright\else\filleft\fi - \else - \filright - \fi} - -\newcommand\wordsep{\fontdimen\tw@\font \@plus - \fontdimen\thr@@\font \@minus \fontdimen4\font} - -% +-----------------+ -% | O P T I O N S | -% +-----------------+ - - -\DeclareOption{pagestyles}{\let\sectiontitle\@empty} -\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} -\DeclareOption{floatps}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\space - \else - \PackageWarning{titlesec}{Ignoring `floatps' without - `pagestyles'. This option is now deprecated.}% - \fi} -\DeclareOption{psfloats}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\@empty - \else - \PackageWarning{titlesec}{Ignoring `psfloats' without - `pagestyles'}% - \fi} - -\DeclareOption{loadonly}{\let\ttl@extract\@empty} - -\DeclareOption{outermarks}{% - \def\ttl@titlemarks{\outertitlemarks}} -\DeclareOption{topmarks}{ - \def\ttl@titlemarks{\toptitlemarks}} -\DeclareOption{botmarks}{% - \def\ttl@titlemarks{\bottitlemarks}} -\DeclareOption{innermarks}{% - \def\ttl@titlemarks{\innertitlemarks}} - -\DeclareOption{footmarks}{} % Backward compat - -\DeclareOption{explicit}{\ttl@explicittrue} - -\DeclareOption{clearempty}{% - \def\cleardoublepage{% - \clearpage{\ps@empty\if@twoside\ifodd\c@page\else - \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} - -\DeclareOption{rigidchapters}{% - \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% - \def\ttl@chapafter{.26\textheight}} -\DeclareOption{rubberchapters}{% - \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% - \def\ttl@chapafter{40\p@}} - -\DeclareOption{bottomtitles}{% - \def\bottomtitlespace{-1\p@}} -\DeclareOption{nobottomtitles}{% - \def\bottomtitlespace{.2\textheight}} -\DeclareOption{nobottomtitles*}{% - \let\ttl@addstretch\relax - \def\bottomtitlespace{.2\textheight}} - -\DeclareOption{calcwidth}{% - \let\ttl@beginlongest\ttl@xbeginlongest} - -\DeclareOption{aftersep}{% - \let\ttl@titlespace\@gobble} -\DeclareOption{largestsep}{% - \let\ttl@titlespace\addvspace} - -\DeclareOption{oldparttoc}{% - \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} -\DeclareOption{newparttoc}{% - \let\ttl@tocpart\relax} -\DeclareOption{notocpart*}{% - \let\ttl@notocparts\@empty} - -\DeclareOption{rm}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} -\DeclareOption{sf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} -\DeclareOption{tt}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} -\DeclareOption{md}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} -\DeclareOption{bf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} -\DeclareOption{up}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} -\DeclareOption{it}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} -\DeclareOption{sl}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} -\DeclareOption{sc}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} - -\DeclareOption{big}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi}} -\DeclareOption{medium}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large - \or\normalsize\or\or\or\LARGE\fi}} -\DeclareOption{small}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large - \or\normalsize\or\normalsize\or\or\or\Large\fi}} -\DeclareOption{tiny}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or - \normalsize\or\normalsize\or\or\or\normalsize\fi}} - -\DeclareOption{raggedleft}{% - \gdef\ttl@fil{\filleft}} -\DeclareOption{center}{% - \gdef\ttl@fil{\filcenter}} -\DeclareOption{raggedright}{% - \gdef\ttl@fil{\filright}} - -\DeclareOption{uppercase}{% - \gdef\ttl@case{\MakeUppercase}} - -\DeclareOption{compact}{% - \gdef\ttl@space{1}% - \gdef\ttl@chapafter{30\p@}} - -% Deprecated. To be remmoved in a major upgrade (3.0) -\DeclareOption{indentfirst}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{nonindentfirst}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% New names -\DeclareOption{indentafter}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{noindentafter}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% newlinetospace -\let\ttl@blinemarks\relax -\let\ttl@elinemarks\relax - -\DeclareRobustCommand\ttl@linetosp{% - \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% - -\def\ttl@linetosp@i{% - \ifdim\lastskip>\z@\else\space\fi - \ignorespaces} - -\DeclareOption{newlinetospace}{% - \def\ttl@blinemarks{% - \let\ttl@e\\% - \def\\{\ttl@linetosp}}% - \def\ttl@elinemarks{\let\\\ttl@e}}% - -% toctitles -\def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% - \nobreak} - -\DeclareOption{toctitles}{% - \def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% - \nobreak}} - -% pageatnewline - -\def\ttl@changecentercr{% - \let\ttl@centercr\@centercr - \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} - -\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} - -\def\ttl@fonts{} - -\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% - innermarks} - -\ProcessOptions - -% +-----------------+ -% | H Y P E R R E F | -% +-----------------+ -% -% These two commands are provided by hyperref. But if they -% are not defined at \begin{document} hyperref has not been -% loaded or it is an old version. - -\AtBeginDocument{% - \ifx\ttl@Hy@steplink\@undefined - \let\ttl@Hy@steplink\@gobble - \let\ttl@Hy@refstepcounter\refstepcounter - \fi} - -% +-----------------+ -% | PAGE STYLES | -% +-----------------+ -% -% This is generic: - -\newcommand\assignpagestyle[2]{% - \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} - -% Old pagestyles -% ~~~~~~~~~~~~~~ - -\providecommand\newpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \newpagestyle} - -\providecommand\renewpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \renewpagestyle} - -\providecommand\widenhead{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \widenhead} - -% New pagestyles -% ~~~~~~~~~~~~~~ - -\@ifundefined{sectiontitle}{}{\input{ttlps.def}} - -% +-----------------+ -% | C O M P A T | -% +-----------------+ -% Easy setup, i.e., that of package options, is -% taken care of, if necessary. - -\renewcommand\secdef[2]{% - \@ifstar - {\ttl@labelfalse - #2} - {\ttl@labeltrue - \ifx#1\@chapter - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \else\ifx#1\@part - \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi - \fi\fi - \let\ifttl@toclabel\ifttl@label - \@dblarg{#1}}} - -\@ifundefined{ttl@extract}{}{\endinput} - -\newcommand\titlelabel[1]{% - \def\@seccntformat##1{#1}} - -\expandafter\ifx\csname chapter\endcsname\relax - - \def\ttl@compatpart{\titleclass{\part}{part}\relax} - -\else - - \def\ttl@compatchapter{% - \def\@makechapterhead{% - \ttl@labeltrue - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}% - \def\@makeschapterhead{% - \ttl@labelfalse - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}} - - \def\ttl@compatpart{\titleclass{\part}{page}\relax} - -\fi - -\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% - \@tempskipa=#5 - \@tempskipb=#6 - \ifdim\@tempskipa<\z@ - \toks@{\titlespacing*#8{#4}}% - \@tempskipa-\@tempskipa - \else - \toks@{\titlespacing#8{#4}}% - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% - \ifdim\@tempskipb<\z@ - \if@tempswa - \titleformat#8[runin]% - {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8[runin]% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@tempskipb-\@tempskipb - \else - \if@tempswa - \titleformat#8% - {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% - \fi - \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} - \ttl@a} - -\def\ttl@extract#1{% - \expandafter\in@\expandafter\@startsection\expandafter{#1}% - \ifin@ - \expandafter\ttl@@extract#1#1% - \else - \PackageWarningNoLine{titlesec}% - {Non standard sectioning command detected\MessageBreak - Using default spacing and no format} - \titlespacing*#1{\z@}{*3}{*2}% - \fi} - -\@tempswafalse - -\ifx\ttl@fonts\@empty - \def\ttl@fonts{\bfseries} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@sizes\endcsname\relax - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@fil\endcsname\relax - \let\ttl@fil\@empty -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@case\endcsname\relax - \let\ttl@case\@firstofone -\else - \@tempswatrue -\fi - -\if@tempswa - - \expandafter\ifx\csname chapter\endcsname\relax\else - \titleformat\chapter[display]% - {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} - {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} - \fi - -\fi - -\ttl@extract\section -\ttl@extract\subsection -\ttl@extract\subsubsection -\ttl@extract\paragraph -\ttl@extract\subparagraph - -\let\ttl@extract\@undefined -\let\ttl@@extract\@undefined - -\def\ttl@toplevel{part} - -\expandafter\ifx\csname chapter\endcsname\relax - - \@namedef{ttll@part}{0} - \titleclass{\section}{straight}[\part] - - \titlespacing*{\part} - {\z@} - {4ex} - {3ex} - -\else - - \let\ttl@save@mkchap\@makechapterhead - \let\ttl@save@mkschap\@makeschapterhead - - \def\@makechapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkchap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \def\@makeschapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkschap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \@namedef{ttll@part}{-1} - \@namedef{ttlss@part}{chapter} - \@namedef{ttll@chapter}{0} - \titleclass{\section}{straight}[\chapter] - -% The following is unoperant, unless when \chapter / \part -% format is redefined - - \titlespacing*{\part} - {\z@} - {\z@\@plus1fil} - {\z@\@plus1fil} - - \titlespacing*\chapter - {\z@}% - {50\p@}% - {\ttl@chapafter}% - -\fi - -\titleclass{\subsection} {straight}[\section] -\titleclass{\subsubsection}{straight}[\subsection] -\titleclass{\paragraph} {straight}[\subsubsection] -\titleclass{\subparagraph} {straight}[\paragraph] - -\endinput +% +--------------------------------------------------+ +% | Typeset titlesec.tex to get the documentation. | +% +--------------------------------------------------+ +% +% Copyright (c) 1998-2016 by Javier Bezos. +% All Rights Reserved. +% +% This file is part of the titlesec distribution release 2.10.2 +% ----------------------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is Javier Bezos. +% +% Notes +% ~~~~~ +% +% The following tags are used: +% ttl@ : the generic tag used through the style +% ttlh@ : a shape definition +% ttlf@ : a macro containing the title format +% ttls@ : id. the title space +% ttlp@ : page key related macros +% ttll@ : level number +% +% The ttlf@ and ttls@ contains data in the form {..}{..}. +% Perhaps in future releases they should be converted +% to a prop-like list, similar to that proposed by the +% latex team. +% +% Admittedly, the current implementation seems too +% complicated, but that's necessary in order to provide +% certain compatibility with the sections as defined by the +% used class. Other packages opt for providing the sections +% as defined by standard classes ignoring the class; for +% instance sectsty which does a simple task in a simple and +% nice way. However, that was not my goal. +% +% Release +% ~~~~~~~ + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] + +% Initialization +% ~~~~~~~~~~~~~~ + +\newif\ifttl@ps +\ttl@psfalse + +% The \ttl@label switch is used when printing the label in titles. +% A numberless variant makes it to true. +% There is a \ttl@toclabel as well, which is true iff the +% title is numbered; used in toc entries (except default part +% and chapter) and marks (only in titlesec pagestyles). + +\newif\ifttl@label +\newif\ifttl@toclabel + +\newbox\ttl@box + +% A provision for the report style: + +\@ifundefined{if@mainmatter} + {\let\if@mainmatter\iftrue}{} + +\@ifundefined{if@openright} + {\let\if@openright\iftrue}{} + +% and the ams styles as well + +\@ifundefined{@chapapp} + {\let\@chapapp\chaptername}{} + +\def\ttl@trylist{\ttl@try{}} + +\def\ttl@getkeys#1#2{% + \if\expandafter @\@gobble#1@\@empty + \edef\ttl@b{\expandafter\@gobble\string#1}% + \let\ttl@a\ttl@b + \else + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlkeys.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \ttl@getkeys{#1}{#2}% + \fi} + +% A more meaningful error for \@notdefinable + +\expandafter\AtEndOfPackage\expandafter{\expandafter + \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} + +\def\@notdefinable{% + \PackageError{titlesec}% + {Incompatible package}% + {Titlesec cannot continue defining its own macros + because\MessageBreak + \@backslashchar\reserved@a\space is already used by other package, + the class\MessageBreak + or the document.}} + +% +-----------------+ +% | C L A S S E S | +% +-----------------+ + +\def\ttl@useclass#1#2{% + \@ifstar + {\ttl@labelfalse#1{#2}[]}% + {\ttl@labeltrue\@dblarg{#1{#2}}}} + +\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} +\def\ttl@partclass{\ttl@useclass\ttl@part@i} +\def\ttl@topclass{\ttl@useclass\ttl@top@i} +\def\ttl@pageclass{\ttl@useclass\ttl@page@i} + +% Here \scantokens is used to make sure the unescaped name +% has `letters' and no `others'. Mainly for hyperref, so there +% should be no problems. + +\newcommand\titleclass[1]{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \ifx\scantokens\@undefined\else + \scantokens\expandafter{\expandafter + \def\expandafter\ttl@a\expandafter{\ttl@a}}% + \fi + \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% + {\@tempswafalse\ttl@class@ii{#1}}} + +\def\ttl@class@i#1[#2]{% + \@namedef{ttll@\ttl@a}{#2}% + \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% + \@ifundefined{ttl@toplevel}{}% + {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@toplevel\endcsname}% + \edef\ttl@toplevel{\ttl@a}% + \ttl@class@ii{#1}} + +\def\ttl@class@ii#1#2{% + \@ifundefined{ttl@#2class}% + {\PackageError{titlesec}{Unknown sectioning class}% + {Valid names are top, page and straight}}% + {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax + \@ifundefined{\ttl@a mark}% + {\@namedef{\ttl@a mark}{\@gobble}}% + {}% + \edef#1{% + \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% + \if@tempswa + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {\@ifnextchar[% + {\ttl@class@iii}% + {\@ifundefined{ttll@\ttl@a}% + {\PackageError{titlesec}{Unknown sectioning level}% + {\string\titleclass\space with no optional arguments\MessageBreak + only changes the class of an *existing* level}}}}} + +\def\ttl@class@iii[#1]{% + \edef\ttl@b{\expandafter\@gobble\string#1}% + \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@b\endcsname + \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% + \let\ttl@a\ttl@toplevel + \count@\csname ttll@\ttl@toplevel\endcsname + \ttl@class@iv} + +\def\ttl@class@iv{% + \@ifundefined{ttlss@\ttl@a}{}% + {\advance\count@\@ne + \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% + \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% + \ttl@class@iv}} + +% Typesetting Classes: General tools +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% The following command handles the *n spacing +% Some tricks are necessary to multiply a +% skip by a non integer number + +\newskip\beforetitleunit +\beforetitleunit=1ex\@plus.3ex\@minus.06ex +\newskip\aftertitleunit +\aftertitleunit=1ex\@plus.1ex + +\newdimen\ttl@plus +\newdimen\ttl@minus + +\def\ttl@assign#1{% + \@ifstar + {\ttl@assign@i{#1}}% + {\ttl@assign@d{#1}}} + +\def\ttl@assign@i#1#2\relax#3{% + \ttl@plus\z@ + \ttl@minus\z@ + \afterassignment\ttl@assign@ii + \dimen@\the#3, % <- space + #1 = #2\dimen@ + plus #2\ttl@plus + minus #2\ttl@minus} + +\def\ttl@assign@ii#1 {% <- space + \if#1,\else\afterassignment\ttl@assign@ii\fi + \csname ttl@\string#1\endcsname} + +\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} + +% To be used with \v/vspace to make them calc-savvy + +\def\ttl@calc#1#2{% + {\setlength\@tempskipa{#2}% + #1\@tempskipa}} + +\def\ttl@calcneg#1#2{% + {\setlength\@tempskipa{#2}% + #1{-\@tempskipa}}} + +% Gets from ttls@ and passes the spacing parameters: + +\def\ttl@startargs#1#2{% Get the first arguments, with the spacing + \@ifundefined{ttlp@#2}% + {\let\ttl@key@page\@empty}% + {\ttlp@fetch{#2}}% + \begingroup + \def\ttl@b{ttls@#2}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \xdef\ttl@b{\ttl@c}% + \endgroup + \ifx\ttl@b\@empty + \PackageError{titlesec}{Format/spacing not found}% + {I was unable to find the format corresponding to #2.\MessageBreak + Maybe you haven't set it with \string\titleformat\space and + \string\titlespacing} + \fi + \expandafter#1\ttl@b{#2}} + +% Used in ttl@select + +\def\ttl@savefn#1[#2]#3{% + \ifcase#1% + \footnotemark[#2]% + \gdef\ttl@fn{\footnotetext[#2]{#3}}% + \else + \footnotemark + \gdef\ttl@fn{\footnotetext{#3}}% + \fi} + +\def\ttl@nest@error{% + \PackageError{titlesec}{Nested titles}{Titles must not be nested}} + +\def\ttl@hmode@error{% + \PackageError{titlesec}{Entered in horizontal mode} + {The argument cannot contain horizontal material\MessageBreak + such as text, \string\noindent, \string\makebox, etc.}} + +% \ttl@select not only selects the right version to be +% used. It also take steps to ensure that a mark +% is not lost inside a box by saving it into \ttl@mk, +% which in turn is used by the sect and chap commands. + +\newif\ifttl@explicit + +\def\ttl@gmk#1{\gdef\ttl@mk{#1}} + +\def\ttl@select#1#2#3#4{% + \ttl@Hy@saveanchor + \global\let\ttl@mk\@empty % global because of rigidchapters + \global\let\ttl@fn\@empty + \begingroup + \if@inlabel\else % Keep item's \everypar + \everypar{\setbox\z@\lastbox\strut}% + \fi + \let\ttl@straight@i\ttl@nest@error + \let\ttl@top@i \ttl@nest@error + \let\ttl@part@i \ttl@nest@error + \let\ttl@page@i \ttl@nest@error + \let\ttl@newpage\newpage + \def\newpage{\ttl@savewrite\ttl@newpage}% + \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% + \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% + \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% + \def\footnote{\@ifnextchar[% + {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@b{ttlf@#1}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \ifttl@explicit + \def\ttl@passexplicit{\ttl@case{#4}}% + \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... + \else + \let\ttl@passexplicit\ttl@case + \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... + \fi + \endgroup} + +\let\ttl@savewrite\@empty + +\def\ttl@finmarks{% + \ttl@savewrite + \ttl@mk % Contains a possible mark, returned by \ttl@select + \ttl@fn} % And a footnote + +\def\ttl@try#1{% + \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} + \@ifundefined{\ttl@b\ttl@c}{}{% + \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% + \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% + #1% + \let\ttl@try\@gobble}} % locally modified to `break' testings + +% \ttl@write writes marks and toc. tocdepth is taken care of when +% the toc is typesetted and not here. Used always through +% ttl@savewrite, which is reset to \@empty to avoid duplicated +% calls. + +\def\ttl@write#1#2{% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% + \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a + \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a + \ttl@elinemarks + \global\ttl@toclabelfalse + \global\let\ttl@savewrite\@empty} + +\newif\ifttl@premark % to be used in ttlps.def +\ttl@premarkfalse + +\def\ttl@premark#1#2{% + \protected@xdef\ttl@prevmarks{\ttl@marks}% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \ttl@elinemarks + \gdef\ttl@prevmarks{\ttl@marks}} + +% Must be preceded by a default \ttl@savewrite, which is used +% in starred variants--\@empty in top and straight classes. +% In straight class, it is preceded by the setting of +% prev marks to provide a "fixed" top mark. Otherwise, +% the default prev mark (= curr mark) is used (restored +% after ttl@labelling in straight). This is the command +% to be hacked if you want to change the behaviour of +% starred variants. + +\def\ttl@labelling#1#2{% + \let\ttl@Hy@saveanchor\@empty + \ifttl@label % 1st - if star + \def\ttl@savewrite{\ttl@write{#1}{#2}}% + \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. + \ifttl@label % 2nd - eg, if not main matter + \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax + \ttl@labelfalse % 3rd - if too deep + \else + \ttl@Hy@refstepcounter{#1}% + \@nameuse{ttl@#1out}% + \fi + \fi + \fi + \let\ifttl@toclabel\ifttl@label + \ifx\ttl@savewrite\@empty\else % If marks + \ifttl@ps + \ifttl@premark + \global\ttl@premarkfalse + \else % if no \pretitlemark + \ttl@premark{#1}{#2}% + \fi + \fi + \ifttl@label\else\ttl@Hy@steplink{#1}\fi + \fi} + +% Executed by ttl@labelling if the name of section is chapter: + +\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} + +% Executed by ttl@labelling if chapter has a number. Note +% you can define messages for other sectioning levels (eg, +% \ttl@sectionout). + +\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} + +% Straight class +% ~~~~~~~~~~~~~ +% Default for nobottomtitles. Changed by nobottomtitles* + +\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} + +% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title +% The second argument of ttl@sect is the level, which +% is empty if the star version is used. In this case +% neither the toc nor the marks are written. + +\def\ttl@straight@i#1[#2]#3{% + \def\@currentlabelname{#2}% for nameref + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \gdef\thetitle{\csname the#1\endcsname}% + \if@noskipsec \leavevmode \fi + \par + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@straight@ii{#1}{#3}} + +% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title + +\def\ttl@straight@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in straight class ignored}}% + \if@nobreak + \ttl@titlespace{\@tempskipa}% + \else + \@ifundefined{#6break}% + {\addpenalty{\@secpenalty}}% + {\csname#6break\endcsname}% + \addvspace{\@tempskipa}% + \ifdim\bottomtitlespace<\z@ + \else + \begingroup + \@tempskipb\pagegoal + \@tempskipa\pagegoal + \ttl@addstretch % \relax if nobottomtitle* + \advance\@tempskipa-\bottomtitlespace\relax % not a register + \pagegoal\@tempskipa + \def\@textbottom{\vskip\z@\@plus.0001fil}% + \penalty9999 + \pagegoal\@tempskipb + \endgroup + \fi + \fi + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \if@noskipsec + \global\@nobreakfalse + \everypar{% + \if@noskipsec + \global\@noskipsecfalse + \clubpenalty\@M + \hskip-\parindent + \begingroup + \@svsechd\unskip{\hspace{\@tempskipb}}% + \endgroup + \else + \clubpenalty\@clubpenalty\everypar{}% + \fi}% + \else + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading + \fi + \ignorespaces} + +% Part class +% ~~~~~~~~~~ + +\providecommand\partmark[1]{\markboth{}{}} + +\def\ttl@part@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@part@ii{#1}{#3}} + +\def\ttl@part@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in part class ignored}}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse \fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading} + +% Page class +% ~~~~~~~~~~ + +\def\ttl@page@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@page@ii{#1}{#3}} + +\def\ttl@page@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi + \vspace*{\@tempskipa}% + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \vspace{\@tempskipb}% + \newpage + \if@twoside + \if@openright + \null + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{empty}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \newpage + \fi + \fi + \if@tempswa + \twocolumn + \fi + \ignorespaces} + +% Top class and some makechapterhead stuff +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% +% \ttl@mkchap is the new make(s)chapterhead. + +\def\ttl@mkchap#1#2#3#4#5#6#7{% + \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% + \let\ttl@savewrite\@empty + \let\ttl@Hy@saveanchor\@empty + \@ifundefined{ttl@ps@#6}{}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \let\ifttl@toclabel\ifttl@label + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} + +% But \ttl@mkchap@i is used by both makechapterhead and +% the top class. + +\def\ttl@mkchap@i#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@topmode{\@tempskipb}{% + \ttl@select{#6}{#1}{#2}{#7}}% + \ttl@finmarks % Outside the box! + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} + +\def\ttl@top@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@top@ii{#1}{#3}} + +\def\ttl@top@ii#1#2#3#4#5#6#7{% + \@ifundefined{#6break}% + {\if@openright + \cleardoublepage + \else + \clearpage + \fi}% + {\csname#6break\endcsname}% + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \global\@topnum\z@ + \@ifundefined{#6tolists}% + {\addtocontents{lof}{\protect\ttl@tocsep}% + \addtocontents{lot}{\protect\ttl@tocsep}} + {\@nameuse{#6tolists}}% + \if@twocolumn + \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% + \else + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \@afterheading + \fi + \ignorespaces} + + +% \def\ttl@noskipsectrue{% +% \if@noskipsec +% \PackageError{titlesec}{Invalid shape for top class}% +% {The selected shape only makes sense when merged into\MessageBreak +% a paragraph. That is impossible in the top class}% +% \else + +\newcommand\chaptertitlename{\@chapapp} +\def\ttl@tocsep{\addvspace{10\p@}} + +% +-----------------+ +% | S H A P E S | +% +-----------------+ +% +% % Reformatting Titles: Interface +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +% The surrounding space is stored in a macro +% named \ttls@
whose content is +% {left}{right}{before}{after}{afterindent}. +% But if there is the page key, the name is +% \ttls@
/ + +\newcommand\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} + +\def\ttl@spacing@i#1#2#3#4#5{% + \ttl@getkeys{#2}{titlesec}% + \@ifnextchar[{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}% + }{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} + +\def\ttl@spacing@ii#1#2#3#4[#5]{% + \expandafter\def\csname ttls@\ttl@a\endcsname + {{#2}{#5}{#3}{#4}{#1}}} + +% The section name is built in \ttl@a. +% The format is stored in a macro named \ttlf@
, +% or \ttlf@
/ if there is the page spec, +% or \ttlf@.../* if numberless is true +% whose content is +% \ttl@{format}{label}{sep}{before}{after} + +\newtoks\ttl@toksa + +\newcommand\titleformat{% + \@ifstar{\ttl@format@s}% + {\ttl@format@i}} + +\def\ttl@format@s#1#2{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \@ifundefined{ttlf@\ttl@a}% + {\PackageError{titlesec}{Not allowed in `easy' settings} + {The sectiong command you are trying to redefine\MessageBreak + is not handled by the starred variant (eg, \string\part)}}{} + \expandafter\expandafter\expandafter + \ttl@format@si\csname ttlf@\ttl@a \endcsname + {#2}} + +\def\ttl@format@si#1#2#3#4#5#6#7{% + \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} + +\def\ttl@format@i#1{% + \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} + +\def\ttl@format@ii#1[#2]#3#4#5#6{% + \ttl@getkeys{#1}{titlesec}% + \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments + \@ifnextchar[{% + \ttl@format@iii{#2}% + }{% + \ttl@format@iii{#2}[]}} + +% First, we get the shape -- if not defined it loads +% the corresponding file. + +\def\ttl@format@iii#1[#2]{% + \@ifundefined{ttlh@#1}{% + \begingroup + \makeatletter + \InputIfFileExists{#1.tss}{}{% + \PackageError{titlesec}{Unknown shape}% + {Shapes are defined in files with extension tss\MessageBreak + Either you have misspelled the shape\MessageBreak + or there is no a #1.tss file}}% + \endgroup}{}% + \@temptokena{#2}% + \ifttl@explicit + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \else + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \fi + \ttl@b + \csname ttl@compat\ttl@a\endcsname} + +% Styles +% ~~~~~~ + +% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title +% \ttl@ and \ttlh@ take the following eight +% arguments: +% {format}{label}{sep}{before}{after}{left}{right}{title} +% where before and after refer to the format. +% With the option explicit, #4 contains the title and #8 is +% empty. + +\def\ttlh@display#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \ifttl@label + {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% + \fi + #4{#8}% + \kern\z@\strut\@@par + \nobreak\ttl@midlongest#5\@@par + \ttl@endlongest} + +\def\ttlh@hang#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1{\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \begingroup + \ifttl@label + \noindent + \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% + \hangindent\wd\z@ + \box\z@ + \fi + #4{#8}% + \kern\z@\strut\@@par + \endgroup + \nobreak\ttl@midlongest#5\@@par}% + \ttl@endlongest} + +\def\ttlh@runin#1#2#3#4#5#6#7#8{% + \global\@noskipsectrue + \gdef\ttl@makeline##1{##1}% + \ttl@changecentercr + #1{\ifhmode\ttl@hmode@error\fi + \global\sbox\ttl@box{% + \ttl@calc\hspace{#6}% + \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi + #4{#8}#5\unskip}}% + \gdef\@svsechd{\unhbox\ttl@box}} + +% +-----------------+ +% | T O O L S | +% +-----------------+ +% +% calcwidth +% ~~~~~~~~~ +% Implemented after code from soul (but much modified...) + +\newdimen\titlewidth +\newdimen\titlewidthlast +\newdimen\titlewidthfirst + +\let\ttl@glcmds\relax +\let\ttl@beginlongest\@empty +\let\ttl@midlongest\@empty +\let\ttl@endlongest\@empty +\let\iftitlemeasuring\@secondoftwo + +\def\ttl@xbeginlongest#1\ttl@endlongest{% + \titlewidth\z@ + \titlewidthlast\z@ + \let\iftitlemeasuring\@firstoftwo + \setbox\ttl@box\vbox{% + \def\ttl@glcmds{% + \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% + {\@ifnextchar[{\ttl@bs}{\newline}}}% + \def\ttl@bs[####1]{\newline}% + \let\@centercr\\% + \def\ttl@midlongest####1\@@par{}% Very dirty... + \advance\rightskip 1\leftskip plus 1fil + \leftskip=\z@}% + #1}% + \let\iftitlemeasuring\@secondoftwo + \ttl@boxprocess + #1} + +\def\ttl@boxprocess{% + \setbox\ttl@box=\vbox{% + \unvcopy\ttl@box + \unskip\unpenalty + \global\setbox\@ne=\lastbox}% + \ifvoid\@ne + \else + \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% + \titlewidthfirst\wd\tw@ + \ifdim\titlewidth<\titlewidthfirst + \titlewidth\titlewidthfirst + \fi + \ifdim\titlewidthlast=\z@ + \titlewidthlast\titlewidthfirst + \fi + \expandafter\ttl@boxprocess + \fi} + +% Rules +% ~~~~~ + +\providecommand\titleline{% + \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% + {\ttl@line@i{}}} + +\def\ttl@line@i#1{% + \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} + +\def\ttl@line#1[#2]#3{% + \vskip\topskip + \hrule \@height \z@ + \nobreak + \vskip-\topskip + \begingroup + \parindent\z@ + \everypar{}% + \leftskip\z@ + \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: + \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% + \par + \endgroup + \hrule height \z@ + \nobreak} + +\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} + +\let\ttl@leaders\xleaders % For titletoc compatibility + +\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} +\def\ttl@row@i[#1]#2{% + \ifvmode\expandafter\titleline\fi + {\sbox\z@{#2}% + \ttl@calcneg\hspace{#1}% + \hskip\wd\z@ + \ttl@leaders\hb@xt@#1{\hss\box\z@}% + \hfill\kern\z@}} + +\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} +\def\ttl@rule@i[#1]{% + \ifvmode\expandafter\titleline\fi + {\leaders\hrule height #1\hfill\kern\z@}} + +% Par shapes and space +% ~~~~~~~~~~~~~~~~~~~~ + +\providecommand\filright{% + \gdef\ttl@filleft##1{\hskip##1}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \advance\rightskip\z@ \@plus 1fil\relax} +\providecommand\filleft{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hskip##1}% + \let\\\@centercr + \advance\leftskip\z@ \@plus 1fil + \parfillskip\z@} +\providecommand\filcenter{\filleft\filright + \gdef\ttl@filleft##1{\hfill}} +\providecommand\fillast{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \filleft\advance\rightskip\z@ \@plus -1fil + \parfillskip\z@ \@plus 2fil\relax} +\newcommand\filinner{% + \if@twoside + \ifodd\count\z@\filleft\else\filright\fi + \else + \filleft + \fi} +\newcommand\filouter{% + \if@twoside + \ifodd\count\z@\filright\else\filleft\fi + \else + \filright + \fi} + +\newcommand\wordsep{\fontdimen\tw@\font \@plus + \fontdimen\thr@@\font \@minus \fontdimen4\font} + +% +-----------------+ +% | O P T I O N S | +% +-----------------+ + + +\DeclareOption{pagestyles}{\let\sectiontitle\@empty} +\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} +\DeclareOption{floatps}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\space + \else + \PackageWarning{titlesec}{Ignoring `floatps' without + `pagestyles'. This option is now deprecated.}% + \fi} +\DeclareOption{psfloats}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\@empty + \else + \PackageWarning{titlesec}{Ignoring `psfloats' without + `pagestyles'}% + \fi} + +\DeclareOption{loadonly}{\let\ttl@extract\@empty} + +\DeclareOption{outermarks}{% + \def\ttl@titlemarks{\outertitlemarks}} +\DeclareOption{topmarks}{ + \def\ttl@titlemarks{\toptitlemarks}} +\DeclareOption{botmarks}{% + \def\ttl@titlemarks{\bottitlemarks}} +\DeclareOption{innermarks}{% + \def\ttl@titlemarks{\innertitlemarks}} + +\DeclareOption{footmarks}{} % Backward compat + +\DeclareOption{explicit}{\ttl@explicittrue} + +\DeclareOption{clearempty}{% + \def\cleardoublepage{% + \clearpage{\ps@empty\if@twoside\ifodd\c@page\else + \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} + +\DeclareOption{rigidchapters}{% + \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% + \def\ttl@chapafter{.26\textheight}} +\DeclareOption{rubberchapters}{% + \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% + \def\ttl@chapafter{40\p@}} + +\DeclareOption{bottomtitles}{% + \def\bottomtitlespace{-1\p@}} +\DeclareOption{nobottomtitles}{% + \def\bottomtitlespace{.2\textheight}} +\DeclareOption{nobottomtitles*}{% + \let\ttl@addstretch\relax + \def\bottomtitlespace{.2\textheight}} + +\DeclareOption{calcwidth}{% + \let\ttl@beginlongest\ttl@xbeginlongest} + +\DeclareOption{aftersep}{% + \let\ttl@titlespace\@gobble} +\DeclareOption{largestsep}{% + \let\ttl@titlespace\addvspace} + +\DeclareOption{oldparttoc}{% + \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} +\DeclareOption{newparttoc}{% + \let\ttl@tocpart\relax} +\DeclareOption{notocpart*}{% + \let\ttl@notocparts\@empty} + +\DeclareOption{rm}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} +\DeclareOption{sf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} +\DeclareOption{tt}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} +\DeclareOption{md}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} +\DeclareOption{bf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} +\DeclareOption{up}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} +\DeclareOption{it}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} +\DeclareOption{sl}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} +\DeclareOption{sc}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} + +\DeclareOption{big}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi}} +\DeclareOption{medium}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large + \or\normalsize\or\or\or\LARGE\fi}} +\DeclareOption{small}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large + \or\normalsize\or\normalsize\or\or\or\Large\fi}} +\DeclareOption{tiny}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or + \normalsize\or\normalsize\or\or\or\normalsize\fi}} + +\DeclareOption{raggedleft}{% + \gdef\ttl@fil{\filleft}} +\DeclareOption{center}{% + \gdef\ttl@fil{\filcenter}} +\DeclareOption{raggedright}{% + \gdef\ttl@fil{\filright}} + +\DeclareOption{uppercase}{% + \gdef\ttl@case{\MakeUppercase}} + +\DeclareOption{compact}{% + \gdef\ttl@space{1}% + \gdef\ttl@chapafter{30\p@}} + +% Deprecated. To be remmoved in a major upgrade (3.0) +\DeclareOption{indentfirst}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{nonindentfirst}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% New names +\DeclareOption{indentafter}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{noindentafter}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% newlinetospace +\let\ttl@blinemarks\relax +\let\ttl@elinemarks\relax + +\DeclareRobustCommand\ttl@linetosp{% + \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% + +\def\ttl@linetosp@i{% + \ifdim\lastskip>\z@\else\space\fi + \ignorespaces} + +\DeclareOption{newlinetospace}{% + \def\ttl@blinemarks{% + \let\ttl@e\\% + \def\\{\ttl@linetosp}}% + \def\ttl@elinemarks{\let\\\ttl@e}}% + +% toctitles +\def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% + \nobreak} + +\DeclareOption{toctitles}{% + \def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% + \nobreak}} + +% pageatnewline + +\def\ttl@changecentercr{% + \let\ttl@centercr\@centercr + \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} + +\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} + +\def\ttl@fonts{} + +\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% + innermarks} + +\ProcessOptions + +% +-----------------+ +% | H Y P E R R E F | +% +-----------------+ +% +% These two commands are provided by hyperref. But if they +% are not defined at \begin{document} hyperref has not been +% loaded or it is an old version. + +\AtBeginDocument{% + \ifx\ttl@Hy@steplink\@undefined + \let\ttl@Hy@steplink\@gobble + \let\ttl@Hy@refstepcounter\refstepcounter + \fi} + +% +-----------------+ +% | PAGE STYLES | +% +-----------------+ +% +% This is generic: + +\newcommand\assignpagestyle[2]{% + \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} + +% Old pagestyles +% ~~~~~~~~~~~~~~ + +\providecommand\newpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \newpagestyle} + +\providecommand\renewpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \renewpagestyle} + +\providecommand\widenhead{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \widenhead} + +% New pagestyles +% ~~~~~~~~~~~~~~ + +\@ifundefined{sectiontitle}{}{\input{ttlps.def}} + +% +-----------------+ +% | C O M P A T | +% +-----------------+ +% Easy setup, i.e., that of package options, is +% taken care of, if necessary. + +\renewcommand\secdef[2]{% + \@ifstar + {\ttl@labelfalse + #2} + {\ttl@labeltrue + \ifx#1\@chapter + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \else\ifx#1\@part + \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi + \fi\fi + \let\ifttl@toclabel\ifttl@label + \@dblarg{#1}}} + +\@ifundefined{ttl@extract}{}{\endinput} + +\newcommand\titlelabel[1]{% + \def\@seccntformat##1{#1}} + +\expandafter\ifx\csname chapter\endcsname\relax + + \def\ttl@compatpart{\titleclass{\part}{part}\relax} + +\else + + \def\ttl@compatchapter{% + \def\@makechapterhead{% + \ttl@labeltrue + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}% + \def\@makeschapterhead{% + \ttl@labelfalse + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}} + + \def\ttl@compatpart{\titleclass{\part}{page}\relax} + +\fi + +\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% + \@tempskipa=#5 + \@tempskipb=#6 + \ifdim\@tempskipa<\z@ + \toks@{\titlespacing*#8{#4}}% + \@tempskipa-\@tempskipa + \else + \toks@{\titlespacing#8{#4}}% + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% + \ifdim\@tempskipb<\z@ + \if@tempswa + \titleformat#8[runin]% + {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8[runin]% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@tempskipb-\@tempskipb + \else + \if@tempswa + \titleformat#8% + {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% + \fi + \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} + \ttl@a} + +\def\ttl@extract#1{% + \expandafter\in@\expandafter\@startsection\expandafter{#1}% + \ifin@ + \expandafter\ttl@@extract#1#1% + \else + \PackageWarningNoLine{titlesec}% + {Non standard sectioning command detected\MessageBreak + Using default spacing and no format} + \titlespacing*#1{\z@}{*3}{*2}% + \fi} + +\@tempswafalse + +\ifx\ttl@fonts\@empty + \def\ttl@fonts{\bfseries} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@sizes\endcsname\relax + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@fil\endcsname\relax + \let\ttl@fil\@empty +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@case\endcsname\relax + \let\ttl@case\@firstofone +\else + \@tempswatrue +\fi + +\if@tempswa + + \expandafter\ifx\csname chapter\endcsname\relax\else + \titleformat\chapter[display]% + {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} + {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} + \fi + +\fi + +\ttl@extract\section +\ttl@extract\subsection +\ttl@extract\subsubsection +\ttl@extract\paragraph +\ttl@extract\subparagraph + +\let\ttl@extract\@undefined +\let\ttl@@extract\@undefined + +\def\ttl@toplevel{part} + +\expandafter\ifx\csname chapter\endcsname\relax + + \@namedef{ttll@part}{0} + \titleclass{\section}{straight}[\part] + + \titlespacing*{\part} + {\z@} + {4ex} + {3ex} + +\else + + \let\ttl@save@mkchap\@makechapterhead + \let\ttl@save@mkschap\@makeschapterhead + + \def\@makechapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkchap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \def\@makeschapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkschap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \@namedef{ttll@part}{-1} + \@namedef{ttlss@part}{chapter} + \@namedef{ttll@chapter}{0} + \titleclass{\section}{straight}[\chapter] + +% The following is unoperant, unless when \chapter / \part +% format is redefined + + \titlespacing*{\part} + {\z@} + {\z@\@plus1fil} + {\z@\@plus1fil} + + \titlespacing*\chapter + {\z@}% + {50\p@}% + {\ttl@chapafter}% + +\fi + +\titleclass{\subsection} {straight}[\section] +\titleclass{\subsubsection}{straight}[\subsection] +\titleclass{\paragraph} {straight}[\subsubsection] +\titleclass{\subparagraph} {straight}[\paragraph] + +\endinput diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/README.md b/docs/NARK/Resources/texmf-local/texmf-local/README.md similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/README.md rename to docs/NARK/Resources/texmf-local/texmf-local/README.md diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bib/economics.bib b/docs/NARK/Resources/texmf-local/texmf-local/bibtex/bib/economics.bib similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bib/economics.bib rename to docs/NARK/Resources/texmf-local/texmf-local/bibtex/bib/economics.bib diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/econtex.bst b/docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/econtex.bst similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/econtex.bst rename to docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/econtex.bst diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/handout.bst b/docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/handout.bst similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/handout.bst rename to docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/handout.bst diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst b/docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst rename to docs/NARK/Resources/texmf-local/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/ls-R b/docs/NARK/Resources/texmf-local/texmf-local/ls-R similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/ls-R rename to docs/NARK/Resources/texmf-local/texmf-local/ls-R diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/ReadMe.texmf b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/ReadMe.texmf similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/ReadMe.texmf rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/ReadMe.texmf diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/articleNoRefHead.cls b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/articleNoRefHead.cls old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/articleNoRefHead.cls rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/articleNoRefHead.cls diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/bibMake.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/bibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/bibMake.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/bibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/cvBibMake.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/cvBibMake.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/cvBibMake.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/cvBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.cls b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.cls similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.cls rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.cls diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtex.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexBibMake.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexBibMake.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexBibMake.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexSetup.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexSetup.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexSetup.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexSetup.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexShortcuts.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexShortcuts.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexShortcuts.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/econtexShortcuts.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.cls b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.cls similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.cls rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.cls diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handout.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutBibMake.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutBibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutBibMake.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutBibMake.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutSetup.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutSetup.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutSetup.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutSetup.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutShortcuts.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutShortcuts.sty similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutShortcuts.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/handoutShortcuts.sty diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/makePostHandoutsStart.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/makePostHandoutsStart.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/makePostHandoutsStart.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/makePostHandoutsStart.tex diff --git a/Documentation/texmf-local/tex/latex/printvrb.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty old mode 100755 new mode 100644 similarity index 96% rename from Documentation/texmf-local/tex/latex/printvrb.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty index b8757b3d4..47f13792a --- a/Documentation/texmf-local/tex/latex/printvrb.sty +++ b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty @@ -1,112 +1,112 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% printvrb.sty %%%%%%%%%%%%%%%%%% -%%% Amy Hendrickson -%%% TeXnology Inc. -%%% http://www.texnology.com -%%% revised version, April 8, 2011 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Uses moreverb.sty, Rainer Schopf author, -%%% as method to send verbatim text to -%%% another file, - -%%% These commands allow user to type in text or math and -%%% have it print in more than one document, -%%% for example, print in an article and also in slides. - -%%% This is done by sending fragments to a jobname.vrb file. -%%% Each fragment will have a unique name given as an argument -%%% to writetofile. - -%%% -\usepackage{moreverb} - -\newwrite\verbatimout - -%% The fragments will be sent to a new file called -%% the same name as the file they are found in with a -%% .vrb filename ending. (ie., test.tex ==> test.vrb) -%% They will also print in the originating .tex file -%% when LaTeX is run on the file twice (like the \tableofcontents -%% and cross-references). - - -%%% \begin{writetofile}{name}{your text}\end{writetofile} -%%% Notice that there are curly brackets surrounding the -%%% text you enter. These are necessary. - -%%% (Name can include numbers or any symbols you want) - -%%% Used: -%%% \begin{writetofile}{name} -%%% {my text} -%%% \end{writetofile} - -\newcount\definitionnumber - -%%% \namesinmargin will make name of fragment appear in margin. -%%% If this command isn't there, there will be no names in the margin. - -\newif\ifnamesinmargin -\def\namesinmargin{\global\namesinmargintrue} - -\def\writetofile#1{% -\vskip1sp -\ifnum\definitionnumber=0 -\expandafter\openin1 \jobname.vrb -\ifeof1 -\else -\input \jobname.vrb -\fi%% to get the previous definitions -\immediate\openout\verbatimout=\jobname.vrb -\fi -%% -\global\advance\definitionnumber by 1 -\gdef\currname{#1}% -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% -\fi% -%% -\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space -\currname\string\endcsname} - \@bsphack - \let\do\@makeother\dospecials - \catcode`\^^M\active \catcode`\^^I=12 - \def\verbatim@processline{% - \immediate\write\verbatimout - {\the\verbatim@line}}% -\verbatim@start} - -\def\endwritetofile{% - \@esphack -\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on -file one more time!\else -\ifnamesinmargin\vskip-\baselineskip\fi -\noindent\expandafter\csname \currname\endcsname\relax\fi -} - -\makeatother - -%%%%%%%%%%%%%%%%%%%%% -%%% Using fragments in new file: - -%%% \input jobname.vrb will bring in the definitions -%%% for the fragments. -%%% (jobname is the same as the filename of the source document) - -%%% \namesinmargin will make names print as well as as printing -%%% the fragment. - -%%% \printfrag{name} will bring in fragment defined in source file, -%%% and sent to jobname.vrb. - -%%% \printfrag will save the problem of remembering to use -%%% \csname ...\endcsname, and will check to see if fragment is defined - -\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt -\noindent(!! There is -no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% -\csname #1\endcsname\fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% printvrb.sty %%%%%%%%%%%%%%%%%% +%%% Amy Hendrickson +%%% TeXnology Inc. +%%% http://www.texnology.com +%%% revised version, April 8, 2011 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%% Uses moreverb.sty, Rainer Schopf author, +%%% as method to send verbatim text to +%%% another file, + +%%% These commands allow user to type in text or math and +%%% have it print in more than one document, +%%% for example, print in an article and also in slides. + +%%% This is done by sending fragments to a jobname.vrb file. +%%% Each fragment will have a unique name given as an argument +%%% to writetofile. + +%%% +\usepackage{moreverb} + +\newwrite\verbatimout + +%% The fragments will be sent to a new file called +%% the same name as the file they are found in with a +%% .vrb filename ending. (ie., test.tex ==> test.vrb) +%% They will also print in the originating .tex file +%% when LaTeX is run on the file twice (like the \tableofcontents +%% and cross-references). + + +%%% \begin{writetofile}{name}{your text}\end{writetofile} +%%% Notice that there are curly brackets surrounding the +%%% text you enter. These are necessary. + +%%% (Name can include numbers or any symbols you want) + +%%% Used: +%%% \begin{writetofile}{name} +%%% {my text} +%%% \end{writetofile} + +\newcount\definitionnumber + +%%% \namesinmargin will make name of fragment appear in margin. +%%% If this command isn't there, there will be no names in the margin. + +\newif\ifnamesinmargin +\def\namesinmargin{\global\namesinmargintrue} + +\def\writetofile#1{% +\vskip1sp +\ifnum\definitionnumber=0 +\expandafter\openin1 \jobname.vrb +\ifeof1 +\else +\input \jobname.vrb +\fi%% to get the previous definitions +\immediate\openout\verbatimout=\jobname.vrb +\fi +%% +\global\advance\definitionnumber by 1 +\gdef\currname{#1}% +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% +\fi% +%% +\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space +\currname\string\endcsname} + \@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatimout + {\the\verbatim@line}}% +\verbatim@start} + +\def\endwritetofile{% + \@esphack +\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on +file one more time!\else +\ifnamesinmargin\vskip-\baselineskip\fi +\noindent\expandafter\csname \currname\endcsname\relax\fi +} + +\makeatother + +%%%%%%%%%%%%%%%%%%%%% +%%% Using fragments in new file: + +%%% \input jobname.vrb will bring in the definitions +%%% for the fragments. +%%% (jobname is the same as the filename of the source document) + +%%% \namesinmargin will make names print as well as as printing +%%% the fragment. + +%%% \printfrag{name} will bring in fragment defined in source file, +%%% and sent to jobname.vrb. + +%%% \printfrag will save the problem of remembering to use +%%% \csname ...\endcsname, and will check to see if fragment is defined + +\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt +\noindent(!! There is +no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% +\csname #1\endcsname\fi } diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/snapshot.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty similarity index 97% rename from Documentation/NARK/Resources/texmf-local/tex/latex/snapshot.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty index 311018ebe..92b5bc57e 100644 --- a/Documentation/NARK/Resources/texmf-local/tex/latex/snapshot.sty +++ b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/snapshot.sty @@ -1,341 +1,341 @@ -%% -%% This is file `snapshot.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% snapshot.dtx -%% -%%% ==================================================================== -%%% @LaTeX-doc-source-file{ -%%% filename = "snapshot.dtx", -%%% version = "1.14", -%%% date = "2002/03/05", -%%% time = "15:29:00 EST", -%%% checksum = "39090 807 3449 29761", -%%% author = "American Mathematical Society", -%%% copyright = "Copyright 2001 American Mathematical Society, -%%% all rights reserved. Copying of this file is -%%% authorized only if either: -%%% (1) you make absolutely no changes to your copy, -%%% including name; OR -%%% (2) if you do make changes, you first rename it -%%% to some other name.", -%%% address = "American Mathematical Society, -%%% Electronic Products and Services, -%%% PO Box 6248, -%%% Providence, RI 02940, -%%% USA", -%%% email = "tech-support@ams.org", -%%% URL = "http://www.ams.org/", -%%% supported = "yes", -%%% keywords = "version, compatibility, dependencies, LaTeX", -%%% abstract = "This package provides a way for a LaTeX -%%% document to specify, for each external file -%%% on which the document depends, which version -%%% is required to guarantee output fidelity.", -%%% docstring = "The checksum field above contains a CRC-16 -%%% checksum as the first value, followed by the -%%% equivalent of the standard UNIX wc (word -%%% count) utility output of lines, words, and -%%% characters. This is produced by Robert -%%% Solovay's checksum utility.", -%%% } -%%% ==================================================================== -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{snapshot}[2002/03/05 v1.14] -\let\@xp\expandafter \let\@nx\noexpand -\newcommand{\RequireVersions}[2][]{% - \let\snap@check\snap@compare@versions - \let\snap@selfcheck\snap@selfcheck@a - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% -} -\@onlypreamble\RequireVersions -\def\snap@store@error#1{% - \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc -} -\@onlypreamble\snap@store@error -\def\snap@store@version #1#2#3#4{% - \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% -} -\@onlypreamble\snap@store@version -\def\@fmtextension{fmt} -\def\@tfmextension{tfm} -\edef\snapx@package{.\@pkgextension} -\edef\snapx@class{.\@clsextension} -\edef\snapx@format{.\@fmtextension} -\edef\snapx@tfm{.\@tfmextension} -\long\def\snapx@application{} -\let\snap@file=\@empty -\let\snapx@end\@@end -\def\snap@store@b#1#2#3#4{% - \ifx#1\snapx@end - \@xp\@gobblefour - \else - \ifx#1\relax \let#1\@empty\fi - \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% - \ifx#1\snapx@application - \else - \xdef\rqv@list{\rqv@list - \ifx\@empty\rqv@list\else,\fi - #3#1% - }% - \fi - \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% - \ifx#1\snapx@format \snap@check{#3.fmt}% - \else \snap@selfcheck{#3.sty}% - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\@onlypreamble\snap@store@b -\def\snap@write{\immediate\write\snap@out} -\let\snap@out\sixt@@n % fallback, probably never used -\DeclareOption{dep}{% - \def\snap@write{\immediate\write\snap@out}% -} -\DeclareOption{log}{% - \let\snap@write\typeout -} -\let\snap@fake@b\relax -\DeclareOption{test}{% - \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% -} -\DeclareOption{tfm}{% - \typeout{Option 'tfm' not implemented yet [1999/09/23]}% -} -\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} -\def\snap@mismatch{\snap@mismatch@warning} -\DeclareOption{error}{% - \def\snap@mismatch{\PackageError}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\DeclareOption{warning}{% - \def\snap@mismatch{\snap@mismatch@warning}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} -\let\snap@select\@empty -\DeclareOption{date}{% - \def\snap@select#1#2 #3\@nil{#1#2}% -} -\def\snap@select@version#1{% - \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi -} -\def\snap@sva#1.#2 #3\@nil{#1.#2} -\def\snap@select@major#1{% - \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi -} -\def\snap@svm#1.#2\@nil{#1} -\DeclareOption{version}{% - \def\snap@select#1#2 #3{\snap@select@version #3}% -} -\DeclareOption{major-version}{% - \def\snap@select#1#2 #3{\snap@select@major #3}% -} -\ProcessOptions\par -\edef\snap@restore@extensions{% - \def\@nx\@pkgextension{\@pkgextension}% - \def\@nx\@clsextension{\@clsextension}% -} -\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} -\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} -\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} -\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} -\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} -\def\snap@trim@c#1#2 #3\@nil{#2} -\let\rqv@list=\@empty -\edef\@tempc#1\fmtname{#1\fmtname}\@tempc -\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} -\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} -\if ?\@tempb?\@nil - \edef\@filelist{\fmtname.fmt,\@filelist}% - \def\@tempc{LaTeX2e}% - \@xp\edef\csname ver@\fmtname.fmt\endcsname{% - \fmtversion\space - v\ifx\@tempc\fmtname 2.e\else ?.?\fi - }% -\fi -\listfiles -\def\@dofilelist{% - \snap@restore@extensions - \ifx\rqv@list\@empty - \else \rqv@compare@lists - \fi - \ifx\snap@write\typeout - \else - \newwrite\snap@out - \immediate\openout\snap@out=\jobname.dep \relax - \fi - \snap@write{\string\RequireVersions\@charlb}% - \snap@write{\space\space *{application}{TeX}% - \space\space\space\space\space{1990/03/25 v3.x}}% - \@for\@currname:=\@filelist\do{% - \filename@parse\@currname - \ifx\filename@ext\relax - \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% - \def\@tempb{~~~}% - \else\ifx\filename@ext\@pkgextension - \def\@tempa{package}\let\@tempd\@empty - \def\@tempb{}% - \else\ifx\filename@ext\@clsextension - \def\@tempa{class}\let\@tempd\@empty - \def\@tempb{~~}% - \else\ifx\filename@ext\@fmtextension - \def\@tempa{format}\let\@tempd\@empty - \def\@tempb{~}% - \else\ifx\filename@ext\@tfmextension - \def\@tempa{tfm}\let\@tempd\@empty - \def\@tempb{~~~~}% - \else - \def\@tempa{file}\edef\@tempd{.\filename@ext}% - \def\@tempb{~~~}% - \fi\fi\fi\fi\fi - \@xp\let\@xp\@tempe - \csname ver@\filename@base.\filename@ext\endcsname - \ifx\@tempe\@empty \let\@tempe\relax \fi - \edef\@tempe{% - \ifx\@tempe\relax 0000/00/00 v0.0% - \else - \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil - \fi - }% - \edef\@tempc{\filename@area\filename@base\@tempd}% full file name - \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd - \begingroup \let~\space - \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% - \endgroup - }% - \snap@write{\@charrb}% - \ifx\snap@write\typeout - \else \immediate\closeout\snap@out - \typeout{Dependency list written on \jobname.dep.}% - \fi -}% -\def\rqv@condense#1,{% - \if ,#1,% - \else - \@xp\ifx\csname ver@#1\endcsname\N - \else - \edef\L{\L,#1}% - \@xp\let\csname ver@#1\endcsname=\N - \fi - \fi - \rqv@condense -} -\def\rqv@compare@lists{% - \begingroup - \def\N{1}\let\L=\@gobble - \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \let\rqv@list=\L - \let\L=\@gobble - \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space loaded though not in - \noexpand\RequireVersions list% - }\@ehc - }% - \def\N{2}\let\L=\@gobble - \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \let\L=\@gobble - \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space [\csname rqv@\@currname\endcsname] - required but not loaded% - }\@ehc - }% - \endgroup -} -\begingroup \catcode\endlinechar=12\relax % -\long\gdef\snap@ignoline#1 -{}\endgroup % -\def\snap@fake@input#1#2#3#4{% - \ifx#1\snapx@end - \aftergroup\@@end \@xp\@gobblefour - \else - \ifx#1\snapx@format - \else - \message{^^J}% - \@xp\snap@fake@b\@@input #3#1\relax - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\newcommand{\rqvTest}[2][]{% - \begingroup \catcode\endlinechar=12 - \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax - \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% - \endgroup -} -\@ifundefined{snap@fake@b}{}{% - \let\snap@store@b\snap@fake@input - \let\RequireVersions\rqvTest -} -\AtBeginDocument{% - \@ifundefined{ver@amsgen}{}{% - \@xp\let\csname ver@amsgen.sty\@xp\endcsname - \csname ver@amsgen\endcsname - }% -} -\let\snap@compare@versions\@gobble \let\snap@check\@gobble -\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble -\ifx\snap@select\@empty \endinput \fi -\begingroup \catcode`\.=11\relax -\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} -\gdef\snap@selfcheck@a#1{% - \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% - \rqv@snapshot.sty F\@nil - \snap@check{#1}% - \fi -} -\endgroup -\def\@nofmt#1.fmt.#2 {#1 } -\def\snap@mismatch@a#1#2#3{% - \snap@mismatch{snapshot}{^^J% - \space\space Required version #2 of \@nofmt#1.fmt. and^^J% - \space\space provided version #3 do not match% - }\@ehc -} -\def\snap@compare@versions#1{% - \begingroup - \@ifundefined{rqv@#1}{}{% - \edef\0{\csname rqv@#1\endcsname}% - \edef\1{\csname ver@#1\endcsname}% - \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% - \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% - \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% - \ifx\@tempa\@tempb - \else - \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% - \@xp\@tempd - \fi - }% - \endgroup -} -\def\ProvidesFile#1{% - \def\snap@checker{\snap@check{#1}}% - \begingroup - \aftergroup\snap@checker - \catcode`\ 10\catcode\endlinechar 10 % - \@makeother\/% - \@makeother\&% - \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% -} -\def\@pr@videpackage[#1]{% - \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% - \ifx\@currext\@clsextension - \typeout{Document Class: \@gtempa\space#1}% - \else - \wlog{Package: \@gtempa\space#1}% - \fi - \snap@check{\@currname.\@currext}% -} -\endinput -%% -%% End of file `snapshot.sty'. +%% +%% This is file `snapshot.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% snapshot.dtx +%% +%%% ==================================================================== +%%% @LaTeX-doc-source-file{ +%%% filename = "snapshot.dtx", +%%% version = "1.14", +%%% date = "2002/03/05", +%%% time = "15:29:00 EST", +%%% checksum = "39090 807 3449 29761", +%%% author = "American Mathematical Society", +%%% copyright = "Copyright 2001 American Mathematical Society, +%%% all rights reserved. Copying of this file is +%%% authorized only if either: +%%% (1) you make absolutely no changes to your copy, +%%% including name; OR +%%% (2) if you do make changes, you first rename it +%%% to some other name.", +%%% address = "American Mathematical Society, +%%% Electronic Products and Services, +%%% PO Box 6248, +%%% Providence, RI 02940, +%%% USA", +%%% email = "tech-support@ams.org", +%%% URL = "http://www.ams.org/", +%%% supported = "yes", +%%% keywords = "version, compatibility, dependencies, LaTeX", +%%% abstract = "This package provides a way for a LaTeX +%%% document to specify, for each external file +%%% on which the document depends, which version +%%% is required to guarantee output fidelity.", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{snapshot}[2002/03/05 v1.14] +\let\@xp\expandafter \let\@nx\noexpand +\newcommand{\RequireVersions}[2][]{% + \let\snap@check\snap@compare@versions + \let\snap@selfcheck\snap@selfcheck@a + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% +} +\@onlypreamble\RequireVersions +\def\snap@store@error#1{% + \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc +} +\@onlypreamble\snap@store@error +\def\snap@store@version #1#2#3#4{% + \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% +} +\@onlypreamble\snap@store@version +\def\@fmtextension{fmt} +\def\@tfmextension{tfm} +\edef\snapx@package{.\@pkgextension} +\edef\snapx@class{.\@clsextension} +\edef\snapx@format{.\@fmtextension} +\edef\snapx@tfm{.\@tfmextension} +\long\def\snapx@application{} +\let\snap@file=\@empty +\let\snapx@end\@@end +\def\snap@store@b#1#2#3#4{% + \ifx#1\snapx@end + \@xp\@gobblefour + \else + \ifx#1\relax \let#1\@empty\fi + \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% + \ifx#1\snapx@application + \else + \xdef\rqv@list{\rqv@list + \ifx\@empty\rqv@list\else,\fi + #3#1% + }% + \fi + \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% + \ifx#1\snapx@format \snap@check{#3.fmt}% + \else \snap@selfcheck{#3.sty}% + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\@onlypreamble\snap@store@b +\def\snap@write{\immediate\write\snap@out} +\let\snap@out\sixt@@n % fallback, probably never used +\DeclareOption{dep}{% + \def\snap@write{\immediate\write\snap@out}% +} +\DeclareOption{log}{% + \let\snap@write\typeout +} +\let\snap@fake@b\relax +\DeclareOption{test}{% + \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% +} +\DeclareOption{tfm}{% + \typeout{Option 'tfm' not implemented yet [1999/09/23]}% +} +\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} +\def\snap@mismatch{\snap@mismatch@warning} +\DeclareOption{error}{% + \def\snap@mismatch{\PackageError}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\DeclareOption{warning}{% + \def\snap@mismatch{\snap@mismatch@warning}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} +\let\snap@select\@empty +\DeclareOption{date}{% + \def\snap@select#1#2 #3\@nil{#1#2}% +} +\def\snap@select@version#1{% + \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi +} +\def\snap@sva#1.#2 #3\@nil{#1.#2} +\def\snap@select@major#1{% + \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi +} +\def\snap@svm#1.#2\@nil{#1} +\DeclareOption{version}{% + \def\snap@select#1#2 #3{\snap@select@version #3}% +} +\DeclareOption{major-version}{% + \def\snap@select#1#2 #3{\snap@select@major #3}% +} +\ProcessOptions\par +\edef\snap@restore@extensions{% + \def\@nx\@pkgextension{\@pkgextension}% + \def\@nx\@clsextension{\@clsextension}% +} +\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} +\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} +\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} +\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} +\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} +\def\snap@trim@c#1#2 #3\@nil{#2} +\let\rqv@list=\@empty +\edef\@tempc#1\fmtname{#1\fmtname}\@tempc +\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} +\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} +\if ?\@tempb?\@nil + \edef\@filelist{\fmtname.fmt,\@filelist}% + \def\@tempc{LaTeX2e}% + \@xp\edef\csname ver@\fmtname.fmt\endcsname{% + \fmtversion\space + v\ifx\@tempc\fmtname 2.e\else ?.?\fi + }% +\fi +\listfiles +\def\@dofilelist{% + \snap@restore@extensions + \ifx\rqv@list\@empty + \else \rqv@compare@lists + \fi + \ifx\snap@write\typeout + \else + \newwrite\snap@out + \immediate\openout\snap@out=\jobname.dep \relax + \fi + \snap@write{\string\RequireVersions\@charlb}% + \snap@write{\space\space *{application}{TeX}% + \space\space\space\space\space{1990/03/25 v3.x}}% + \@for\@currname:=\@filelist\do{% + \filename@parse\@currname + \ifx\filename@ext\relax + \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% + \def\@tempb{~~~}% + \else\ifx\filename@ext\@pkgextension + \def\@tempa{package}\let\@tempd\@empty + \def\@tempb{}% + \else\ifx\filename@ext\@clsextension + \def\@tempa{class}\let\@tempd\@empty + \def\@tempb{~~}% + \else\ifx\filename@ext\@fmtextension + \def\@tempa{format}\let\@tempd\@empty + \def\@tempb{~}% + \else\ifx\filename@ext\@tfmextension + \def\@tempa{tfm}\let\@tempd\@empty + \def\@tempb{~~~~}% + \else + \def\@tempa{file}\edef\@tempd{.\filename@ext}% + \def\@tempb{~~~}% + \fi\fi\fi\fi\fi + \@xp\let\@xp\@tempe + \csname ver@\filename@base.\filename@ext\endcsname + \ifx\@tempe\@empty \let\@tempe\relax \fi + \edef\@tempe{% + \ifx\@tempe\relax 0000/00/00 v0.0% + \else + \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil + \fi + }% + \edef\@tempc{\filename@area\filename@base\@tempd}% full file name + \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd + \begingroup \let~\space + \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% + \endgroup + }% + \snap@write{\@charrb}% + \ifx\snap@write\typeout + \else \immediate\closeout\snap@out + \typeout{Dependency list written on \jobname.dep.}% + \fi +}% +\def\rqv@condense#1,{% + \if ,#1,% + \else + \@xp\ifx\csname ver@#1\endcsname\N + \else + \edef\L{\L,#1}% + \@xp\let\csname ver@#1\endcsname=\N + \fi + \fi + \rqv@condense +} +\def\rqv@compare@lists{% + \begingroup + \def\N{1}\let\L=\@gobble + \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \let\rqv@list=\L + \let\L=\@gobble + \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space loaded though not in + \noexpand\RequireVersions list% + }\@ehc + }% + \def\N{2}\let\L=\@gobble + \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \let\L=\@gobble + \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space [\csname rqv@\@currname\endcsname] + required but not loaded% + }\@ehc + }% + \endgroup +} +\begingroup \catcode\endlinechar=12\relax % +\long\gdef\snap@ignoline#1 +{}\endgroup % +\def\snap@fake@input#1#2#3#4{% + \ifx#1\snapx@end + \aftergroup\@@end \@xp\@gobblefour + \else + \ifx#1\snapx@format + \else + \message{^^J}% + \@xp\snap@fake@b\@@input #3#1\relax + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\newcommand{\rqvTest}[2][]{% + \begingroup \catcode\endlinechar=12 + \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax + \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% + \endgroup +} +\@ifundefined{snap@fake@b}{}{% + \let\snap@store@b\snap@fake@input + \let\RequireVersions\rqvTest +} +\AtBeginDocument{% + \@ifundefined{ver@amsgen}{}{% + \@xp\let\csname ver@amsgen.sty\@xp\endcsname + \csname ver@amsgen\endcsname + }% +} +\let\snap@compare@versions\@gobble \let\snap@check\@gobble +\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble +\ifx\snap@select\@empty \endinput \fi +\begingroup \catcode`\.=11\relax +\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} +\gdef\snap@selfcheck@a#1{% + \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% + \rqv@snapshot.sty F\@nil + \snap@check{#1}% + \fi +} +\endgroup +\def\@nofmt#1.fmt.#2 {#1 } +\def\snap@mismatch@a#1#2#3{% + \snap@mismatch{snapshot}{^^J% + \space\space Required version #2 of \@nofmt#1.fmt. and^^J% + \space\space provided version #3 do not match% + }\@ehc +} +\def\snap@compare@versions#1{% + \begingroup + \@ifundefined{rqv@#1}{}{% + \edef\0{\csname rqv@#1\endcsname}% + \edef\1{\csname ver@#1\endcsname}% + \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% + \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% + \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% + \ifx\@tempa\@tempb + \else + \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% + \@xp\@tempd + \fi + }% + \endgroup +} +\def\ProvidesFile#1{% + \def\snap@checker{\snap@check{#1}}% + \begingroup + \aftergroup\snap@checker + \catcode`\ 10\catcode\endlinechar 10 % + \@makeother\/% + \@makeother\&% + \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% +} +\def\@pr@videpackage[#1]{% + \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% + \ifx\@currext\@clsextension + \typeout{Document Class: \@gtempa\space#1}% + \else + \wlog{Package: \@gtempa\space#1}% + \fi + \snap@check{\@currname.\@currext}% +} +\endinput +%% +%% End of file `snapshot.sty'. diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/pictureenv.4ht b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/pictureenv.4ht similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/pictureenv.4ht rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/pictureenv.4ht diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures-README.md diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p1x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p2x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p3x1p0.mk4 diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4htMakeCFG.sh b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4htMakeCFG.sh old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4htMakeCFG.sh rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/tex4htMakeCFG.sh diff --git a/Documentation/texmf-local/tex/latex/titlesec.sty b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty similarity index 96% rename from Documentation/texmf-local/tex/latex/titlesec.sty rename to docs/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty index f588cad6a..fb7f24e2b 100644 --- a/Documentation/texmf-local/tex/latex/titlesec.sty +++ b/docs/NARK/Resources/texmf-local/texmf-local/tex/latex/titlesec.sty @@ -1,1350 +1,1350 @@ -% +--------------------------------------------------+ -% | Typeset titlesec.tex to get the documentation. | -% +--------------------------------------------------+ -% -% Copyright (c) 1998-2016 by Javier Bezos. -% All Rights Reserved. -% -% This file is part of the titlesec distribution release 2.10.2 -% ----------------------------------------------------------- -% -% It may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2003/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainer of this work is Javier Bezos. -% -% Notes -% ~~~~~ -% -% The following tags are used: -% ttl@ : the generic tag used through the style -% ttlh@ : a shape definition -% ttlf@ : a macro containing the title format -% ttls@ : id. the title space -% ttlp@ : page key related macros -% ttll@ : level number -% -% The ttlf@ and ttls@ contains data in the form {..}{..}. -% Perhaps in future releases they should be converted -% to a prop-like list, similar to that proposed by the -% latex team. -% -% Admittedly, the current implementation seems too -% complicated, but that's necessary in order to provide -% certain compatibility with the sections as defined by the -% used class. Other packages opt for providing the sections -% as defined by standard classes ignoring the class; for -% instance sectsty which does a simple task in a simple and -% nice way. However, that was not my goal. -% -% Release -% ~~~~~~~ - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] - -% Initialization -% ~~~~~~~~~~~~~~ - -\newif\ifttl@ps -\ttl@psfalse - -% The \ttl@label switch is used when printing the label in titles. -% A numberless variant makes it to true. -% There is a \ttl@toclabel as well, which is true iff the -% title is numbered; used in toc entries (except default part -% and chapter) and marks (only in titlesec pagestyles). - -\newif\ifttl@label -\newif\ifttl@toclabel - -\newbox\ttl@box - -% A provision for the report style: - -\@ifundefined{if@mainmatter} - {\let\if@mainmatter\iftrue}{} - -\@ifundefined{if@openright} - {\let\if@openright\iftrue}{} - -% and the ams styles as well - -\@ifundefined{@chapapp} - {\let\@chapapp\chaptername}{} - -\def\ttl@trylist{\ttl@try{}} - -\def\ttl@getkeys#1#2{% - \if\expandafter @\@gobble#1@\@empty - \edef\ttl@b{\expandafter\@gobble\string#1}% - \let\ttl@a\ttl@b - \else - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlkeys.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \ttl@getkeys{#1}{#2}% - \fi} - -% A more meaningful error for \@notdefinable - -\expandafter\AtEndOfPackage\expandafter{\expandafter - \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} - -\def\@notdefinable{% - \PackageError{titlesec}% - {Incompatible package}% - {Titlesec cannot continue defining its own macros - because\MessageBreak - \@backslashchar\reserved@a\space is already used by other package, - the class\MessageBreak - or the document.}} - -% +-----------------+ -% | C L A S S E S | -% +-----------------+ - -\def\ttl@useclass#1#2{% - \@ifstar - {\ttl@labelfalse#1{#2}[]}% - {\ttl@labeltrue\@dblarg{#1{#2}}}} - -\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} -\def\ttl@partclass{\ttl@useclass\ttl@part@i} -\def\ttl@topclass{\ttl@useclass\ttl@top@i} -\def\ttl@pageclass{\ttl@useclass\ttl@page@i} - -% Here \scantokens is used to make sure the unescaped name -% has `letters' and no `others'. Mainly for hyperref, so there -% should be no problems. - -\newcommand\titleclass[1]{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \ifx\scantokens\@undefined\else - \scantokens\expandafter{\expandafter - \def\expandafter\ttl@a\expandafter{\ttl@a}}% - \fi - \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% - {\@tempswafalse\ttl@class@ii{#1}}} - -\def\ttl@class@i#1[#2]{% - \@namedef{ttll@\ttl@a}{#2}% - \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% - \@ifundefined{ttl@toplevel}{}% - {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@toplevel\endcsname}% - \edef\ttl@toplevel{\ttl@a}% - \ttl@class@ii{#1}} - -\def\ttl@class@ii#1#2{% - \@ifundefined{ttl@#2class}% - {\PackageError{titlesec}{Unknown sectioning class}% - {Valid names are top, page and straight}}% - {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax - \@ifundefined{\ttl@a mark}% - {\@namedef{\ttl@a mark}{\@gobble}}% - {}% - \edef#1{% - \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% - \if@tempswa - \expandafter\@gobble - \else - \expandafter\@firstofone - \fi - {\@ifnextchar[% - {\ttl@class@iii}% - {\@ifundefined{ttll@\ttl@a}% - {\PackageError{titlesec}{Unknown sectioning level}% - {\string\titleclass\space with no optional arguments\MessageBreak - only changes the class of an *existing* level}}}}} - -\def\ttl@class@iii[#1]{% - \edef\ttl@b{\expandafter\@gobble\string#1}% - \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@b\endcsname - \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% - \let\ttl@a\ttl@toplevel - \count@\csname ttll@\ttl@toplevel\endcsname - \ttl@class@iv} - -\def\ttl@class@iv{% - \@ifundefined{ttlss@\ttl@a}{}% - {\advance\count@\@ne - \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% - \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% - \ttl@class@iv}} - -% Typesetting Classes: General tools -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% The following command handles the *n spacing -% Some tricks are necessary to multiply a -% skip by a non integer number - -\newskip\beforetitleunit -\beforetitleunit=1ex\@plus.3ex\@minus.06ex -\newskip\aftertitleunit -\aftertitleunit=1ex\@plus.1ex - -\newdimen\ttl@plus -\newdimen\ttl@minus - -\def\ttl@assign#1{% - \@ifstar - {\ttl@assign@i{#1}}% - {\ttl@assign@d{#1}}} - -\def\ttl@assign@i#1#2\relax#3{% - \ttl@plus\z@ - \ttl@minus\z@ - \afterassignment\ttl@assign@ii - \dimen@\the#3, % <- space - #1 = #2\dimen@ - plus #2\ttl@plus - minus #2\ttl@minus} - -\def\ttl@assign@ii#1 {% <- space - \if#1,\else\afterassignment\ttl@assign@ii\fi - \csname ttl@\string#1\endcsname} - -\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} - -% To be used with \v/vspace to make them calc-savvy - -\def\ttl@calc#1#2{% - {\setlength\@tempskipa{#2}% - #1\@tempskipa}} - -\def\ttl@calcneg#1#2{% - {\setlength\@tempskipa{#2}% - #1{-\@tempskipa}}} - -% Gets from ttls@ and passes the spacing parameters: - -\def\ttl@startargs#1#2{% Get the first arguments, with the spacing - \@ifundefined{ttlp@#2}% - {\let\ttl@key@page\@empty}% - {\ttlp@fetch{#2}}% - \begingroup - \def\ttl@b{ttls@#2}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \xdef\ttl@b{\ttl@c}% - \endgroup - \ifx\ttl@b\@empty - \PackageError{titlesec}{Format/spacing not found}% - {I was unable to find the format corresponding to #2.\MessageBreak - Maybe you haven't set it with \string\titleformat\space and - \string\titlespacing} - \fi - \expandafter#1\ttl@b{#2}} - -% Used in ttl@select - -\def\ttl@savefn#1[#2]#3{% - \ifcase#1% - \footnotemark[#2]% - \gdef\ttl@fn{\footnotetext[#2]{#3}}% - \else - \footnotemark - \gdef\ttl@fn{\footnotetext{#3}}% - \fi} - -\def\ttl@nest@error{% - \PackageError{titlesec}{Nested titles}{Titles must not be nested}} - -\def\ttl@hmode@error{% - \PackageError{titlesec}{Entered in horizontal mode} - {The argument cannot contain horizontal material\MessageBreak - such as text, \string\noindent, \string\makebox, etc.}} - -% \ttl@select not only selects the right version to be -% used. It also take steps to ensure that a mark -% is not lost inside a box by saving it into \ttl@mk, -% which in turn is used by the sect and chap commands. - -\newif\ifttl@explicit - -\def\ttl@gmk#1{\gdef\ttl@mk{#1}} - -\def\ttl@select#1#2#3#4{% - \ttl@Hy@saveanchor - \global\let\ttl@mk\@empty % global because of rigidchapters - \global\let\ttl@fn\@empty - \begingroup - \if@inlabel\else % Keep item's \everypar - \everypar{\setbox\z@\lastbox\strut}% - \fi - \let\ttl@straight@i\ttl@nest@error - \let\ttl@top@i \ttl@nest@error - \let\ttl@part@i \ttl@nest@error - \let\ttl@page@i \ttl@nest@error - \let\ttl@newpage\newpage - \def\newpage{\ttl@savewrite\ttl@newpage}% - \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% - \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% - \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% - \def\footnote{\@ifnextchar[% - {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@b{ttlf@#1}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \ifttl@explicit - \def\ttl@passexplicit{\ttl@case{#4}}% - \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... - \else - \let\ttl@passexplicit\ttl@case - \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... - \fi - \endgroup} - -\let\ttl@savewrite\@empty - -\def\ttl@finmarks{% - \ttl@savewrite - \ttl@mk % Contains a possible mark, returned by \ttl@select - \ttl@fn} % And a footnote - -\def\ttl@try#1{% - \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} - \@ifundefined{\ttl@b\ttl@c}{}{% - \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% - \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% - #1% - \let\ttl@try\@gobble}} % locally modified to `break' testings - -% \ttl@write writes marks and toc. tocdepth is taken care of when -% the toc is typesetted and not here. Used always through -% ttl@savewrite, which is reset to \@empty to avoid duplicated -% calls. - -\def\ttl@write#1#2{% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% - \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a - \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a - \ttl@elinemarks - \global\ttl@toclabelfalse - \global\let\ttl@savewrite\@empty} - -\newif\ifttl@premark % to be used in ttlps.def -\ttl@premarkfalse - -\def\ttl@premark#1#2{% - \protected@xdef\ttl@prevmarks{\ttl@marks}% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \ttl@elinemarks - \gdef\ttl@prevmarks{\ttl@marks}} - -% Must be preceded by a default \ttl@savewrite, which is used -% in starred variants--\@empty in top and straight classes. -% In straight class, it is preceded by the setting of -% prev marks to provide a "fixed" top mark. Otherwise, -% the default prev mark (= curr mark) is used (restored -% after ttl@labelling in straight). This is the command -% to be hacked if you want to change the behaviour of -% starred variants. - -\def\ttl@labelling#1#2{% - \let\ttl@Hy@saveanchor\@empty - \ifttl@label % 1st - if star - \def\ttl@savewrite{\ttl@write{#1}{#2}}% - \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. - \ifttl@label % 2nd - eg, if not main matter - \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax - \ttl@labelfalse % 3rd - if too deep - \else - \ttl@Hy@refstepcounter{#1}% - \@nameuse{ttl@#1out}% - \fi - \fi - \fi - \let\ifttl@toclabel\ifttl@label - \ifx\ttl@savewrite\@empty\else % If marks - \ifttl@ps - \ifttl@premark - \global\ttl@premarkfalse - \else % if no \pretitlemark - \ttl@premark{#1}{#2}% - \fi - \fi - \ifttl@label\else\ttl@Hy@steplink{#1}\fi - \fi} - -% Executed by ttl@labelling if the name of section is chapter: - -\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} - -% Executed by ttl@labelling if chapter has a number. Note -% you can define messages for other sectioning levels (eg, -% \ttl@sectionout). - -\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} - -% Straight class -% ~~~~~~~~~~~~~ -% Default for nobottomtitles. Changed by nobottomtitles* - -\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} - -% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title -% The second argument of ttl@sect is the level, which -% is empty if the star version is used. In this case -% neither the toc nor the marks are written. - -\def\ttl@straight@i#1[#2]#3{% - \def\@currentlabelname{#2}% for nameref - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \gdef\thetitle{\csname the#1\endcsname}% - \if@noskipsec \leavevmode \fi - \par - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@straight@ii{#1}{#3}} - -% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title - -\def\ttl@straight@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in straight class ignored}}% - \if@nobreak - \ttl@titlespace{\@tempskipa}% - \else - \@ifundefined{#6break}% - {\addpenalty{\@secpenalty}}% - {\csname#6break\endcsname}% - \addvspace{\@tempskipa}% - \ifdim\bottomtitlespace<\z@ - \else - \begingroup - \@tempskipb\pagegoal - \@tempskipa\pagegoal - \ttl@addstretch % \relax if nobottomtitle* - \advance\@tempskipa-\bottomtitlespace\relax % not a register - \pagegoal\@tempskipa - \def\@textbottom{\vskip\z@\@plus.0001fil}% - \penalty9999 - \pagegoal\@tempskipb - \endgroup - \fi - \fi - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \if@noskipsec - \global\@nobreakfalse - \everypar{% - \if@noskipsec - \global\@noskipsecfalse - \clubpenalty\@M - \hskip-\parindent - \begingroup - \@svsechd\unskip{\hspace{\@tempskipb}}% - \endgroup - \else - \clubpenalty\@clubpenalty\everypar{}% - \fi}% - \else - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading - \fi - \ignorespaces} - -% Part class -% ~~~~~~~~~~ - -\providecommand\partmark[1]{\markboth{}{}} - -\def\ttl@part@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@part@ii{#1}{#3}} - -\def\ttl@part@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in part class ignored}}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse \fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading} - -% Page class -% ~~~~~~~~~~ - -\def\ttl@page@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@page@ii{#1}{#3}} - -\def\ttl@page@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \if@openright - \cleardoublepage - \else - \clearpage - \fi - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \if@twocolumn - \onecolumn - \@tempswatrue - \else - \@tempswafalse - \fi - \vspace*{\@tempskipa}% - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \vspace{\@tempskipb}% - \newpage - \if@twoside - \if@openright - \null - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{empty}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \newpage - \fi - \fi - \if@tempswa - \twocolumn - \fi - \ignorespaces} - -% Top class and some makechapterhead stuff -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% -% \ttl@mkchap is the new make(s)chapterhead. - -\def\ttl@mkchap#1#2#3#4#5#6#7{% - \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% - \let\ttl@savewrite\@empty - \let\ttl@Hy@saveanchor\@empty - \@ifundefined{ttl@ps@#6}{}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \let\ifttl@toclabel\ifttl@label - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} - -% But \ttl@mkchap@i is used by both makechapterhead and -% the top class. - -\def\ttl@mkchap@i#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@topmode{\@tempskipb}{% - \ttl@select{#6}{#1}{#2}{#7}}% - \ttl@finmarks % Outside the box! - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} - -\def\ttl@top@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@top@ii{#1}{#3}} - -\def\ttl@top@ii#1#2#3#4#5#6#7{% - \@ifundefined{#6break}% - {\if@openright - \cleardoublepage - \else - \clearpage - \fi}% - {\csname#6break\endcsname}% - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \global\@topnum\z@ - \@ifundefined{#6tolists}% - {\addtocontents{lof}{\protect\ttl@tocsep}% - \addtocontents{lot}{\protect\ttl@tocsep}} - {\@nameuse{#6tolists}}% - \if@twocolumn - \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% - \else - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% - \@afterheading - \fi - \ignorespaces} - - -% \def\ttl@noskipsectrue{% -% \if@noskipsec -% \PackageError{titlesec}{Invalid shape for top class}% -% {The selected shape only makes sense when merged into\MessageBreak -% a paragraph. That is impossible in the top class}% -% \else - -\newcommand\chaptertitlename{\@chapapp} -\def\ttl@tocsep{\addvspace{10\p@}} - -% +-----------------+ -% | S H A P E S | -% +-----------------+ -% -% % Reformatting Titles: Interface -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -% The surrounding space is stored in a macro -% named \ttls@
whose content is -% {left}{right}{before}{after}{afterindent}. -% But if there is the page key, the name is -% \ttls@
/ - -\newcommand\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} - -\def\ttl@spacing@i#1#2#3#4#5{% - \ttl@getkeys{#2}{titlesec}% - \@ifnextchar[{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}% - }{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} - -\def\ttl@spacing@ii#1#2#3#4[#5]{% - \expandafter\def\csname ttls@\ttl@a\endcsname - {{#2}{#5}{#3}{#4}{#1}}} - -% The section name is built in \ttl@a. -% The format is stored in a macro named \ttlf@
, -% or \ttlf@
/ if there is the page spec, -% or \ttlf@.../* if numberless is true -% whose content is -% \ttl@{format}{label}{sep}{before}{after} - -\newtoks\ttl@toksa - -\newcommand\titleformat{% - \@ifstar{\ttl@format@s}% - {\ttl@format@i}} - -\def\ttl@format@s#1#2{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \@ifundefined{ttlf@\ttl@a}% - {\PackageError{titlesec}{Not allowed in `easy' settings} - {The sectiong command you are trying to redefine\MessageBreak - is not handled by the starred variant (eg, \string\part)}}{} - \expandafter\expandafter\expandafter - \ttl@format@si\csname ttlf@\ttl@a \endcsname - {#2}} - -\def\ttl@format@si#1#2#3#4#5#6#7{% - \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} - -\def\ttl@format@i#1{% - \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} - -\def\ttl@format@ii#1[#2]#3#4#5#6{% - \ttl@getkeys{#1}{titlesec}% - \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments - \@ifnextchar[{% - \ttl@format@iii{#2}% - }{% - \ttl@format@iii{#2}[]}} - -% First, we get the shape -- if not defined it loads -% the corresponding file. - -\def\ttl@format@iii#1[#2]{% - \@ifundefined{ttlh@#1}{% - \begingroup - \makeatletter - \InputIfFileExists{#1.tss}{}{% - \PackageError{titlesec}{Unknown shape}% - {Shapes are defined in files with extension tss\MessageBreak - Either you have misspelled the shape\MessageBreak - or there is no a #1.tss file}}% - \endgroup}{}% - \@temptokena{#2}% - \ifttl@explicit - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \else - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \fi - \ttl@b - \csname ttl@compat\ttl@a\endcsname} - -% Styles -% ~~~~~~ - -% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title -% \ttl@ and \ttlh@ take the following eight -% arguments: -% {format}{label}{sep}{before}{after}{left}{right}{title} -% where before and after refer to the format. -% With the option explicit, #4 contains the title and #8 is -% empty. - -\def\ttlh@display#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \ifttl@label - {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% - \fi - #4{#8}% - \kern\z@\strut\@@par - \nobreak\ttl@midlongest#5\@@par - \ttl@endlongest} - -\def\ttlh@hang#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1{\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \begingroup - \ifttl@label - \noindent - \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% - \hangindent\wd\z@ - \box\z@ - \fi - #4{#8}% - \kern\z@\strut\@@par - \endgroup - \nobreak\ttl@midlongest#5\@@par}% - \ttl@endlongest} - -\def\ttlh@runin#1#2#3#4#5#6#7#8{% - \global\@noskipsectrue - \gdef\ttl@makeline##1{##1}% - \ttl@changecentercr - #1{\ifhmode\ttl@hmode@error\fi - \global\sbox\ttl@box{% - \ttl@calc\hspace{#6}% - \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi - #4{#8}#5\unskip}}% - \gdef\@svsechd{\unhbox\ttl@box}} - -% +-----------------+ -% | T O O L S | -% +-----------------+ -% -% calcwidth -% ~~~~~~~~~ -% Implemented after code from soul (but much modified...) - -\newdimen\titlewidth -\newdimen\titlewidthlast -\newdimen\titlewidthfirst - -\let\ttl@glcmds\relax -\let\ttl@beginlongest\@empty -\let\ttl@midlongest\@empty -\let\ttl@endlongest\@empty -\let\iftitlemeasuring\@secondoftwo - -\def\ttl@xbeginlongest#1\ttl@endlongest{% - \titlewidth\z@ - \titlewidthlast\z@ - \let\iftitlemeasuring\@firstoftwo - \setbox\ttl@box\vbox{% - \def\ttl@glcmds{% - \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% - {\@ifnextchar[{\ttl@bs}{\newline}}}% - \def\ttl@bs[####1]{\newline}% - \let\@centercr\\% - \def\ttl@midlongest####1\@@par{}% Very dirty... - \advance\rightskip 1\leftskip plus 1fil - \leftskip=\z@}% - #1}% - \let\iftitlemeasuring\@secondoftwo - \ttl@boxprocess - #1} - -\def\ttl@boxprocess{% - \setbox\ttl@box=\vbox{% - \unvcopy\ttl@box - \unskip\unpenalty - \global\setbox\@ne=\lastbox}% - \ifvoid\@ne - \else - \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% - \titlewidthfirst\wd\tw@ - \ifdim\titlewidth<\titlewidthfirst - \titlewidth\titlewidthfirst - \fi - \ifdim\titlewidthlast=\z@ - \titlewidthlast\titlewidthfirst - \fi - \expandafter\ttl@boxprocess - \fi} - -% Rules -% ~~~~~ - -\providecommand\titleline{% - \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% - {\ttl@line@i{}}} - -\def\ttl@line@i#1{% - \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} - -\def\ttl@line#1[#2]#3{% - \vskip\topskip - \hrule \@height \z@ - \nobreak - \vskip-\topskip - \begingroup - \parindent\z@ - \everypar{}% - \leftskip\z@ - \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: - \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% - \par - \endgroup - \hrule height \z@ - \nobreak} - -\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} - -\let\ttl@leaders\xleaders % For titletoc compatibility - -\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} -\def\ttl@row@i[#1]#2{% - \ifvmode\expandafter\titleline\fi - {\sbox\z@{#2}% - \ttl@calcneg\hspace{#1}% - \hskip\wd\z@ - \ttl@leaders\hb@xt@#1{\hss\box\z@}% - \hfill\kern\z@}} - -\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} -\def\ttl@rule@i[#1]{% - \ifvmode\expandafter\titleline\fi - {\leaders\hrule height #1\hfill\kern\z@}} - -% Par shapes and space -% ~~~~~~~~~~~~~~~~~~~~ - -\providecommand\filright{% - \gdef\ttl@filleft##1{\hskip##1}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \advance\rightskip\z@ \@plus 1fil\relax} -\providecommand\filleft{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hskip##1}% - \let\\\@centercr - \advance\leftskip\z@ \@plus 1fil - \parfillskip\z@} -\providecommand\filcenter{\filleft\filright - \gdef\ttl@filleft##1{\hfill}} -\providecommand\fillast{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \filleft\advance\rightskip\z@ \@plus -1fil - \parfillskip\z@ \@plus 2fil\relax} -\newcommand\filinner{% - \if@twoside - \ifodd\count\z@\filleft\else\filright\fi - \else - \filleft - \fi} -\newcommand\filouter{% - \if@twoside - \ifodd\count\z@\filright\else\filleft\fi - \else - \filright - \fi} - -\newcommand\wordsep{\fontdimen\tw@\font \@plus - \fontdimen\thr@@\font \@minus \fontdimen4\font} - -% +-----------------+ -% | O P T I O N S | -% +-----------------+ - - -\DeclareOption{pagestyles}{\let\sectiontitle\@empty} -\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} -\DeclareOption{floatps}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\space - \else - \PackageWarning{titlesec}{Ignoring `floatps' without - `pagestyles'. This option is now deprecated.}% - \fi} -\DeclareOption{psfloats}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\@empty - \else - \PackageWarning{titlesec}{Ignoring `psfloats' without - `pagestyles'}% - \fi} - -\DeclareOption{loadonly}{\let\ttl@extract\@empty} - -\DeclareOption{outermarks}{% - \def\ttl@titlemarks{\outertitlemarks}} -\DeclareOption{topmarks}{ - \def\ttl@titlemarks{\toptitlemarks}} -\DeclareOption{botmarks}{% - \def\ttl@titlemarks{\bottitlemarks}} -\DeclareOption{innermarks}{% - \def\ttl@titlemarks{\innertitlemarks}} - -\DeclareOption{footmarks}{} % Backward compat - -\DeclareOption{explicit}{\ttl@explicittrue} - -\DeclareOption{clearempty}{% - \def\cleardoublepage{% - \clearpage{\ps@empty\if@twoside\ifodd\c@page\else - \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} - -\DeclareOption{rigidchapters}{% - \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% - \def\ttl@chapafter{.26\textheight}} -\DeclareOption{rubberchapters}{% - \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% - \def\ttl@chapafter{40\p@}} - -\DeclareOption{bottomtitles}{% - \def\bottomtitlespace{-1\p@}} -\DeclareOption{nobottomtitles}{% - \def\bottomtitlespace{.2\textheight}} -\DeclareOption{nobottomtitles*}{% - \let\ttl@addstretch\relax - \def\bottomtitlespace{.2\textheight}} - -\DeclareOption{calcwidth}{% - \let\ttl@beginlongest\ttl@xbeginlongest} - -\DeclareOption{aftersep}{% - \let\ttl@titlespace\@gobble} -\DeclareOption{largestsep}{% - \let\ttl@titlespace\addvspace} - -\DeclareOption{oldparttoc}{% - \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} -\DeclareOption{newparttoc}{% - \let\ttl@tocpart\relax} -\DeclareOption{notocpart*}{% - \let\ttl@notocparts\@empty} - -\DeclareOption{rm}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} -\DeclareOption{sf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} -\DeclareOption{tt}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} -\DeclareOption{md}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} -\DeclareOption{bf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} -\DeclareOption{up}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} -\DeclareOption{it}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} -\DeclareOption{sl}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} -\DeclareOption{sc}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} - -\DeclareOption{big}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi}} -\DeclareOption{medium}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large - \or\normalsize\or\or\or\LARGE\fi}} -\DeclareOption{small}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large - \or\normalsize\or\normalsize\or\or\or\Large\fi}} -\DeclareOption{tiny}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or - \normalsize\or\normalsize\or\or\or\normalsize\fi}} - -\DeclareOption{raggedleft}{% - \gdef\ttl@fil{\filleft}} -\DeclareOption{center}{% - \gdef\ttl@fil{\filcenter}} -\DeclareOption{raggedright}{% - \gdef\ttl@fil{\filright}} - -\DeclareOption{uppercase}{% - \gdef\ttl@case{\MakeUppercase}} - -\DeclareOption{compact}{% - \gdef\ttl@space{1}% - \gdef\ttl@chapafter{30\p@}} - -% Deprecated. To be remmoved in a major upgrade (3.0) -\DeclareOption{indentfirst}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{nonindentfirst}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% New names -\DeclareOption{indentafter}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{noindentafter}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% newlinetospace -\let\ttl@blinemarks\relax -\let\ttl@elinemarks\relax - -\DeclareRobustCommand\ttl@linetosp{% - \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% - -\def\ttl@linetosp@i{% - \ifdim\lastskip>\z@\else\space\fi - \ignorespaces} - -\DeclareOption{newlinetospace}{% - \def\ttl@blinemarks{% - \let\ttl@e\\% - \def\\{\ttl@linetosp}}% - \def\ttl@elinemarks{\let\\\ttl@e}}% - -% toctitles -\def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% - \nobreak} - -\DeclareOption{toctitles}{% - \def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% - \nobreak}} - -% pageatnewline - -\def\ttl@changecentercr{% - \let\ttl@centercr\@centercr - \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} - -\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} - -\def\ttl@fonts{} - -\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% - innermarks} - -\ProcessOptions - -% +-----------------+ -% | H Y P E R R E F | -% +-----------------+ -% -% These two commands are provided by hyperref. But if they -% are not defined at \begin{document} hyperref has not been -% loaded or it is an old version. - -\AtBeginDocument{% - \ifx\ttl@Hy@steplink\@undefined - \let\ttl@Hy@steplink\@gobble - \let\ttl@Hy@refstepcounter\refstepcounter - \fi} - -% +-----------------+ -% | PAGE STYLES | -% +-----------------+ -% -% This is generic: - -\newcommand\assignpagestyle[2]{% - \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} - -% Old pagestyles -% ~~~~~~~~~~~~~~ - -\providecommand\newpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \newpagestyle} - -\providecommand\renewpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \renewpagestyle} - -\providecommand\widenhead{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \widenhead} - -% New pagestyles -% ~~~~~~~~~~~~~~ - -\@ifundefined{sectiontitle}{}{\input{ttlps.def}} - -% +-----------------+ -% | C O M P A T | -% +-----------------+ -% Easy setup, i.e., that of package options, is -% taken care of, if necessary. - -\renewcommand\secdef[2]{% - \@ifstar - {\ttl@labelfalse - #2} - {\ttl@labeltrue - \ifx#1\@chapter - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \else\ifx#1\@part - \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi - \fi\fi - \let\ifttl@toclabel\ifttl@label - \@dblarg{#1}}} - -\@ifundefined{ttl@extract}{}{\endinput} - -\newcommand\titlelabel[1]{% - \def\@seccntformat##1{#1}} - -\expandafter\ifx\csname chapter\endcsname\relax - - \def\ttl@compatpart{\titleclass{\part}{part}\relax} - -\else - - \def\ttl@compatchapter{% - \def\@makechapterhead{% - \ttl@labeltrue - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}% - \def\@makeschapterhead{% - \ttl@labelfalse - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}} - - \def\ttl@compatpart{\titleclass{\part}{page}\relax} - -\fi - -\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% - \@tempskipa=#5 - \@tempskipb=#6 - \ifdim\@tempskipa<\z@ - \toks@{\titlespacing*#8{#4}}% - \@tempskipa-\@tempskipa - \else - \toks@{\titlespacing#8{#4}}% - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% - \ifdim\@tempskipb<\z@ - \if@tempswa - \titleformat#8[runin]% - {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8[runin]% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@tempskipb-\@tempskipb - \else - \if@tempswa - \titleformat#8% - {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% - \fi - \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} - \ttl@a} - -\def\ttl@extract#1{% - \expandafter\in@\expandafter\@startsection\expandafter{#1}% - \ifin@ - \expandafter\ttl@@extract#1#1% - \else - \PackageWarningNoLine{titlesec}% - {Non standard sectioning command detected\MessageBreak - Using default spacing and no format} - \titlespacing*#1{\z@}{*3}{*2}% - \fi} - -\@tempswafalse - -\ifx\ttl@fonts\@empty - \def\ttl@fonts{\bfseries} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@sizes\endcsname\relax - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@fil\endcsname\relax - \let\ttl@fil\@empty -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@case\endcsname\relax - \let\ttl@case\@firstofone -\else - \@tempswatrue -\fi - -\if@tempswa - - \expandafter\ifx\csname chapter\endcsname\relax\else - \titleformat\chapter[display]% - {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} - {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} - \fi - -\fi - -\ttl@extract\section -\ttl@extract\subsection -\ttl@extract\subsubsection -\ttl@extract\paragraph -\ttl@extract\subparagraph - -\let\ttl@extract\@undefined -\let\ttl@@extract\@undefined - -\def\ttl@toplevel{part} - -\expandafter\ifx\csname chapter\endcsname\relax - - \@namedef{ttll@part}{0} - \titleclass{\section}{straight}[\part] - - \titlespacing*{\part} - {\z@} - {4ex} - {3ex} - -\else - - \let\ttl@save@mkchap\@makechapterhead - \let\ttl@save@mkschap\@makeschapterhead - - \def\@makechapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkchap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \def\@makeschapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkschap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \@namedef{ttll@part}{-1} - \@namedef{ttlss@part}{chapter} - \@namedef{ttll@chapter}{0} - \titleclass{\section}{straight}[\chapter] - -% The following is unoperant, unless when \chapter / \part -% format is redefined - - \titlespacing*{\part} - {\z@} - {\z@\@plus1fil} - {\z@\@plus1fil} - - \titlespacing*\chapter - {\z@}% - {50\p@}% - {\ttl@chapafter}% - -\fi - -\titleclass{\subsection} {straight}[\section] -\titleclass{\subsubsection}{straight}[\subsection] -\titleclass{\paragraph} {straight}[\subsubsection] -\titleclass{\subparagraph} {straight}[\paragraph] - -\endinput +% +--------------------------------------------------+ +% | Typeset titlesec.tex to get the documentation. | +% +--------------------------------------------------+ +% +% Copyright (c) 1998-2016 by Javier Bezos. +% All Rights Reserved. +% +% This file is part of the titlesec distribution release 2.10.2 +% ----------------------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is Javier Bezos. +% +% Notes +% ~~~~~ +% +% The following tags are used: +% ttl@ : the generic tag used through the style +% ttlh@ : a shape definition +% ttlf@ : a macro containing the title format +% ttls@ : id. the title space +% ttlp@ : page key related macros +% ttll@ : level number +% +% The ttlf@ and ttls@ contains data in the form {..}{..}. +% Perhaps in future releases they should be converted +% to a prop-like list, similar to that proposed by the +% latex team. +% +% Admittedly, the current implementation seems too +% complicated, but that's necessary in order to provide +% certain compatibility with the sections as defined by the +% used class. Other packages opt for providing the sections +% as defined by standard classes ignoring the class; for +% instance sectsty which does a simple task in a simple and +% nice way. However, that was not my goal. +% +% Release +% ~~~~~~~ + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] + +% Initialization +% ~~~~~~~~~~~~~~ + +\newif\ifttl@ps +\ttl@psfalse + +% The \ttl@label switch is used when printing the label in titles. +% A numberless variant makes it to true. +% There is a \ttl@toclabel as well, which is true iff the +% title is numbered; used in toc entries (except default part +% and chapter) and marks (only in titlesec pagestyles). + +\newif\ifttl@label +\newif\ifttl@toclabel + +\newbox\ttl@box + +% A provision for the report style: + +\@ifundefined{if@mainmatter} + {\let\if@mainmatter\iftrue}{} + +\@ifundefined{if@openright} + {\let\if@openright\iftrue}{} + +% and the ams styles as well + +\@ifundefined{@chapapp} + {\let\@chapapp\chaptername}{} + +\def\ttl@trylist{\ttl@try{}} + +\def\ttl@getkeys#1#2{% + \if\expandafter @\@gobble#1@\@empty + \edef\ttl@b{\expandafter\@gobble\string#1}% + \let\ttl@a\ttl@b + \else + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlkeys.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \ttl@getkeys{#1}{#2}% + \fi} + +% A more meaningful error for \@notdefinable + +\expandafter\AtEndOfPackage\expandafter{\expandafter + \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} + +\def\@notdefinable{% + \PackageError{titlesec}% + {Incompatible package}% + {Titlesec cannot continue defining its own macros + because\MessageBreak + \@backslashchar\reserved@a\space is already used by other package, + the class\MessageBreak + or the document.}} + +% +-----------------+ +% | C L A S S E S | +% +-----------------+ + +\def\ttl@useclass#1#2{% + \@ifstar + {\ttl@labelfalse#1{#2}[]}% + {\ttl@labeltrue\@dblarg{#1{#2}}}} + +\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} +\def\ttl@partclass{\ttl@useclass\ttl@part@i} +\def\ttl@topclass{\ttl@useclass\ttl@top@i} +\def\ttl@pageclass{\ttl@useclass\ttl@page@i} + +% Here \scantokens is used to make sure the unescaped name +% has `letters' and no `others'. Mainly for hyperref, so there +% should be no problems. + +\newcommand\titleclass[1]{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \ifx\scantokens\@undefined\else + \scantokens\expandafter{\expandafter + \def\expandafter\ttl@a\expandafter{\ttl@a}}% + \fi + \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% + {\@tempswafalse\ttl@class@ii{#1}}} + +\def\ttl@class@i#1[#2]{% + \@namedef{ttll@\ttl@a}{#2}% + \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% + \@ifundefined{ttl@toplevel}{}% + {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@toplevel\endcsname}% + \edef\ttl@toplevel{\ttl@a}% + \ttl@class@ii{#1}} + +\def\ttl@class@ii#1#2{% + \@ifundefined{ttl@#2class}% + {\PackageError{titlesec}{Unknown sectioning class}% + {Valid names are top, page and straight}}% + {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax + \@ifundefined{\ttl@a mark}% + {\@namedef{\ttl@a mark}{\@gobble}}% + {}% + \edef#1{% + \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% + \if@tempswa + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {\@ifnextchar[% + {\ttl@class@iii}% + {\@ifundefined{ttll@\ttl@a}% + {\PackageError{titlesec}{Unknown sectioning level}% + {\string\titleclass\space with no optional arguments\MessageBreak + only changes the class of an *existing* level}}}}} + +\def\ttl@class@iii[#1]{% + \edef\ttl@b{\expandafter\@gobble\string#1}% + \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@b\endcsname + \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% + \let\ttl@a\ttl@toplevel + \count@\csname ttll@\ttl@toplevel\endcsname + \ttl@class@iv} + +\def\ttl@class@iv{% + \@ifundefined{ttlss@\ttl@a}{}% + {\advance\count@\@ne + \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% + \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% + \ttl@class@iv}} + +% Typesetting Classes: General tools +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% The following command handles the *n spacing +% Some tricks are necessary to multiply a +% skip by a non integer number + +\newskip\beforetitleunit +\beforetitleunit=1ex\@plus.3ex\@minus.06ex +\newskip\aftertitleunit +\aftertitleunit=1ex\@plus.1ex + +\newdimen\ttl@plus +\newdimen\ttl@minus + +\def\ttl@assign#1{% + \@ifstar + {\ttl@assign@i{#1}}% + {\ttl@assign@d{#1}}} + +\def\ttl@assign@i#1#2\relax#3{% + \ttl@plus\z@ + \ttl@minus\z@ + \afterassignment\ttl@assign@ii + \dimen@\the#3, % <- space + #1 = #2\dimen@ + plus #2\ttl@plus + minus #2\ttl@minus} + +\def\ttl@assign@ii#1 {% <- space + \if#1,\else\afterassignment\ttl@assign@ii\fi + \csname ttl@\string#1\endcsname} + +\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} + +% To be used with \v/vspace to make them calc-savvy + +\def\ttl@calc#1#2{% + {\setlength\@tempskipa{#2}% + #1\@tempskipa}} + +\def\ttl@calcneg#1#2{% + {\setlength\@tempskipa{#2}% + #1{-\@tempskipa}}} + +% Gets from ttls@ and passes the spacing parameters: + +\def\ttl@startargs#1#2{% Get the first arguments, with the spacing + \@ifundefined{ttlp@#2}% + {\let\ttl@key@page\@empty}% + {\ttlp@fetch{#2}}% + \begingroup + \def\ttl@b{ttls@#2}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \xdef\ttl@b{\ttl@c}% + \endgroup + \ifx\ttl@b\@empty + \PackageError{titlesec}{Format/spacing not found}% + {I was unable to find the format corresponding to #2.\MessageBreak + Maybe you haven't set it with \string\titleformat\space and + \string\titlespacing} + \fi + \expandafter#1\ttl@b{#2}} + +% Used in ttl@select + +\def\ttl@savefn#1[#2]#3{% + \ifcase#1% + \footnotemark[#2]% + \gdef\ttl@fn{\footnotetext[#2]{#3}}% + \else + \footnotemark + \gdef\ttl@fn{\footnotetext{#3}}% + \fi} + +\def\ttl@nest@error{% + \PackageError{titlesec}{Nested titles}{Titles must not be nested}} + +\def\ttl@hmode@error{% + \PackageError{titlesec}{Entered in horizontal mode} + {The argument cannot contain horizontal material\MessageBreak + such as text, \string\noindent, \string\makebox, etc.}} + +% \ttl@select not only selects the right version to be +% used. It also take steps to ensure that a mark +% is not lost inside a box by saving it into \ttl@mk, +% which in turn is used by the sect and chap commands. + +\newif\ifttl@explicit + +\def\ttl@gmk#1{\gdef\ttl@mk{#1}} + +\def\ttl@select#1#2#3#4{% + \ttl@Hy@saveanchor + \global\let\ttl@mk\@empty % global because of rigidchapters + \global\let\ttl@fn\@empty + \begingroup + \if@inlabel\else % Keep item's \everypar + \everypar{\setbox\z@\lastbox\strut}% + \fi + \let\ttl@straight@i\ttl@nest@error + \let\ttl@top@i \ttl@nest@error + \let\ttl@part@i \ttl@nest@error + \let\ttl@page@i \ttl@nest@error + \let\ttl@newpage\newpage + \def\newpage{\ttl@savewrite\ttl@newpage}% + \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% + \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% + \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% + \def\footnote{\@ifnextchar[% + {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@b{ttlf@#1}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \ifttl@explicit + \def\ttl@passexplicit{\ttl@case{#4}}% + \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... + \else + \let\ttl@passexplicit\ttl@case + \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... + \fi + \endgroup} + +\let\ttl@savewrite\@empty + +\def\ttl@finmarks{% + \ttl@savewrite + \ttl@mk % Contains a possible mark, returned by \ttl@select + \ttl@fn} % And a footnote + +\def\ttl@try#1{% + \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} + \@ifundefined{\ttl@b\ttl@c}{}{% + \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% + \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% + #1% + \let\ttl@try\@gobble}} % locally modified to `break' testings + +% \ttl@write writes marks and toc. tocdepth is taken care of when +% the toc is typesetted and not here. Used always through +% ttl@savewrite, which is reset to \@empty to avoid duplicated +% calls. + +\def\ttl@write#1#2{% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% + \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a + \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a + \ttl@elinemarks + \global\ttl@toclabelfalse + \global\let\ttl@savewrite\@empty} + +\newif\ifttl@premark % to be used in ttlps.def +\ttl@premarkfalse + +\def\ttl@premark#1#2{% + \protected@xdef\ttl@prevmarks{\ttl@marks}% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \ttl@elinemarks + \gdef\ttl@prevmarks{\ttl@marks}} + +% Must be preceded by a default \ttl@savewrite, which is used +% in starred variants--\@empty in top and straight classes. +% In straight class, it is preceded by the setting of +% prev marks to provide a "fixed" top mark. Otherwise, +% the default prev mark (= curr mark) is used (restored +% after ttl@labelling in straight). This is the command +% to be hacked if you want to change the behaviour of +% starred variants. + +\def\ttl@labelling#1#2{% + \let\ttl@Hy@saveanchor\@empty + \ifttl@label % 1st - if star + \def\ttl@savewrite{\ttl@write{#1}{#2}}% + \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. + \ifttl@label % 2nd - eg, if not main matter + \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax + \ttl@labelfalse % 3rd - if too deep + \else + \ttl@Hy@refstepcounter{#1}% + \@nameuse{ttl@#1out}% + \fi + \fi + \fi + \let\ifttl@toclabel\ifttl@label + \ifx\ttl@savewrite\@empty\else % If marks + \ifttl@ps + \ifttl@premark + \global\ttl@premarkfalse + \else % if no \pretitlemark + \ttl@premark{#1}{#2}% + \fi + \fi + \ifttl@label\else\ttl@Hy@steplink{#1}\fi + \fi} + +% Executed by ttl@labelling if the name of section is chapter: + +\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} + +% Executed by ttl@labelling if chapter has a number. Note +% you can define messages for other sectioning levels (eg, +% \ttl@sectionout). + +\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} + +% Straight class +% ~~~~~~~~~~~~~ +% Default for nobottomtitles. Changed by nobottomtitles* + +\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} + +% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title +% The second argument of ttl@sect is the level, which +% is empty if the star version is used. In this case +% neither the toc nor the marks are written. + +\def\ttl@straight@i#1[#2]#3{% + \def\@currentlabelname{#2}% for nameref + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \gdef\thetitle{\csname the#1\endcsname}% + \if@noskipsec \leavevmode \fi + \par + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@straight@ii{#1}{#3}} + +% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title + +\def\ttl@straight@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in straight class ignored}}% + \if@nobreak + \ttl@titlespace{\@tempskipa}% + \else + \@ifundefined{#6break}% + {\addpenalty{\@secpenalty}}% + {\csname#6break\endcsname}% + \addvspace{\@tempskipa}% + \ifdim\bottomtitlespace<\z@ + \else + \begingroup + \@tempskipb\pagegoal + \@tempskipa\pagegoal + \ttl@addstretch % \relax if nobottomtitle* + \advance\@tempskipa-\bottomtitlespace\relax % not a register + \pagegoal\@tempskipa + \def\@textbottom{\vskip\z@\@plus.0001fil}% + \penalty9999 + \pagegoal\@tempskipb + \endgroup + \fi + \fi + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \if@noskipsec + \global\@nobreakfalse + \everypar{% + \if@noskipsec + \global\@noskipsecfalse + \clubpenalty\@M + \hskip-\parindent + \begingroup + \@svsechd\unskip{\hspace{\@tempskipb}}% + \endgroup + \else + \clubpenalty\@clubpenalty\everypar{}% + \fi}% + \else + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading + \fi + \ignorespaces} + +% Part class +% ~~~~~~~~~~ + +\providecommand\partmark[1]{\markboth{}{}} + +\def\ttl@part@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@part@ii{#1}{#3}} + +\def\ttl@part@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in part class ignored}}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse \fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading} + +% Page class +% ~~~~~~~~~~ + +\def\ttl@page@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@page@ii{#1}{#3}} + +\def\ttl@page@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi + \vspace*{\@tempskipa}% + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \vspace{\@tempskipb}% + \newpage + \if@twoside + \if@openright + \null + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{empty}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \newpage + \fi + \fi + \if@tempswa + \twocolumn + \fi + \ignorespaces} + +% Top class and some makechapterhead stuff +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% +% \ttl@mkchap is the new make(s)chapterhead. + +\def\ttl@mkchap#1#2#3#4#5#6#7{% + \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% + \let\ttl@savewrite\@empty + \let\ttl@Hy@saveanchor\@empty + \@ifundefined{ttl@ps@#6}{}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \let\ifttl@toclabel\ifttl@label + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} + +% But \ttl@mkchap@i is used by both makechapterhead and +% the top class. + +\def\ttl@mkchap@i#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@topmode{\@tempskipb}{% + \ttl@select{#6}{#1}{#2}{#7}}% + \ttl@finmarks % Outside the box! + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} + +\def\ttl@top@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@top@ii{#1}{#3}} + +\def\ttl@top@ii#1#2#3#4#5#6#7{% + \@ifundefined{#6break}% + {\if@openright + \cleardoublepage + \else + \clearpage + \fi}% + {\csname#6break\endcsname}% + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \global\@topnum\z@ + \@ifundefined{#6tolists}% + {\addtocontents{lof}{\protect\ttl@tocsep}% + \addtocontents{lot}{\protect\ttl@tocsep}} + {\@nameuse{#6tolists}}% + \if@twocolumn + \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% + \else + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \@afterheading + \fi + \ignorespaces} + + +% \def\ttl@noskipsectrue{% +% \if@noskipsec +% \PackageError{titlesec}{Invalid shape for top class}% +% {The selected shape only makes sense when merged into\MessageBreak +% a paragraph. That is impossible in the top class}% +% \else + +\newcommand\chaptertitlename{\@chapapp} +\def\ttl@tocsep{\addvspace{10\p@}} + +% +-----------------+ +% | S H A P E S | +% +-----------------+ +% +% % Reformatting Titles: Interface +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +% The surrounding space is stored in a macro +% named \ttls@
whose content is +% {left}{right}{before}{after}{afterindent}. +% But if there is the page key, the name is +% \ttls@
/ + +\newcommand\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} + +\def\ttl@spacing@i#1#2#3#4#5{% + \ttl@getkeys{#2}{titlesec}% + \@ifnextchar[{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}% + }{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} + +\def\ttl@spacing@ii#1#2#3#4[#5]{% + \expandafter\def\csname ttls@\ttl@a\endcsname + {{#2}{#5}{#3}{#4}{#1}}} + +% The section name is built in \ttl@a. +% The format is stored in a macro named \ttlf@
, +% or \ttlf@
/ if there is the page spec, +% or \ttlf@.../* if numberless is true +% whose content is +% \ttl@{format}{label}{sep}{before}{after} + +\newtoks\ttl@toksa + +\newcommand\titleformat{% + \@ifstar{\ttl@format@s}% + {\ttl@format@i}} + +\def\ttl@format@s#1#2{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \@ifundefined{ttlf@\ttl@a}% + {\PackageError{titlesec}{Not allowed in `easy' settings} + {The sectiong command you are trying to redefine\MessageBreak + is not handled by the starred variant (eg, \string\part)}}{} + \expandafter\expandafter\expandafter + \ttl@format@si\csname ttlf@\ttl@a \endcsname + {#2}} + +\def\ttl@format@si#1#2#3#4#5#6#7{% + \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} + +\def\ttl@format@i#1{% + \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} + +\def\ttl@format@ii#1[#2]#3#4#5#6{% + \ttl@getkeys{#1}{titlesec}% + \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments + \@ifnextchar[{% + \ttl@format@iii{#2}% + }{% + \ttl@format@iii{#2}[]}} + +% First, we get the shape -- if not defined it loads +% the corresponding file. + +\def\ttl@format@iii#1[#2]{% + \@ifundefined{ttlh@#1}{% + \begingroup + \makeatletter + \InputIfFileExists{#1.tss}{}{% + \PackageError{titlesec}{Unknown shape}% + {Shapes are defined in files with extension tss\MessageBreak + Either you have misspelled the shape\MessageBreak + or there is no a #1.tss file}}% + \endgroup}{}% + \@temptokena{#2}% + \ifttl@explicit + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \else + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \fi + \ttl@b + \csname ttl@compat\ttl@a\endcsname} + +% Styles +% ~~~~~~ + +% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title +% \ttl@ and \ttlh@ take the following eight +% arguments: +% {format}{label}{sep}{before}{after}{left}{right}{title} +% where before and after refer to the format. +% With the option explicit, #4 contains the title and #8 is +% empty. + +\def\ttlh@display#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \ifttl@label + {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% + \fi + #4{#8}% + \kern\z@\strut\@@par + \nobreak\ttl@midlongest#5\@@par + \ttl@endlongest} + +\def\ttlh@hang#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1{\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \begingroup + \ifttl@label + \noindent + \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% + \hangindent\wd\z@ + \box\z@ + \fi + #4{#8}% + \kern\z@\strut\@@par + \endgroup + \nobreak\ttl@midlongest#5\@@par}% + \ttl@endlongest} + +\def\ttlh@runin#1#2#3#4#5#6#7#8{% + \global\@noskipsectrue + \gdef\ttl@makeline##1{##1}% + \ttl@changecentercr + #1{\ifhmode\ttl@hmode@error\fi + \global\sbox\ttl@box{% + \ttl@calc\hspace{#6}% + \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi + #4{#8}#5\unskip}}% + \gdef\@svsechd{\unhbox\ttl@box}} + +% +-----------------+ +% | T O O L S | +% +-----------------+ +% +% calcwidth +% ~~~~~~~~~ +% Implemented after code from soul (but much modified...) + +\newdimen\titlewidth +\newdimen\titlewidthlast +\newdimen\titlewidthfirst + +\let\ttl@glcmds\relax +\let\ttl@beginlongest\@empty +\let\ttl@midlongest\@empty +\let\ttl@endlongest\@empty +\let\iftitlemeasuring\@secondoftwo + +\def\ttl@xbeginlongest#1\ttl@endlongest{% + \titlewidth\z@ + \titlewidthlast\z@ + \let\iftitlemeasuring\@firstoftwo + \setbox\ttl@box\vbox{% + \def\ttl@glcmds{% + \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% + {\@ifnextchar[{\ttl@bs}{\newline}}}% + \def\ttl@bs[####1]{\newline}% + \let\@centercr\\% + \def\ttl@midlongest####1\@@par{}% Very dirty... + \advance\rightskip 1\leftskip plus 1fil + \leftskip=\z@}% + #1}% + \let\iftitlemeasuring\@secondoftwo + \ttl@boxprocess + #1} + +\def\ttl@boxprocess{% + \setbox\ttl@box=\vbox{% + \unvcopy\ttl@box + \unskip\unpenalty + \global\setbox\@ne=\lastbox}% + \ifvoid\@ne + \else + \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% + \titlewidthfirst\wd\tw@ + \ifdim\titlewidth<\titlewidthfirst + \titlewidth\titlewidthfirst + \fi + \ifdim\titlewidthlast=\z@ + \titlewidthlast\titlewidthfirst + \fi + \expandafter\ttl@boxprocess + \fi} + +% Rules +% ~~~~~ + +\providecommand\titleline{% + \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% + {\ttl@line@i{}}} + +\def\ttl@line@i#1{% + \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} + +\def\ttl@line#1[#2]#3{% + \vskip\topskip + \hrule \@height \z@ + \nobreak + \vskip-\topskip + \begingroup + \parindent\z@ + \everypar{}% + \leftskip\z@ + \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: + \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% + \par + \endgroup + \hrule height \z@ + \nobreak} + +\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} + +\let\ttl@leaders\xleaders % For titletoc compatibility + +\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} +\def\ttl@row@i[#1]#2{% + \ifvmode\expandafter\titleline\fi + {\sbox\z@{#2}% + \ttl@calcneg\hspace{#1}% + \hskip\wd\z@ + \ttl@leaders\hb@xt@#1{\hss\box\z@}% + \hfill\kern\z@}} + +\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} +\def\ttl@rule@i[#1]{% + \ifvmode\expandafter\titleline\fi + {\leaders\hrule height #1\hfill\kern\z@}} + +% Par shapes and space +% ~~~~~~~~~~~~~~~~~~~~ + +\providecommand\filright{% + \gdef\ttl@filleft##1{\hskip##1}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \advance\rightskip\z@ \@plus 1fil\relax} +\providecommand\filleft{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hskip##1}% + \let\\\@centercr + \advance\leftskip\z@ \@plus 1fil + \parfillskip\z@} +\providecommand\filcenter{\filleft\filright + \gdef\ttl@filleft##1{\hfill}} +\providecommand\fillast{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \filleft\advance\rightskip\z@ \@plus -1fil + \parfillskip\z@ \@plus 2fil\relax} +\newcommand\filinner{% + \if@twoside + \ifodd\count\z@\filleft\else\filright\fi + \else + \filleft + \fi} +\newcommand\filouter{% + \if@twoside + \ifodd\count\z@\filright\else\filleft\fi + \else + \filright + \fi} + +\newcommand\wordsep{\fontdimen\tw@\font \@plus + \fontdimen\thr@@\font \@minus \fontdimen4\font} + +% +-----------------+ +% | O P T I O N S | +% +-----------------+ + + +\DeclareOption{pagestyles}{\let\sectiontitle\@empty} +\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} +\DeclareOption{floatps}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\space + \else + \PackageWarning{titlesec}{Ignoring `floatps' without + `pagestyles'. This option is now deprecated.}% + \fi} +\DeclareOption{psfloats}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\@empty + \else + \PackageWarning{titlesec}{Ignoring `psfloats' without + `pagestyles'}% + \fi} + +\DeclareOption{loadonly}{\let\ttl@extract\@empty} + +\DeclareOption{outermarks}{% + \def\ttl@titlemarks{\outertitlemarks}} +\DeclareOption{topmarks}{ + \def\ttl@titlemarks{\toptitlemarks}} +\DeclareOption{botmarks}{% + \def\ttl@titlemarks{\bottitlemarks}} +\DeclareOption{innermarks}{% + \def\ttl@titlemarks{\innertitlemarks}} + +\DeclareOption{footmarks}{} % Backward compat + +\DeclareOption{explicit}{\ttl@explicittrue} + +\DeclareOption{clearempty}{% + \def\cleardoublepage{% + \clearpage{\ps@empty\if@twoside\ifodd\c@page\else + \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} + +\DeclareOption{rigidchapters}{% + \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% + \def\ttl@chapafter{.26\textheight}} +\DeclareOption{rubberchapters}{% + \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% + \def\ttl@chapafter{40\p@}} + +\DeclareOption{bottomtitles}{% + \def\bottomtitlespace{-1\p@}} +\DeclareOption{nobottomtitles}{% + \def\bottomtitlespace{.2\textheight}} +\DeclareOption{nobottomtitles*}{% + \let\ttl@addstretch\relax + \def\bottomtitlespace{.2\textheight}} + +\DeclareOption{calcwidth}{% + \let\ttl@beginlongest\ttl@xbeginlongest} + +\DeclareOption{aftersep}{% + \let\ttl@titlespace\@gobble} +\DeclareOption{largestsep}{% + \let\ttl@titlespace\addvspace} + +\DeclareOption{oldparttoc}{% + \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} +\DeclareOption{newparttoc}{% + \let\ttl@tocpart\relax} +\DeclareOption{notocpart*}{% + \let\ttl@notocparts\@empty} + +\DeclareOption{rm}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} +\DeclareOption{sf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} +\DeclareOption{tt}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} +\DeclareOption{md}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} +\DeclareOption{bf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} +\DeclareOption{up}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} +\DeclareOption{it}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} +\DeclareOption{sl}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} +\DeclareOption{sc}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} + +\DeclareOption{big}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi}} +\DeclareOption{medium}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large + \or\normalsize\or\or\or\LARGE\fi}} +\DeclareOption{small}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large + \or\normalsize\or\normalsize\or\or\or\Large\fi}} +\DeclareOption{tiny}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or + \normalsize\or\normalsize\or\or\or\normalsize\fi}} + +\DeclareOption{raggedleft}{% + \gdef\ttl@fil{\filleft}} +\DeclareOption{center}{% + \gdef\ttl@fil{\filcenter}} +\DeclareOption{raggedright}{% + \gdef\ttl@fil{\filright}} + +\DeclareOption{uppercase}{% + \gdef\ttl@case{\MakeUppercase}} + +\DeclareOption{compact}{% + \gdef\ttl@space{1}% + \gdef\ttl@chapafter{30\p@}} + +% Deprecated. To be remmoved in a major upgrade (3.0) +\DeclareOption{indentfirst}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{nonindentfirst}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% New names +\DeclareOption{indentafter}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{noindentafter}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% newlinetospace +\let\ttl@blinemarks\relax +\let\ttl@elinemarks\relax + +\DeclareRobustCommand\ttl@linetosp{% + \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% + +\def\ttl@linetosp@i{% + \ifdim\lastskip>\z@\else\space\fi + \ignorespaces} + +\DeclareOption{newlinetospace}{% + \def\ttl@blinemarks{% + \let\ttl@e\\% + \def\\{\ttl@linetosp}}% + \def\ttl@elinemarks{\let\\\ttl@e}}% + +% toctitles +\def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% + \nobreak} + +\DeclareOption{toctitles}{% + \def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% + \nobreak}} + +% pageatnewline + +\def\ttl@changecentercr{% + \let\ttl@centercr\@centercr + \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} + +\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} + +\def\ttl@fonts{} + +\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% + innermarks} + +\ProcessOptions + +% +-----------------+ +% | H Y P E R R E F | +% +-----------------+ +% +% These two commands are provided by hyperref. But if they +% are not defined at \begin{document} hyperref has not been +% loaded or it is an old version. + +\AtBeginDocument{% + \ifx\ttl@Hy@steplink\@undefined + \let\ttl@Hy@steplink\@gobble + \let\ttl@Hy@refstepcounter\refstepcounter + \fi} + +% +-----------------+ +% | PAGE STYLES | +% +-----------------+ +% +% This is generic: + +\newcommand\assignpagestyle[2]{% + \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} + +% Old pagestyles +% ~~~~~~~~~~~~~~ + +\providecommand\newpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \newpagestyle} + +\providecommand\renewpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \renewpagestyle} + +\providecommand\widenhead{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \widenhead} + +% New pagestyles +% ~~~~~~~~~~~~~~ + +\@ifundefined{sectiontitle}{}{\input{ttlps.def}} + +% +-----------------+ +% | C O M P A T | +% +-----------------+ +% Easy setup, i.e., that of package options, is +% taken care of, if necessary. + +\renewcommand\secdef[2]{% + \@ifstar + {\ttl@labelfalse + #2} + {\ttl@labeltrue + \ifx#1\@chapter + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \else\ifx#1\@part + \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi + \fi\fi + \let\ifttl@toclabel\ifttl@label + \@dblarg{#1}}} + +\@ifundefined{ttl@extract}{}{\endinput} + +\newcommand\titlelabel[1]{% + \def\@seccntformat##1{#1}} + +\expandafter\ifx\csname chapter\endcsname\relax + + \def\ttl@compatpart{\titleclass{\part}{part}\relax} + +\else + + \def\ttl@compatchapter{% + \def\@makechapterhead{% + \ttl@labeltrue + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}% + \def\@makeschapterhead{% + \ttl@labelfalse + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}} + + \def\ttl@compatpart{\titleclass{\part}{page}\relax} + +\fi + +\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% + \@tempskipa=#5 + \@tempskipb=#6 + \ifdim\@tempskipa<\z@ + \toks@{\titlespacing*#8{#4}}% + \@tempskipa-\@tempskipa + \else + \toks@{\titlespacing#8{#4}}% + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% + \ifdim\@tempskipb<\z@ + \if@tempswa + \titleformat#8[runin]% + {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8[runin]% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@tempskipb-\@tempskipb + \else + \if@tempswa + \titleformat#8% + {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% + \fi + \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} + \ttl@a} + +\def\ttl@extract#1{% + \expandafter\in@\expandafter\@startsection\expandafter{#1}% + \ifin@ + \expandafter\ttl@@extract#1#1% + \else + \PackageWarningNoLine{titlesec}% + {Non standard sectioning command detected\MessageBreak + Using default spacing and no format} + \titlespacing*#1{\z@}{*3}{*2}% + \fi} + +\@tempswafalse + +\ifx\ttl@fonts\@empty + \def\ttl@fonts{\bfseries} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@sizes\endcsname\relax + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@fil\endcsname\relax + \let\ttl@fil\@empty +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@case\endcsname\relax + \let\ttl@case\@firstofone +\else + \@tempswatrue +\fi + +\if@tempswa + + \expandafter\ifx\csname chapter\endcsname\relax\else + \titleformat\chapter[display]% + {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} + {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} + \fi + +\fi + +\ttl@extract\section +\ttl@extract\subsection +\ttl@extract\subsubsection +\ttl@extract\paragraph +\ttl@extract\subparagraph + +\let\ttl@extract\@undefined +\let\ttl@@extract\@undefined + +\def\ttl@toplevel{part} + +\expandafter\ifx\csname chapter\endcsname\relax + + \@namedef{ttll@part}{0} + \titleclass{\section}{straight}[\part] + + \titlespacing*{\part} + {\z@} + {4ex} + {3ex} + +\else + + \let\ttl@save@mkchap\@makechapterhead + \let\ttl@save@mkschap\@makeschapterhead + + \def\@makechapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkchap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \def\@makeschapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkschap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \@namedef{ttll@part}{-1} + \@namedef{ttlss@part}{chapter} + \@namedef{ttll@chapter}{0} + \titleclass{\section}{straight}[\chapter] + +% The following is unoperant, unless when \chapter / \part +% format is redefined + + \titlespacing*{\part} + {\z@} + {\z@\@plus1fil} + {\z@\@plus1fil} + + \titlespacing*\chapter + {\z@}% + {50\p@}% + {\ttl@chapafter}% + +\fi + +\titleclass{\subsection} {straight}[\section] +\titleclass{\subsubsection}{straight}[\subsection] +\titleclass{\paragraph} {straight}[\subsubsection] +\titleclass{\subparagraph} {straight}[\paragraph] + +\endinput diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/web2c/texmf.cnf b/docs/NARK/Resources/texmf-local/texmf-local/web2c/texmf.cnf similarity index 100% rename from Documentation/NARK/Resources/texmf-local/texmf-local/web2c/texmf.cnf rename to docs/NARK/Resources/texmf-local/texmf-local/web2c/texmf.cnf diff --git a/Documentation/NARK/Resources/texmf-local/web2c/texmf.cnf b/docs/NARK/Resources/texmf-local/web2c/texmf.cnf similarity index 100% rename from Documentation/NARK/Resources/texmf-local/web2c/texmf.cnf rename to docs/NARK/Resources/texmf-local/web2c/texmf.cnf diff --git a/Documentation/NARK/econtexRoot.tex b/docs/NARK/econtexRoot.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/NARK/econtexRoot.tex rename to docs/NARK/econtexRoot.tex diff --git a/Documentation/_static/override-nbsphinx-gallery.css b/docs/_static/override-nbsphinx-gallery.css similarity index 100% rename from Documentation/_static/override-nbsphinx-gallery.css rename to docs/_static/override-nbsphinx-gallery.css diff --git a/Documentation/conf.py b/docs/conf.py similarity index 100% rename from Documentation/conf.py rename to docs/conf.py diff --git a/docs/example_notebooks/ConsPortfolioModel.ipynb b/docs/example_notebooks/ConsPortfolioModel.ipynb new file mode 100644 index 000000000..6e388f23f --- /dev/null +++ b/docs/example_notebooks/ConsPortfolioModel.ipynb @@ -0,0 +1 @@ +../../examples/ConsPortfolioModel/example_ConsPortfolioModel.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/GenIncProcessModel.ipynb b/docs/example_notebooks/GenIncProcessModel.ipynb new file mode 100644 index 000000000..95382b26a --- /dev/null +++ b/docs/example_notebooks/GenIncProcessModel.ipynb @@ -0,0 +1 @@ +../../examples/GenIncProcessModel/GenIncProcessModel.ipynb \ No newline at end of file diff --git a/Documentation/example_notebooks/GenIncProcessModel.py b/docs/example_notebooks/GenIncProcessModel.py similarity index 100% rename from Documentation/example_notebooks/GenIncProcessModel.py rename to docs/example_notebooks/GenIncProcessModel.py diff --git a/docs/example_notebooks/Gentle-Intro-To-HARK.ipynb b/docs/example_notebooks/Gentle-Intro-To-HARK.ipynb new file mode 100644 index 000000000..85e84e64c --- /dev/null +++ b/docs/example_notebooks/Gentle-Intro-To-HARK.ipynb @@ -0,0 +1 @@ +../../examples/Gentle-Intro/Gentle-Intro-To-HARK.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/HARK-struct-2.png b/docs/example_notebooks/HARK-struct-2.png new file mode 100644 index 000000000..e17a1e20a --- /dev/null +++ b/docs/example_notebooks/HARK-struct-2.png @@ -0,0 +1 @@ +../../examples/Journeys/HARK-struct-2.png \ No newline at end of file diff --git a/docs/example_notebooks/HARK-struct-3.png b/docs/example_notebooks/HARK-struct-3.png new file mode 100644 index 000000000..cf5661e64 --- /dev/null +++ b/docs/example_notebooks/HARK-struct-3.png @@ -0,0 +1 @@ +../../examples/Journeys/HARK-struct-3.png \ No newline at end of file diff --git a/docs/example_notebooks/HARK-struct-4.png b/docs/example_notebooks/HARK-struct-4.png new file mode 100644 index 000000000..a607c7d0c --- /dev/null +++ b/docs/example_notebooks/HARK-struct-4.png @@ -0,0 +1 @@ +../../examples/Journeys/HARK-struct-4.png \ No newline at end of file diff --git a/docs/example_notebooks/HowWeSolveIndShockConsumerType.ipynb b/docs/example_notebooks/HowWeSolveIndShockConsumerType.ipynb new file mode 100644 index 000000000..3d43a3c53 --- /dev/null +++ b/docs/example_notebooks/HowWeSolveIndShockConsumerType.ipynb @@ -0,0 +1 @@ +../../examples/HowWeSolveIndShockConsumerType/HowWeSolveIndShockConsumerType.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/IndShockConsumerType.ipynb b/docs/example_notebooks/IndShockConsumerType.ipynb new file mode 100644 index 000000000..2bc279db3 --- /dev/null +++ b/docs/example_notebooks/IndShockConsumerType.ipynb @@ -0,0 +1 @@ +../../examples/ConsIndShockModel/IndShockConsumerType.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/Journey-PhD.ipynb b/docs/example_notebooks/Journey-PhD.ipynb new file mode 100644 index 000000000..550352740 --- /dev/null +++ b/docs/example_notebooks/Journey-PhD.ipynb @@ -0,0 +1 @@ +../../examples/Journeys/Journey-PhD.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/JourneyPhDparam.py b/docs/example_notebooks/JourneyPhDparam.py new file mode 100644 index 000000000..44f05c3fe --- /dev/null +++ b/docs/example_notebooks/JourneyPhDparam.py @@ -0,0 +1 @@ +../../examples/Journeys/JourneyPhDparam.py \ No newline at end of file diff --git a/docs/example_notebooks/KinkedRconsumerType.ipynb b/docs/example_notebooks/KinkedRconsumerType.ipynb new file mode 100644 index 000000000..fd9844aa1 --- /dev/null +++ b/docs/example_notebooks/KinkedRconsumerType.ipynb @@ -0,0 +1 @@ +../../examples/ConsIndShockModel/KinkedRconsumerType.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/LifecycleModel.ipynb b/docs/example_notebooks/LifecycleModel.ipynb new file mode 100644 index 000000000..af569e35a --- /dev/null +++ b/docs/example_notebooks/LifecycleModel.ipynb @@ -0,0 +1 @@ +../../examples/LifecycleModel/LifecycleModel.ipynb \ No newline at end of file diff --git a/docs/example_notebooks/PerfForesightConsumerType.ipynb b/docs/example_notebooks/PerfForesightConsumerType.ipynb new file mode 100644 index 000000000..23345c01c --- /dev/null +++ b/docs/example_notebooks/PerfForesightConsumerType.ipynb @@ -0,0 +1 @@ +../../examples/ConsIndShockModel/PerfForesightConsumerType.ipynb \ No newline at end of file diff --git a/Documentation/guides/contributing.md b/docs/guides/contributing.md similarity index 100% rename from Documentation/guides/contributing.md rename to docs/guides/contributing.md diff --git a/Documentation/guides/index.rst b/docs/guides/index.rst similarity index 100% rename from Documentation/guides/index.rst rename to docs/guides/index.rst diff --git a/Documentation/guides/installation.md b/docs/guides/installation.md similarity index 100% rename from Documentation/guides/installation.md rename to docs/guides/installation.md diff --git a/Documentation/guides/quick_start.md b/docs/guides/quick_start.md similarity index 100% rename from Documentation/guides/quick_start.md rename to docs/guides/quick_start.md diff --git a/Documentation/images/econ-ark-logo.png b/docs/images/econ-ark-logo.png similarity index 100% rename from Documentation/images/econ-ark-logo.png rename to docs/images/econ-ark-logo.png diff --git a/Documentation/images/numfocus-logo.png b/docs/images/numfocus-logo.png similarity index 100% rename from Documentation/images/numfocus-logo.png rename to docs/images/numfocus-logo.png diff --git a/Documentation/images/usage-agent-problem-bellman-form.png b/docs/images/usage-agent-problem-bellman-form.png similarity index 100% rename from Documentation/images/usage-agent-problem-bellman-form.png rename to docs/images/usage-agent-problem-bellman-form.png diff --git a/Documentation/images/usage-crra-utility-function.png b/docs/images/usage-crra-utility-function.png similarity index 100% rename from Documentation/images/usage-crra-utility-function.png rename to docs/images/usage-crra-utility-function.png diff --git a/Documentation/index.md b/docs/index.md similarity index 100% rename from Documentation/index.md rename to docs/index.md diff --git a/Documentation/index.rst b/docs/index.rst similarity index 100% rename from Documentation/index.rst rename to docs/index.rst diff --git a/Documentation/license.md b/docs/license.md similarity index 100% rename from Documentation/license.md rename to docs/license.md diff --git a/Documentation/make.bat b/docs/make.bat similarity index 96% rename from Documentation/make.bat rename to docs/make.bat index e456b73f7..dc17bc34b 100644 --- a/Documentation/make.bat +++ b/docs/make.bat @@ -1,281 +1,281 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. epub3 to make an epub3 - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - echo. dummy to check syntax errors of document sources - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 1>NUL 2>NUL -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\HARK.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\HARK.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "epub3" ( - %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -if "%1" == "dummy" ( - %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. Dummy builder generates no files. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +set I18NSPHINXOPTS=%SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. epub3 to make an epub3 + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + echo. dummy to check syntax errors of document sources + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 1>NUL 2>NUL +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\HARK.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\HARK.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "epub3" ( + %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +if "%1" == "dummy" ( + %SPHINXBUILD% -b dummy %ALLSPHINXOPTS% %BUILDDIR%/dummy + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. Dummy builder generates no files. + goto end +) + +:end diff --git a/Documentation/overview/ARKitecture.md b/docs/overview/ARKitecture.md similarity index 100% rename from Documentation/overview/ARKitecture.md rename to docs/overview/ARKitecture.md diff --git a/Documentation/overview/index.rst b/docs/overview/index.rst similarity index 100% rename from Documentation/overview/index.rst rename to docs/overview/index.rst diff --git a/Documentation/overview/introduction.md b/docs/overview/introduction.md similarity index 100% rename from Documentation/overview/introduction.md rename to docs/overview/introduction.md diff --git a/Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst b/docs/reference/ConsumptionSaving/ConsAggShockModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsAggShockModel.rst rename to docs/reference/ConsumptionSaving/ConsAggShockModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst b/docs/reference/ConsumptionSaving/ConsGenIncProcessModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsGenIncProcessModel.rst rename to docs/reference/ConsumptionSaving/ConsGenIncProcessModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst b/docs/reference/ConsumptionSaving/ConsIndShockModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsIndShockModel.rst rename to docs/reference/ConsumptionSaving/ConsIndShockModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst b/docs/reference/ConsumptionSaving/ConsIndShockModelFast.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsIndShockModelFast.rst rename to docs/reference/ConsumptionSaving/ConsIndShockModelFast.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsLaborModel.rst b/docs/reference/ConsumptionSaving/ConsLaborModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsLaborModel.rst rename to docs/reference/ConsumptionSaving/ConsLaborModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst b/docs/reference/ConsumptionSaving/ConsMarkovModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsMarkovModel.rst rename to docs/reference/ConsumptionSaving/ConsMarkovModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsMedModel.rst b/docs/reference/ConsumptionSaving/ConsMedModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsMedModel.rst rename to docs/reference/ConsumptionSaving/ConsMedModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst b/docs/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst rename to docs/reference/ConsumptionSaving/ConsPortfolioFrameModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst b/docs/reference/ConsumptionSaving/ConsPortfolioModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsPortfolioModel.rst rename to docs/reference/ConsumptionSaving/ConsPortfolioModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst b/docs/reference/ConsumptionSaving/ConsPrefShochModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsPrefShochModel.rst rename to docs/reference/ConsumptionSaving/ConsPrefShochModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst b/docs/reference/ConsumptionSaving/ConsRepAgentModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsRepAgentModel.rst rename to docs/reference/ConsumptionSaving/ConsRepAgentModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst b/docs/reference/ConsumptionSaving/ConsRiskyAssetModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsRiskyAssetModel.rst rename to docs/reference/ConsumptionSaving/ConsRiskyAssetModel.rst diff --git a/Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst b/docs/reference/ConsumptionSaving/ConsRiskyContribModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/ConsRiskyContribModel.rst rename to docs/reference/ConsumptionSaving/ConsRiskyContribModel.rst diff --git a/Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst b/docs/reference/ConsumptionSaving/TractableBufferStockModel.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/TractableBufferStockModel.rst rename to docs/reference/ConsumptionSaving/TractableBufferStockModel.rst diff --git a/Documentation/reference/ConsumptionSaving/index.rst b/docs/reference/ConsumptionSaving/index.rst similarity index 100% rename from Documentation/reference/ConsumptionSaving/index.rst rename to docs/reference/ConsumptionSaving/index.rst diff --git a/Documentation/reference/index.rst b/docs/reference/index.rst similarity index 100% rename from Documentation/reference/index.rst rename to docs/reference/index.rst diff --git a/Documentation/reference/tools/core.rst b/docs/reference/tools/core.rst similarity index 100% rename from Documentation/reference/tools/core.rst rename to docs/reference/tools/core.rst diff --git a/Documentation/reference/tools/dcegm.rst b/docs/reference/tools/dcegm.rst similarity index 100% rename from Documentation/reference/tools/dcegm.rst rename to docs/reference/tools/dcegm.rst diff --git a/Documentation/reference/tools/distribution.rst b/docs/reference/tools/distribution.rst similarity index 100% rename from Documentation/reference/tools/distribution.rst rename to docs/reference/tools/distribution.rst diff --git a/Documentation/reference/tools/econforgeinterp.rst b/docs/reference/tools/econforgeinterp.rst similarity index 100% rename from Documentation/reference/tools/econforgeinterp.rst rename to docs/reference/tools/econforgeinterp.rst diff --git a/Documentation/reference/tools/estimation.rst b/docs/reference/tools/estimation.rst similarity index 100% rename from Documentation/reference/tools/estimation.rst rename to docs/reference/tools/estimation.rst diff --git a/Documentation/reference/tools/frame.rst b/docs/reference/tools/frame.rst similarity index 100% rename from Documentation/reference/tools/frame.rst rename to docs/reference/tools/frame.rst diff --git a/Documentation/reference/tools/helpers.rst b/docs/reference/tools/helpers.rst similarity index 100% rename from Documentation/reference/tools/helpers.rst rename to docs/reference/tools/helpers.rst diff --git a/Documentation/reference/tools/index.rst b/docs/reference/tools/index.rst similarity index 100% rename from Documentation/reference/tools/index.rst rename to docs/reference/tools/index.rst diff --git a/Documentation/reference/tools/interpolation.rst b/docs/reference/tools/interpolation.rst similarity index 100% rename from Documentation/reference/tools/interpolation.rst rename to docs/reference/tools/interpolation.rst diff --git a/Documentation/reference/tools/model.rst b/docs/reference/tools/model.rst similarity index 100% rename from Documentation/reference/tools/model.rst rename to docs/reference/tools/model.rst diff --git a/Documentation/reference/tools/numba_tools.rst b/docs/reference/tools/numba_tools.rst similarity index 100% rename from Documentation/reference/tools/numba_tools.rst rename to docs/reference/tools/numba_tools.rst diff --git a/Documentation/reference/tools/parallel.rst b/docs/reference/tools/parallel.rst similarity index 100% rename from Documentation/reference/tools/parallel.rst rename to docs/reference/tools/parallel.rst diff --git a/Documentation/reference/tools/rewards.rst b/docs/reference/tools/rewards.rst similarity index 100% rename from Documentation/reference/tools/rewards.rst rename to docs/reference/tools/rewards.rst diff --git a/Documentation/reference/tools/simulation.rst b/docs/reference/tools/simulation.rst similarity index 100% rename from Documentation/reference/tools/simulation.rst rename to docs/reference/tools/simulation.rst diff --git a/Documentation/reference/tools/utilities.rst b/docs/reference/tools/utilities.rst similarity index 100% rename from Documentation/reference/tools/utilities.rst rename to docs/reference/tools/utilities.rst diff --git a/Documentation/reference/tools/validators.rst b/docs/reference/tools/validators.rst similarity index 100% rename from Documentation/reference/tools/validators.rst rename to docs/reference/tools/validators.rst diff --git a/Documentation/texmf-local/bibtex/bib/economics-UTF8.bib b/docs/texmf-local/bibtex/bib/economics-UTF8.bib similarity index 100% rename from Documentation/texmf-local/bibtex/bib/economics-UTF8.bib rename to docs/texmf-local/bibtex/bib/economics-UTF8.bib diff --git a/Documentation/texmf-local/bibtex/bib/economics.bib b/docs/texmf-local/bibtex/bib/economics.bib similarity index 100% rename from Documentation/texmf-local/bibtex/bib/economics.bib rename to docs/texmf-local/bibtex/bib/economics.bib diff --git a/Documentation/texmf-local/bibtex/bst/econtex.bst b/docs/texmf-local/bibtex/bst/econtex.bst similarity index 100% rename from Documentation/texmf-local/bibtex/bst/econtex.bst rename to docs/texmf-local/bibtex/bst/econtex.bst diff --git a/Documentation/texmf-local/bibtex/bst/handout.bst b/docs/texmf-local/bibtex/bst/handout.bst similarity index 100% rename from Documentation/texmf-local/bibtex/bst/handout.bst rename to docs/texmf-local/bibtex/bst/handout.bst diff --git a/Documentation/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst b/docs/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst rename to docs/texmf-local/bibtex/bst/unsrtnatTitlesFirst.bst diff --git a/Documentation/texmf-local/ls-R b/docs/texmf-local/ls-R similarity index 100% rename from Documentation/texmf-local/ls-R rename to docs/texmf-local/ls-R diff --git a/Documentation/texmf-local/tex/latex/ReadMe.texmf b/docs/texmf-local/tex/latex/ReadMe.texmf similarity index 100% rename from Documentation/texmf-local/tex/latex/ReadMe.texmf rename to docs/texmf-local/tex/latex/ReadMe.texmf diff --git a/Documentation/texmf-local/tex/latex/articleNoRefHead.cls b/docs/texmf-local/tex/latex/articleNoRefHead.cls old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/articleNoRefHead.cls rename to docs/texmf-local/tex/latex/articleNoRefHead.cls diff --git a/Documentation/texmf-local/tex/latex/bibMake.tex b/docs/texmf-local/tex/latex/bibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/bibMake.tex rename to docs/texmf-local/tex/latex/bibMake.tex diff --git a/Documentation/texmf-local/tex/latex/cvBibMake.tex b/docs/texmf-local/tex/latex/cvBibMake.tex similarity index 100% rename from Documentation/texmf-local/tex/latex/cvBibMake.tex rename to docs/texmf-local/tex/latex/cvBibMake.tex diff --git a/Documentation/texmf-local/tex/latex/econtex.cls b/docs/texmf-local/tex/latex/econtex.cls similarity index 100% rename from Documentation/texmf-local/tex/latex/econtex.cls rename to docs/texmf-local/tex/latex/econtex.cls diff --git a/Documentation/texmf-local/tex/latex/econtex.sty b/docs/texmf-local/tex/latex/econtex.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/econtex.sty rename to docs/texmf-local/tex/latex/econtex.sty diff --git a/Documentation/texmf-local/tex/latex/econtexBibMake.tex b/docs/texmf-local/tex/latex/econtexBibMake.tex similarity index 100% rename from Documentation/texmf-local/tex/latex/econtexBibMake.tex rename to docs/texmf-local/tex/latex/econtexBibMake.tex diff --git a/Documentation/texmf-local/tex/latex/econtexSetup.sty b/docs/texmf-local/tex/latex/econtexSetup.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/econtexSetup.sty rename to docs/texmf-local/tex/latex/econtexSetup.sty diff --git a/Documentation/texmf-local/tex/latex/econtexShortcuts.sty b/docs/texmf-local/tex/latex/econtexShortcuts.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/econtexShortcuts.sty rename to docs/texmf-local/tex/latex/econtexShortcuts.sty diff --git a/Documentation/texmf-local/tex/latex/handout.cls b/docs/texmf-local/tex/latex/handout.cls similarity index 100% rename from Documentation/texmf-local/tex/latex/handout.cls rename to docs/texmf-local/tex/latex/handout.cls diff --git a/Documentation/texmf-local/tex/latex/handout.sty b/docs/texmf-local/tex/latex/handout.sty old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/handout.sty rename to docs/texmf-local/tex/latex/handout.sty diff --git a/Documentation/texmf-local/tex/latex/handoutBibMake.tex b/docs/texmf-local/tex/latex/handoutBibMake.tex old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/handoutBibMake.tex rename to docs/texmf-local/tex/latex/handoutBibMake.tex diff --git a/Documentation/texmf-local/tex/latex/handoutSetup.sty b/docs/texmf-local/tex/latex/handoutSetup.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/handoutSetup.sty rename to docs/texmf-local/tex/latex/handoutSetup.sty diff --git a/Documentation/texmf-local/tex/latex/handoutshortcuts.sty b/docs/texmf-local/tex/latex/handoutshortcuts.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/handoutshortcuts.sty rename to docs/texmf-local/tex/latex/handoutshortcuts.sty diff --git a/Documentation/texmf-local/tex/latex/makePostHandoutsStart.tex b/docs/texmf-local/tex/latex/makePostHandoutsStart.tex similarity index 100% rename from Documentation/texmf-local/tex/latex/makePostHandoutsStart.tex rename to docs/texmf-local/tex/latex/makePostHandoutsStart.tex diff --git a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty b/docs/texmf-local/tex/latex/printvrb.sty old mode 100755 new mode 100644 similarity index 96% rename from Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty rename to docs/texmf-local/tex/latex/printvrb.sty index b8757b3d4..47f13792a --- a/Documentation/NARK/Resources/texmf-local/texmf-local/tex/latex/printvrb.sty +++ b/docs/texmf-local/tex/latex/printvrb.sty @@ -1,112 +1,112 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%% printvrb.sty %%%%%%%%%%%%%%%%%% -%%% Amy Hendrickson -%%% TeXnology Inc. -%%% http://www.texnology.com -%%% revised version, April 8, 2011 -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -%%% Uses moreverb.sty, Rainer Schopf author, -%%% as method to send verbatim text to -%%% another file, - -%%% These commands allow user to type in text or math and -%%% have it print in more than one document, -%%% for example, print in an article and also in slides. - -%%% This is done by sending fragments to a jobname.vrb file. -%%% Each fragment will have a unique name given as an argument -%%% to writetofile. - -%%% -\usepackage{moreverb} - -\newwrite\verbatimout - -%% The fragments will be sent to a new file called -%% the same name as the file they are found in with a -%% .vrb filename ending. (ie., test.tex ==> test.vrb) -%% They will also print in the originating .tex file -%% when LaTeX is run on the file twice (like the \tableofcontents -%% and cross-references). - - -%%% \begin{writetofile}{name}{your text}\end{writetofile} -%%% Notice that there are curly brackets surrounding the -%%% text you enter. These are necessary. - -%%% (Name can include numbers or any symbols you want) - -%%% Used: -%%% \begin{writetofile}{name} -%%% {my text} -%%% \end{writetofile} - -\newcount\definitionnumber - -%%% \namesinmargin will make name of fragment appear in margin. -%%% If this command isn't there, there will be no names in the margin. - -\newif\ifnamesinmargin -\def\namesinmargin{\global\namesinmargintrue} - -\def\writetofile#1{% -\vskip1sp -\ifnum\definitionnumber=0 -\expandafter\openin1 \jobname.vrb -\ifeof1 -\else -\input \jobname.vrb -\fi%% to get the previous definitions -\immediate\openout\verbatimout=\jobname.vrb -\fi -%% -\global\advance\definitionnumber by 1 -\gdef\currname{#1}% -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% -\fi% -%% -\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space -\currname\string\endcsname} - \@bsphack - \let\do\@makeother\dospecials - \catcode`\^^M\active \catcode`\^^I=12 - \def\verbatim@processline{% - \immediate\write\verbatimout - {\the\verbatim@line}}% -\verbatim@start} - -\def\endwritetofile{% - \@esphack -\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on -file one more time!\else -\ifnamesinmargin\vskip-\baselineskip\fi -\noindent\expandafter\csname \currname\endcsname\relax\fi -} - -\makeatother - -%%%%%%%%%%%%%%%%%%%%% -%%% Using fragments in new file: - -%%% \input jobname.vrb will bring in the definitions -%%% for the fragments. -%%% (jobname is the same as the filename of the source document) - -%%% \namesinmargin will make names print as well as as printing -%%% the fragment. - -%%% \printfrag{name} will bring in fragment defined in source file, -%%% and sent to jobname.vrb. - -%%% \printfrag will save the problem of remembering to use -%%% \csname ...\endcsname, and will check to see if fragment is defined - -\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt -\noindent(!! There is -no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else -\ifnamesinmargin -\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% -\csname #1\endcsname\fi +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% printvrb.sty %%%%%%%%%%%%%%%%%% +%%% Amy Hendrickson +%%% TeXnology Inc. +%%% http://www.texnology.com +%%% revised version, April 8, 2011 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%% Uses moreverb.sty, Rainer Schopf author, +%%% as method to send verbatim text to +%%% another file, + +%%% These commands allow user to type in text or math and +%%% have it print in more than one document, +%%% for example, print in an article and also in slides. + +%%% This is done by sending fragments to a jobname.vrb file. +%%% Each fragment will have a unique name given as an argument +%%% to writetofile. + +%%% +\usepackage{moreverb} + +\newwrite\verbatimout + +%% The fragments will be sent to a new file called +%% the same name as the file they are found in with a +%% .vrb filename ending. (ie., test.tex ==> test.vrb) +%% They will also print in the originating .tex file +%% when LaTeX is run on the file twice (like the \tableofcontents +%% and cross-references). + + +%%% \begin{writetofile}{name}{your text}\end{writetofile} +%%% Notice that there are curly brackets surrounding the +%%% text you enter. These are necessary. + +%%% (Name can include numbers or any symbols you want) + +%%% Used: +%%% \begin{writetofile}{name} +%%% {my text} +%%% \end{writetofile} + +\newcount\definitionnumber + +%%% \namesinmargin will make name of fragment appear in margin. +%%% If this command isn't there, there will be no names in the margin. + +\newif\ifnamesinmargin +\def\namesinmargin{\global\namesinmargintrue} + +\def\writetofile#1{% +\vskip1sp +\ifnum\definitionnumber=0 +\expandafter\openin1 \jobname.vrb +\ifeof1 +\else +\input \jobname.vrb +\fi%% to get the previous definitions +\immediate\openout\verbatimout=\jobname.vrb +\fi +%% +\global\advance\definitionnumber by 1 +\gdef\currname{#1}% +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt\csname currname\endcsname\hskip4pt==>\ }\vss}}% +\fi% +%% +\immediate\write\verbatimout{^^J^^J\string\expandafter\string\gdef\string\csname\space +\currname\string\endcsname} + \@bsphack + \let\do\@makeother\dospecials + \catcode`\^^M\active \catcode`\^^I=12 + \def\verbatim@processline{% + \immediate\write\verbatimout + {\the\verbatim@line}}% +\verbatim@start} + +\def\endwritetofile{% + \@esphack +\expandafter\ifx\csname \currname\endcsname\relax Please run LaTeX on +file one more time!\else +\ifnamesinmargin\vskip-\baselineskip\fi +\noindent\expandafter\csname \currname\endcsname\relax\fi +} + +\makeatother + +%%%%%%%%%%%%%%%%%%%%% +%%% Using fragments in new file: + +%%% \input jobname.vrb will bring in the definitions +%%% for the fragments. +%%% (jobname is the same as the filename of the source document) + +%%% \namesinmargin will make names print as well as as printing +%%% the fragment. + +%%% \printfrag{name} will bring in fragment defined in source file, +%%% and sent to jobname.vrb. + +%%% \printfrag will save the problem of remembering to use +%%% \csname ...\endcsname, and will check to see if fragment is defined + +\def\printfrag#1{\expandafter\ifx\csname #1\endcsname\relax\vskip12pt +\noindent(!! There is +no fragment {\tt ==> #1 <==} maybe run LaTeX on source file again?)\vskip12pt\else +\ifnamesinmargin +\vskip1sp\noindent\llap{\vtop to 0pt{\hbox{\tt #1\hskip4pt==>\ }\vss}}\fi% +\csname #1\endcsname\fi } diff --git a/Documentation/texmf-local/tex/latex/snapshot.sty b/docs/texmf-local/tex/latex/snapshot.sty similarity index 97% rename from Documentation/texmf-local/tex/latex/snapshot.sty rename to docs/texmf-local/tex/latex/snapshot.sty index 311018ebe..92b5bc57e 100644 --- a/Documentation/texmf-local/tex/latex/snapshot.sty +++ b/docs/texmf-local/tex/latex/snapshot.sty @@ -1,341 +1,341 @@ -%% -%% This is file `snapshot.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% snapshot.dtx -%% -%%% ==================================================================== -%%% @LaTeX-doc-source-file{ -%%% filename = "snapshot.dtx", -%%% version = "1.14", -%%% date = "2002/03/05", -%%% time = "15:29:00 EST", -%%% checksum = "39090 807 3449 29761", -%%% author = "American Mathematical Society", -%%% copyright = "Copyright 2001 American Mathematical Society, -%%% all rights reserved. Copying of this file is -%%% authorized only if either: -%%% (1) you make absolutely no changes to your copy, -%%% including name; OR -%%% (2) if you do make changes, you first rename it -%%% to some other name.", -%%% address = "American Mathematical Society, -%%% Electronic Products and Services, -%%% PO Box 6248, -%%% Providence, RI 02940, -%%% USA", -%%% email = "tech-support@ams.org", -%%% URL = "http://www.ams.org/", -%%% supported = "yes", -%%% keywords = "version, compatibility, dependencies, LaTeX", -%%% abstract = "This package provides a way for a LaTeX -%%% document to specify, for each external file -%%% on which the document depends, which version -%%% is required to guarantee output fidelity.", -%%% docstring = "The checksum field above contains a CRC-16 -%%% checksum as the first value, followed by the -%%% equivalent of the standard UNIX wc (word -%%% count) utility output of lines, words, and -%%% characters. This is produced by Robert -%%% Solovay's checksum utility.", -%%% } -%%% ==================================================================== -\NeedsTeXFormat{LaTeX2e}[1994/12/01] -\ProvidesPackage{snapshot}[2002/03/05 v1.14] -\let\@xp\expandafter \let\@nx\noexpand -\newcommand{\RequireVersions}[2][]{% - \let\snap@check\snap@compare@versions - \let\snap@selfcheck\snap@selfcheck@a - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% -} -\@onlypreamble\RequireVersions -\def\snap@store@error#1{% - \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc -} -\@onlypreamble\snap@store@error -\def\snap@store@version #1#2#3#4{% - \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% -} -\@onlypreamble\snap@store@version -\def\@fmtextension{fmt} -\def\@tfmextension{tfm} -\edef\snapx@package{.\@pkgextension} -\edef\snapx@class{.\@clsextension} -\edef\snapx@format{.\@fmtextension} -\edef\snapx@tfm{.\@tfmextension} -\long\def\snapx@application{} -\let\snap@file=\@empty -\let\snapx@end\@@end -\def\snap@store@b#1#2#3#4{% - \ifx#1\snapx@end - \@xp\@gobblefour - \else - \ifx#1\relax \let#1\@empty\fi - \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% - \ifx#1\snapx@application - \else - \xdef\rqv@list{\rqv@list - \ifx\@empty\rqv@list\else,\fi - #3#1% - }% - \fi - \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% - \ifx#1\snapx@format \snap@check{#3.fmt}% - \else \snap@selfcheck{#3.sty}% - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\@onlypreamble\snap@store@b -\def\snap@write{\immediate\write\snap@out} -\let\snap@out\sixt@@n % fallback, probably never used -\DeclareOption{dep}{% - \def\snap@write{\immediate\write\snap@out}% -} -\DeclareOption{log}{% - \let\snap@write\typeout -} -\let\snap@fake@b\relax -\DeclareOption{test}{% - \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% -} -\DeclareOption{tfm}{% - \typeout{Option 'tfm' not implemented yet [1999/09/23]}% -} -\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} -\def\snap@mismatch{\snap@mismatch@warning} -\DeclareOption{error}{% - \def\snap@mismatch{\PackageError}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\DeclareOption{warning}{% - \def\snap@mismatch{\snap@mismatch@warning}% - \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi -} -\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} -\let\snap@select\@empty -\DeclareOption{date}{% - \def\snap@select#1#2 #3\@nil{#1#2}% -} -\def\snap@select@version#1{% - \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi -} -\def\snap@sva#1.#2 #3\@nil{#1.#2} -\def\snap@select@major#1{% - \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi -} -\def\snap@svm#1.#2\@nil{#1} -\DeclareOption{version}{% - \def\snap@select#1#2 #3{\snap@select@version #3}% -} -\DeclareOption{major-version}{% - \def\snap@select#1#2 #3{\snap@select@major #3}% -} -\ProcessOptions\par -\edef\snap@restore@extensions{% - \def\@nx\@pkgextension{\@pkgextension}% - \def\@nx\@clsextension{\@clsextension}% -} -\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} -\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} -\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} -\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} -\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} -\def\snap@trim@c#1#2 #3\@nil{#2} -\let\rqv@list=\@empty -\edef\@tempc#1\fmtname{#1\fmtname}\@tempc -\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} -\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} -\if ?\@tempb?\@nil - \edef\@filelist{\fmtname.fmt,\@filelist}% - \def\@tempc{LaTeX2e}% - \@xp\edef\csname ver@\fmtname.fmt\endcsname{% - \fmtversion\space - v\ifx\@tempc\fmtname 2.e\else ?.?\fi - }% -\fi -\listfiles -\def\@dofilelist{% - \snap@restore@extensions - \ifx\rqv@list\@empty - \else \rqv@compare@lists - \fi - \ifx\snap@write\typeout - \else - \newwrite\snap@out - \immediate\openout\snap@out=\jobname.dep \relax - \fi - \snap@write{\string\RequireVersions\@charlb}% - \snap@write{\space\space *{application}{TeX}% - \space\space\space\space\space{1990/03/25 v3.x}}% - \@for\@currname:=\@filelist\do{% - \filename@parse\@currname - \ifx\filename@ext\relax - \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% - \def\@tempb{~~~}% - \else\ifx\filename@ext\@pkgextension - \def\@tempa{package}\let\@tempd\@empty - \def\@tempb{}% - \else\ifx\filename@ext\@clsextension - \def\@tempa{class}\let\@tempd\@empty - \def\@tempb{~~}% - \else\ifx\filename@ext\@fmtextension - \def\@tempa{format}\let\@tempd\@empty - \def\@tempb{~}% - \else\ifx\filename@ext\@tfmextension - \def\@tempa{tfm}\let\@tempd\@empty - \def\@tempb{~~~~}% - \else - \def\@tempa{file}\edef\@tempd{.\filename@ext}% - \def\@tempb{~~~}% - \fi\fi\fi\fi\fi - \@xp\let\@xp\@tempe - \csname ver@\filename@base.\filename@ext\endcsname - \ifx\@tempe\@empty \let\@tempe\relax \fi - \edef\@tempe{% - \ifx\@tempe\relax 0000/00/00 v0.0% - \else - \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil - \fi - }% - \edef\@tempc{\filename@area\filename@base\@tempd}% full file name - \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd - \begingroup \let~\space - \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% - \endgroup - }% - \snap@write{\@charrb}% - \ifx\snap@write\typeout - \else \immediate\closeout\snap@out - \typeout{Dependency list written on \jobname.dep.}% - \fi -}% -\def\rqv@condense#1,{% - \if ,#1,% - \else - \@xp\ifx\csname ver@#1\endcsname\N - \else - \edef\L{\L,#1}% - \@xp\let\csname ver@#1\endcsname=\N - \fi - \fi - \rqv@condense -} -\def\rqv@compare@lists{% - \begingroup - \def\N{1}\let\L=\@gobble - \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \let\rqv@list=\L - \let\L=\@gobble - \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space loaded though not in - \noexpand\RequireVersions list% - }\@ehc - }% - \def\N{2}\let\L=\@gobble - \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% - \let\L=\@gobble - \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% - \ifx\L\@gobble\let\L\@empty\fi - \@for\@currname:=\L\do{% - \snap@mismatch{snapshot}{^^J% - File \@currname\space [\csname rqv@\@currname\endcsname] - required but not loaded% - }\@ehc - }% - \endgroup -} -\begingroup \catcode\endlinechar=12\relax % -\long\gdef\snap@ignoline#1 -{}\endgroup % -\def\snap@fake@input#1#2#3#4{% - \ifx#1\snapx@end - \aftergroup\@@end \@xp\@gobblefour - \else - \ifx#1\snapx@format - \else - \message{^^J}% - \@xp\snap@fake@b\@@input #3#1\relax - \fi - \fi - \@ifnextchar *\snap@store@version\snap@store@error -} -\newcommand{\rqvTest}[2][]{% - \begingroup \catcode\endlinechar=12 - \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax - \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format - \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% - \endgroup -} -\@ifundefined{snap@fake@b}{}{% - \let\snap@store@b\snap@fake@input - \let\RequireVersions\rqvTest -} -\AtBeginDocument{% - \@ifundefined{ver@amsgen}{}{% - \@xp\let\csname ver@amsgen.sty\@xp\endcsname - \csname ver@amsgen\endcsname - }% -} -\let\snap@compare@versions\@gobble \let\snap@check\@gobble -\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble -\ifx\snap@select\@empty \endinput \fi -\begingroup \catcode`\.=11\relax -\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} -\gdef\snap@selfcheck@a#1{% - \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% - \rqv@snapshot.sty F\@nil - \snap@check{#1}% - \fi -} -\endgroup -\def\@nofmt#1.fmt.#2 {#1 } -\def\snap@mismatch@a#1#2#3{% - \snap@mismatch{snapshot}{^^J% - \space\space Required version #2 of \@nofmt#1.fmt. and^^J% - \space\space provided version #3 do not match% - }\@ehc -} -\def\snap@compare@versions#1{% - \begingroup - \@ifundefined{rqv@#1}{}{% - \edef\0{\csname rqv@#1\endcsname}% - \edef\1{\csname ver@#1\endcsname}% - \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% - \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% - \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% - \ifx\@tempa\@tempb - \else - \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% - \@xp\@tempd - \fi - }% - \endgroup -} -\def\ProvidesFile#1{% - \def\snap@checker{\snap@check{#1}}% - \begingroup - \aftergroup\snap@checker - \catcode`\ 10\catcode\endlinechar 10 % - \@makeother\/% - \@makeother\&% - \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% -} -\def\@pr@videpackage[#1]{% - \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% - \ifx\@currext\@clsextension - \typeout{Document Class: \@gtempa\space#1}% - \else - \wlog{Package: \@gtempa\space#1}% - \fi - \snap@check{\@currname.\@currext}% -} -\endinput -%% -%% End of file `snapshot.sty'. +%% +%% This is file `snapshot.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% snapshot.dtx +%% +%%% ==================================================================== +%%% @LaTeX-doc-source-file{ +%%% filename = "snapshot.dtx", +%%% version = "1.14", +%%% date = "2002/03/05", +%%% time = "15:29:00 EST", +%%% checksum = "39090 807 3449 29761", +%%% author = "American Mathematical Society", +%%% copyright = "Copyright 2001 American Mathematical Society, +%%% all rights reserved. Copying of this file is +%%% authorized only if either: +%%% (1) you make absolutely no changes to your copy, +%%% including name; OR +%%% (2) if you do make changes, you first rename it +%%% to some other name.", +%%% address = "American Mathematical Society, +%%% Electronic Products and Services, +%%% PO Box 6248, +%%% Providence, RI 02940, +%%% USA", +%%% email = "tech-support@ams.org", +%%% URL = "http://www.ams.org/", +%%% supported = "yes", +%%% keywords = "version, compatibility, dependencies, LaTeX", +%%% abstract = "This package provides a way for a LaTeX +%%% document to specify, for each external file +%%% on which the document depends, which version +%%% is required to guarantee output fidelity.", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== +\NeedsTeXFormat{LaTeX2e}[1994/12/01] +\ProvidesPackage{snapshot}[2002/03/05 v1.14] +\let\@xp\expandafter \let\@nx\noexpand +\newcommand{\RequireVersions}[2][]{% + \let\snap@check\snap@compare@versions + \let\snap@selfcheck\snap@selfcheck@a + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% +} +\@onlypreamble\RequireVersions +\def\snap@store@error#1{% + \PackageError{snapshot}{Expected '*' here, not '#1'}\@ehc +} +\@onlypreamble\snap@store@error +\def\snap@store@version #1#2#3#4{% + \@xp\snap@store@b\csname snapx@#2\endcsname{#2}{#3}{#4}% +} +\@onlypreamble\snap@store@version +\def\@fmtextension{fmt} +\def\@tfmextension{tfm} +\edef\snapx@package{.\@pkgextension} +\edef\snapx@class{.\@clsextension} +\edef\snapx@format{.\@fmtextension} +\edef\snapx@tfm{.\@tfmextension} +\long\def\snapx@application{} +\let\snap@file=\@empty +\let\snapx@end\@@end +\def\snap@store@b#1#2#3#4{% + \ifx#1\snapx@end + \@xp\@gobblefour + \else + \ifx#1\relax \let#1\@empty\fi + \def\@tempa##1 ##2 ##3\@nil{##1 ##2}% + \ifx#1\snapx@application + \else + \xdef\rqv@list{\rqv@list + \ifx\@empty\rqv@list\else,\fi + #3#1% + }% + \fi + \@xp\xdef\csname rqv@#3#1\endcsname{\@tempa#4 v?.? ? \relax\@nil}% + \ifx#1\snapx@format \snap@check{#3.fmt}% + \else \snap@selfcheck{#3.sty}% + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\@onlypreamble\snap@store@b +\def\snap@write{\immediate\write\snap@out} +\let\snap@out\sixt@@n % fallback, probably never used +\DeclareOption{dep}{% + \def\snap@write{\immediate\write\snap@out}% +} +\DeclareOption{log}{% + \let\snap@write\typeout +} +\let\snap@fake@b\relax +\DeclareOption{test}{% + \def\snap@fake@b{\endinput \futurelet\@let@token\snap@ignoline}% +} +\DeclareOption{tfm}{% + \typeout{Option 'tfm' not implemented yet [1999/09/23]}% +} +\def\snap@mismatch@warning#1#2#3{\PackageWarningNoLine{#1}{#2}} +\def\snap@mismatch{\snap@mismatch@warning} +\DeclareOption{error}{% + \def\snap@mismatch{\PackageError}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\DeclareOption{warning}{% + \def\snap@mismatch{\snap@mismatch@warning}% + \ifx\snap@select\@empty \let\snap@select\snap@select@all \fi +} +\def\snap@select@all#1#2 #3#4 #5\@nil{#1#2 #3#4} +\let\snap@select\@empty +\DeclareOption{date}{% + \def\snap@select#1#2 #3\@nil{#1#2}% +} +\def\snap@select@version#1{% + \ifodd 0#11 \@xp\snap@sva\@xp#1\else\@xp\snap@select@version\fi +} +\def\snap@sva#1.#2 #3\@nil{#1.#2} +\def\snap@select@major#1{% + \ifodd 0#11 \@xp\snap@svm\@xp#1\else\@xp\snap@select@major\fi +} +\def\snap@svm#1.#2\@nil{#1} +\DeclareOption{version}{% + \def\snap@select#1#2 #3{\snap@select@version #3}% +} +\DeclareOption{major-version}{% + \def\snap@select#1#2 #3{\snap@select@major #3}% +} +\ProcessOptions\par +\edef\snap@restore@extensions{% + \def\@nx\@pkgextension{\@pkgextension}% + \def\@nx\@clsextension{\@clsextension}% +} +\def\snap@pad#1#2#3#4#5#6#7#8#9{\snap@pad@a{#1#2#3#4#5#6#7#8#9}} +\def\snap@pad@a#1#2#3#4#5\@nil{\snap@pad@b#1#2#3#4\space\@nil} +\def\snap@pad@b#1\space#2\@nil#3{\def#3{#2}} +\def\snap@trim@version#1#2 #3{#1#2 \snap@trim@b #3} +\def\snap@trim@b#1{\ifodd 0#11 v#1\@xp\snap@trim@c\fi \snap@trim@b} +\def\snap@trim@c#1#2 #3\@nil{#2} +\let\rqv@list=\@empty +\edef\@tempc#1\fmtname{#1\fmtname}\@tempc +\def\@tempa#1,\fmtname.fmt,#2#3\@nil{#2} +\edef\@tempb{\@nx\@tempa,\@filelist,\fmtname.fmt,} +\if ?\@tempb?\@nil + \edef\@filelist{\fmtname.fmt,\@filelist}% + \def\@tempc{LaTeX2e}% + \@xp\edef\csname ver@\fmtname.fmt\endcsname{% + \fmtversion\space + v\ifx\@tempc\fmtname 2.e\else ?.?\fi + }% +\fi +\listfiles +\def\@dofilelist{% + \snap@restore@extensions + \ifx\rqv@list\@empty + \else \rqv@compare@lists + \fi + \ifx\snap@write\typeout + \else + \newwrite\snap@out + \immediate\openout\snap@out=\jobname.dep \relax + \fi + \snap@write{\string\RequireVersions\@charlb}% + \snap@write{\space\space *{application}{TeX}% + \space\space\space\space\space{1990/03/25 v3.x}}% + \@for\@currname:=\@filelist\do{% + \filename@parse\@currname + \ifx\filename@ext\relax + \def\@tempa{file}\def\@tempd{.tex}\def\filename@ext{tex}% + \def\@tempb{~~~}% + \else\ifx\filename@ext\@pkgextension + \def\@tempa{package}\let\@tempd\@empty + \def\@tempb{}% + \else\ifx\filename@ext\@clsextension + \def\@tempa{class}\let\@tempd\@empty + \def\@tempb{~~}% + \else\ifx\filename@ext\@fmtextension + \def\@tempa{format}\let\@tempd\@empty + \def\@tempb{~}% + \else\ifx\filename@ext\@tfmextension + \def\@tempa{tfm}\let\@tempd\@empty + \def\@tempb{~~~~}% + \else + \def\@tempa{file}\edef\@tempd{.\filename@ext}% + \def\@tempb{~~~}% + \fi\fi\fi\fi\fi + \@xp\let\@xp\@tempe + \csname ver@\filename@base.\filename@ext\endcsname + \ifx\@tempe\@empty \let\@tempe\relax \fi + \edef\@tempe{% + \ifx\@tempe\relax 0000/00/00 v0.0% + \else + \@xp\@xp\@xp\snap@trim@version\@xp\@tempe\space v0.0 v0.0 \@nil + \fi + }% + \edef\@tempc{\filename@area\filename@base\@tempd}% full file name + \@xp\snap@pad\@tempc\space~~~~~~~~~~~~~~~~\@nil\@tempd + \begingroup \let~\space + \snap@write{\space\space *{\@tempa}\@tempb{\@tempc}\@tempd{\@tempe}}% + \endgroup + }% + \snap@write{\@charrb}% + \ifx\snap@write\typeout + \else \immediate\closeout\snap@out + \typeout{Dependency list written on \jobname.dep.}% + \fi +}% +\def\rqv@condense#1,{% + \if ,#1,% + \else + \@xp\ifx\csname ver@#1\endcsname\N + \else + \edef\L{\L,#1}% + \@xp\let\csname ver@#1\endcsname=\N + \fi + \fi + \rqv@condense +} +\def\rqv@compare@lists{% + \begingroup + \def\N{1}\let\L=\@gobble + \@xp\rqv@condense \rqv@list,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \let\rqv@list=\L + \let\L=\@gobble + \@xp\rqv@condense \@filelist,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space loaded though not in + \noexpand\RequireVersions list% + }\@ehc + }% + \def\N{2}\let\L=\@gobble + \@xp\rqv@condense\@filelist,TeX,{,\relax\@xp\@gobbletwo\@xp},% + \let\L=\@gobble + \@xp\rqv@condense\rqv@list,{,\relax\@xp\@gobbletwo\@xp},% + \ifx\L\@gobble\let\L\@empty\fi + \@for\@currname:=\L\do{% + \snap@mismatch{snapshot}{^^J% + File \@currname\space [\csname rqv@\@currname\endcsname] + required but not loaded% + }\@ehc + }% + \endgroup +} +\begingroup \catcode\endlinechar=12\relax % +\long\gdef\snap@ignoline#1 +{}\endgroup % +\def\snap@fake@input#1#2#3#4{% + \ifx#1\snapx@end + \aftergroup\@@end \@xp\@gobblefour + \else + \ifx#1\snapx@format + \else + \message{^^J}% + \@xp\snap@fake@b\@@input #3#1\relax + \fi + \fi + \@ifnextchar *\snap@store@version\snap@store@error +} +\newcommand{\rqvTest}[2][]{% + \begingroup \catcode\endlinechar=12 + \catcode`\%=12 \catcode`\{=12 \catcode`\}=12\relax + \let\snapx@application=\snapx@format \let\snapx@tfm=\snap@format + \@ifnextchar *\snap@store@version\snap@store@error#2*{end}{}{}% + \endgroup +} +\@ifundefined{snap@fake@b}{}{% + \let\snap@store@b\snap@fake@input + \let\RequireVersions\rqvTest +} +\AtBeginDocument{% + \@ifundefined{ver@amsgen}{}{% + \@xp\let\csname ver@amsgen.sty\@xp\endcsname + \csname ver@amsgen\endcsname + }% +} +\let\snap@compare@versions\@gobble \let\snap@check\@gobble +\let\snap@selfcheck\@gobble \let\snap@selfcheck@a\@gobble +\ifx\snap@select\@empty \endinput \fi +\begingroup \catcode`\.=11\relax +\gdef\snap@selfcheck@b#1\rqv@snapshot.sty#2#3\@nil{T#2} +\gdef\snap@selfcheck@a#1{% + \if\@xp\snap@selfcheck@b\csname rqv@#1\endcsname T% + \rqv@snapshot.sty F\@nil + \snap@check{#1}% + \fi +} +\endgroup +\def\@nofmt#1.fmt.#2 {#1 } +\def\snap@mismatch@a#1#2#3{% + \snap@mismatch{snapshot}{^^J% + \space\space Required version #2 of \@nofmt#1.fmt. and^^J% + \space\space provided version #3 do not match% + }\@ehc +} +\def\snap@compare@versions#1{% + \begingroup + \@ifundefined{rqv@#1}{}{% + \edef\0{\csname rqv@#1\endcsname}% + \edef\1{\csname ver@#1\endcsname}% + \edef\1{\@xp\snap@trim@version\1 v0.0 v0.0 \@nil}% + \edef\@tempa{\@xp\snap@select\0 v0.0 v0.0 \@nil}% + \edef\@tempb{\@xp\snap@select\1 v0.0 v0.0 \@nil}% + \ifx\@tempa\@tempb + \else + \edef\@tempd{\@nx\snap@mismatch@a{#1}{\@tempa}{\@tempb}}% + \@xp\@tempd + \fi + }% + \endgroup +} +\def\ProvidesFile#1{% + \def\snap@checker{\snap@check{#1}}% + \begingroup + \aftergroup\snap@checker + \catcode`\ 10\catcode\endlinechar 10 % + \@makeother\/% + \@makeother\&% + \@ifnextchar[{\@providesfile{#1}}{\@providesfile{#1}[]}% +} +\def\@pr@videpackage[#1]{% + \expandafter\xdef\csname ver@\@currname.\@currext\endcsname{#1}% + \ifx\@currext\@clsextension + \typeout{Document Class: \@gtempa\space#1}% + \else + \wlog{Package: \@gtempa\space#1}% + \fi + \snap@check{\@currname.\@currext}% +} +\endinput +%% +%% End of file `snapshot.sty'. diff --git a/Documentation/texmf-local/tex/latex/tex4ht/pictureenv.4ht b/docs/texmf-local/tex/latex/tex4ht/pictureenv.4ht similarity index 100% rename from Documentation/texmf-local/tex/latex/tex4ht/pictureenv.4ht rename to docs/texmf-local/tex/latex/tex4ht/pictureenv.4ht diff --git a/Documentation/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg b/docs/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg similarity index 100% rename from Documentation/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg rename to docs/texmf-local/tex/latex/tex4ht/svg-math-and-subfigures.cfg diff --git a/Documentation/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 b/docs/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 similarity index 100% rename from Documentation/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 rename to docs/texmf-local/tex/latex/tex4ht/svg-set-size-to-1p0.mk4 diff --git a/Documentation/texmf-local/tex/latex/tex4htMakeCFG.sh b/docs/texmf-local/tex/latex/tex4htMakeCFG.sh old mode 100755 new mode 100644 similarity index 100% rename from Documentation/texmf-local/tex/latex/tex4htMakeCFG.sh rename to docs/texmf-local/tex/latex/tex4htMakeCFG.sh diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtex.cls b/docs/texmf-local/tex/latex/texmf-local/tex/latex/econtex.cls similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtex.cls rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/econtex.cls diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtex.sty b/docs/texmf-local/tex/latex/texmf-local/tex/latex/econtex.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtex.sty rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/econtex.sty diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexBibMake.tex b/docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexBibMake.tex similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexBibMake.tex rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexBibMake.tex diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexSetup.sty b/docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexSetup.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexSetup.sty rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexSetup.sty diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexShortcuts.sty b/docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexShortcuts.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/econtexShortcuts.sty rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/econtexShortcuts.sty diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handout.cls b/docs/texmf-local/tex/latex/texmf-local/tex/latex/handout.cls similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handout.cls rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/handout.cls diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handoutSetup.sty b/docs/texmf-local/tex/latex/texmf-local/tex/latex/handoutSetup.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handoutSetup.sty rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/handoutSetup.sty diff --git a/Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handoutShortcuts.sty b/docs/texmf-local/tex/latex/texmf-local/tex/latex/handoutShortcuts.sty similarity index 100% rename from Documentation/texmf-local/tex/latex/texmf-local/tex/latex/handoutShortcuts.sty rename to docs/texmf-local/tex/latex/texmf-local/tex/latex/handoutShortcuts.sty diff --git a/Documentation/NARK/Resources/texmf-local/tex/latex/titlesec.sty b/docs/texmf-local/tex/latex/titlesec.sty similarity index 96% rename from Documentation/NARK/Resources/texmf-local/tex/latex/titlesec.sty rename to docs/texmf-local/tex/latex/titlesec.sty index f588cad6a..fb7f24e2b 100644 --- a/Documentation/NARK/Resources/texmf-local/tex/latex/titlesec.sty +++ b/docs/texmf-local/tex/latex/titlesec.sty @@ -1,1350 +1,1350 @@ -% +--------------------------------------------------+ -% | Typeset titlesec.tex to get the documentation. | -% +--------------------------------------------------+ -% -% Copyright (c) 1998-2016 by Javier Bezos. -% All Rights Reserved. -% -% This file is part of the titlesec distribution release 2.10.2 -% ----------------------------------------------------------- -% -% It may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2003/12/01 or later. -% -% This work has the LPPL maintenance status "maintained". -% -% The Current Maintainer of this work is Javier Bezos. -% -% Notes -% ~~~~~ -% -% The following tags are used: -% ttl@ : the generic tag used through the style -% ttlh@ : a shape definition -% ttlf@ : a macro containing the title format -% ttls@ : id. the title space -% ttlp@ : page key related macros -% ttll@ : level number -% -% The ttlf@ and ttls@ contains data in the form {..}{..}. -% Perhaps in future releases they should be converted -% to a prop-like list, similar to that proposed by the -% latex team. -% -% Admittedly, the current implementation seems too -% complicated, but that's necessary in order to provide -% certain compatibility with the sections as defined by the -% used class. Other packages opt for providing the sections -% as defined by standard classes ignoring the class; for -% instance sectsty which does a simple task in a simple and -% nice way. However, that was not my goal. -% -% Release -% ~~~~~~~ - -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] - -% Initialization -% ~~~~~~~~~~~~~~ - -\newif\ifttl@ps -\ttl@psfalse - -% The \ttl@label switch is used when printing the label in titles. -% A numberless variant makes it to true. -% There is a \ttl@toclabel as well, which is true iff the -% title is numbered; used in toc entries (except default part -% and chapter) and marks (only in titlesec pagestyles). - -\newif\ifttl@label -\newif\ifttl@toclabel - -\newbox\ttl@box - -% A provision for the report style: - -\@ifundefined{if@mainmatter} - {\let\if@mainmatter\iftrue}{} - -\@ifundefined{if@openright} - {\let\if@openright\iftrue}{} - -% and the ams styles as well - -\@ifundefined{@chapapp} - {\let\@chapapp\chaptername}{} - -\def\ttl@trylist{\ttl@try{}} - -\def\ttl@getkeys#1#2{% - \if\expandafter @\@gobble#1@\@empty - \edef\ttl@b{\expandafter\@gobble\string#1}% - \let\ttl@a\ttl@b - \else - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlkeys.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \ttl@getkeys{#1}{#2}% - \fi} - -% A more meaningful error for \@notdefinable - -\expandafter\AtEndOfPackage\expandafter{\expandafter - \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} - -\def\@notdefinable{% - \PackageError{titlesec}% - {Incompatible package}% - {Titlesec cannot continue defining its own macros - because\MessageBreak - \@backslashchar\reserved@a\space is already used by other package, - the class\MessageBreak - or the document.}} - -% +-----------------+ -% | C L A S S E S | -% +-----------------+ - -\def\ttl@useclass#1#2{% - \@ifstar - {\ttl@labelfalse#1{#2}[]}% - {\ttl@labeltrue\@dblarg{#1{#2}}}} - -\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} -\def\ttl@partclass{\ttl@useclass\ttl@part@i} -\def\ttl@topclass{\ttl@useclass\ttl@top@i} -\def\ttl@pageclass{\ttl@useclass\ttl@page@i} - -% Here \scantokens is used to make sure the unescaped name -% has `letters' and no `others'. Mainly for hyperref, so there -% should be no problems. - -\newcommand\titleclass[1]{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \ifx\scantokens\@undefined\else - \scantokens\expandafter{\expandafter - \def\expandafter\ttl@a\expandafter{\ttl@a}}% - \fi - \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% - {\@tempswafalse\ttl@class@ii{#1}}} - -\def\ttl@class@i#1[#2]{% - \@namedef{ttll@\ttl@a}{#2}% - \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% - \@ifundefined{ttl@toplevel}{}% - {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@toplevel\endcsname}% - \edef\ttl@toplevel{\ttl@a}% - \ttl@class@ii{#1}} - -\def\ttl@class@ii#1#2{% - \@ifundefined{ttl@#2class}% - {\PackageError{titlesec}{Unknown sectioning class}% - {Valid names are top, page and straight}}% - {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax - \@ifundefined{\ttl@a mark}% - {\@namedef{\ttl@a mark}{\@gobble}}% - {}% - \edef#1{% - \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% - \if@tempswa - \expandafter\@gobble - \else - \expandafter\@firstofone - \fi - {\@ifnextchar[% - {\ttl@class@iii}% - {\@ifundefined{ttll@\ttl@a}% - {\PackageError{titlesec}{Unknown sectioning level}% - {\string\titleclass\space with no optional arguments\MessageBreak - only changes the class of an *existing* level}}}}} - -\def\ttl@class@iii[#1]{% - \edef\ttl@b{\expandafter\@gobble\string#1}% - \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname - \csname ttlss@\ttl@b\endcsname - \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% - \let\ttl@a\ttl@toplevel - \count@\csname ttll@\ttl@toplevel\endcsname - \ttl@class@iv} - -\def\ttl@class@iv{% - \@ifundefined{ttlss@\ttl@a}{}% - {\advance\count@\@ne - \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% - \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% - \ttl@class@iv}} - -% Typesetting Classes: General tools -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% The following command handles the *n spacing -% Some tricks are necessary to multiply a -% skip by a non integer number - -\newskip\beforetitleunit -\beforetitleunit=1ex\@plus.3ex\@minus.06ex -\newskip\aftertitleunit -\aftertitleunit=1ex\@plus.1ex - -\newdimen\ttl@plus -\newdimen\ttl@minus - -\def\ttl@assign#1{% - \@ifstar - {\ttl@assign@i{#1}}% - {\ttl@assign@d{#1}}} - -\def\ttl@assign@i#1#2\relax#3{% - \ttl@plus\z@ - \ttl@minus\z@ - \afterassignment\ttl@assign@ii - \dimen@\the#3, % <- space - #1 = #2\dimen@ - plus #2\ttl@plus - minus #2\ttl@minus} - -\def\ttl@assign@ii#1 {% <- space - \if#1,\else\afterassignment\ttl@assign@ii\fi - \csname ttl@\string#1\endcsname} - -\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} - -% To be used with \v/vspace to make them calc-savvy - -\def\ttl@calc#1#2{% - {\setlength\@tempskipa{#2}% - #1\@tempskipa}} - -\def\ttl@calcneg#1#2{% - {\setlength\@tempskipa{#2}% - #1{-\@tempskipa}}} - -% Gets from ttls@ and passes the spacing parameters: - -\def\ttl@startargs#1#2{% Get the first arguments, with the spacing - \@ifundefined{ttlp@#2}% - {\let\ttl@key@page\@empty}% - {\ttlp@fetch{#2}}% - \begingroup - \def\ttl@b{ttls@#2}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \xdef\ttl@b{\ttl@c}% - \endgroup - \ifx\ttl@b\@empty - \PackageError{titlesec}{Format/spacing not found}% - {I was unable to find the format corresponding to #2.\MessageBreak - Maybe you haven't set it with \string\titleformat\space and - \string\titlespacing} - \fi - \expandafter#1\ttl@b{#2}} - -% Used in ttl@select - -\def\ttl@savefn#1[#2]#3{% - \ifcase#1% - \footnotemark[#2]% - \gdef\ttl@fn{\footnotetext[#2]{#3}}% - \else - \footnotemark - \gdef\ttl@fn{\footnotetext{#3}}% - \fi} - -\def\ttl@nest@error{% - \PackageError{titlesec}{Nested titles}{Titles must not be nested}} - -\def\ttl@hmode@error{% - \PackageError{titlesec}{Entered in horizontal mode} - {The argument cannot contain horizontal material\MessageBreak - such as text, \string\noindent, \string\makebox, etc.}} - -% \ttl@select not only selects the right version to be -% used. It also take steps to ensure that a mark -% is not lost inside a box by saving it into \ttl@mk, -% which in turn is used by the sect and chap commands. - -\newif\ifttl@explicit - -\def\ttl@gmk#1{\gdef\ttl@mk{#1}} - -\def\ttl@select#1#2#3#4{% - \ttl@Hy@saveanchor - \global\let\ttl@mk\@empty % global because of rigidchapters - \global\let\ttl@fn\@empty - \begingroup - \if@inlabel\else % Keep item's \everypar - \everypar{\setbox\z@\lastbox\strut}% - \fi - \let\ttl@straight@i\ttl@nest@error - \let\ttl@top@i \ttl@nest@error - \let\ttl@part@i \ttl@nest@error - \let\ttl@page@i \ttl@nest@error - \let\ttl@newpage\newpage - \def\newpage{\ttl@savewrite\ttl@newpage}% - \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% - \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% - \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% - \def\footnote{\@ifnextchar[% - {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% - \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% - \def\ttl@b{ttlf@#1}% - \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try - \ttl@trylist - \ifttl@explicit - \def\ttl@passexplicit{\ttl@case{#4}}% - \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... - \else - \let\ttl@passexplicit\ttl@case - \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... - \fi - \endgroup} - -\let\ttl@savewrite\@empty - -\def\ttl@finmarks{% - \ttl@savewrite - \ttl@mk % Contains a possible mark, returned by \ttl@select - \ttl@fn} % And a footnote - -\def\ttl@try#1{% - \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} - \@ifundefined{\ttl@b\ttl@c}{}{% - \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% - \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% - #1% - \let\ttl@try\@gobble}} % locally modified to `break' testings - -% \ttl@write writes marks and toc. tocdepth is taken care of when -% the toc is typesetted and not here. Used always through -% ttl@savewrite, which is reset to \@empty to avoid duplicated -% calls. - -\def\ttl@write#1#2{% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% - \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a - \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a - \ttl@elinemarks - \global\ttl@toclabelfalse - \global\let\ttl@savewrite\@empty} - -\newif\ifttl@premark % to be used in ttlps.def -\ttl@premarkfalse - -\def\ttl@premark#1#2{% - \protected@xdef\ttl@prevmarks{\ttl@marks}% - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \ttl@elinemarks - \gdef\ttl@prevmarks{\ttl@marks}} - -% Must be preceded by a default \ttl@savewrite, which is used -% in starred variants--\@empty in top and straight classes. -% In straight class, it is preceded by the setting of -% prev marks to provide a "fixed" top mark. Otherwise, -% the default prev mark (= curr mark) is used (restored -% after ttl@labelling in straight). This is the command -% to be hacked if you want to change the behaviour of -% starred variants. - -\def\ttl@labelling#1#2{% - \let\ttl@Hy@saveanchor\@empty - \ifttl@label % 1st - if star - \def\ttl@savewrite{\ttl@write{#1}{#2}}% - \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. - \ifttl@label % 2nd - eg, if not main matter - \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax - \ttl@labelfalse % 3rd - if too deep - \else - \ttl@Hy@refstepcounter{#1}% - \@nameuse{ttl@#1out}% - \fi - \fi - \fi - \let\ifttl@toclabel\ifttl@label - \ifx\ttl@savewrite\@empty\else % If marks - \ifttl@ps - \ifttl@premark - \global\ttl@premarkfalse - \else % if no \pretitlemark - \ttl@premark{#1}{#2}% - \fi - \fi - \ifttl@label\else\ttl@Hy@steplink{#1}\fi - \fi} - -% Executed by ttl@labelling if the name of section is chapter: - -\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} - -% Executed by ttl@labelling if chapter has a number. Note -% you can define messages for other sectioning levels (eg, -% \ttl@sectionout). - -\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} - -% Straight class -% ~~~~~~~~~~~~~ -% Default for nobottomtitles. Changed by nobottomtitles* - -\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} - -% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title -% The second argument of ttl@sect is the level, which -% is empty if the star version is used. In this case -% neither the toc nor the marks are written. - -\def\ttl@straight@i#1[#2]#3{% - \def\@currentlabelname{#2}% for nameref - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \gdef\thetitle{\csname the#1\endcsname}% - \if@noskipsec \leavevmode \fi - \par - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@straight@ii{#1}{#3}} - -% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title - -\def\ttl@straight@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in straight class ignored}}% - \if@nobreak - \ttl@titlespace{\@tempskipa}% - \else - \@ifundefined{#6break}% - {\addpenalty{\@secpenalty}}% - {\csname#6break\endcsname}% - \addvspace{\@tempskipa}% - \ifdim\bottomtitlespace<\z@ - \else - \begingroup - \@tempskipb\pagegoal - \@tempskipa\pagegoal - \ttl@addstretch % \relax if nobottomtitle* - \advance\@tempskipa-\bottomtitlespace\relax % not a register - \pagegoal\@tempskipa - \def\@textbottom{\vskip\z@\@plus.0001fil}% - \penalty9999 - \pagegoal\@tempskipb - \endgroup - \fi - \fi - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \if@noskipsec - \global\@nobreakfalse - \everypar{% - \if@noskipsec - \global\@noskipsecfalse - \clubpenalty\@M - \hskip-\parindent - \begingroup - \@svsechd\unskip{\hspace{\@tempskipb}}% - \endgroup - \else - \clubpenalty\@clubpenalty\everypar{}% - \fi}% - \else - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading - \fi - \ignorespaces} - -% Part class -% ~~~~~~~~~~ - -\providecommand\partmark[1]{\markboth{}{}} - -\def\ttl@part@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@part@ii{#1}{#3}} - -\def\ttl@part@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \@ifundefined{ttl@ps@#6}{}% - {\PackageWarning{titlesec}{Page style in part class ignored}}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse \fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \par\nobreak - \vspace{\@tempskipb}% - \@afterheading} - -% Page class -% ~~~~~~~~~~ - -\def\ttl@page@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \ifx\ttl@notocparts\@undefined - \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! - \else - \let\ttl@savewrite\@empty - \fi - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@page@ii{#1}{#3}} - -\def\ttl@page@ii#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \if@openright - \cleardoublepage - \else - \clearpage - \fi - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \if@twocolumn - \onecolumn - \@tempswatrue - \else - \@tempswafalse - \fi - \vspace*{\@tempskipa}% - \@afterindenttrue - \ifcase#5 \@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@select{#6}{#1}{#2}{#7}% - \ttl@finmarks - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% - \vspace{\@tempskipb}% - \newpage - \if@twoside - \if@openright - \null - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{empty}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \newpage - \fi - \fi - \if@tempswa - \twocolumn - \fi - \ignorespaces} - -% Top class and some makechapterhead stuff -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -% -% \ttl@mkchap is the new make(s)chapterhead. - -\def\ttl@mkchap#1#2#3#4#5#6#7{% - \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% - \let\ttl@savewrite\@empty - \let\ttl@Hy@saveanchor\@empty - \@ifundefined{ttl@ps@#6}{}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \let\ifttl@toclabel\ifttl@label - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} - -% But \ttl@mkchap@i is used by both makechapterhead and -% the top class. - -\def\ttl@mkchap@i#1#2#3#4#5#6#7{% - \ttl@assign\@tempskipa#3\relax\beforetitleunit - \vspace*{\@tempskipa}% - \global\@afterindenttrue - \ifcase#5 \global\@afterindentfalse\fi - \ttl@assign\@tempskipb#4\relax\aftertitleunit - \ttl@topmode{\@tempskipb}{% - \ttl@select{#6}{#1}{#2}{#7}}% - \ttl@finmarks % Outside the box! - \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} - -\def\ttl@top@i#1[#2]#3{% - \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% - \let\ttl@savewrite\@empty - \def\ttl@savetitle{#3}% - \ttl@labelling{#1}{#2}% - \ttl@startargs\ttl@top@ii{#1}{#3}} - -\def\ttl@top@ii#1#2#3#4#5#6#7{% - \@ifundefined{#6break}% - {\if@openright - \cleardoublepage - \else - \clearpage - \fi}% - {\csname#6break\endcsname}% - \@ifundefined{ttl@ps@#6}% - {\thispagestyle{plain}}% - {\thispagestyle{\@nameuse{ttl@ps@#6}}}% - \global\@topnum\z@ - \@ifundefined{#6tolists}% - {\addtocontents{lof}{\protect\ttl@tocsep}% - \addtocontents{lot}{\protect\ttl@tocsep}} - {\@nameuse{#6tolists}}% - \if@twocolumn - \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% - \else - \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% - \@afterheading - \fi - \ignorespaces} - - -% \def\ttl@noskipsectrue{% -% \if@noskipsec -% \PackageError{titlesec}{Invalid shape for top class}% -% {The selected shape only makes sense when merged into\MessageBreak -% a paragraph. That is impossible in the top class}% -% \else - -\newcommand\chaptertitlename{\@chapapp} -\def\ttl@tocsep{\addvspace{10\p@}} - -% +-----------------+ -% | S H A P E S | -% +-----------------+ -% -% % Reformatting Titles: Interface -% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -% The surrounding space is stored in a macro -% named \ttls@
whose content is -% {left}{right}{before}{after}{afterindent}. -% But if there is the page key, the name is -% \ttls@
/ - -\newcommand\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} - -\def\ttl@spacing@i#1#2#3#4#5{% - \ttl@getkeys{#2}{titlesec}% - \@ifnextchar[{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}% - }{% - \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} - -\def\ttl@spacing@ii#1#2#3#4[#5]{% - \expandafter\def\csname ttls@\ttl@a\endcsname - {{#2}{#5}{#3}{#4}{#1}}} - -% The section name is built in \ttl@a. -% The format is stored in a macro named \ttlf@
, -% or \ttlf@
/ if there is the page spec, -% or \ttlf@.../* if numberless is true -% whose content is -% \ttl@{format}{label}{sep}{before}{after} - -\newtoks\ttl@toksa - -\newcommand\titleformat{% - \@ifstar{\ttl@format@s}% - {\ttl@format@i}} - -\def\ttl@format@s#1#2{% - \edef\ttl@a{\expandafter\@gobble\string#1}% - \@ifundefined{ttlf@\ttl@a}% - {\PackageError{titlesec}{Not allowed in `easy' settings} - {The sectiong command you are trying to redefine\MessageBreak - is not handled by the starred variant (eg, \string\part)}}{} - \expandafter\expandafter\expandafter - \ttl@format@si\csname ttlf@\ttl@a \endcsname - {#2}} - -\def\ttl@format@si#1#2#3#4#5#6#7{% - \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} - -\def\ttl@format@i#1{% - \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} - -\def\ttl@format@ii#1[#2]#3#4#5#6{% - \ttl@getkeys{#1}{titlesec}% - \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments - \@ifnextchar[{% - \ttl@format@iii{#2}% - }{% - \ttl@format@iii{#2}[]}} - -% First, we get the shape -- if not defined it loads -% the corresponding file. - -\def\ttl@format@iii#1[#2]{% - \@ifundefined{ttlh@#1}{% - \begingroup - \makeatletter - \InputIfFileExists{#1.tss}{}{% - \PackageError{titlesec}{Unknown shape}% - {Shapes are defined in files with extension tss\MessageBreak - Either you have misspelled the shape\MessageBreak - or there is no a #1.tss file}}% - \endgroup}{}% - \@temptokena{#2}% - \ifttl@explicit - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \else - \edef\ttl@b{% - \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname - {\expandafter\noexpand\csname ttlh@#1\endcsname - \the\ttl@toksa{\the\@temptokena}}}% - \fi - \ttl@b - \csname ttl@compat\ttl@a\endcsname} - -% Styles -% ~~~~~~ - -% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title -% \ttl@ and \ttlh@ take the following eight -% arguments: -% {format}{label}{sep}{before}{after}{left}{right}{title} -% where before and after refer to the format. -% With the option explicit, #4 contains the title and #8 is -% empty. - -\def\ttlh@display#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \ifttl@label - {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% - \fi - #4{#8}% - \kern\z@\strut\@@par - \nobreak\ttl@midlongest#5\@@par - \ttl@endlongest} - -\def\ttlh@hang#1#2#3#4#5#6#7#8{% - \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% - \setlength\leftskip{#6}% - \setlength\rightskip{#7}% - \interlinepenalty\@M - \ttl@changecentercr - \ttl@beginlongest - #1{\ifhmode\ttl@hmode@error\fi - \ttl@glcmds - \parindent\z@ - \begingroup - \ifttl@label - \noindent - \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% - \hangindent\wd\z@ - \box\z@ - \fi - #4{#8}% - \kern\z@\strut\@@par - \endgroup - \nobreak\ttl@midlongest#5\@@par}% - \ttl@endlongest} - -\def\ttlh@runin#1#2#3#4#5#6#7#8{% - \global\@noskipsectrue - \gdef\ttl@makeline##1{##1}% - \ttl@changecentercr - #1{\ifhmode\ttl@hmode@error\fi - \global\sbox\ttl@box{% - \ttl@calc\hspace{#6}% - \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi - #4{#8}#5\unskip}}% - \gdef\@svsechd{\unhbox\ttl@box}} - -% +-----------------+ -% | T O O L S | -% +-----------------+ -% -% calcwidth -% ~~~~~~~~~ -% Implemented after code from soul (but much modified...) - -\newdimen\titlewidth -\newdimen\titlewidthlast -\newdimen\titlewidthfirst - -\let\ttl@glcmds\relax -\let\ttl@beginlongest\@empty -\let\ttl@midlongest\@empty -\let\ttl@endlongest\@empty -\let\iftitlemeasuring\@secondoftwo - -\def\ttl@xbeginlongest#1\ttl@endlongest{% - \titlewidth\z@ - \titlewidthlast\z@ - \let\iftitlemeasuring\@firstoftwo - \setbox\ttl@box\vbox{% - \def\ttl@glcmds{% - \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% - {\@ifnextchar[{\ttl@bs}{\newline}}}% - \def\ttl@bs[####1]{\newline}% - \let\@centercr\\% - \def\ttl@midlongest####1\@@par{}% Very dirty... - \advance\rightskip 1\leftskip plus 1fil - \leftskip=\z@}% - #1}% - \let\iftitlemeasuring\@secondoftwo - \ttl@boxprocess - #1} - -\def\ttl@boxprocess{% - \setbox\ttl@box=\vbox{% - \unvcopy\ttl@box - \unskip\unpenalty - \global\setbox\@ne=\lastbox}% - \ifvoid\@ne - \else - \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% - \titlewidthfirst\wd\tw@ - \ifdim\titlewidth<\titlewidthfirst - \titlewidth\titlewidthfirst - \fi - \ifdim\titlewidthlast=\z@ - \titlewidthlast\titlewidthfirst - \fi - \expandafter\ttl@boxprocess - \fi} - -% Rules -% ~~~~~ - -\providecommand\titleline{% - \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% - {\ttl@line@i{}}} - -\def\ttl@line@i#1{% - \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} - -\def\ttl@line#1[#2]#3{% - \vskip\topskip - \hrule \@height \z@ - \nobreak - \vskip-\topskip - \begingroup - \parindent\z@ - \everypar{}% - \leftskip\z@ - \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: - \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% - \par - \endgroup - \hrule height \z@ - \nobreak} - -\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} - -\let\ttl@leaders\xleaders % For titletoc compatibility - -\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} -\def\ttl@row@i[#1]#2{% - \ifvmode\expandafter\titleline\fi - {\sbox\z@{#2}% - \ttl@calcneg\hspace{#1}% - \hskip\wd\z@ - \ttl@leaders\hb@xt@#1{\hss\box\z@}% - \hfill\kern\z@}} - -\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} -\def\ttl@rule@i[#1]{% - \ifvmode\expandafter\titleline\fi - {\leaders\hrule height #1\hfill\kern\z@}} - -% Par shapes and space -% ~~~~~~~~~~~~~~~~~~~~ - -\providecommand\filright{% - \gdef\ttl@filleft##1{\hskip##1}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \advance\rightskip\z@ \@plus 1fil\relax} -\providecommand\filleft{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hskip##1}% - \let\\\@centercr - \advance\leftskip\z@ \@plus 1fil - \parfillskip\z@} -\providecommand\filcenter{\filleft\filright - \gdef\ttl@filleft##1{\hfill}} -\providecommand\fillast{% - \gdef\ttl@filleft##1{\hfill}% - \gdef\ttl@filright##1{\hfill}% - \let\\\@centercr - \filleft\advance\rightskip\z@ \@plus -1fil - \parfillskip\z@ \@plus 2fil\relax} -\newcommand\filinner{% - \if@twoside - \ifodd\count\z@\filleft\else\filright\fi - \else - \filleft - \fi} -\newcommand\filouter{% - \if@twoside - \ifodd\count\z@\filright\else\filleft\fi - \else - \filright - \fi} - -\newcommand\wordsep{\fontdimen\tw@\font \@plus - \fontdimen\thr@@\font \@minus \fontdimen4\font} - -% +-----------------+ -% | O P T I O N S | -% +-----------------+ - - -\DeclareOption{pagestyles}{\let\sectiontitle\@empty} -\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} -\DeclareOption{floatps}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\space - \else - \PackageWarning{titlesec}{Ignoring `floatps' without - `pagestyles'. This option is now deprecated.}% - \fi} -\DeclareOption{psfloats}{% - \ifx\sectiontitle\@empty - \let\ttl@replace\@empty - \else - \PackageWarning{titlesec}{Ignoring `psfloats' without - `pagestyles'}% - \fi} - -\DeclareOption{loadonly}{\let\ttl@extract\@empty} - -\DeclareOption{outermarks}{% - \def\ttl@titlemarks{\outertitlemarks}} -\DeclareOption{topmarks}{ - \def\ttl@titlemarks{\toptitlemarks}} -\DeclareOption{botmarks}{% - \def\ttl@titlemarks{\bottitlemarks}} -\DeclareOption{innermarks}{% - \def\ttl@titlemarks{\innertitlemarks}} - -\DeclareOption{footmarks}{} % Backward compat - -\DeclareOption{explicit}{\ttl@explicittrue} - -\DeclareOption{clearempty}{% - \def\cleardoublepage{% - \clearpage{\ps@empty\if@twoside\ifodd\c@page\else - \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} - -\DeclareOption{rigidchapters}{% - \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% - \def\ttl@chapafter{.26\textheight}} -\DeclareOption{rubberchapters}{% - \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% - \def\ttl@chapafter{40\p@}} - -\DeclareOption{bottomtitles}{% - \def\bottomtitlespace{-1\p@}} -\DeclareOption{nobottomtitles}{% - \def\bottomtitlespace{.2\textheight}} -\DeclareOption{nobottomtitles*}{% - \let\ttl@addstretch\relax - \def\bottomtitlespace{.2\textheight}} - -\DeclareOption{calcwidth}{% - \let\ttl@beginlongest\ttl@xbeginlongest} - -\DeclareOption{aftersep}{% - \let\ttl@titlespace\@gobble} -\DeclareOption{largestsep}{% - \let\ttl@titlespace\addvspace} - -\DeclareOption{oldparttoc}{% - \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} -\DeclareOption{newparttoc}{% - \let\ttl@tocpart\relax} -\DeclareOption{notocpart*}{% - \let\ttl@notocparts\@empty} - -\DeclareOption{rm}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} -\DeclareOption{sf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} -\DeclareOption{tt}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} -\DeclareOption{md}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} -\DeclareOption{bf}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} -\DeclareOption{up}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} -\DeclareOption{it}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} -\DeclareOption{sl}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} -\DeclareOption{sc}{% - \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} - -\DeclareOption{big}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi}} -\DeclareOption{medium}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large - \or\normalsize\or\or\or\LARGE\fi}} -\DeclareOption{small}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large - \or\normalsize\or\normalsize\or\or\or\Large\fi}} -\DeclareOption{tiny}{% - \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or - \normalsize\or\normalsize\or\or\or\normalsize\fi}} - -\DeclareOption{raggedleft}{% - \gdef\ttl@fil{\filleft}} -\DeclareOption{center}{% - \gdef\ttl@fil{\filcenter}} -\DeclareOption{raggedright}{% - \gdef\ttl@fil{\filright}} - -\DeclareOption{uppercase}{% - \gdef\ttl@case{\MakeUppercase}} - -\DeclareOption{compact}{% - \gdef\ttl@space{1}% - \gdef\ttl@chapafter{30\p@}} - -% Deprecated. To be remmoved in a major upgrade (3.0) -\DeclareOption{indentfirst}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{nonindentfirst}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% New names -\DeclareOption{indentafter}{% - \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% - \@afterindenttrue - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} -\DeclareOption{noindentafter}{% - \def\titlespacing{% - \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} - -% newlinetospace -\let\ttl@blinemarks\relax -\let\ttl@elinemarks\relax - -\DeclareRobustCommand\ttl@linetosp{% - \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% - -\def\ttl@linetosp@i{% - \ifdim\lastskip>\z@\else\space\fi - \ignorespaces} - -\DeclareOption{newlinetospace}{% - \def\ttl@blinemarks{% - \let\ttl@e\\% - \def\\{\ttl@linetosp}}% - \def\ttl@elinemarks{\let\\\ttl@e}}% - -% toctitles -\def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% - \nobreak} - -\DeclareOption{toctitles}{% - \def\ttl@addcontentsline#1#2{% - \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% - \nobreak}} - -% pageatnewline - -\def\ttl@changecentercr{% - \let\ttl@centercr\@centercr - \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} - -\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} - -\def\ttl@fonts{} - -\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% - innermarks} - -\ProcessOptions - -% +-----------------+ -% | H Y P E R R E F | -% +-----------------+ -% -% These two commands are provided by hyperref. But if they -% are not defined at \begin{document} hyperref has not been -% loaded or it is an old version. - -\AtBeginDocument{% - \ifx\ttl@Hy@steplink\@undefined - \let\ttl@Hy@steplink\@gobble - \let\ttl@Hy@refstepcounter\refstepcounter - \fi} - -% +-----------------+ -% | PAGE STYLES | -% +-----------------+ -% -% This is generic: - -\newcommand\assignpagestyle[2]{% - \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} - -% Old pagestyles -% ~~~~~~~~~~~~~~ - -\providecommand\newpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \newpagestyle} - -\providecommand\renewpagestyle{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \renewpagestyle} - -\providecommand\widenhead{% - \let\ttl@compatps\@empty % marks the ``old interface'' - \makeatletter - \edef\ttl@d{% - \noexpand\input{ttlps.def}% - \catcode`\noexpand\@=\the\catcode`\@}% - \ttl@d - \widenhead} - -% New pagestyles -% ~~~~~~~~~~~~~~ - -\@ifundefined{sectiontitle}{}{\input{ttlps.def}} - -% +-----------------+ -% | C O M P A T | -% +-----------------+ -% Easy setup, i.e., that of package options, is -% taken care of, if necessary. - -\renewcommand\secdef[2]{% - \@ifstar - {\ttl@labelfalse - #2} - {\ttl@labeltrue - \ifx#1\@chapter - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \else\ifx#1\@part - \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi - \fi\fi - \let\ifttl@toclabel\ifttl@label - \@dblarg{#1}}} - -\@ifundefined{ttl@extract}{}{\endinput} - -\newcommand\titlelabel[1]{% - \def\@seccntformat##1{#1}} - -\expandafter\ifx\csname chapter\endcsname\relax - - \def\ttl@compatpart{\titleclass{\part}{part}\relax} - -\else - - \def\ttl@compatchapter{% - \def\@makechapterhead{% - \ttl@labeltrue - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}% - \def\@makeschapterhead{% - \ttl@labelfalse - \if@mainmatter\else\ttl@labelfalse\fi - \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi - \ttl@startargs\ttl@mkchap{chapter}}} - - \def\ttl@compatpart{\titleclass{\part}{page}\relax} - -\fi - -\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% - \@tempskipa=#5 - \@tempskipb=#6 - \ifdim\@tempskipa<\z@ - \toks@{\titlespacing*#8{#4}}% - \@tempskipa-\@tempskipa - \else - \toks@{\titlespacing#8{#4}}% - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% - \ifdim\@tempskipb<\z@ - \if@tempswa - \titleformat#8[runin]% - {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8[runin]% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@tempskipb-\@tempskipb - \else - \if@tempswa - \titleformat#8% - {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \else - \titleformat#8% - {#7}{\@seccntformat{#2}}% - {\z@}\ttl@passexplicit - \fi - \@ifundefined{ttl@space}{}{% - \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% - \fi - \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} - \ttl@a} - -\def\ttl@extract#1{% - \expandafter\in@\expandafter\@startsection\expandafter{#1}% - \ifin@ - \expandafter\ttl@@extract#1#1% - \else - \PackageWarningNoLine{titlesec}% - {Non standard sectioning command detected\MessageBreak - Using default spacing and no format} - \titlespacing*#1{\z@}{*3}{*2}% - \fi} - -\@tempswafalse - -\ifx\ttl@fonts\@empty - \def\ttl@fonts{\bfseries} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@sizes\endcsname\relax - \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large - \or\normalsize\or\or\or\huge\fi} -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@fil\endcsname\relax - \let\ttl@fil\@empty -\else - \@tempswatrue -\fi - -\expandafter\ifx\csname ttl@case\endcsname\relax - \let\ttl@case\@firstofone -\else - \@tempswatrue -\fi - -\if@tempswa - - \expandafter\ifx\csname chapter\endcsname\relax\else - \titleformat\chapter[display]% - {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} - {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} - \fi - -\fi - -\ttl@extract\section -\ttl@extract\subsection -\ttl@extract\subsubsection -\ttl@extract\paragraph -\ttl@extract\subparagraph - -\let\ttl@extract\@undefined -\let\ttl@@extract\@undefined - -\def\ttl@toplevel{part} - -\expandafter\ifx\csname chapter\endcsname\relax - - \@namedef{ttll@part}{0} - \titleclass{\section}{straight}[\part] - - \titlespacing*{\part} - {\z@} - {4ex} - {3ex} - -\else - - \let\ttl@save@mkchap\@makechapterhead - \let\ttl@save@mkschap\@makeschapterhead - - \def\@makechapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkchap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \def\@makeschapterhead#1{% - \gdef\ttl@savemark{\chaptermark{#1}}% - \ttl@save@mkschap{#1}% - \@ifundefined{ttl@ps@chapter}{}% - {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} - - \@namedef{ttll@part}{-1} - \@namedef{ttlss@part}{chapter} - \@namedef{ttll@chapter}{0} - \titleclass{\section}{straight}[\chapter] - -% The following is unoperant, unless when \chapter / \part -% format is redefined - - \titlespacing*{\part} - {\z@} - {\z@\@plus1fil} - {\z@\@plus1fil} - - \titlespacing*\chapter - {\z@}% - {50\p@}% - {\ttl@chapafter}% - -\fi - -\titleclass{\subsection} {straight}[\section] -\titleclass{\subsubsection}{straight}[\subsection] -\titleclass{\paragraph} {straight}[\subsubsection] -\titleclass{\subparagraph} {straight}[\paragraph] - -\endinput +% +--------------------------------------------------+ +% | Typeset titlesec.tex to get the documentation. | +% +--------------------------------------------------+ +% +% Copyright (c) 1998-2016 by Javier Bezos. +% All Rights Reserved. +% +% This file is part of the titlesec distribution release 2.10.2 +% ----------------------------------------------------------- +% +% It may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% The Current Maintainer of this work is Javier Bezos. +% +% Notes +% ~~~~~ +% +% The following tags are used: +% ttl@ : the generic tag used through the style +% ttlh@ : a shape definition +% ttlf@ : a macro containing the title format +% ttls@ : id. the title space +% ttlp@ : page key related macros +% ttll@ : level number +% +% The ttlf@ and ttls@ contains data in the form {..}{..}. +% Perhaps in future releases they should be converted +% to a prop-like list, similar to that proposed by the +% latex team. +% +% Admittedly, the current implementation seems too +% complicated, but that's necessary in order to provide +% certain compatibility with the sections as defined by the +% used class. Other packages opt for providing the sections +% as defined by standard classes ignoring the class; for +% instance sectsty which does a simple task in a simple and +% nice way. However, that was not my goal. +% +% Release +% ~~~~~~~ + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{titlesec}[2016/03/21 v2.10.2 Sectioning titles] + +% Initialization +% ~~~~~~~~~~~~~~ + +\newif\ifttl@ps +\ttl@psfalse + +% The \ttl@label switch is used when printing the label in titles. +% A numberless variant makes it to true. +% There is a \ttl@toclabel as well, which is true iff the +% title is numbered; used in toc entries (except default part +% and chapter) and marks (only in titlesec pagestyles). + +\newif\ifttl@label +\newif\ifttl@toclabel + +\newbox\ttl@box + +% A provision for the report style: + +\@ifundefined{if@mainmatter} + {\let\if@mainmatter\iftrue}{} + +\@ifundefined{if@openright} + {\let\if@openright\iftrue}{} + +% and the ams styles as well + +\@ifundefined{@chapapp} + {\let\@chapapp\chaptername}{} + +\def\ttl@trylist{\ttl@try{}} + +\def\ttl@getkeys#1#2{% + \if\expandafter @\@gobble#1@\@empty + \edef\ttl@b{\expandafter\@gobble\string#1}% + \let\ttl@a\ttl@b + \else + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlkeys.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \ttl@getkeys{#1}{#2}% + \fi} + +% A more meaningful error for \@notdefinable + +\expandafter\AtEndOfPackage\expandafter{\expandafter + \gdef\expandafter\@notdefinable\expandafter{\@notdefinable}} + +\def\@notdefinable{% + \PackageError{titlesec}% + {Incompatible package}% + {Titlesec cannot continue defining its own macros + because\MessageBreak + \@backslashchar\reserved@a\space is already used by other package, + the class\MessageBreak + or the document.}} + +% +-----------------+ +% | C L A S S E S | +% +-----------------+ + +\def\ttl@useclass#1#2{% + \@ifstar + {\ttl@labelfalse#1{#2}[]}% + {\ttl@labeltrue\@dblarg{#1{#2}}}} + +\def\ttl@straightclass{\ttl@useclass\ttl@straight@i} +\def\ttl@partclass{\ttl@useclass\ttl@part@i} +\def\ttl@topclass{\ttl@useclass\ttl@top@i} +\def\ttl@pageclass{\ttl@useclass\ttl@page@i} + +% Here \scantokens is used to make sure the unescaped name +% has `letters' and no `others'. Mainly for hyperref, so there +% should be no problems. + +\newcommand\titleclass[1]{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \ifx\scantokens\@undefined\else + \scantokens\expandafter{\expandafter + \def\expandafter\ttl@a\expandafter{\ttl@a}}% + \fi + \@ifnextchar[{\@tempswatrue\ttl@class@i{#1}}% + {\@tempswafalse\ttl@class@ii{#1}}} + +\def\ttl@class@i#1[#2]{% + \@namedef{ttll@\ttl@a}{#2}% + \expandafter\providecommand\csname\ttl@a title\endcsname{}%%%% + \@ifundefined{ttl@toplevel}{}% + {\expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@toplevel\endcsname}% + \edef\ttl@toplevel{\ttl@a}% + \ttl@class@ii{#1}} + +\def\ttl@class@ii#1#2{% + \@ifundefined{ttl@#2class}% + {\PackageError{titlesec}{Unknown sectioning class}% + {Valid names are top, page and straight}}% + {\expandafter\let\csname ttl@compat\ttl@a\endcsname\relax + \@ifundefined{\ttl@a mark}% + {\@namedef{\ttl@a mark}{\@gobble}}% + {}% + \edef#1{% + \expandafter\noexpand\csname ttl@#2class\endcsname{\ttl@a}}}% + \if@tempswa + \expandafter\@gobble + \else + \expandafter\@firstofone + \fi + {\@ifnextchar[% + {\ttl@class@iii}% + {\@ifundefined{ttll@\ttl@a}% + {\PackageError{titlesec}{Unknown sectioning level}% + {\string\titleclass\space with no optional arguments\MessageBreak + only changes the class of an *existing* level}}}}} + +\def\ttl@class@iii[#1]{% + \edef\ttl@b{\expandafter\@gobble\string#1}% + \expandafter\let\csname ttlss@\ttl@a\expandafter\endcsname + \csname ttlss@\ttl@b\endcsname + \expandafter\edef\csname ttlss@\ttl@b\endcsname{\ttl@a}% + \let\ttl@a\ttl@toplevel + \count@\csname ttll@\ttl@toplevel\endcsname + \ttl@class@iv} + +\def\ttl@class@iv{% + \@ifundefined{ttlss@\ttl@a}{}% + {\advance\count@\@ne + \edef\ttl@a{\csname ttlss@\ttl@a\endcsname}% + \expandafter\edef\csname ttll@\ttl@a\endcsname{\the\count@}% + \ttl@class@iv}} + +% Typesetting Classes: General tools +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% The following command handles the *n spacing +% Some tricks are necessary to multiply a +% skip by a non integer number + +\newskip\beforetitleunit +\beforetitleunit=1ex\@plus.3ex\@minus.06ex +\newskip\aftertitleunit +\aftertitleunit=1ex\@plus.1ex + +\newdimen\ttl@plus +\newdimen\ttl@minus + +\def\ttl@assign#1{% + \@ifstar + {\ttl@assign@i{#1}}% + {\ttl@assign@d{#1}}} + +\def\ttl@assign@i#1#2\relax#3{% + \ttl@plus\z@ + \ttl@minus\z@ + \afterassignment\ttl@assign@ii + \dimen@\the#3, % <- space + #1 = #2\dimen@ + plus #2\ttl@plus + minus #2\ttl@minus} + +\def\ttl@assign@ii#1 {% <- space + \if#1,\else\afterassignment\ttl@assign@ii\fi + \csname ttl@\string#1\endcsname} + +\def\ttl@assign@d#1#2\relax#3{\setlength#1{#2}} + +% To be used with \v/vspace to make them calc-savvy + +\def\ttl@calc#1#2{% + {\setlength\@tempskipa{#2}% + #1\@tempskipa}} + +\def\ttl@calcneg#1#2{% + {\setlength\@tempskipa{#2}% + #1{-\@tempskipa}}} + +% Gets from ttls@ and passes the spacing parameters: + +\def\ttl@startargs#1#2{% Get the first arguments, with the spacing + \@ifundefined{ttlp@#2}% + {\let\ttl@key@page\@empty}% + {\ttlp@fetch{#2}}% + \begingroup + \def\ttl@b{ttls@#2}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \xdef\ttl@b{\ttl@c}% + \endgroup + \ifx\ttl@b\@empty + \PackageError{titlesec}{Format/spacing not found}% + {I was unable to find the format corresponding to #2.\MessageBreak + Maybe you haven't set it with \string\titleformat\space and + \string\titlespacing} + \fi + \expandafter#1\ttl@b{#2}} + +% Used in ttl@select + +\def\ttl@savefn#1[#2]#3{% + \ifcase#1% + \footnotemark[#2]% + \gdef\ttl@fn{\footnotetext[#2]{#3}}% + \else + \footnotemark + \gdef\ttl@fn{\footnotetext{#3}}% + \fi} + +\def\ttl@nest@error{% + \PackageError{titlesec}{Nested titles}{Titles must not be nested}} + +\def\ttl@hmode@error{% + \PackageError{titlesec}{Entered in horizontal mode} + {The argument cannot contain horizontal material\MessageBreak + such as text, \string\noindent, \string\makebox, etc.}} + +% \ttl@select not only selects the right version to be +% used. It also take steps to ensure that a mark +% is not lost inside a box by saving it into \ttl@mk, +% which in turn is used by the sect and chap commands. + +\newif\ifttl@explicit + +\def\ttl@gmk#1{\gdef\ttl@mk{#1}} + +\def\ttl@select#1#2#3#4{% + \ttl@Hy@saveanchor + \global\let\ttl@mk\@empty % global because of rigidchapters + \global\let\ttl@fn\@empty + \begingroup + \if@inlabel\else % Keep item's \everypar + \everypar{\setbox\z@\lastbox\strut}% + \fi + \let\ttl@straight@i\ttl@nest@error + \let\ttl@top@i \ttl@nest@error + \let\ttl@part@i \ttl@nest@error + \let\ttl@page@i \ttl@nest@error + \let\ttl@newpage\newpage + \def\newpage{\ttl@savewrite\ttl@newpage}% + \def\markboth##1##2{\protect\ttl@gmk{\protect\markboth{##1}{##2}}}% + \def\markright##1{\protect\ttl@gmk{\protect\markright{##1}}}% + \def\@mkboth##1##2{\protect\ttl@gmk{\protect\@mkboth{##1}{##2}}}% + \def\footnote{\@ifnextchar[% + {\ttl@savefn\z@}{\ttl@savefn\@ne[]}}% + \edef\ttl@key@numberless{\ifttl@label//\else/*\fi}% + \def\ttl@b{ttlf@#1}% + \def\ttl@a##1{\csname ttl@key@##1\endcsname}% Used as elt in try + \ttl@trylist + \ifttl@explicit + \def\ttl@passexplicit{\ttl@case{#4}}% + \ttl@c{#4}{#2}{#3}{}% ttl@c is returned by ttl@try with ttlf@... + \else + \let\ttl@passexplicit\ttl@case + \ttl@c{#2}{#3}{#4}% ttl@c is returned by ttl@try with ttlf@... + \fi + \endgroup} + +\let\ttl@savewrite\@empty + +\def\ttl@finmarks{% + \ttl@savewrite + \ttl@mk % Contains a possible mark, returned by \ttl@select + \ttl@fn} % And a footnote + +\def\ttl@try#1{% + \edef\ttl@c{#1}% #1 is a list in the form \ttl@a{key}\ttl@a{key} + \@ifundefined{\ttl@b\ttl@c}{}{% + \edef\ttl@c{\expandafter\noexpand\csname\ttl@b\ttl@c\endcsname}% + \def\ttl@a##1{\csname ttl@extra@##1\endcsname}% + #1% + \let\ttl@try\@gobble}} % locally modified to `break' testings + +% \ttl@write writes marks and toc. tocdepth is taken care of when +% the toc is typesetted and not here. Used always through +% ttl@savewrite, which is reset to \@empty to avoid duplicated +% calls. + +\def\ttl@write#1#2{% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \def\ttl@a{\protect\numberline{\@nameuse{the#1}}}% + \@nameuse{ttl@toc#1}% eg, \ttl@tocpart modifies \ttl@a + \ttl@addcontentsline{#1}{#2}% Depends on toctitles, uses \ttl@a + \ttl@elinemarks + \global\ttl@toclabelfalse + \global\let\ttl@savewrite\@empty} + +\newif\ifttl@premark % to be used in ttlps.def +\ttl@premarkfalse + +\def\ttl@premark#1#2{% + \protected@xdef\ttl@prevmarks{\ttl@marks}% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \ttl@elinemarks + \gdef\ttl@prevmarks{\ttl@marks}} + +% Must be preceded by a default \ttl@savewrite, which is used +% in starred variants--\@empty in top and straight classes. +% In straight class, it is preceded by the setting of +% prev marks to provide a "fixed" top mark. Otherwise, +% the default prev mark (= curr mark) is used (restored +% after ttl@labelling in straight). This is the command +% to be hacked if you want to change the behaviour of +% starred variants. + +\def\ttl@labelling#1#2{% + \let\ttl@Hy@saveanchor\@empty + \ifttl@label % 1st - if star + \def\ttl@savewrite{\ttl@write{#1}{#2}}% + \@nameuse{ttl@#1label}% eg, sets if mainmatter in chapter. + \ifttl@label % 2nd - eg, if not main matter + \ifnum\@nameuse{ttll@#1}>\c@secnumdepth\relax + \ttl@labelfalse % 3rd - if too deep + \else + \ttl@Hy@refstepcounter{#1}% + \@nameuse{ttl@#1out}% + \fi + \fi + \fi + \let\ifttl@toclabel\ifttl@label + \ifx\ttl@savewrite\@empty\else % If marks + \ifttl@ps + \ifttl@premark + \global\ttl@premarkfalse + \else % if no \pretitlemark + \ttl@premark{#1}{#2}% + \fi + \fi + \ifttl@label\else\ttl@Hy@steplink{#1}\fi + \fi} + +% Executed by ttl@labelling if the name of section is chapter: + +\def\ttl@chapterlabel{\if@mainmatter\else\ttl@labelfalse\fi} + +% Executed by ttl@labelling if chapter has a number. Note +% you can define messages for other sectioning levels (eg, +% \ttl@sectionout). + +\def\ttl@chapterout{\typeout{\chaptertitlename\space\thechapter.}} + +% Straight class +% ~~~~~~~~~~~~~ +% Default for nobottomtitles. Changed by nobottomtitles* + +\def\ttl@addstretch{\advance\@tempskipa-\pagestretch} + +% 1:name 2:level 3:indent 4:before 5:after 6:afind [7]:cap 8:title +% The second argument of ttl@sect is the level, which +% is empty if the star version is used. In this case +% neither the toc nor the marks are written. + +\def\ttl@straight@i#1[#2]#3{% + \def\@currentlabelname{#2}% for nameref + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \gdef\thetitle{\csname the#1\endcsname}% + \if@noskipsec \leavevmode \fi + \par + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@straight@ii{#1}{#3}} + +% 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title + +\def\ttl@straight@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in straight class ignored}}% + \if@nobreak + \ttl@titlespace{\@tempskipa}% + \else + \@ifundefined{#6break}% + {\addpenalty{\@secpenalty}}% + {\csname#6break\endcsname}% + \addvspace{\@tempskipa}% + \ifdim\bottomtitlespace<\z@ + \else + \begingroup + \@tempskipb\pagegoal + \@tempskipa\pagegoal + \ttl@addstretch % \relax if nobottomtitle* + \advance\@tempskipa-\bottomtitlespace\relax % not a register + \pagegoal\@tempskipa + \def\@textbottom{\vskip\z@\@plus.0001fil}% + \penalty9999 + \pagegoal\@tempskipb + \endgroup + \fi + \fi + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \if@noskipsec + \global\@nobreakfalse + \everypar{% + \if@noskipsec + \global\@noskipsecfalse + \clubpenalty\@M + \hskip-\parindent + \begingroup + \@svsechd\unskip{\hspace{\@tempskipb}}% + \endgroup + \else + \clubpenalty\@clubpenalty\everypar{}% + \fi}% + \else + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading + \fi + \ignorespaces} + +% Part class +% ~~~~~~~~~~ + +\providecommand\partmark[1]{\markboth{}{}} + +\def\ttl@part@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@part@ii{#1}{#3}} + +\def\ttl@part@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \@ifundefined{ttl@ps@#6}{}% + {\PackageWarning{titlesec}{Page style in part class ignored}}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse \fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \par\nobreak + \vspace{\@tempskipb}% + \@afterheading} + +% Page class +% ~~~~~~~~~~ + +\def\ttl@page@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \ifx\ttl@notocparts\@undefined + \def\ttl@savewrite{\ttl@write{#1}{#3}}% Not #2! + \else + \let\ttl@savewrite\@empty + \fi + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@page@ii{#1}{#3}} + +\def\ttl@page@ii#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \if@openright + \cleardoublepage + \else + \clearpage + \fi + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \if@twocolumn + \onecolumn + \@tempswatrue + \else + \@tempswafalse + \fi + \vspace*{\@tempskipa}% + \@afterindenttrue + \ifcase#5 \@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@select{#6}{#1}{#2}{#7}% + \ttl@finmarks + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}% + \vspace{\@tempskipb}% + \newpage + \if@twoside + \if@openright + \null + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{empty}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \newpage + \fi + \fi + \if@tempswa + \twocolumn + \fi + \ignorespaces} + +% Top class and some makechapterhead stuff +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +% +% \ttl@mkchap is the new make(s)chapterhead. + +\def\ttl@mkchap#1#2#3#4#5#6#7{% + \gdef\ttl@savemark{\csname#6mark\endcsname{#7}}% + \let\ttl@savewrite\@empty + \let\ttl@Hy@saveanchor\@empty + \@ifundefined{ttl@ps@#6}{}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \let\ifttl@toclabel\ifttl@label + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}} + +% But \ttl@mkchap@i is used by both makechapterhead and +% the top class. + +\def\ttl@mkchap@i#1#2#3#4#5#6#7{% + \ttl@assign\@tempskipa#3\relax\beforetitleunit + \vspace*{\@tempskipa}% + \global\@afterindenttrue + \ifcase#5 \global\@afterindentfalse\fi + \ttl@assign\@tempskipb#4\relax\aftertitleunit + \ttl@topmode{\@tempskipb}{% + \ttl@select{#6}{#1}{#2}{#7}}% + \ttl@finmarks % Outside the box! + \@ifundefined{ttlp@#6}{}{\ttlp@write{#6}}} + +\def\ttl@top@i#1[#2]#3{% + \gdef\ttl@savemark{\csname#1mark\endcsname{#3}}% + \let\ttl@savewrite\@empty + \def\ttl@savetitle{#3}% + \ttl@labelling{#1}{#2}% + \ttl@startargs\ttl@top@ii{#1}{#3}} + +\def\ttl@top@ii#1#2#3#4#5#6#7{% + \@ifundefined{#6break}% + {\if@openright + \cleardoublepage + \else + \clearpage + \fi}% + {\csname#6break\endcsname}% + \@ifundefined{ttl@ps@#6}% + {\thispagestyle{plain}}% + {\thispagestyle{\@nameuse{ttl@ps@#6}}}% + \global\@topnum\z@ + \@ifundefined{#6tolists}% + {\addtocontents{lof}{\protect\ttl@tocsep}% + \addtocontents{lot}{\protect\ttl@tocsep}} + {\@nameuse{#6tolists}}% + \if@twocolumn + \@topnewpage[\ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}]% + \else + \ttl@mkchap@i{#1}{#2}{#3}{#4}{#5}{#6}{#7}% + \@afterheading + \fi + \ignorespaces} + + +% \def\ttl@noskipsectrue{% +% \if@noskipsec +% \PackageError{titlesec}{Invalid shape for top class}% +% {The selected shape only makes sense when merged into\MessageBreak +% a paragraph. That is impossible in the top class}% +% \else + +\newcommand\chaptertitlename{\@chapapp} +\def\ttl@tocsep{\addvspace{10\p@}} + +% +-----------------+ +% | S H A P E S | +% +-----------------+ +% +% % Reformatting Titles: Interface +% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +% The surrounding space is stored in a macro +% named \ttls@
whose content is +% {left}{right}{before}{after}{afterindent}. +% But if there is the page key, the name is +% \ttls@
/ + +\newcommand\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\@ne}}} + +\def\ttl@spacing@i#1#2#3#4#5{% + \ttl@getkeys{#2}{titlesec}% + \@ifnextchar[{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}% + }{% + \ttl@spacing@ii{#1}{#3}{#4}{#5}[\z@]}} + +\def\ttl@spacing@ii#1#2#3#4[#5]{% + \expandafter\def\csname ttls@\ttl@a\endcsname + {{#2}{#5}{#3}{#4}{#1}}} + +% The section name is built in \ttl@a. +% The format is stored in a macro named \ttlf@
, +% or \ttlf@
/ if there is the page spec, +% or \ttlf@.../* if numberless is true +% whose content is +% \ttl@{format}{label}{sep}{before}{after} + +\newtoks\ttl@toksa + +\newcommand\titleformat{% + \@ifstar{\ttl@format@s}% + {\ttl@format@i}} + +\def\ttl@format@s#1#2{% + \edef\ttl@a{\expandafter\@gobble\string#1}% + \@ifundefined{ttlf@\ttl@a}% + {\PackageError{titlesec}{Not allowed in `easy' settings} + {The sectiong command you are trying to redefine\MessageBreak + is not handled by the starred variant (eg, \string\part)}}{} + \expandafter\expandafter\expandafter + \ttl@format@si\csname ttlf@\ttl@a \endcsname + {#2}} + +\def\ttl@format@si#1#2#3#4#5#6#7{% + \@namedef{ttlf@\ttl@a}{#1{#7}{#3}{#4}{#5}{#6}}} + +\def\ttl@format@i#1{% + \@ifnextchar[{\ttl@format@ii{#1}}{\ttl@format@ii{#1}[hang]}} + +\def\ttl@format@ii#1[#2]#3#4#5#6{% + \ttl@getkeys{#1}{titlesec}% + \ttl@toksa{{#3}{#4}{#5}{#6}}% Save arguments + \@ifnextchar[{% + \ttl@format@iii{#2}% + }{% + \ttl@format@iii{#2}[]}} + +% First, we get the shape -- if not defined it loads +% the corresponding file. + +\def\ttl@format@iii#1[#2]{% + \@ifundefined{ttlh@#1}{% + \begingroup + \makeatletter + \InputIfFileExists{#1.tss}{}{% + \PackageError{titlesec}{Unknown shape}% + {Shapes are defined in files with extension tss\MessageBreak + Either you have misspelled the shape\MessageBreak + or there is no a #1.tss file}}% + \endgroup}{}% + \@temptokena{#2}% + \ifttl@explicit + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname####1% + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \else + \edef\ttl@b{% + \def\expandafter\noexpand\csname ttlf@\ttl@a\endcsname + {\expandafter\noexpand\csname ttlh@#1\endcsname + \the\ttl@toksa{\the\@temptokena}}}% + \fi + \ttl@b + \csname ttl@compat\ttl@a\endcsname} + +% Styles +% ~~~~~~ + +% 1:global 2:label 3:sep 4:style 5:after 6:left 7:right 8:title +% \ttl@ and \ttlh@ take the following eight +% arguments: +% {format}{label}{sep}{before}{after}{left}{right}{title} +% where before and after refer to the format. +% With the option explicit, #4 contains the title and #8 is +% empty. + +\def\ttlh@display#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \ifttl@label + {#2\strut\@@par}\nobreak\ttl@calc\vspace{#3}% + \fi + #4{#8}% + \kern\z@\strut\@@par + \nobreak\ttl@midlongest#5\@@par + \ttl@endlongest} + +\def\ttlh@hang#1#2#3#4#5#6#7#8{% + \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% + \setlength\leftskip{#6}% + \setlength\rightskip{#7}% + \interlinepenalty\@M + \ttl@changecentercr + \ttl@beginlongest + #1{\ifhmode\ttl@hmode@error\fi + \ttl@glcmds + \parindent\z@ + \begingroup + \ifttl@label + \noindent + \sbox\z@{#2\strut\ttl@calc\hspace{#3}}% + \hangindent\wd\z@ + \box\z@ + \fi + #4{#8}% + \kern\z@\strut\@@par + \endgroup + \nobreak\ttl@midlongest#5\@@par}% + \ttl@endlongest} + +\def\ttlh@runin#1#2#3#4#5#6#7#8{% + \global\@noskipsectrue + \gdef\ttl@makeline##1{##1}% + \ttl@changecentercr + #1{\ifhmode\ttl@hmode@error\fi + \global\sbox\ttl@box{% + \ttl@calc\hspace{#6}% + \ifttl@label{\strut#2}\ttl@calc\hspace{#3}\fi + #4{#8}#5\unskip}}% + \gdef\@svsechd{\unhbox\ttl@box}} + +% +-----------------+ +% | T O O L S | +% +-----------------+ +% +% calcwidth +% ~~~~~~~~~ +% Implemented after code from soul (but much modified...) + +\newdimen\titlewidth +\newdimen\titlewidthlast +\newdimen\titlewidthfirst + +\let\ttl@glcmds\relax +\let\ttl@beginlongest\@empty +\let\ttl@midlongest\@empty +\let\ttl@endlongest\@empty +\let\iftitlemeasuring\@secondoftwo + +\def\ttl@xbeginlongest#1\ttl@endlongest{% + \titlewidth\z@ + \titlewidthlast\z@ + \let\iftitlemeasuring\@firstoftwo + \setbox\ttl@box\vbox{% + \def\ttl@glcmds{% + \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}% + {\@ifnextchar[{\ttl@bs}{\newline}}}% + \def\ttl@bs[####1]{\newline}% + \let\@centercr\\% + \def\ttl@midlongest####1\@@par{}% Very dirty... + \advance\rightskip 1\leftskip plus 1fil + \leftskip=\z@}% + #1}% + \let\iftitlemeasuring\@secondoftwo + \ttl@boxprocess + #1} + +\def\ttl@boxprocess{% + \setbox\ttl@box=\vbox{% + \unvcopy\ttl@box + \unskip\unpenalty + \global\setbox\@ne=\lastbox}% + \ifvoid\@ne + \else + \setbox\tw@=\hbox{\hskip-\leftskip\unhbox\@ne\hskip-\rightskip}% + \titlewidthfirst\wd\tw@ + \ifdim\titlewidth<\titlewidthfirst + \titlewidth\titlewidthfirst + \fi + \ifdim\titlewidthlast=\z@ + \titlewidthlast\titlewidthfirst + \fi + \expandafter\ttl@boxprocess + \fi} + +% Rules +% ~~~~~ + +\providecommand\titleline{% + \@ifstar{\ttl@line@i{\hb@xt@\titlewidth}}% + {\ttl@line@i{}}} + +\def\ttl@line@i#1{% + \@ifnextchar[{\ttl@line{#1}}{\ttl@line{#1}[s]}} + +\def\ttl@line#1[#2]#3{% + \vskip\topskip + \hrule \@height \z@ + \nobreak + \vskip-\topskip + \begingroup + \parindent\z@ + \everypar{}% + \leftskip\z@ + \rightskip\z@ % #1 is either \hb@xt@\titlewidth or empty: + \@makebox[\hsize][#2]{\ttl@makeline{#1{#3}}}% + \par + \endgroup + \hrule height \z@ + \nobreak} + +\providecommand\titlerule{\@ifstar{\ttl@row}{\ttl@rule}} + +\let\ttl@leaders\xleaders % For titletoc compatibility + +\def\ttl@row{\@ifnextchar[{\ttl@row@i}{\ttl@row@i[\wd\z@]}} +\def\ttl@row@i[#1]#2{% + \ifvmode\expandafter\titleline\fi + {\sbox\z@{#2}% + \ttl@calcneg\hspace{#1}% + \hskip\wd\z@ + \ttl@leaders\hb@xt@#1{\hss\box\z@}% + \hfill\kern\z@}} + +\def\ttl@rule{\@ifnextchar[{\ttl@rule@i}{\ttl@rule@i[.4\p@]}} +\def\ttl@rule@i[#1]{% + \ifvmode\expandafter\titleline\fi + {\leaders\hrule height #1\hfill\kern\z@}} + +% Par shapes and space +% ~~~~~~~~~~~~~~~~~~~~ + +\providecommand\filright{% + \gdef\ttl@filleft##1{\hskip##1}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \advance\rightskip\z@ \@plus 1fil\relax} +\providecommand\filleft{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hskip##1}% + \let\\\@centercr + \advance\leftskip\z@ \@plus 1fil + \parfillskip\z@} +\providecommand\filcenter{\filleft\filright + \gdef\ttl@filleft##1{\hfill}} +\providecommand\fillast{% + \gdef\ttl@filleft##1{\hfill}% + \gdef\ttl@filright##1{\hfill}% + \let\\\@centercr + \filleft\advance\rightskip\z@ \@plus -1fil + \parfillskip\z@ \@plus 2fil\relax} +\newcommand\filinner{% + \if@twoside + \ifodd\count\z@\filleft\else\filright\fi + \else + \filleft + \fi} +\newcommand\filouter{% + \if@twoside + \ifodd\count\z@\filright\else\filleft\fi + \else + \filright + \fi} + +\newcommand\wordsep{\fontdimen\tw@\font \@plus + \fontdimen\thr@@\font \@minus \fontdimen4\font} + +% +-----------------+ +% | O P T I O N S | +% +-----------------+ + + +\DeclareOption{pagestyles}{\let\sectiontitle\@empty} +\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} +\DeclareOption{floatps}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\space + \else + \PackageWarning{titlesec}{Ignoring `floatps' without + `pagestyles'. This option is now deprecated.}% + \fi} +\DeclareOption{psfloats}{% + \ifx\sectiontitle\@empty + \let\ttl@replace\@empty + \else + \PackageWarning{titlesec}{Ignoring `psfloats' without + `pagestyles'}% + \fi} + +\DeclareOption{loadonly}{\let\ttl@extract\@empty} + +\DeclareOption{outermarks}{% + \def\ttl@titlemarks{\outertitlemarks}} +\DeclareOption{topmarks}{ + \def\ttl@titlemarks{\toptitlemarks}} +\DeclareOption{botmarks}{% + \def\ttl@titlemarks{\bottitlemarks}} +\DeclareOption{innermarks}{% + \def\ttl@titlemarks{\innertitlemarks}} + +\DeclareOption{footmarks}{} % Backward compat + +\DeclareOption{explicit}{\ttl@explicittrue} + +\DeclareOption{clearempty}{% + \def\cleardoublepage{% + \clearpage{\ps@empty\if@twoside\ifodd\c@page\else + \hbox{}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}}} + +\DeclareOption{rigidchapters}{% + \def\ttl@topmode#1#2{\vbox to #1{#2\vfil}}% + \def\ttl@chapafter{.26\textheight}} +\DeclareOption{rubberchapters}{% + \def\ttl@topmode#1#2{{#2}\ttl@calc\vspace{#1}}% + \def\ttl@chapafter{40\p@}} + +\DeclareOption{bottomtitles}{% + \def\bottomtitlespace{-1\p@}} +\DeclareOption{nobottomtitles}{% + \def\bottomtitlespace{.2\textheight}} +\DeclareOption{nobottomtitles*}{% + \let\ttl@addstretch\relax + \def\bottomtitlespace{.2\textheight}} + +\DeclareOption{calcwidth}{% + \let\ttl@beginlongest\ttl@xbeginlongest} + +\DeclareOption{aftersep}{% + \let\ttl@titlespace\@gobble} +\DeclareOption{largestsep}{% + \let\ttl@titlespace\addvspace} + +\DeclareOption{oldparttoc}{% + \def\ttl@tocpart{\def\ttl@a{\thepart\hspace{1em}}}} +\DeclareOption{newparttoc}{% + \let\ttl@tocpart\relax} +\DeclareOption{notocpart*}{% + \let\ttl@notocparts\@empty} + +\DeclareOption{rm}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\rmfamily}} +\DeclareOption{sf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\sffamily}} +\DeclareOption{tt}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\ttfamily}} +\DeclareOption{md}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\mdseries}} +\DeclareOption{bf}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\bfseries}} +\DeclareOption{up}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\upshape}} +\DeclareOption{it}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\itshape}} +\DeclareOption{sl}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\slshape}} +\DeclareOption{sc}{% + \protected@xdef\ttl@fonts{\ttl@fonts\protect\scshape}} + +\DeclareOption{big}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi}} +\DeclareOption{medium}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\huge\or\Large\or\large + \or\normalsize\or\or\or\LARGE\fi}} +\DeclareOption{small}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\LARGE\or\large + \or\normalsize\or\normalsize\or\or\or\Large\fi}} +\DeclareOption{tiny}{% + \gdef\ttl@sizes#1{\ifcase#1\relax\large\or\normalsize\or + \normalsize\or\normalsize\or\or\or\normalsize\fi}} + +\DeclareOption{raggedleft}{% + \gdef\ttl@fil{\filleft}} +\DeclareOption{center}{% + \gdef\ttl@fil{\filcenter}} +\DeclareOption{raggedright}{% + \gdef\ttl@fil{\filright}} + +\DeclareOption{uppercase}{% + \gdef\ttl@case{\MakeUppercase}} + +\DeclareOption{compact}{% + \gdef\ttl@space{1}% + \gdef\ttl@chapafter{30\p@}} + +% Deprecated. To be remmoved in a major upgrade (3.0) +\DeclareOption{indentfirst}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{nonindentfirst}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% New names +\DeclareOption{indentafter}{% + \gdef\@afterindentfalse{\let\if@afterindent\iftrue}% + \@afterindenttrue + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\@ne}}{\ttl@spacing@i{\@ne}}}} +\DeclareOption{noindentafter}{% + \def\titlespacing{% + \@ifstar{\ttl@spacing@i{\z@}}{\ttl@spacing@i{\z@}}}} + +% newlinetospace +\let\ttl@blinemarks\relax +\let\ttl@elinemarks\relax + +\DeclareRobustCommand\ttl@linetosp{% + \@ifstar{\ttl@linetosp@i}{\ttl@linetosp@i}}% + +\def\ttl@linetosp@i{% + \ifdim\lastskip>\z@\else\space\fi + \ignorespaces} + +\DeclareOption{newlinetospace}{% + \def\ttl@blinemarks{% + \let\ttl@e\\% + \def\\{\ttl@linetosp}}% + \def\ttl@elinemarks{\let\\\ttl@e}}% + +% toctitles +\def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi#2}% + \nobreak} + +\DeclareOption{toctitles}{% + \def\ttl@addcontentsline#1#2{% + \addcontentsline{toc}{#1}{\ifttl@toclabel\ttl@a\fi\ttl@savetitle}% + \nobreak}} + +% pageatnewline + +\def\ttl@changecentercr{% + \let\ttl@centercr\@centercr + \def\@centercr{\@ifstar{\ttl@centercr*}{\ttl@centercr*}}} + +\DeclareOption{pageatnewline}{\let\ttl@changecentercr\relax} + +\def\ttl@fonts{} + +\ExecuteOptions{rubberchapters,bottomtitles,aftersep,oldparttoc,% + innermarks} + +\ProcessOptions + +% +-----------------+ +% | H Y P E R R E F | +% +-----------------+ +% +% These two commands are provided by hyperref. But if they +% are not defined at \begin{document} hyperref has not been +% loaded or it is an old version. + +\AtBeginDocument{% + \ifx\ttl@Hy@steplink\@undefined + \let\ttl@Hy@steplink\@gobble + \let\ttl@Hy@refstepcounter\refstepcounter + \fi} + +% +-----------------+ +% | PAGE STYLES | +% +-----------------+ +% +% This is generic: + +\newcommand\assignpagestyle[2]{% + \@namedef{ttl@ps@\expandafter\@gobble\string#1}{#2}} + +% Old pagestyles +% ~~~~~~~~~~~~~~ + +\providecommand\newpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \newpagestyle} + +\providecommand\renewpagestyle{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \renewpagestyle} + +\providecommand\widenhead{% + \let\ttl@compatps\@empty % marks the ``old interface'' + \makeatletter + \edef\ttl@d{% + \noexpand\input{ttlps.def}% + \catcode`\noexpand\@=\the\catcode`\@}% + \ttl@d + \widenhead} + +% New pagestyles +% ~~~~~~~~~~~~~~ + +\@ifundefined{sectiontitle}{}{\input{ttlps.def}} + +% +-----------------+ +% | C O M P A T | +% +-----------------+ +% Easy setup, i.e., that of package options, is +% taken care of, if necessary. + +\renewcommand\secdef[2]{% + \@ifstar + {\ttl@labelfalse + #2} + {\ttl@labeltrue + \ifx#1\@chapter + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \else\ifx#1\@part + \ifnum\ttll@part>\c@secnumdepth\ttl@labelfalse\fi + \fi\fi + \let\ifttl@toclabel\ifttl@label + \@dblarg{#1}}} + +\@ifundefined{ttl@extract}{}{\endinput} + +\newcommand\titlelabel[1]{% + \def\@seccntformat##1{#1}} + +\expandafter\ifx\csname chapter\endcsname\relax + + \def\ttl@compatpart{\titleclass{\part}{part}\relax} + +\else + + \def\ttl@compatchapter{% + \def\@makechapterhead{% + \ttl@labeltrue + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}% + \def\@makeschapterhead{% + \ttl@labelfalse + \if@mainmatter\else\ttl@labelfalse\fi + \ifnum\ttll@chapter>\c@secnumdepth\ttl@labelfalse\fi + \ttl@startargs\ttl@mkchap{chapter}}} + + \def\ttl@compatpart{\titleclass{\part}{page}\relax} + +\fi + +\def\ttl@@extract#1\@startsection#2#3#4#5#6#7#8{% + \@tempskipa=#5 + \@tempskipb=#6 + \ifdim\@tempskipa<\z@ + \toks@{\titlespacing*#8{#4}}% + \@tempskipa-\@tempskipa + \else + \toks@{\titlespacing#8{#4}}% + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipa*\ttl@space\relax\beforetitleunit}% + \ifdim\@tempskipb<\z@ + \if@tempswa + \titleformat#8[runin]% + {\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8[runin]% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@tempskipb-\@tempskipb + \else + \if@tempswa + \titleformat#8% + {\ttl@fil\ttl@fonts\ttl@sizes{#3}}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \else + \titleformat#8% + {#7}{\@seccntformat{#2}}% + {\z@}\ttl@passexplicit + \fi + \@ifundefined{ttl@space}{}{% + \ttl@assign\@tempskipb*\ttl@space\relax\aftertitleunit}% + \fi + \edef\ttl@a{\the\toks@{\the\@tempskipa}{\the\@tempskipb}} + \ttl@a} + +\def\ttl@extract#1{% + \expandafter\in@\expandafter\@startsection\expandafter{#1}% + \ifin@ + \expandafter\ttl@@extract#1#1% + \else + \PackageWarningNoLine{titlesec}% + {Non standard sectioning command detected\MessageBreak + Using default spacing and no format} + \titlespacing*#1{\z@}{*3}{*2}% + \fi} + +\@tempswafalse + +\ifx\ttl@fonts\@empty + \def\ttl@fonts{\bfseries} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@sizes\endcsname\relax + \gdef\ttl@sizes#1{\ifcase#1\relax\Huge\or\Large\or\large + \or\normalsize\or\or\or\huge\fi} +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@fil\endcsname\relax + \let\ttl@fil\@empty +\else + \@tempswatrue +\fi + +\expandafter\ifx\csname ttl@case\endcsname\relax + \let\ttl@case\@firstofone +\else + \@tempswatrue +\fi + +\if@tempswa + + \expandafter\ifx\csname chapter\endcsname\relax\else + \titleformat\chapter[display]% + {\@ifundefined{ttl@fil}{\raggedright}{\ttl@fil}\ttl@fonts\ttl@sizes6} + {\@chapapp\space\thechapter}{.8\baselineskip}{\ttl@sizes\z@\ttl@passexplicit} + \fi + +\fi + +\ttl@extract\section +\ttl@extract\subsection +\ttl@extract\subsubsection +\ttl@extract\paragraph +\ttl@extract\subparagraph + +\let\ttl@extract\@undefined +\let\ttl@@extract\@undefined + +\def\ttl@toplevel{part} + +\expandafter\ifx\csname chapter\endcsname\relax + + \@namedef{ttll@part}{0} + \titleclass{\section}{straight}[\part] + + \titlespacing*{\part} + {\z@} + {4ex} + {3ex} + +\else + + \let\ttl@save@mkchap\@makechapterhead + \let\ttl@save@mkschap\@makeschapterhead + + \def\@makechapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkchap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \def\@makeschapterhead#1{% + \gdef\ttl@savemark{\chaptermark{#1}}% + \ttl@save@mkschap{#1}% + \@ifundefined{ttl@ps@chapter}{}% + {\thispagestyle{\@nameuse{ttl@ps@chapter}}}} + + \@namedef{ttll@part}{-1} + \@namedef{ttlss@part}{chapter} + \@namedef{ttll@chapter}{0} + \titleclass{\section}{straight}[\chapter] + +% The following is unoperant, unless when \chapter / \part +% format is redefined + + \titlespacing*{\part} + {\z@} + {\z@\@plus1fil} + {\z@\@plus1fil} + + \titlespacing*\chapter + {\z@}% + {50\p@}% + {\ttl@chapafter}% + +\fi + +\titleclass{\subsection} {straight}[\section] +\titleclass{\subsubsection}{straight}[\subsection] +\titleclass{\paragraph} {straight}[\subsubsection] +\titleclass{\subparagraph} {straight}[\paragraph] + +\endinput diff --git a/Documentation/texmf-local/web2c/texmf.cnf b/docs/texmf-local/web2c/texmf.cnf similarity index 100% rename from Documentation/texmf-local/web2c/texmf.cnf rename to docs/texmf-local/web2c/texmf.cnf