summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-03-15 03:01:24 +0000
committerNorbert Preining <norbert@preining.info>2021-03-15 03:01:24 +0000
commit36607734949d1736c36ed7b9f3a12a74d7a8ce86 (patch)
tree16f4b95c6487768dc8c9ab93a82bbcfe6e7f35df /macros
parent954d393d844eacce4354b6174613f467bcd7a257 (diff)
CTAN sync 202103150301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/doclicense/Makefile52
-rw-r--r--macros/latex/contrib/doclicense/README56
-rw-r--r--macros/latex/contrib/doclicense/README.md78
-rw-r--r--macros/latex/contrib/doclicense/doclicense-UKenglish.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-USenglish.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-acadian.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-american.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-australian.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-brazilian.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-british.ldf8
-rw-r--r--macros/latex/contrib/doclicense/doclicense-bulgarian.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-canadian.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-canadien.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-catalan.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-chinese-gbk.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-chinese-utf8.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-english.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-french.ldf10
-rw-r--r--macros/latex/contrib/doclicense/doclicense-galician.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-german.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-italian.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-japanese.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-marathi.ldf10
-rw-r--r--macros/latex/contrib/doclicense/doclicense-newzealand.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-ngerman.ldf7
-rw-r--r--macros/latex/contrib/doclicense/doclicense-polish.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-portuguese.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-russian.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense-spanish.ldf9
-rw-r--r--macros/latex/contrib/doclicense/doclicense.dtx185
-rw-r--r--macros/latex/contrib/doclicense/doclicense.ins8
-rw-r--r--macros/latex/contrib/doclicense/doclicense.pdfbin254137 -> 262200 bytes
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-3.0-latex.html421
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-4.0-latex.html397
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.html440
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.html398
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.html406
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.html397
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.html472
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.html409
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.html388
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.html395
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.html472
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.html407
-rw-r--r--macros/latex/contrib/doclicense/license-texts/doclicense-CC-zero-1.0-latex.html200
-rw-r--r--macros/latex/contrib/doclicense/manifest.txt143
-rw-r--r--macros/latex/contrib/easybook/doc/easybook-demo.pdfbin287472 -> 287471 bytes
-rw-r--r--macros/latex/contrib/easybook/doc/easybook-demo.tex2
-rw-r--r--macros/latex/contrib/easybook/doc/easybook.pdfbin237329 -> 245151 bytes
-rw-r--r--macros/latex/contrib/easybook/doc/easybook.tex74
-rw-r--r--macros/latex/contrib/easybook/easybook.cls31
-rw-r--r--macros/latex/contrib/hitreport/LICENSE416
-rw-r--r--macros/latex/contrib/hitreport/Makefile63
-rw-r--r--macros/latex/contrib/hitreport/README.md150
-rw-r--r--macros/latex/contrib/hitreport/data/abstract.tex22
-rw-r--r--macros/latex/contrib/hitreport/data/appendix.tex48
-rw-r--r--macros/latex/contrib/hitreport/data/chap01.tex78
-rw-r--r--macros/latex/contrib/hitreport/data/chap02.tex153
-rw-r--r--macros/latex/contrib/hitreport/data/chap03.tex71
-rw-r--r--macros/latex/contrib/hitreport/figures/example-image-a.pdfbin0 -> 12160 bytes
-rw-r--r--macros/latex/contrib/hitreport/figures/example-image-b.pdfbin0 -> 17201 bytes
-rw-r--r--macros/latex/contrib/hitreport/figures/scan-copyright.pdfbin0 -> 35716 bytes
-rw-r--r--macros/latex/contrib/hitreport/figures/scan-record.pdfbin0 -> 108783 bytes
-rw-r--r--macros/latex/contrib/hitreport/figures/scan-statement.pdfbin0 -> 31558 bytes
-rw-r--r--macros/latex/contrib/hitreport/hitreport-example.pdfbin0 -> 416027 bytes
-rw-r--r--macros/latex/contrib/hitreport/hitreport-example.tex42
-rw-r--r--macros/latex/contrib/hitreport/hitreport.dtx3191
-rw-r--r--macros/latex/contrib/hitreport/hitreport.ins54
-rw-r--r--macros/latex/contrib/hitreport/hitreport.pdfbin0 -> 485273 bytes
-rw-r--r--macros/latex/contrib/hitreport/hitsetup.tex109
-rw-r--r--macros/latex/contrib/hitreport/latexmkrc18
-rw-r--r--macros/latex/contrib/hitreport/photo/hithrb.pdfbin0 -> 156229 bytes
-rw-r--r--macros/latex/contrib/hitreport/photo/hitsz.pdfbin0 -> 136064 bytes
-rw-r--r--macros/latex/contrib/hitreport/photo/hitwh.pdfbin0 -> 200504 bytes
-rw-r--r--macros/latex/contrib/hitreport/ref/appendix.bib14
-rw-r--r--macros/latex/contrib/hitreport/ref/refs.bib331
-rw-r--r--macros/latex/contrib/parskip/changes.txt6
-rw-r--r--macros/latex/contrib/parskip/parskip-code.pdfbin225639 -> 225887 bytes
-rw-r--r--macros/latex/contrib/parskip/parskip.dtx10
-rw-r--r--macros/latex/contrib/parskip/parskip.pdfbin174611 -> 174843 bytes
-rw-r--r--macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdfbin1702509 -> 2573778 bytes
-rw-r--r--macros/latex/contrib/profcollege/latex/PfC-EquationComposition2.tex (renamed from macros/latex/contrib/profcollege/latex/PfC-EquationComposition1.tex)184
-rw-r--r--macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction2.tex (renamed from macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction1.tex)53
-rw-r--r--macros/latex/contrib/profcollege/latex/ProfCollege.sty5782
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfC-Afficheur.mp182
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfC-Calculatrice.mp11
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfC-Constantes.mp3
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfC-LaTeX.mp7
-rw-r--r--macros/latex/contrib/profcollege/metapost/PfC-Svgnames.mp3
-rw-r--r--macros/luatex/latex/unitipa/README.txt3
-rw-r--r--macros/luatex/latex/unitipa/unitipa.dtx256
-rw-r--r--macros/luatex/latex/unitipa/unitipa.pdfbin178561 -> 191050 bytes
92 files changed, 14955 insertions, 2351 deletions
diff --git a/macros/latex/contrib/doclicense/Makefile b/macros/latex/contrib/doclicense/Makefile
new file mode 100644
index 0000000000..62eb5c63ca
--- /dev/null
+++ b/macros/latex/contrib/doclicense/Makefile
@@ -0,0 +1,52 @@
+# SPDX-FileCopyrightText: 2015,2020-2021 Robin Schneider <ypid@riseup.net>
+#
+# SPDX-License-Identifier: LPPL-1.3c
+#
+# This work consists of all files listed in manifest.txt.
+# For more details about the licensing, refer to the README.md file.
+
+TEXMFHOME ?= $(shell kpsewhich -var-value TEXMFHOME)
+
+all: install build manifest.txt
+
+build: check-quick doclicense.sty doclicense.pdf
+
+install:
+ mkdir --parents "$(TEXMFHOME)/tex/latex/"
+ test -L "$(TEXMFHOME)/tex/latex/doclicense" || ln --no-target-directory --symbolic "$$PWD" "$(TEXMFHOME)/tex/latex/doclicense"
+
+check-quick: doclicense.dtx
+ chktex "$<"
+
+check: run_tests doclicense.sty lint
+ ./"$<"
+
+lint:
+ find -regextype posix-egrep -iregex '.*\.(tex|ldf)' -and -not -iname '*-plaintext.tex' -print0 | xargs --null chktex
+ reuse lint
+
+clean:
+ rm -rf *.sty *.pdf *.aux *.out *.glo *.gls *.hd *.idx *.ilg *.ind *.log *.toc
+
+doclicense.sty:
+doclicense.pdf:
+
+%.sty: %.ins %.dtx
+ tex "$<"
+
+%.pdf: %.dtx doclicense.sty
+ lualatex "$<"
+ makeindex -s gglo.ist -o doclicense.gls doclicense.glo
+ makeindex -s gind doclicense
+ lualatex "$<"
+ # thumbpdf doclicense
+ # lualatex "$<"
+
+# The `cd .. && git archive` trick was needed with 2.29.2 so that evaluation of
+# the `.gitattributes` file worked correctly.
+manifest.txt: manifest_header.txt Makefile
+ cat "$<" > "$@"
+ echo "% This work consists of the files:" >> "$@"
+ cd .. && git archive --worktree-attributes HEAD doclicense | tar -t -f - | grep -v '/$$' | sort >> "$(PWD)/$@"
+ echo "% and the derived files:" >> "$@"
+ echo doclicense.sty doclicense.pdf | tr ' ' '\n' >> "$@"
diff --git a/macros/latex/contrib/doclicense/README b/macros/latex/contrib/doclicense/README
deleted file mode 100644
index cac1ca77eb..0000000000
--- a/macros/latex/contrib/doclicense/README
+++ /dev/null
@@ -1,56 +0,0 @@
-LaTeX package 'doclicense'
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-Copyright (C) 2015-2020 by Robin Schneider <ypid@riseup.net>
-
-This work 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 2005/12/01 or later.
-
-CTAN: https://www.ctan.org/pkg/doclicense
-Code repository: https://github.com/ypid/latex-packages/tree/master/doclicense
-
-Question on Stackexchange: https://tex.stackexchange.com/a/226788/32320
-
-
- DESCRIPTION
-Support for putting documents under a license.
-
-The doclicense package allows you to put your document under a license and include a link
-to read about the license or include an icon or image of the license.
-Currently, only Creative Commons is supported but this package is designed to
-handle all kinds of licenses.
-
- GENERATING THE FILES
-You can generate the doclicense.sty file with: tex doclicense.ins
-
-The documentation can be generated with:
-
- pdflatex doclicense.dtx
- makeindex -s gglo.ist -o doclicense.gls doclicense.glo
- makeindex -s gind doclicense
- pdflatex doclicense.dtx
- thumbpdf doclicense
- pdflatex doclicense.dtx
-
-Note that this will only work when this directory is below your
-$TEXMFHOME tree (unless the doclicense package is already installed
-for example by your TeX distribution). Example for doing this manually:
-
- mkdir --parents ~/texmf/tex/latex/ && cd ~/texmf/tex/latex/
- git clone https://github.com/ypid/latex-packages.git ypid-latex-packages
- cd ypid-latex-packages/doclicense && make build
- ## Or
- make all
-
-If you have not worked with $TEXMFHOME you might want to refer to the
-documentation of your TeX distribution for details. See also the next section.
-
- IMPORTANT NOTES REGARDING TDS
-
-Please note that the images/ and the license-texts/ subdirectories must end up in the runtime tex/
-subtree (that is tex/latex/doclicense/) for the \doclicenseImage macro and the \doclicense*FullText macros to work
-correctly.
diff --git a/macros/latex/contrib/doclicense/README.md b/macros/latex/contrib/doclicense/README.md
new file mode 100644
index 0000000000..2a0fd5ed8a
--- /dev/null
+++ b/macros/latex/contrib/doclicense/README.md
@@ -0,0 +1,78 @@
+<!--
+SPDX-FileCopyrightText: 2015,2021 Robin Schneider <ypid@riseup.net>
+
+SPDX-License-Identifier: LPPL-1.3c
+
+This work consists of all files listed in manifest.txt.
+For more details about the licensing, refer "License" section of this file.
+-->
+
+# LaTeX package 'doclicense'
+
+[![CTAN](https://img.shields.io/ctan/v/doclicense.svg)](https://ctan.org/pkg/doclicense)
+
+CTAN: https://www.ctan.org/pkg/doclicense
+
+Code repository: https://github.com/ypid/latex-packages/tree/master/doclicense
+
+Question on Stackexchange: https://tex.stackexchange.com/a/226788/32320
+
+## Description
+
+Support for putting documents under a license.
+
+The doclicense package allows you to put your document under a license and include a link
+to read about the license or include an icon or image of the license.
+Currently, only Creative Commons is supported but this package is designed to
+handle all kinds of licenses.
+
+## Generating the files
+
+You can generate the `doclicense.sty` file with:
+
+```Shell
+tex doclicense.ins
+```
+
+The documentation can be generated with:
+
+```Shell
+make doclicense.pdf
+```
+
+Note that this will only work when this directory is below your
+`$TEXMFHOME` tree (unless the doclicense package is already installed
+for example by your TeX distribution). Example for doing this manually:
+
+```Shell
+mkdir --parents ~/texmf/tex/latex/ && cd ~/texmf/tex/latex/
+git clone https://github.com/ypid/latex-packages.git ypid-latex-packages
+cd ypid-latex-packages/doclicense && make build
+```
+
+If you have not worked with `$TEXMFHOME` you might want to refer to the
+documentation of your TeX distribution for details. See also the next section.
+
+## Important notes regarding TDS
+
+Please note that the `images/` and the `license-texts/` subdirectories must end up
+in the runtime `tex/` subtree (that is `tex/latex/doclicense/`) for the
+`\doclicenseImage` macro and the `\doclicense*FullText` macros to work correctly.
+
+## License
+
+SPDX-License-Identifier: LPPL-1.3c
+
+This work 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
+ https://www.latex-project.org/lppl.txt
+and version 1.3 or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+This work has the LPPL maintenance status `maintained'.
+
+The Current Maintainer of this work is Robin Schneider.
+
+This work consists of all files listed in manifest.txt.
diff --git a/macros/latex/contrib/doclicense/doclicense-UKenglish.ldf b/macros/latex/contrib/doclicense/doclicense-UKenglish.ldf
index 19daf65d5b..5c95f38d6b 100644
--- a/macros/latex/contrib/doclicense/doclicense-UKenglish.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-UKenglish.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-UKenglish.ldf}
\input{doclicense-british.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-USenglish.ldf b/macros/latex/contrib/doclicense/doclicense-USenglish.ldf
index 3c6a45f461..abcdb987ea 100644
--- a/macros/latex/contrib/doclicense/doclicense-USenglish.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-USenglish.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-USenglish.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-acadian.ldf b/macros/latex/contrib/doclicense/doclicense-acadian.ldf
index 7301dfa4ac..c7ffb022c0 100644
--- a/macros/latex/contrib/doclicense/doclicense-acadian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-acadian.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Eric Guirbal <eric.guirbal@gmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-acadian.ldf}
\input{doclicense-french.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-american.ldf b/macros/latex/contrib/doclicense/doclicense-american.ldf
index 6cdb358fbb..d23f24217c 100644
--- a/macros/latex/contrib/doclicense/doclicense-american.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-american.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-american.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-australian.ldf b/macros/latex/contrib/doclicense/doclicense-australian.ldf
index c40d1caae9..5b69834c3c 100644
--- a/macros/latex/contrib/doclicense/doclicense-australian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-australian.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-australian.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-brazilian.ldf b/macros/latex/contrib/doclicense/doclicense-brazilian.ldf
index 4b1251246d..4201316075 100644
--- a/macros/latex/contrib/doclicense/doclicense-brazilian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-brazilian.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2019 Iago <el.iagows@gmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-brazilian.ldf}
\@namedef{doclicense@lang@thisDoc}{Essa obra tem a licença}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{pt}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense-british.ldf b/macros/latex/contrib/doclicense/doclicense-british.ldf
index 0676b7d3f2..79bbcf86fe 100644
--- a/macros/latex/contrib/doclicense/doclicense-british.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-british.ldf
@@ -1,3 +1,11 @@
+% SPDX-FileCopyrightText: 2015 by Robin Schneider <ypid@riseup.net>
+% SPDX-FileCopyrightText: 2016 Alex Ball <a.j.ball@bath.ac.uk>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-british.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-bulgarian.ldf b/macros/latex/contrib/doclicense/doclicense-bulgarian.ldf
index 96f5be7abc..bf111f4b02 100644
--- a/macros/latex/contrib/doclicense/doclicense-bulgarian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-bulgarian.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2020 Hristo Hristov <hristo.dr.hristov@gmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-bulgarian.ldf}
\@namedef{doclicense@lang@thisDoc}{Това произведение е лицензирано под}%
@@ -5,7 +12,7 @@
\@namedef{doclicense@lang@word@license}{ лиценз}%
\@namedef{doclicense@lang@lic@CC@code}{bg}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Универсален}%
diff --git a/macros/latex/contrib/doclicense/doclicense-canadian.ldf b/macros/latex/contrib/doclicense/doclicense-canadian.ldf
index 855aa5718e..3e67333a04 100644
--- a/macros/latex/contrib/doclicense/doclicense-canadian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-canadian.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-canadian.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-canadien.ldf b/macros/latex/contrib/doclicense/doclicense-canadien.ldf
index fc5484c8d8..f86161f43b 100644
--- a/macros/latex/contrib/doclicense/doclicense-canadien.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-canadien.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Eric Guirbal <eric.guirbal@gmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-canadien.ldf}
\input{doclicense-french.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-catalan.ldf b/macros/latex/contrib/doclicense/doclicense-catalan.ldf
index 5bcb168319..7d7ee780cb 100644
--- a/macros/latex/contrib/doclicense/doclicense-catalan.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-catalan.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2018 Ernesto Lanchares <e.lancha98@gmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-catalan.ldf}
\@namedef{doclicense@lang@thisDoc}{Aquesta obra està subjecta a una llicència de}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{ca}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense-chinese-gbk.ldf b/macros/latex/contrib/doclicense/doclicense-chinese-gbk.ldf
index 0b197eb7c1..e042127cf5 100644
--- a/macros/latex/contrib/doclicense/doclicense-chinese-gbk.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-chinese-gbk.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2019 sd44 <sd44sd44@yeah.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-chinese.ldf}
\@namedef{doclicense@lang@thisDoc}{Ʒ}%
\@namedef{doclicense@lang@word@license}{Э}%
\@namedef{doclicense@lang@lic@CC@code}{zh}%
-%% Using:https://en.wikipedia.org/wiki/ISO_639-1
+% Using:https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 ͨ}%
diff --git a/macros/latex/contrib/doclicense/doclicense-chinese-utf8.ldf b/macros/latex/contrib/doclicense/doclicense-chinese-utf8.ldf
index 4770ae9938..e61621a98d 100644
--- a/macros/latex/contrib/doclicense/doclicense-chinese-utf8.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-chinese-utf8.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2019 sd44 <sd44sd44@yeah.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-chinese.ldf}
\@namedef{doclicense@lang@thisDoc}{本作品采用}%
\@namedef{doclicense@lang@word@license}{许可协议进行许可}%
\@namedef{doclicense@lang@lic@CC@code}{zh}%
-%% Using:https://en.wikipedia.org/wiki/ISO_639-1
+% Using:https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 通用}%
diff --git a/macros/latex/contrib/doclicense/doclicense-english.ldf b/macros/latex/contrib/doclicense/doclicense-english.ldf
index 525345d362..a8e97cd4ea 100644
--- a/macros/latex/contrib/doclicense/doclicense-english.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-english.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-english.ldf}
\@namedef{doclicense@lang@thisDoc}{This work is licensed under a}%
\@namedef{doclicense@lang@word@license}{ license}%
\@namedef{doclicense@lang@lic@CC@code}{en}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense-french.ldf b/macros/latex/contrib/doclicense/doclicense-french.ldf
index fbf2be022a..9411fe3fb0 100644
--- a/macros/latex/contrib/doclicense/doclicense-french.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-french.ldf
@@ -1,3 +1,11 @@
+% SPDX-FileCopyrightText: 2015 Eric Guirbal <eric.guirbal@gmail.com>
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-french.ldf}
\ifthenelse{\equal{\doclicense@imagemodifier}{-88x31}}{% chktex 29
@@ -8,7 +16,7 @@
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{fr}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universel}%
diff --git a/macros/latex/contrib/doclicense/doclicense-galician.ldf b/macros/latex/contrib/doclicense/doclicense-galician.ldf
index 257e607568..9e5bb62b6c 100644
--- a/macros/latex/contrib/doclicense/doclicense-galician.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-galician.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2019 Entity who prefers to remain anonymous
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-galician.ldf}
\@namedef{doclicense@lang@thisDoc}{Esta obra está baixo unha licenza}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{gl}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense-german.ldf b/macros/latex/contrib/doclicense/doclicense-german.ldf
index 802e89225b..8fb47a05b2 100644
--- a/macros/latex/contrib/doclicense/doclicense-german.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-german.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015,2020 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-german.ldf}
\@namedef{doclicense@lang@thisDoc}{Dieses Werk ist lizenziert unter einer}%
@@ -7,7 +14,7 @@
}{}
\@namedef{doclicense@lang@lic@CC@code}{de}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universell}%
diff --git a/macros/latex/contrib/doclicense/doclicense-italian.ldf b/macros/latex/contrib/doclicense/doclicense-italian.ldf
index e3a4454cf2..87c78f38a5 100644
--- a/macros/latex/contrib/doclicense/doclicense-italian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-italian.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2017 Filippo Rigotto <rigottofilippo@altervista.org>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-italian.ldf}
\@namedef{doclicense@lang@thisDoc}{Quest'opera è distribuita con licenza}%
@@ -7,7 +14,7 @@
}{}
\@namedef{doclicense@lang@lic@CC@code}{it}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universale}%
diff --git a/macros/latex/contrib/doclicense/doclicense-japanese.ldf b/macros/latex/contrib/doclicense/doclicense-japanese.ldf
index 8b9f778db9..4d6c05bf54 100644
--- a/macros/latex/contrib/doclicense/doclicense-japanese.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-japanese.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2020 B̅
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-japanese.ldf}
\@namedef{doclicense@lang@thisDoc}{本作品が採用しているのは}%
diff --git a/macros/latex/contrib/doclicense/doclicense-marathi.ldf b/macros/latex/contrib/doclicense/doclicense-marathi.ldf
index e39b7ef8ca..af7b1924f3 100644
--- a/macros/latex/contrib/doclicense/doclicense-marathi.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-marathi.ldf
@@ -1,3 +1,11 @@
+% SPDX-FileCopyrightText: 2020 Niranjan <niranjanvikastambe@gmail.com>
+% SPDX-FileCopyrightText: 2020 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-marathi.ldf}
\@namedef{doclicense@lang@thisDoc}{हे काम}%
@@ -9,7 +17,7 @@
\@namedef{doclicense@lang@lic@CC}{क्रिएटिव्ह कॉमन्सच्या}%
\@namedef{doclicense@lang@lic@CC@code}{mr}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@code}{mr}%
% Reference: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes
diff --git a/macros/latex/contrib/doclicense/doclicense-newzealand.ldf b/macros/latex/contrib/doclicense/doclicense-newzealand.ldf
index 9775602edc..22ab0c1ec9 100644
--- a/macros/latex/contrib/doclicense/doclicense-newzealand.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-newzealand.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-newzealand.ldf}
\input{doclicense-english.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-ngerman.ldf b/macros/latex/contrib/doclicense/doclicense-ngerman.ldf
index 5f4247c1db..042e59b817 100644
--- a/macros/latex/contrib/doclicense/doclicense-ngerman.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-ngerman.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-ngerman.ldf}
\input{doclicense-german.ldf}
diff --git a/macros/latex/contrib/doclicense/doclicense-polish.ldf b/macros/latex/contrib/doclicense/doclicense-polish.ldf
index 484a7123ad..76e7af9305 100644
--- a/macros/latex/contrib/doclicense/doclicense-polish.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-polish.ldf
@@ -1,3 +1,10 @@
+% SPDX-FileCopyrightText: 2018 Janusz S. Bień jsbien@mimuw.edu.pl
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-polish.ldf}
\@namedef{doclicense@lang@thisDoc}{Na ten utwór udzielona jest licencja}%
@@ -6,7 +13,7 @@
% In Polish the word "licencja" should precede the license name
\@namedef{doclicense@lang@lic@CC@code}{pl}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{Przekazanie do Domeny Publicznej (CC0 1.0)}%
% https://creativecommons.org/publicdomain/zero/1.0/deed.pl
diff --git a/macros/latex/contrib/doclicense/doclicense-portuguese.ldf b/macros/latex/contrib/doclicense/doclicense-portuguese.ldf
index 416253e0b3..d1029d5245 100644
--- a/macros/latex/contrib/doclicense/doclicense-portuguese.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-portuguese.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2018 Daniel Santos <danisantos@protonmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-portuguese.ldf}
\@namedef{doclicense@lang@thisDoc}{Esta obra tem a licença}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{pt}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense-russian.ldf b/macros/latex/contrib/doclicense/doclicense-russian.ldf
index 09f66ea778..167af54814 100644
--- a/macros/latex/contrib/doclicense/doclicense-russian.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-russian.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2017 Anton Karmanov <bergertroll@openmailbox.org>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-russian.ldf}
\@namedef{doclicense@lang@thisDoc}{Это произведение доступно по лицензии}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{ru}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Универсальная}%
diff --git a/macros/latex/contrib/doclicense/doclicense-spanish.ldf b/macros/latex/contrib/doclicense/doclicense-spanish.ldf
index 9be63aaa4f..726defd672 100644
--- a/macros/latex/contrib/doclicense/doclicense-spanish.ldf
+++ b/macros/latex/contrib/doclicense/doclicense-spanish.ldf
@@ -1,10 +1,17 @@
+% SPDX-FileCopyrightText: 2015 Carlos <pepitogrillo148@hotmail.com>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\ProvidesFile{doclicense-spanish.ldf}
\@namedef{doclicense@lang@thisDoc}{Esta obra está bajo una licencia}%
\@namedef{doclicense@lang@word@license}{}%
\@namedef{doclicense@lang@lic@CC@code}{es}%
-%% Using: https://en.wikipedia.org/wiki/ISO_639-1
+% Using: https://en.wikipedia.org/wiki/ISO_639-1
\@namedef{doclicense@lang@lic@CC@zero@1.0}{CC0 1.0 Universal}%
diff --git a/macros/latex/contrib/doclicense/doclicense.dtx b/macros/latex/contrib/doclicense/doclicense.dtx
index 75e34f64a8..5932dabaa4 100644
--- a/macros/latex/contrib/doclicense/doclicense.dtx
+++ b/macros/latex/contrib/doclicense/doclicense.dtx
@@ -1,21 +1,11 @@
% \iffalse meta-comment
%
-% Copyright (C) 2015-2020 by Robin Schneider <ypid@riseup.net>
+% SPDX-FileCopyrightText: 2015-2021 Robin Schneider <ypid@riseup.net>
%
-% This work 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 2005/12/01 or later.
+% SPDX-License-Identifier: LPPL-1.3c
%
-% This work has the LPPL maintenance status `maintained'.
-%
-% The Current Maintainer of this work is Robin Schneider.
-%
-% This work consists of the files doclicense.dtx and doclicense.ins
-% and the derived files doclicense.sty and doclicense.pdf.
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
%
% \fi
%
@@ -23,11 +13,18 @@
%<*driver>
\ProvidesFile{doclicense.dtx}
%</driver>
-%<package>%% See file 'doclicense.dtx' for copyright and license.
+%<package>% SPDX-FileCopyrightText: 2015-2021 Robin Schneider <ypid@riseup.net>
+%<package>%
+%<package>% SPDX-License-Identifier: LPPL-1.3c
+%<package>%
+%<package>% This work consists of all files listed in manifest.txt.
+%<package>% For more details about the licensing, refer to the README.md file.
+%<package>% If you don't have those files, you can find them at: https://ctan.org/pkg/doclicense
+%<package>
%<package>\NeedsTeXFormat{LaTeX2e}[1998/12/01]
%<package>\ProvidesPackage{doclicense}
%<*package>
- [2020/09/25 v2.2.1 Support for putting documents under a license]
+ [2021/03/13 v2.3.0 Support for putting documents under a license]
%</package>
%
%<*driver>
@@ -39,8 +36,8 @@
\newcommand{\PackageAuthorEmail}{ypid@riseup.net}
\newcommand{\PackageName}{\PrintPackage{doclicense}}
\newcommand{\PrintPackage}[1]{\textsf{#1}}
-\newcommand{\PrintOptionF}[1]{\emph{#1}} %% ^^A This macro is used for
-%% ^^A explaining any parameter when they first come up in the manual.
+\newcommand{\PrintOptionF}[1]{\emph{#1}} % ^^A This macro is used for
+% ^^A explaining any parameter when they first come up in the manual.
\newcommand{\DescribePara}[1]{\marginpar{\raggedleft\strut\MacroFont\string#1}}
\usepackage[
hyphens,
@@ -56,7 +53,7 @@
eqlist,
}
\usepackage[iso]{isodate}
-%% ^^A https://tex.stackexchange.com/a/95893/32320
+% ^^A https://tex.stackexchange.com/a/95893/32320
\setlength\IndexMin{100pt}
\usepackage[
type={CC},
@@ -138,11 +135,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \changes{2.1.0}{2020/07/26}{Fix regression: Proper language default image variants (Euro variants for example) was broken and the US variant was always used. This bug was introduced in v2.0.0. Documentation fixes. Added Marathi translation.}
% \changes{2.2.0}{2020/09/18}{Add Japanese and Bulgarian translation. Add hint how to use Chinese to docs. Load hyperxmp by default when it is installed. Before, doclicense just suggested to load it and made use of the package when the user did.}
% \changes{2.2.1}{2020/09/25}{Fix compatibility issue with newer versions of hyperxmp (bug confirmed with Tex Live 2020) resulting in an compile error by loading hyperxmp and hyperref in the order the packages expect it.}
+% \changes{2.3.0}{2021/03/13}{Add option to disable the use of hyperxmp and add compatibility for pdfx. Use \url{https://reuse.software/} for the doclicense source code itself.}
%
%
%
-%% ^^A nag warned about the center environment and it really messes up spacing.
+% ^^A nag warned about the center environment and it really messes up spacing.
%
% \DoNotIndex{\RequirePackage, \DeclareOption, \ProcessOptions}
% \DoNotIndex{\PackageWarning, \MessageBreak}
@@ -193,16 +191,22 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
%
% This will explicitly set the license to \doclicenseNameRef.
%
-% If the \PrintPackage{hyperxmp} package is installed, it will be loaded and the options
-% \PrintOptionF{pdflicenseurl} and \PrintOptionF{pdfcopyright} will be set
-% by \PackageName{} to the corresponding values
-% (\enquote{\url{\doclicenseURL}} and \enquote{\doclicenseLongText{}}).
-% This embeds license metadata into the PDF which proper PDF readers can show.
-% For example Evince shows it in the \enquote{Document License} tab under
-% \enquote{Properties}. You may check this manual for how your PDF reader
-% handles such metadata.
-% If the package is not installed, a warning will be emitted to allow you to
-% install the package as needed.
+% With the default settings and if the \PrintPackage{hyperxmp} package is
+% installed, it will be loaded and the options \PrintOptionF{pdflicenseurl}
+% and \PrintOptionF{pdfcopyright} will be set by \PackageName{} to the
+% corresponding values (\enquote{\url{\doclicenseURL}} and
+% \enquote{\doclicenseLongText{}}). This embeds license metadata into the PDF
+% which proper PDF readers can show. For example Evince shows it in the
+% \enquote{Document License} tab under \enquote{Properties}. You may check
+% this manual for how your PDF reader handles such metadata.
+%
+% In case you are using other package to manipulate the metadata which is
+% incompatible to the use of hyperxmp, e.\,g. \PrintPackage{pdfx} you can use
+% the \PrintOptionF{hyperxmp=false} to disable this automatism. If
+% \PrintPackage{pdfx} is loaded before \PrintPackage{doclicense} or if
+% \PrintPackage{hyperxmp} is not installed this automatism is disabled.
+% In these cases a warning is emitted to inform you about the reasons.
+% The warning will not show up if \PrintOptionF{hyperxmp} is set to false.
%
% \section{Package options}
%
@@ -227,23 +231,23 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
%
% Supported languages:
% ^^A Sorted alphabetically.
-% \begin{eqlist}
-% \item[Brazilian] Added by \href{https://github.com/iagows}{Iago}.
-% \item[Bulgarian] Added by \href{https://github.com/hristo-d-hristov}{hristo-d-hristov}.
-% \item[Catalan] Added by \href{https://github.com/elancha98}{Ernesto Lanchares}.
-% \item[Chinese] Added by \href{https://github.com/sd44}{sd44}. Note that you might need to pass \verb+lang={chinese-utf8}+ or \verb+chinese-gbk+.
-% \item[English] Added by \href{https://me.ypid.de/}{Robin Schneider}.
-% \item[French] Added by \href{https://github.com/ericguirbal}{\'Eric Guirbal}.
-% \item[Galician] Submitted by Email.
-% \item[German] Added by \href{https://me.ypid.de/}{Robin Schneider}.
-% \item[Italian] Added by \href{https://github.com/rig8f}{Filippo Rigotto}.
-% \item[Japanese] Added by \href{https://github.com/cmplstofB}{cmplstofB}.
-% \item[Marathi] Added by \href{https://github.com/NiranjanTambe}{Niranjan}. Note that Niranjan also translated the images which are considered unofficial by the package. Creative Commons has no plans to support additional currencies.
-% \item[Polish] Added by \href{https://github.com/jsbien}{jsbien}.
-% \item[Portuguese] Added by \href{https://github.com/alexandre1985}{Daniel Alexandre Cerqueira Santos}.
-% \item[Russian] Added by \href{https://github.com/bergentroll}{Anton Karmanov}.
-% \item[Spanish] Added by \href{https://github.com/elsudano}{Carlos}. Updated by \href{https://github.com/IgnacioFDM}{IgnacioFDM}.
-% \end{eqlist}
+% \begin{itemize}
+% \item Brazilian
+% \item Bulgarian
+% \item Catalan
+% \item Chinese: Note that you might need to pass \verb+lang={chinese-utf8}+ or \verb+chinese-gbk+.
+% \item English
+% \item French
+% \item Galician
+% \item German
+% \item Italian
+% \item Japanese
+% \item Marathi: Note that Niranjan also translated the images which are considered unofficial by the package. Creative Commons has no plans to support additional currencies.
+% \item Polish
+% \item Portuguese
+% \item Russian
+% \item Spanish
+% \end{itemize}
%
% Image position for \cmd{\doclicenseThis}: right (default) or left.
% \DescribePara{imageposition}
@@ -328,6 +332,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% |]{doclicense}|
% \end{quote}
%
+% This option allows to disable the automatic loading of \PrintPackage{hyperxmp}.
+% \DescribePara{hyperxmp}
+% It's initialized to true. This might also be used to suppress the warning if
+% \PrintPackage{hyperxmp} is not available or \PrintPackage{pdfx} was loaded before
+% \PrintPackage{doclicense}.
+%
% \section{Macros}
% \DescribeMacro{\doclicenseType}
% Expands to the type as set in the package options. Example: \enquote{\doclicenseType{}}
@@ -545,7 +555,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \fi
% \subsection{Declaring the options}
% \begin{macrocode}
-%% Parameters (((
+% Parameters (((
\RequirePackage{kvoptions}
\DeclareStringOption{type}
\DeclareStringOption{modifier}
@@ -556,7 +566,8 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
\DeclareStringOption[10em]{imagewidth}
\DeclareStringOption[2em]{imagedistance}
\DeclareStringOption{hyphenation}
-%% )))
+\DeclareBoolOption[true]{hyperxmp}
+% )))
% \end{macrocode}
% To test if all parameters are valid the macro |\ProcessLocalKeyvalOptions*|
@@ -568,15 +579,15 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% \end{macrocode}
% \subsection{Dependencies}
% \begin{macrocode}
-%% Dependencies (((
+% Dependencies (((
\RequirePackage{xifthen}
\RequirePackage{xstring}
-\RequirePackage{etoolbox} %% \ifcsdef
+\RequirePackage{etoolbox} % \ifcsdef
\RequirePackage{xspace}
\RequirePackage{verbatim}
-%% Custom enumerate list with adjusted labels
-%% that match the license text conventions
+% Custom enumerate list with adjusted labels
+% that match the license text conventions
\newenvironment{doclicense@enumerate}{%
\begin{enumerate}
\renewcommand{\labelenumi}{(\alph{enumi})}%
@@ -597,10 +608,10 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
\AtEndPreamble{%
\@ifpackageloaded{csquotes}{
- %% csquotes has already been loaded so we are fine.
+ % csquotes has already been loaded so we are fine.
}{
\ifcsdef{enquote}{
- %% \enquote is defined but not by csquotes.
+ % \enquote is defined but not by csquotes.
\@ifpackageloaded{biblatex}{
\PackageError{doclicense}{The enquote macro is defined by biblatex}
{This package assumes that the enquote macro is defined by the
@@ -618,32 +629,42 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
}
\@ifpackageloaded{ccicons}{}{\RequirePackage{ccicons}}
- %% For \doclicenseIcon
+ % For \doclicenseIcon
\@ifpackageloaded{graphicx}{}{\RequirePackage{graphicx}}
- %% For \doclicenseImage
+ % For \doclicenseImage
\@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}
\@ifpackageloaded{hyperxmp}{
- %% The following options are only defined when the hyperxmp package was loaded.
+ % The following options are only defined when the hyperxmp package was loaded.
\hypersetup{
pdfcopyright = {\doclicenseLongText},
pdflicenseurl = {\doclicenseURL},
}
}{}
}
-\IfFileExists{hyperxmp.sty}{
- \@ifpackageloaded{hyperxmp}{}{\RequirePackage{hyperxmp}}
-}{
- \PackageWarning{doclicense}{%
- The hyperxmp package is missing so no license metadata can be embedded
- into the PDF. Consider installing hyperxmp.% chktex 13
+\ifdoclicense@hyperxmp
+ \@ifpackageloaded{pdfx}{%
+ \PackageWarning{doclicense}{%
+ The pdfx package was detected. Therefore the mechanism to add license
+ metadata won't work. Ensure to setup \string\Copyright\space and
+ corresponding settings to your xmpdata-file.
}
-}
-%% )))
+ }{
+ \IfFileExists{hyperxmp.sty}{
+ \@ifpackageloaded{hyperxmp}{}{\RequirePackage{hyperxmp}}
+ }{
+ \PackageWarning{doclicense}{%
+ The hyperxmp package is missing so no license metadata can be embedded
+ into the PDF. Consider installing hyperxmp.% chktex 13
+ }
+ }
+ }
+\fi
+% )))
% \end{macrocode}
% \subsection{Deprecation handling}
% \begin{macrocode}
-%% Deprecation handling (((
+% Deprecation handling (((
\ifthenelse{
\equal{\doclicense@type}{}
}{
@@ -678,12 +699,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
Please explicitly pick a license of your choosing.
}
}{}
-%% )))
+% )))
% \end{macrocode}
% \subsection{Declare variables and macros}
% \begin{macrocode}
-%% Declare variables (((
+% Declare variables (((
\@namedef{doclicense@lang@lic@CC}{Creative Commons}%
\newcommand{\doclicense@baseUrlCC}{https://creativecommons.org}
\newcommand{\doclicense@versionFallback}{}
@@ -703,12 +724,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}{%
\doclicense@modifier}%
}
-%% )))
+% )))
% \end{macrocode}
% \subsection{User macros}
% \begin{macrocode}
-%% User macros (((
+% User macros (((
\newcommand{\doclicenseType}{\doclicense@type\xspace}
\newcommand{\doclicenseLongType}{}
\newcommand{\doclicenseModifier}{\doclicense@modifier@uppercase\xspace}
@@ -733,7 +754,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
\newcommand{\doclicenseIcon}{\doclicense@icon\xspace}
\newcommand{\doclicenseTypeIcon}{\doclicenseType}
-% \newcommand{\doclicenseModifierIcon}{} %% Not directly provided by ccicons.
+% \newcommand{\doclicenseModifierIcon}{} % Not directly provided by ccicons.
\newcommand{\doclicenseImageFileName}{%
doclicense-\doclicense@type-\doclicense@modifier\doclicense@imagemodifier}
\newcommand{\doclicenseImage}[1][]{%
@@ -755,7 +776,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
doclicense-\doclicense@type-\doclicense@modifier-\doclicense@versionUsed-latex}
\newcommand{\doclicenseFullText}{\input{\doclicenseFullTextFileName}}% chktex 27
-\newcommand{\doclicenseLicense}{\doclicenseThis} %% legacy support
+\newcommand{\doclicenseLicense}{\doclicenseThis} % legacy support
\newcommand{\doclicenseThis}{%
\setlength{\doclicense@hsize}{\linewidth-\doclicense@imagewidth-\doclicense@imagedistance}%
\ifthenelse{\equal{\doclicense@imageposition}{left}}{%
@@ -793,7 +814,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% }
}
}
-%% )))
+% )))
% \end{macrocode}
% \subsection{Language selection}
@@ -801,7 +822,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
% should be stored and changed there. Note that one could also redefine
% macros like \cmd{\doclicenseLongText} if necessary.
% \begin{macrocode}
-%% Language support (((
+% Language support (((
\ifthenelse{\equal{\doclicense@lang}{}}{%
\renewcommand{\doclicense@lang}{\languagename}}{}
\IfFileExists{doclicense-\doclicense@lang.ldf}{%
@@ -818,12 +839,12 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
\@namedef{doclicense@imagemodifier}{-88x31}% chktex 29
}{}
-%% )))
+% )))
% \end{macrocode}
% \subsection{Internals}
% \begin{macrocode}
-%% Set license (((
+% Set license (((
\newcommand{\doclicense@setVersion}[1][]{%
\ifthenelse{\equal{#1}{}}{}{%
\renewcommand{\doclicense@versionFallback}{#1}
@@ -835,14 +856,14 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
}
\newcommand{\doclicense@set}{%
- %% CC (((
+ % CC (((
\ifthenelse{\equal{\doclicense@type}{CC}}{%
\renewcommand{\doclicenseLongType}{\doclicense@lang@lic@CC\xspace}
\renewcommand{\doclicenseTypeIcon}{\ccLogo\xspace}
\doclicense@setVersion[3.0]
- %% Allow to predefine the following macros in ldf files.
+ % Allow to predefine the following macros in ldf files.
\ifcsdef{doclicense@UrlLangPart}{}{%
\ifthenelse{\equal{\doclicense@lang@lic@CC@code}{}}{%
\edef\doclicense@UrlLangPart{}
@@ -910,7 +931,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}%
}{}
\IfSubStr{\doclicense@modifier}{nc}{}{
- %% eu (Euro) does only exist for nc (non commercial) so if not nc then reset -eu.
+ % eu (Euro) does only exist for nc (non commercial) so if not nc then reset -eu.
\IfBeginWith{\doclicense@imagemodifier}{-eu}{%
\renewcommand{\doclicense@imagemodifier}{-88x31}% chktex 29
}{}
@@ -929,7 +950,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}
\setboolean{doclicense@licenseKnown}{true}
- }{}%% )))
+ }{}% )))
\ifthenelse{\not\boolean{doclicense@licenseKnown}}{%
\PackageError{doclicense}{License unknown}{%
Please check the manual of doclicense
@@ -937,7 +958,7 @@ corresponds to \PackageName\nobreakspace\fileversion, dated \printdateTeX{\filed
}%
}{}%
}
-%% )))
+% )))
\doclicense@set%
% \end{macrocode}
diff --git a/macros/latex/contrib/doclicense/doclicense.ins b/macros/latex/contrib/doclicense/doclicense.ins
index 8e98df8fab..2b5f1ef966 100644
--- a/macros/latex/contrib/doclicense/doclicense.ins
+++ b/macros/latex/contrib/doclicense/doclicense.ins
@@ -1,4 +1,10 @@
-%% See file 'doclicense.dtx' for copyright and license.
+% SPDX-FileCopyrightText: 2015 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in manifest.txt.
+% For more details about the licensing, refer to the README.md file.
+
\input docstrip.tex
\keepsilent
diff --git a/macros/latex/contrib/doclicense/doclicense.pdf b/macros/latex/contrib/doclicense/doclicense.pdf
index 0ae88d6b61..03d059eacf 100644
--- a/macros/latex/contrib/doclicense/doclicense.pdf
+++ b/macros/latex/contrib/doclicense/doclicense.pdf
Binary files differ
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-3.0-latex.html
new file mode 100644
index 0000000000..44f1c24340
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-3.0-latex.html
@@ -0,0 +1,421 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="green">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(f) below, which, by reason of the selection
+and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined above) for the purposes of this
+License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work or
+Adaptation, as appropriate, through sale or other
+transfer of ownership.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections;</li>
+<li>to create and Reproduce Adaptations provided that any
+such Adaptation, including any translation in any medium,
+takes reasonable steps to clearly label, demarcate or
+otherwise identify that changes were made to the original
+Work. For example, a translation could be marked "The
+original work was translated from English to Spanish," or
+a modification could indicate "The original work has been
+modified.";</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections; and,</li>
+<li>to Distribute and Publicly Perform Adaptations.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor waives the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License; and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor waives the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License.</li>
+</ol>
+</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats. Subject to Section 8(f), all rights not
+expressly granted by Licensor are hereby reserved.</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(b), as
+requested. If You create an Adaptation, upon notice from
+any Licensor You must, to the extent practicable, remove
+from the Adaptation any credit as required by Section
+4(b), as requested.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+any Adaptations or Collections, You must, unless a
+request has been made pursuant to Section 4(a), keep
+intact all copyright notices for the Work and provide,
+reasonable to the medium or means You are utilizing: (i)
+the name of the Original Author (or pseudonym, if
+applicable) if supplied, and/or if the Original Author
+and/or Licensor designate another party or parties (e.g.,
+a sponsor institute, publishing entity, journal) for
+attribution ("Attribution Parties") in Licensor's
+copyright notice, terms of service or by other reasonable
+means, the name of such party or parties; (ii) the title
+of the Work if supplied; (iii) to the extent reasonably
+practicable, the URI, if any, that Licensor specifies to
+be associated with the Work, unless such URI does not
+refer to the copyright notice or licensing information
+for the Work; and (iv) , consistent with Section 3(b), in
+the case of an Adaptation, a credit identifying the use
+of the Work in the Adaptation (e.g., "French translation
+of the Work by Original Author," or "Screenplay based on
+original Work by Original Author"). The credit required
+by this Section 4 (b) may be implemented in any
+reasonable manner; provided, however, that in the case of
+a Adaptation or Collection, at a minimum such credit will
+appear, if a credit for all contributing authors of the
+Adaptation or Collection appears, then as part of these
+credits and in a manner at least as prominent as the
+credits for the other contributing authors. For the
+avoidance of doubt, You may only use the credit required
+by this Section for the purpose of attribution in the
+manner set out above and, by exercising Your rights under
+this License, You may not implicitly or explicitly assert
+or imply any connection with, sponsorship or endorsement
+by the Original Author, Licensor and/or Attribution
+Parties, as appropriate, of You or Your use of the Work,
+without the separate, express prior written permission of
+the Original Author, Licensor and/or Attribution
+Parties.</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Adaptations or
+Collections, You must not distort, mutilate, modify or
+take other derogatory action in relation to the Work
+which would be prejudicial to the Original Author's honor
+or reputation. Licensor agrees that in those
+jurisdictions (e.g. Japan), in which any exercise of the
+right granted in Section 3(b) of this License (the right
+to make Adaptations) would be deemed to be a distortion,
+mutilation, modification or other derogatory action
+prejudicial to the Original Author's honor and
+reputation, the Licensor will waive or not assert, as
+appropriate, this Section, to the fullest extent
+permitted by the applicable national law, to enable You
+to reasonably exercise Your right under Section 3(b) of
+this License (right to make Adaptations) but not
+otherwise.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN
+WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Adaptations or Collections from You under this
+License, however, will not have their licenses terminated
+provided such individuals or entities remain in full
+compliance with those licenses. Sections 1, 2, 5, 6, 7,
+and 8 will survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>Each time You Distribute or Publicly Perform an
+Adaptation, Licensor offers to the recipient a license to
+the original Work on the same terms and conditions as the
+license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of this License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-4.0-latex.html
new file mode 100644
index 0000000000..9a693a62bb
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-4.0-latex.html
@@ -0,0 +1,397 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution 4.0 International — CC BY 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+ </ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="green">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Adapter's License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</li>
+<li id="s1c"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1d"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1e"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1f"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1g"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1h"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1i"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1j"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1k"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part; and</li>
+<li id="s2a1B">produce, reproduce, and Share Adapted Material.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+<ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material (including in modified form), You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+ <li id="s3a4">If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+<p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+<ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations. </p>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.html
new file mode 100644
index 0000000000..fa21a30438
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.html
@@ -0,0 +1,440 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(f) below, which, by reason of the selection
+and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined above) for the purposes of this
+License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work or
+Adaptation, as appropriate, through sale or other
+transfer of ownership.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections;</li>
+<li>to create and Reproduce Adaptations provided that any
+such Adaptation, including any translation in any medium,
+takes reasonable steps to clearly label, demarcate or
+otherwise identify that changes were made to the original
+Work. For example, a translation could be marked "The
+original work was translated from English to Spanish," or
+a modification could indicate "The original work has been
+modified.";</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections; and,</li>
+<li>to Distribute and Publicly Perform Adaptations.</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats. Subject to Section 8(f), all rights not
+expressly granted by Licensor are hereby reserved,
+including but not limited to the rights set forth in
+Section 4(d).</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(c), as
+requested. If You create an Adaptation, upon notice from
+any Licensor You must, to the extent practicable, remove
+from the Adaptation any credit as required by Section
+4(c), as requested.</li>
+<li>You may not exercise any of the rights granted to You
+in Section 3 above in any manner that is primarily
+intended for or directed toward commercial advantage or
+private monetary compensation. The exchange of the Work
+for other copyrighted works by means of digital
+file-sharing or otherwise shall not be considered to be
+intended for or directed toward commercial advantage or
+private monetary compensation, provided there is no
+payment of any monetary compensation in connection with
+the exchange of copyrighted works.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+any Adaptations or Collections, You must, unless a
+request has been made pursuant to Section 4(a), keep
+intact all copyright notices for the Work and provide,
+reasonable to the medium or means You are utilizing: (i)
+the name of the Original Author (or pseudonym, if
+applicable) if supplied, and/or if the Original Author
+and/or Licensor designate another party or parties (e.g.,
+a sponsor institute, publishing entity, journal) for
+attribution ("Attribution Parties") in Licensor's
+copyright notice, terms of service or by other reasonable
+means, the name of such party or parties; (ii) the title
+of the Work if supplied; (iii) to the extent reasonably
+practicable, the URI, if any, that Licensor specifies to
+be associated with the Work, unless such URI does not
+refer to the copyright notice or licensing information
+for the Work; and, (iv) consistent with Section 3(b), in
+the case of an Adaptation, a credit identifying the use
+of the Work in the Adaptation (e.g., "French translation
+of the Work by Original Author," or "Screenplay based on
+original Work by Original Author"). The credit required
+by this Section 4(c) may be implemented in any reasonable
+manner; provided, however, that in the case of a
+Adaptation or Collection, at a minimum such credit will
+appear, if a credit for all contributing authors of the
+Adaptation or Collection appears, then as part of these
+credits and in a manner at least as prominent as the
+credits for the other contributing authors. For the
+avoidance of doubt, You may only use the credit required
+by this Section for the purpose of attribution in the
+manner set out above and, by exercising Your rights under
+this License, You may not implicitly or explicitly assert
+or imply any connection with, sponsorship or endorsement
+by the Original Author, Licensor and/or Attribution
+Parties, as appropriate, of You or Your use of the Work,
+without the separate, express prior written permission of
+the Original Author, Licensor and/or Attribution
+Parties.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License if Your exercise of such
+rights is for a purpose or use which is otherwise
+than noncommercial as permitted under Section 4(b)
+and otherwise waives the right to collect royalties
+through any statutory or compulsory licensing scheme;
+and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor reserves the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License that is for a purpose or
+use which is otherwise than noncommercial as
+permitted under Section 4(c).</li>
+</ol>
+</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Adaptations or
+Collections, You must not distort, mutilate, modify or
+take other derogatory action in relation to the Work
+which would be prejudicial to the Original Author's honor
+or reputation. Licensor agrees that in those
+jurisdictions (e.g. Japan), in which any exercise of the
+right granted in Section 3(b) of this License (the right
+to make Adaptations) would be deemed to be a distortion,
+mutilation, modification or other derogatory action
+prejudicial to the Original Author's honor and
+reputation, the Licensor will waive or not assert, as
+appropriate, this Section, to the fullest extent
+permitted by the applicable national law, to enable You
+to reasonably exercise Your right under Section 3(b) of
+this License (right to make Adaptations) but not
+otherwise.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN
+WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Adaptations or Collections from You under this
+License, however, will not have their licenses terminated
+provided such individuals or entities remain in full
+compliance with those licenses. Sections 1, 2, 5, 6, 7,
+and 8 will survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>Each time You Distribute or Publicly Perform an
+Adaptation, Licensor offers to the recipient a license to
+the original Work on the same terms and conditions as the
+license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+ on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of the License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.html
new file mode 100644
index 0000000000..6bc780e9b2
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.html
@@ -0,0 +1,398 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution-NonCommercial 4.0 International — CC BY-NC 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span><span class="cc-icon-nc"><img src="/images/deed/svg/nc_white.svg" alt="Non-Commerical" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution-NonCommercial 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Adapter's License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</li>
+<li id="s1c"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1d"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1e"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1f"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1g"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1h"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1i"><strong>NonCommercial</strong> means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.</li>
+<li id="s1j"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1k"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1l"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and</li>
+<li id="s2a1B">produce, reproduce, and Share Adapted Material for NonCommercial purposes only.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+<ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material (including in modified form), You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+<li id="s3a4">If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+ <p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+<ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by-nc/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by-nc/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by-nc/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by-nc/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by-nc/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by-nc/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by-nc/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by-nc/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by-nc/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by-nc/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by-nc/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by-nc/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by-nc/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by-nc/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by-nc/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by-nc/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by-nc/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by-nc/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by-nc/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by-nc/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by-nc/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by-nc/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by-nc/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by-nc/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by-nc/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by-nc/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by-nc/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by-nc/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.</p>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.html
new file mode 100644
index 0000000000..0f5d4148a1
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.html
@@ -0,0 +1,406 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial-NoDerivs 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(f) below, which, by reason of the selection
+and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined above) for the purposes of this
+License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work through
+sale or other transfer of ownership.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections; and,</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections.</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats, but otherwise you have no rights to make
+Adaptations. Subject to 8(f), all rights not expressly
+granted by Licensor are hereby reserved, including but not
+limited to the rights set forth in Section 4(d).</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(c), as
+requested.</li>
+<li>You may not exercise any of the rights granted to You
+in Section 3 above in any manner that is primarily
+intended for or directed toward commercial advantage or
+private monetary compensation. The exchange of the Work
+ for other copyrighted works by means of digital
+file-sharing or otherwise shall not be considered to be
+intended for or directed toward commercial advantage or
+private monetary compensation, provided there is no
+payment of any monetary compensation in connection with
+the exchange of copyrighted works.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+Collections, You must, unless a request has been made
+pursuant to Section 4(a), keep intact all copyright
+notices for the Work and provide, reasonable to the
+medium or means You are utilizing: (i) the name of the
+Original Author (or pseudonym, if applicable) if
+supplied, and/or if the Original Author and/or Licensor
+designate another party or parties (e.g., a sponsor
+institute, publishing entity, journal) for attribution
+("Attribution Parties") in Licensor's copyright notice,
+terms of service or by other reasonable means, the name
+of such party or parties; (ii) the title of the Work if
+supplied; (iii) to the extent reasonably practicable, the
+URI, if any, that Licensor specifies to be associated
+with the Work, unless such URI does not refer to the
+copyright notice or licensing information for the Work.
+The credit required by this Section 4(c) may be
+implemented in any reasonable manner; provided, however,
+that in the case of a Collection, at a minimum such
+credit will appear, if a credit for all contributing
+authors of Collection appears, then as part of these
+credits and in a manner at least as prominent as the
+credits for the other contributing authors. For the
+avoidance of doubt, You may only use the credit required
+by this Section for the purpose of attribution in the
+manner set out above and, by exercising Your rights under
+this License, You may not implicitly or explicitly assert
+or imply any connection with, sponsorship or endorsement
+by the Original Author, Licensor and/or Attribution
+Parties, as appropriate, of You or Your use of the Work,
+without the separate, express prior written permission of
+the Original Author, Licensor and/or Attribution
+Parties.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License if Your exercise of such
+rights is for a purpose or use which is otherwise
+than noncommercial as permitted under Section 4(b)
+and otherwise waives the right to collect royalties
+through any statutory or compulsory licensing scheme;
+and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor reserves the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License that is for a purpose or
+use which is otherwise than noncommercial as
+permitted under Section 4(b).</li>
+</ol>
+</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Collections, You must
+not distort, mutilate, modify or take other derogatory
+action in relation to the Work which would be prejudicial
+to the Original Author's honor or reputation.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN
+WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Collections from You under this License,
+however, will not have their licenses terminated provided
+such individuals or entities remain in full compliance
+with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of this License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.html
new file mode 100644
index 0000000000..5342ef7e49
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.html
@@ -0,0 +1,397 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution-NonCommercial-NoDerivatives 4.0 International — CC BY-NC-ND 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span><span class="cc-icon-nc"><img src="/images/deed/svg/nc_white.svg" alt="Non-Commerical" /></span><span class="cc-icon-nd"><img src="/images/deed/svg/nd_white.svg" alt="No Derivatives" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial-NoDerivatives 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1c"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1d"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1e"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1f"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1g"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1h"><strong>NonCommercial</strong> means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.</li>
+<li id="s1i"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1j"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1k"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and</li>
+<li id="s2a1B">produce and reproduce, but not Share, Adapted Material for NonCommercial purposes only.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+ <ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material, You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+For the avoidance of doubt, You do not have permission under this Public License to Share Adapted Material.
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only and provided You do not Share Adapted Material;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+<p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+<ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by-nc-nd/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by-nc-nd/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.</p>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.html
new file mode 100644
index 0000000000..43d0bfd9e9
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.html
@@ -0,0 +1,472 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial-ShareAlike 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(g) below, which, by reason of the selection
+and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined above) for the purposes of this
+License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work or
+Adaptation, as appropriate, through sale or other
+transfer of ownership.</li>
+<li><strong>"License Elements"</strong> means the
+following high-level license attributes as selected by
+Licensor and indicated in the title of this License:
+Attribution, Noncommercial, ShareAlike.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections;</li>
+<li>to create and Reproduce Adaptations provided that any
+such Adaptation, including any translation in any medium,
+takes reasonable steps to clearly label, demarcate or
+otherwise identify that changes were made to the original
+Work. For example, a translation could be marked "The
+original work was translated from English to Spanish," or
+a modification could indicate "The original work has been
+modified.";</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections; and,</li>
+<li>to Distribute and Publicly Perform Adaptations.</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats. Subject to Section 8(f), all rights not
+expressly granted by Licensor are hereby reserved,
+including but not limited to the rights described in
+Section 4(e).</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+ to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(d), as
+requested. If You create an Adaptation, upon notice from
+any Licensor You must, to the extent practicable, remove
+from the Adaptation any credit as required by Section
+4(d), as requested.</li>
+<li>You may Distribute or Publicly Perform an Adaptation
+only under: (i) the terms of this License; (ii) a later
+version of this License with the same License Elements as
+this License; (iii) a Creative Commons jurisdiction
+license (either this or a later license version) that
+contains the same License Elements as this License (e.g.,
+Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable
+License"). You must include a copy of, or the URI, for
+Applicable License with every copy of each Adaptation You
+Distribute or Publicly Perform. You may not offer or
+impose any terms on the Adaptation that restrict the
+terms of the Applicable License or the ability of the
+recipient of the Adaptation to exercise the rights
+granted to that recipient under the terms of the
+Applicable License. You must keep intact all notices that
+refer to the Applicable License and to the disclaimer of
+warranties with every copy of the Work as included in the
+Adaptation You Distribute or Publicly Perform. When You
+Distribute or Publicly Perform the Adaptation, You may
+not impose any effective technological measures on the
+Adaptation that restrict the ability of a recipient of
+the Adaptation from You to exercise the rights granted to
+that recipient under the terms of the Applicable License.
+This Section 4(b) applies to the Adaptation as
+incorporated in a Collection, but this does not require
+the Collection apart from the Adaptation itself to be
+made subject to the terms of the Applicable License.</li>
+<li>You may not exercise any of the rights granted to You
+in Section 3 above in any manner that is primarily
+intended for or directed toward commercial advantage or
+private monetary compensation. The exchange of the Work
+for other copyrighted works by means of digital
+file-sharing or otherwise shall not be considered to be
+intended for or directed toward commercial advantage or
+private monetary compensation, provided there is no
+payment of any monetary compensation in con-nection with
+the exchange of copyrighted works.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+any Adaptations or Collections, You must, unless a
+request has been made pursuant to Section 4(a), keep
+intact all copyright notices for the Work and provide,
+reasonable to the medium or means You are utilizing: (i)
+the name of the Original Author (or pseudonym, if
+applicable) if supplied, and/or if the Original Author
+and/or Licensor designate another party or parties (e.g.,
+a sponsor institute, publishing entity, journal) for
+attribution ("Attribution Parties") in Licensor's
+copyright notice, terms of service or by other reasonable
+means, the name of such party or parties; (ii) the title
+of the Work if supplied; (iii) to the extent reasonably
+practicable, the URI, if any, that Licensor specifies to
+be associated with the Work, unless such URI does not
+refer to the copyright notice or licensing information
+for the Work; and, (iv) consistent with Section 3(b), in
+the case of an Adaptation, a credit identifying the use
+of the Work in the Adaptation (e.g., "French translation
+of the Work by Original Author," or "Screenplay based on
+original Work by Original Author"). The credit required
+by this Section 4(d) may be implemented in any reasonable
+manner; provided, however, that in the case of a
+Adaptation or Collection, at a minimum such credit will
+appear, if a credit for all contributing authors of the
+Adaptation or Collection appears, then as part of these
+credits and in a manner at least as prominent as the
+credits for the other contributing authors. For the
+avoidance of doubt, You may only use the credit required
+by this Section for the purpose of attribution in the
+manner set out above and, by exercising Your rights under
+this License, You may not implicitly or explicitly assert
+or imply any connection with, sponsorship or endorsement
+by the Original Author, Licensor and/or Attribution
+Parties, as appropriate, of You or Your use of the Work,
+without the separate, express prior written permission of
+the Original Author, Licensor and/or Attribution
+Parties.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License if Your exercise of such
+rights is for a purpose or use which is otherwise
+than noncommercial as permitted under Section 4(c)
+and otherwise waives the right to collect royalties
+through any statutory or compulsory licensing scheme;
+and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor reserves the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License that is for a purpose or
+use which is otherwise than noncommercial as
+permitted under Section 4(c).</li>
+</ol>
+</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Adaptations or
+Collections, You must not distort, mutilate, modify or
+take other derogatory action in relation to the Work
+which would be prejudicial to the Original Author's honor
+or reputation. Licensor agrees that in those
+jurisdictions (e.g. Japan), in which any exercise of the
+right granted in Section 3(b) of this License (the right
+to make Adaptations) would be deemed to be a distortion,
+mutilation, modification or other derogatory action
+ prejudicial to the Original Author's honor and
+reputation, the Licensor will waive or not assert, as
+appropriate, this Section, to the fullest extent
+permitted by the applicable national law, to enable You
+to reasonably exercise Your right under Section 3(b) of
+this License (right to make Adaptations) but not
+otherwise.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN
+WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE
+LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Adaptations or Collections from You under this
+License, however, will not have their licenses terminated
+provided such individuals or entities remain in full
+compliance with those licenses. Sections 1, 2, 5, 6, 7,
+and 8 will survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>Each time You Distribute or Publicly Perform an
+Adaptation, Licensor offers to the recipient a license to
+the original Work on the same terms and conditions as the
+license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of this License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.html
new file mode 100644
index 0000000000..e76f866fcd
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.html
@@ -0,0 +1,409 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution-NonCommercial-ShareAlike 4.0 International — CC BY-NC-SA 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span><span class="cc-icon-nc"><img src="/images/deed/svg/nc_white.svg" alt="Non-Commerical" /></span><span class="cc-icon-sa"><img src="/images/deed/svg/sa_white.svg" alt="Share Alike" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NonCommercial-ShareAlike 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use
+to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Adapter's License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</li>
+<li id="s1c"><strong>BY-NC-SA Compatible License</strong> means a license listed at <a href="//creativecommons.org/compatiblelicenses"> creativecommons.org/compatiblelicenses</a>, approved by Creative Commons as essentially the equivalent of this Public License.</li>
+<li id="s1d"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1e"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1f"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1g"><strong>License Elements</strong> means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.</li>
+<li id="s1h"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1i"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1j"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1k"><strong>NonCommercial</strong> means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.</li>
+<li id="s1l"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1m"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1n"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and</li>
+<li id="s2a1B">produce, reproduce, and Share Adapted Material for NonCommercial purposes only.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+<ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">Additional offer from the Licensor – Adapted Material</span>. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.</li>
+<li id="s2a5C"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material (including in modified form), You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+</ol>
+</li>
+<li id="s3b"><strong>ShareAlike</strong>.
+<p>In addition to the conditions in Section <a href="#s3a">3(a)</a>, if You Share Adapted Material You produce, the following conditions also apply.</p>
+<ol>
+<li id="s3b1">The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.</li>
+<li id="s3b2">You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.</li>
+<li id="s3b3">You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section <a href="#s3b">3(b)</a>; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+<p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+ <ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by-nc-sa/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by-nc-sa/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.html
new file mode 100644
index 0000000000..e90174f162
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.html
@@ -0,0 +1,388 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NoDerivs 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(f) below, which, by reason of the selection
+ and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined above) for the purposes of this
+License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work through
+sale or other transfer of ownership.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+ performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections; and,</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor waives the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License; and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor waives the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License.</li>
+</ol>
+</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats, but otherwise you have no rights to make
+Adaptations. Subject to Section 8(f), all rights not
+expressly granted by Licensor are hereby reserved.</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(b), as
+requested.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+Collections, You must, unless a request has been made
+pursuant to Section 4(a), keep intact all copyright
+notices for the Work and provide, reasonable to the
+medium or means You are utilizing: (i) the name of the
+Original Author (or pseudonym, if applicable) if
+supplied, and/or if the Original Author and/or Licensor
+designate another party or parties (e.g., a sponsor
+institute, publishing entity, journal) for attribution
+("Attribution Parties") in Licensor's copyright notice,
+terms of service or by other reasonable means, the name
+of such party or parties; (ii) the title of the Work if
+supplied; (iii) to the extent reasonably practicable, the
+URI, if any, that Licensor specifies to be associated
+with the Work, unless such URI does not refer to the
+copyright notice or licensing information for the Work.
+The credit required by this Section 4(b) may be
+implemented in any reasonable manner; provided, however,
+that in the case of a Collection, at a minimum such
+credit will appear, if a credit for all contributing
+authors of the Collection appears, then as part of these
+credits and in a manner at least as prominent as the
+credits for the other contributing authors. For the
+avoidance of doubt, You may only use the credit required
+by this Section for the purpose of attribution in the
+manner set out above and, by exercising Your rights under
+this License, You may not implicitly or explicitly assert
+or imply any connection with, sponsorship or endorsement
+by the Original Author, Licensor and/or Attribution
+Parties, as appropriate, of You or Your use of the Work,
+without the separate, express prior written permission of
+the Original Author, Licensor and/or Attribution
+Parties.</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Collections, You must
+not distort, mutilate, modify or take other derogatory
+action in relation to the Work which would be prejudicial
+to the Original Author's honor or reputation.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN
+WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Collections from You under this License,
+however, will not have their licenses terminated provided
+such individuals or entities remain in full compliance
+with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
+survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of this License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.html
new file mode 100644
index 0000000000..3ada736c68
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.html
@@ -0,0 +1,395 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution-NoDerivatives 4.0 International — CC BY-ND 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="yellow">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span><span class="cc-icon-nd"><img src="/images/deed/svg/nd_white.svg" alt="No Derivatives" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-NoDerivatives 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution-NoDerivatives 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1c"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1d"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1e"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1f"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1g"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1h"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1i"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1j"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part; and</li>
+<li id="s2a1B">produce and reproduce, but not Share, Adapted Material.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+<ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material, You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+For the avoidance of doubt, You do not have permission under this Public License to Share Adapted Material.
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database, provided You do not Share Adapted Material;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+<p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+<ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by-nd/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by-nd/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by-nd/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by-nd/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by-nd/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by-nd/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by-nd/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by-nd/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by-nd/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by-nd/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by-nd/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by-nd/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by-nd/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by-nd/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by-nd/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by-nd/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by-nd/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by-nd/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by-nd/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by-nd/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by-nd/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by-nd/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by-nd/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by-nd/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by-nd/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by-nd/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by-nd/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by-nd/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.</p>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.html
new file mode 100644
index 0000000000..db7aa35251
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.html
@@ -0,0 +1,472 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" />
+<title>Creative Commons Legal Code</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="https://creativecommons.org/">Creative Commons</a></p>
+<div id="deed" class="green">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="https://creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-ShareAlike 3.0 Unported</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="https://creativecommons.org/images/international/unported.png" alt="" />
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES
+NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE
+DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE
+COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS.
+CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE
+INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES
+RESULTING FROM ITS USE.
+</blockquote>
+<h3><em>License</em></h3>
+<p>THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS
+OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
+"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER
+APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
+AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS
+PROHIBITED.</p>
+<p>BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU
+ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
+TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A
+CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE
+IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
+CONDITIONS.</p>
+<p><strong>1. Definitions</strong></p>
+<ol type="a">
+<li><strong>"Adaptation"</strong> means a work based upon
+the Work, or upon the Work and other pre-existing works,
+such as a translation, adaptation, derivative work,
+arrangement of music or other alterations of a literary
+or artistic work, or phonogram or performance and
+includes cinematographic adaptations or any other form in
+which the Work may be recast, transformed, or adapted
+including in any form recognizably derived from the
+original, except that a work that constitutes a
+Collection will not be considered an Adaptation for the
+purpose of this License. For the avoidance of doubt,
+where the Work is a musical work, performance or
+phonogram, the synchronization of the Work in
+timed-relation with a moving image ("synching") will be
+considered an Adaptation for the purpose of this
+License.</li>
+<li><strong>"Collection"</strong> means a collection of
+literary or artistic works, such as encyclopedias and
+anthologies, or performances, phonograms or broadcasts,
+or other works or subject matter other than works listed
+in Section 1(f) below, which, by reason of the selection
+ and arrangement of their contents, constitute
+intellectual creations, in which the Work is included in
+its entirety in unmodified form along with one or more
+other contributions, each constituting separate and
+independent works in themselves, which together are
+assembled into a collective whole. A work that
+constitutes a Collection will not be considered an
+Adaptation (as defined below) for the purposes of this
+License.</li>
+<li><strong>"Creative Commons Compatible
+License"</strong> means a license that is listed at
+https://creativecommons.org/compatiblelicenses that has
+been approved by Creative Commons as being essentially
+equivalent to this License, including, at a minimum,
+because that license: (i) contains terms that have the
+same purpose, meaning and effect as the License Elements
+of this License; and, (ii) explicitly permits the
+relicensing of adaptations of works made available under
+that license under this License or a Creative Commons
+jurisdiction license with the same License Elements as
+this License.</li>
+<li><strong>"Distribute"</strong> means to make available
+to the public the original and copies of the Work or
+Adaptation, as appropriate, through sale or other
+transfer of ownership.</li>
+<li><strong>"License Elements"</strong> means the
+following high-level license attributes as selected by
+Licensor and indicated in the title of this License:
+Attribution, ShareAlike.</li>
+<li><strong>"Licensor"</strong> means the individual,
+individuals, entity or entities that offer(s) the Work
+under the terms of this License.</li>
+<li><strong>"Original Author"</strong> means, in the case
+of a literary or artistic work, the individual,
+individuals, entity or entities who created the Work or
+if no individual or entity can be identified, the
+publisher; and in addition (i) in the case of a
+performance the actors, singers, musicians, dancers, and
+other persons who act, sing, deliver, declaim, play in,
+interpret or otherwise perform literary or artistic works
+or expressions of folklore; (ii) in the case of a
+phonogram the producer being the person or legal entity
+who first fixes the sounds of a performance or other
+sounds; and, (iii) in the case of broadcasts, the
+organization that transmits the broadcast.</li>
+<li><strong>"Work"</strong> means the literary and/or
+artistic work offered under the terms of this License
+including without limitation any production in the
+literary, scientific and artistic domain, whatever may be
+the mode or form of its expression including digital
+form, such as a book, pamphlet and other writing; a
+lecture, address, sermon or other work of the same
+nature; a dramatic or dramatico-musical work; a
+choreographic work or entertainment in dumb show; a
+musical composition with or without words; a
+cinematographic work to which are assimilated works
+expressed by a process analogous to cinematography; a
+work of drawing, painting, architecture, sculpture,
+engraving or lithography; a photographic work to which
+are assimilated works expressed by a process analogous to
+photography; a work of applied art; an illustration, map,
+plan, sketch or three-dimensional work relative to
+geography, topography, architecture or science; a
+performance; a broadcast; a phonogram; a compilation of
+data to the extent it is protected as a copyrightable
+work; or a work performed by a variety or circus
+performer to the extent it is not otherwise considered a
+literary or artistic work.</li>
+<li><strong>"You"</strong> means an individual or entity
+exercising rights under this License who has not
+previously violated the terms of this License with
+respect to the Work, or who has received express
+permission from the Licensor to exercise rights under
+this License despite a previous violation.</li>
+<li><strong>"Publicly Perform"</strong> means to perform
+public recitations of the Work and to communicate to the
+public those public recitations, by any means or process,
+including by wire or wireless means or public digital
+performances; to make available to the public Works in
+such a way that members of the public may access these
+Works from a place and at a place individually chosen by
+them; to perform the Work to the public by any means or
+process and the communication to the public of the
+performances of the Work, including by public digital
+performance; to broadcast and rebroadcast the Work by any
+means including signs, sounds or images.</li>
+<li><strong>"Reproduce"</strong> means to make copies of
+the Work by any means including without limitation by
+sound or visual recordings and the right of fixation and
+reproducing fixations of the Work, including storage of a
+protected performance or phonogram in digital form or
+other electronic medium.</li>
+</ol>
+<p><strong>2. Fair Dealing Rights.</strong> Nothing in this
+License is intended to reduce, limit, or restrict any uses
+free from copyright or rights arising from limitations or
+exceptions that are provided for in connection with the
+copyright protection under copyright law or other
+applicable laws.</p>
+<p><strong>3. License Grant.</strong> Subject to the terms
+and conditions of this License, Licensor hereby grants You
+a worldwide, royalty-free, non-exclusive, perpetual (for
+the duration of the applicable copyright) license to
+exercise the rights in the Work as stated below:</p>
+<ol type="a">
+<li>to Reproduce the Work, to incorporate the Work into
+one or more Collections, and to Reproduce the Work as
+incorporated in the Collections;</li>
+<li>to create and Reproduce Adaptations provided that any
+such Adaptation, including any translation in any medium,
+takes reasonable steps to clearly label, demarcate or
+otherwise identify that changes were made to the original
+Work. For example, a translation could be marked "The
+original work was translated from English to Spanish," or
+a modification could indicate "The original work has been
+modified.";</li>
+<li>to Distribute and Publicly Perform the Work including
+as incorporated in Collections; and,</li>
+<li>to Distribute and Publicly Perform Adaptations.</li>
+<li>
+<p>For the avoidance of doubt:</p>
+<ol type="i">
+<li><strong>Non-waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme cannot be waived, the
+Licensor reserves the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License;</li>
+<li><strong>Waivable Compulsory License
+Schemes</strong>. In those jurisdictions in which the
+right to collect royalties through any statutory or
+compulsory licensing scheme can be waived, the
+Licensor waives the exclusive right to collect such
+royalties for any exercise by You of the rights
+granted under this License; and,</li>
+<li><strong>Voluntary License Schemes</strong>. The
+Licensor waives the right to collect royalties,
+whether individually or, in the event that the
+Licensor is a member of a collecting society that
+administers voluntary licensing schemes, via that
+society, from any exercise by You of the rights
+granted under this License.</li>
+</ol>
+</li>
+</ol>
+<p>The above rights may be exercised in all media and
+formats whether now known or hereafter devised. The above
+rights include the right to make such modifications as are
+technically necessary to exercise the rights in other media
+and formats. Subject to Section 8(f), all rights not
+expressly granted by Licensor are hereby reserved.</p>
+<p><strong>4. Restrictions.</strong> The license granted in
+Section 3 above is expressly made subject to and limited by
+the following restrictions:</p>
+<ol type="a">
+<li>You may Distribute or Publicly Perform the Work only
+under the terms of this License. You must include a copy
+of, or the Uniform Resource Identifier (URI) for, this
+License with every copy of the Work You Distribute or
+Publicly Perform. You may not offer or impose any terms
+on the Work that restrict the terms of this License or
+the ability of the recipient of the Work to exercise the
+rights granted to that recipient under the terms of the
+License. You may not sublicense the Work. You must keep
+intact all notices that refer to this License and to the
+disclaimer of warranties with every copy of the Work You
+Distribute or Publicly Perform. When You Distribute or
+Publicly Perform the Work, You may not impose any
+effective technological measures on the Work that
+restrict the ability of a recipient of the Work from You
+to exercise the rights granted to that recipient under
+the terms of the License. This Section 4(a) applies to
+the Work as incorporated in a Collection, but this does
+not require the Collection apart from the Work itself to
+be made subject to the terms of this License. If You
+create a Collection, upon notice from any Licensor You
+must, to the extent practicable, remove from the
+Collection any credit as required by Section 4(c), as
+requested. If You create an Adaptation, upon notice from
+any Licensor You must, to the extent practicable, remove
+from the Adaptation any credit as required by Section
+4(c), as requested.</li>
+<li>You may Distribute or Publicly Perform an Adaptation
+only under the terms of: (i) this License; (ii) a later
+version of this License with the same License Elements as
+this License; (iii) a Creative Commons jurisdiction
+license (either this or a later license version) that
+contains the same License Elements as this License (e.g.,
+Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons
+Compatible License. If you license the Adaptation under
+one of the licenses mentioned in (iv), you must comply
+with the terms of that license. If you license the
+Adaptation under the terms of any of the licenses
+mentioned in (i), (ii) or (iii) (the "Applicable
+License"), you must comply with the terms of the
+Applicable License generally and the following
+provisions: (I) You must include a copy of, or the URI
+for, the Applicable License with every copy of each
+Adaptation You Distribute or Publicly Perform; (II) You
+may not offer or impose any terms on the Adaptation that
+restrict the terms of the Applicable License or the
+ability of the recipient of the Adaptation to exercise
+the rights granted to that recipient under the terms of
+the Applicable License; (III) You must keep intact all
+notices that refer to the Applicable License and to the
+disclaimer of warranties with every copy of the Work as
+included in the Adaptation You Distribute or Publicly
+Perform; (IV) when You Distribute or Publicly Perform the
+Adaptation, You may not impose any effective
+technological measures on the Adaptation that restrict
+the ability of a recipient of the Adaptation from You to
+exercise the rights granted to that recipient under the
+terms of the Applicable License. This Section 4(b)
+applies to the Adaptation as incorporated in a
+Collection, but this does not require the Collection
+apart from the Adaptation itself to be made subject to
+the terms of the Applicable License.</li>
+<li>If You Distribute, or Publicly Perform the Work or
+any Adaptations or Collections, You must, unless a
+request has been made pursuant to Section 4(a), keep
+intact all copyright notices for the Work and provide,
+reasonable to the medium or means You are utilizing: (i)
+the name of the Original Author (or pseudonym, if
+applicable) if supplied, and/or if the Original Author
+and/or Licensor designate another party or parties (e.g.,
+a sponsor institute, publishing entity, journal) for
+attribution ("Attribution Parties") in Licensor's
+copyright notice, terms of service or by other reasonable
+means, the name of such party or parties; (ii) the title
+of the Work if supplied; (iii) to the extent reasonably
+practicable, the URI, if any, that Licensor specifies to
+be associated with the Work, unless such URI does not
+refer to the copyright notice or licensing information
+for the Work; and (iv) , consistent with Ssection 3(b),
+in the case of an Adaptation, a credit identifying the
+use of the Work in the Adaptation (e.g., "French
+translation of the Work by Original Author," or
+"Screenplay based on original Work by Original Author").
+The credit required by this Section 4(c) may be
+implemented in any reasonable manner; provided, however,
+that in the case of a Adaptation or Collection, at a
+minimum such credit will appear, if a credit for all
+contributing authors of the Adaptation or Collection
+appears, then as part of these credits and in a manner at
+least as prominent as the credits for the other
+contributing authors. For the avoidance of doubt, You may
+only use the credit required by this Section for the
+purpose of attribution in the manner set out above and,
+by exercising Your rights under this License, You may not
+implicitly or explicitly assert or imply any connection
+with, sponsorship or endorsement by the Original Author,
+Licensor and/or Attribution Parties, as appropriate, of
+You or Your use of the Work, without the separate,
+express prior written permission of the Original Author,
+Licensor and/or Attribution Parties.</li>
+<li>Except as otherwise agreed in writing by the Licensor
+or as may be otherwise permitted by applicable law, if
+You Reproduce, Distribute or Publicly Perform the Work
+either by itself or as part of any Adaptations or
+Collections, You must not distort, mutilate, modify or
+take other derogatory action in relation to the Work
+which would be prejudicial to the Original Author's honor
+or reputation. Licensor agrees that in those
+jurisdictions (e.g. Japan), in which any exercise of the
+right granted in Section 3(b) of this License (the right
+to make Adaptations) would be deemed to be a distortion,
+mutilation, modification or other derogatory action
+prejudicial to the Original Author's honor and
+reputation, the Licensor will waive or not assert, as
+appropriate, this Section, to the fullest extent
+permitted by the applicable national law, to enable You
+to reasonably exercise Your right under Section 3(b) of
+this License (right to make Adaptations) but not
+otherwise.</li>
+</ol>
+<p><strong>5. Representations, Warranties and
+Disclaimer</strong></p>
+<p>UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN
+WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO
+REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE
+WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
+FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE
+ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE
+PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE.
+SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED
+WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.</p>
+<p><strong>6. Limitation on Liability.</strong> EXCEPT TO
+THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL
+LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY
+SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY
+DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
+EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.</p>
+<p><strong>7. Termination</strong></p>
+<ol type="a">
+<li>This License and the rights granted hereunder will
+terminate automatically upon any breach by You of the
+terms of this License. Individuals or entities who have
+received Adaptations or Collections from You under this
+License, however, will not have their licenses terminated
+provided such individuals or entities remain in full
+compliance with those licenses. Sections 1, 2, 5, 6, 7,
+and 8 will survive any termination of this License.</li>
+<li>Subject to the above terms and conditions, the
+license granted here is perpetual (for the duration of
+the applicable copyright in the Work). Notwithstanding
+the above, Licensor reserves the right to release the
+Work under different license terms or to stop
+distributing the Work at any time; provided, however that
+any such election will not serve to withdraw this License
+(or any other license that has been, or is required to
+be, granted under the terms of this License), and this
+License will continue in full force and effect unless
+terminated as stated above.</li>
+</ol>
+<p><strong>8. Miscellaneous</strong></p>
+<ol type="a">
+<li>Each time You Distribute or Publicly Perform the Work
+or a Collection, the Licensor offers to the recipient a
+license to the Work on the same terms and conditions as
+the license granted to You under this License.</li>
+<li>Each time You Distribute or Publicly Perform an
+Adaptation, Licensor offers to the recipient a license to
+the original Work on the same terms and conditions as the
+license granted to You under this License.</li>
+<li>If any provision of this License is invalid or
+unenforceable under applicable law, it shall not affect
+the validity or enforceability of the remainder of the
+terms of this License, and without further action by the
+parties to this agreement, such provision shall be
+reformed to the minimum extent necessary to make such
+provision valid and enforceable.</li>
+<li>No term or provision of this License shall be deemed
+waived and no breach consented to unless such waiver or
+consent shall be in writing and signed by the party to be
+ charged with such waiver or consent.</li>
+<li>This License constitutes the entire agreement between
+the parties with respect to the Work licensed here. There
+are no understandings, agreements or representations with
+respect to the Work not specified here. Licensor shall
+not be bound by any additional provisions that may appear
+in any communication from You. This License may not be
+modified without the mutual written agreement of the
+Licensor and You.</li>
+<li>The rights granted under, and the subject matter
+referenced, in this License were drafted utilizing the
+terminology of the Berne Convention for the Protection of
+Literary and Artistic Works (as amended on September 28,
+1979), the Rome Convention of 1961, the WIPO Copyright
+Treaty of 1996, the WIPO Performances and Phonograms
+Treaty of 1996 and the Universal Copyright Convention (as
+revised on July 24, 1971). These rights and subject
+matter take effect in the relevant jurisdiction in which
+the License terms are sought to be enforced according to
+the corresponding provisions of the implementation of
+those treaty provisions in the applicable national law.
+If the standard suite of rights granted under applicable
+copyright law includes additional rights not granted
+under this License, such additional rights are deemed to
+be included in the License; this License is not intended
+to restrict the license of any rights under applicable
+law.</li>
+</ol>
+
+<blockquote>
+<h3>Creative Commons Notice</h3>
+<p>Creative Commons is not a party to this License, and
+makes no warranty whatsoever in connection with the Work.
+Creative Commons will not be liable to You or any party
+on any legal theory for any damages whatsoever, including
+without limitation any general, special, incidental or
+consequential damages arising in connection to this
+license. Notwithstanding the foregoing two (2) sentences,
+if Creative Commons has expressly identified itself as
+the Licensor hereunder, it shall have all rights and
+obligations of Licensor.</p>
+<p>Except for the limited purpose of indicating to the
+public that the Work is licensed under the CCPL, Creative
+Commons does not authorize the use by either party of the
+trademark "Creative Commons" or any related trademark or
+logo of Creative Commons without the prior written
+consent of Creative Commons. Any permitted use will be in
+compliance with Creative Commons' then-current trademark
+usage guidelines, as may be published on its website or
+otherwise made available upon request from time to time.
+For the avoidance of doubt, this trademark restriction
+does not form part of the License.</p>
+<p>Creative Commons may be contacted at <a href="https://creativecommons.org/">https://creativecommons.org/</a>.</p>
+</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.html
new file mode 100644
index 0000000000..81bd383ab6
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.html
@@ -0,0 +1,407 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Creative Commons — Attribution-ShareAlike 4.0 International — CC BY-SA 4.0</title>
+<meta charset="UTF-8">
+<script type="text/javascript" src="//creativecommons.org/includes/errata.js"></script>
+
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700" rel="stylesheet">
+<link rel='stylesheet' id='cc-fontello-css' href="https://creativecommons.org/wp-content/themes/cc/fonts/fontello/css/cc-fontello.css" type='text/css' media='all' />
+<link rel='stylesheet' id='parent-style-css' href="https://creativecommons.org/wp-content/themes/twentysixteen/style.css" type='text/css' media='all' />
+<link rel='stylesheet' id='cc-style-css' href="https://creativecommons.org/wp-content/themes/cc/css/app.css" type='text/css' media='all' />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="/includes/legalcode-print.css" media="print" />
+<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
+
+</head>
+<body class="lang-en">
+
+<div class="site-header-wrapper">
+<header id="masthead" class="site-header sticky-nav-main sticky attached" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+<header class="site-header spacer" role="banner">
+<div class="site-header-main">
+<div class="site-branding">
+<a class="cc-site-logo-link" href="https://creativecommons.org/" rel="home">
+<img class="cc-site-logo" src="https://creativecommons.org/wp-content/themes/cc/images/cc.logo.white.svg" height="72" width="303">
+</a>
+</div>
+<button id="menu-toggle" class="menu-toggle"><i class="cc-icon-menu"></i> <span>Menu</span></button>
+<div id="site-header-menu" class="site-header-menu">
+<nav id="mobile-navigation" class="mobile-navigation" role="navigation" aria-label="Mobile Menu">
+<div class="menu-mobile-menu-container"><ul id="menu-mobile-menu" class="mobile-menu">
+<li id="menu-item-48798" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48798"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48799" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48799"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48800" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48800"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48801" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48801"><a href="https://creativecommons.org/blog/">Blog</a></li>
+<li id="menu-item-48802" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48802"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48803" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48803"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+</ul></div>
+</nav>
+<nav id="site-navigation" class="main-navigation" role="navigation" aria-label="Primary Menu">
+<div class="menu-primary-menu-container"><ul id="menu-primary-menu" class="primary-menu">
+<li id="menu-item-48791" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48791"><a href="https://creativecommons.org/share-your-work/">Share your work</a></li>
+<li id="menu-item-48792" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48792"><a href="https://creativecommons.org/use-remix/">Use &amp; remix</a></li>
+<li id="menu-item-48570" class="menu-item menu-item-type-post_type menu-item-object-page page_item page-item-7466 menu-item-48570"><a href="https://creativecommons.org/about/">What we do</a></li>
+<li id="menu-item-48793" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48793"><a href="https://creativecommons.org/blog/">Blog</a></li>
+</ul></div>
+</nav>
+<nav id="secondary-navigation" class="secondary-navigation" role="navigation" aria-label="Secondary Menu">
+<div class="menu-secondary-menu-container"><ul id="menu-secondary-menu" class="secondary-menu"><li id="menu-item-48804" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48804"><a href="https://creativecommons.org/about/global-affiliate-network/">Global Affiliate Network</a></li>
+<li id="menu-item-48805" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48805"><a href="https://creativecommons.org/use-remix/search-the-commons/">Search the Commons</a></li>
+<li id="menu-item-48806" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48806"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+</ul></div>
+</nav>
+<nav id="social-navigation" class="social-navigation" role="navigation" aria-label="Social Links Menu">
+<div class="menu-social-links-container"><ul id="menu-social-links" class="social-links-menu">
+<li id="menu-item-48807" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48807"><a href="https://www.facebook.com/creativecommons"><span class="screen-reader-text">Facebook</span></a></li>
+<li id="menu-item-48808" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48808"><a href="https://twitter.com/creativecommons"><span class="screen-reader-text">Twitter</span></a></li>
+<li id="menu-item-48809" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-48809"><a href="mailto:info@creativecommons.org"><span class="screen-reader-text">Mail</span></a></li>
+</ul></div>
+</nav>
+</div>
+</div>
+</header>
+</div>
+<aside id="header-below" class="widget-area">
+<section id="text-15" class="widget-1 widget-first widget-last widget-odd widget widget_text">
+<div class="textwidget">
+<div id="donation-bar-wrapper" class="donation-bar-wrapper">
+<div id="donation-bar-inner" class="donation-bar-inner">
+<p class="donate-text">Help us build a vibrant, collaborative global commons</p>
+<div class="donate-action"><a href="/donate?utm_campaign=2018fund&utm_source=license_header2018" class="button donate arrow">Donate<span class="hide-on-mobile"> Now</span></a></div>
+</div>
+</div>
+</div>
+</section>
+</aside>
+
+
+<div id="language-selector-block" class="container">
+<div class="language-selector-inner">
+This page is available in the following languages:
+<img class="language-icon" src="/images/language_icon_x2.png" alt="Languages">
+<select>
+<option value="legalcode.ar">العربية</option>
+<option value="legalcode.cs">čeština</option>
+<option value="legalcode.de">Deutsch</option>
+<option value="legalcode.el">Ελληνικά</option>
+<option value="legalcode" selected="selected">English</option>
+<option value="legalcode.es">Español</option>
+<option value="legalcode.eu">euskara</option>
+<option value="legalcode.fi">suomeksi</option>
+<option value="legalcode.fr">français</option>
+<option value="legalcode.hr">hrvatski</option>
+<option value="legalcode.id">Bahasa Indonesia</option>
+<option value="legalcode.it">italiano</option>
+<option value="legalcode.ja">日本語</option>
+<option value="legalcode.ko">한국어</option>
+<option value="legalcode.lt">Lietuvių</option>
+<option value="legalcode.lv">latviski</option>
+<option value="legalcode.mi">te reo Māori</option>
+<option value="legalcode.nl">Nederlands</option>
+<option value="legalcode.no">norsk</option>
+<option value="legalcode.pl">polski</option>
+<option value="legalcode.pt">português</option>
+<option value="legalcode.ro">română</option>
+<option value="legalcode.ru">русский</option>
+<option value="legalcode.sl">Slovenščina</option>
+<option value="legalcode.sv">svenska</option>
+<option value="legalcode.tr">Türkçe</option>
+<option value="legalcode.uk">українська</option>
+<option value="legalcode.zh-Hans">中文</option>
+<option value="legalcode.zh-Hant">華語</option>
+</select>
+</div>
+</div>
+
+
+<div id="deed" class="green">
+<div id="deed-head">
+<div id="cc-logo"><span class="cc-icon-logo"><img src="/images/deed/svg/cc_white.svg" alt="CC" /></span><span class="cc-icon-by"><img src="/images/deed/svg/attribution_icon_white.svg" alt="Attribution" /></span><span class="cc-icon-sa"><img src="/images/deed/svg/sa_white.svg" alt="Share Alike" /></span></div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>Attribution-ShareAlike 4.0 International</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this license are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<div class="shaded">
+<p>Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.</p>
+</div>
+<div class="shaded">
+<p><strong>Using Creative Commons Public Licenses</strong></p>
+<p>Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.</p>
+<p class="usage-considerations"><strong>Considerations for licensors:</strong> Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. <a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors">More considerations for licensors.</a></p>
+<p class="usage-considerations"><strong>Considerations for the public:</strong> By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable.
+<a href="//wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees">More considerations for the public.</a></p>
+</div>
+<h3>Creative Commons Attribution-ShareAlike 4.0 International Public License</h3>
+<p>By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.</p>
+<p id="s1"><strong>Section 1 – Definitions.</strong></p>
+<ol type="a">
+<li id="s1a"><strong>Adapted Material</strong> means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.</li>
+<li id="s1b"><strong>Adapter's License</strong> means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.</li>
+<li id="s1c"><strong>BY-SA Compatible License</strong> means a license listed at <a href="//creativecommons.org/compatiblelicenses"> creativecommons.org/compatiblelicenses</a>, approved by Creative Commons as essentially the equivalent of this Public License.</li>
+<li id="s1d"><strong>Copyright and Similar Rights</strong> means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section <a href="#s2b">2(b)(1)-(2)</a> are not Copyright and Similar Rights.</li>
+<li id="s1e"><strong>Effective Technological Measures</strong> means those measures that, in the absence of proper authority, may not
+be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar
+international agreements.</li>
+<li id="s1f"><strong>Exceptions and Limitations</strong> means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.</li>
+<li id="s1g"><strong>License Elements</strong> means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution and ShareAlike.</li>
+<li id="s1h"><strong>Licensed Material</strong> means the artistic or literary work, database, or other material to which the Licensor applied this Public License.</li>
+<li id="s1i"><strong>Licensed Rights</strong> means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.</li>
+<li id="s1j"><strong>Licensor</strong> means the individual(s) or entity(ies) granting rights under this Public License.</li>
+<li id="s1k"><strong>Share</strong> means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.</li>
+<li id="s1l"><strong>Sui Generis Database Rights</strong> means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.</li>
+<li id="s1m"><strong>You</strong> means the individual or entity exercising the Licensed Rights under this Public License. <strong>Your</strong> has a corresponding meaning.</li>
+</ol>
+<p id="s2"><strong>Section 2 – Scope.</strong></p>
+<ol type="a">
+<li id="s2a"><strong>License grant</strong>.
+<ol>
+<li id="s2a1">Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
+<ol type="A">
+<li id="s2a1A">reproduce and Share the Licensed Material, in whole or in part; and</li>
+<li id="s2a1B">produce, reproduce, and Share Adapted Material.</li>
+</ol>
+<li id="s2a2"><span style="text-decoration: underline;">Exceptions and Limitations</span>. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.</li>
+<li id="s2a3"><span style="text-decoration: underline;">Term</span>. The term of this Public License is specified in Section <a href="#s6a">6(a)</a>.</li>
+<li id="s2a4"><span style="text-decoration: underline;">Media and formats; technical modifications allowed</span>. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section <a href="#s2a4">2(a)(4)</a> never produces Adapted Material.</li>
+<li id="s2a5"><span style="text-decoration: underline;">Downstream recipients</span>.
+<div class="para">
+<ol type="A">
+<li id="s2a5A"><span style="text-decoration: underline;">Offer from the Licensor – Licensed Material</span>. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.</li>
+<li id="s2a5B"><span style="text-decoration: underline;">Additional offer from the Licensor – Adapted Material</span>. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.</li>
+<li id="s2a5C"><span style="text-decoration: underline;">No downstream restrictions</span>. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.</li>
+</ol>
+</div>
+<li id="s2a6"><span style="text-decoration: underline;">No endorsement</span>. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section <a href="#s3a1Ai">3(a)(1)(A)(i)</a>.</li>
+</ol>
+<li id="s2b"><p><strong>Other rights</strong>.</p>
+<ol>
+<li id="s2b1">Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.</li>
+<li id="s2b2">Patent and trademark rights are not licensed under this Public License.</li>
+<li id="s2b3">To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.</li>
+</ol>
+</li>
+</ol>
+<p id="s3"><strong>Section 3 – License Conditions.</strong></p>
+<p>Your exercise of the Licensed Rights is expressly made subject to the following conditions.</p>
+<ol type="a">
+<li id="s3a"><p><strong>Attribution</strong>.</p>
+<ol>
+<li id="s3a1"><p>If You Share the Licensed Material (including in modified form), You must:</p>
+<ol type="A">
+<li id="s3a1A">retain the following if it is supplied by the Licensor with the Licensed Material:
+<ol type="i">
+<li id="s3a1Ai">identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);</li>
+<li id="s3a1Aii">a copyright notice;</li>
+<li id="s3a1Aiii">a notice that refers to this Public License; </li>
+<li id="s3a1Aiv">a notice that refers to the disclaimer of warranties;</li>
+<li id="s3a1Av">a URI or hyperlink to the Licensed Material to the extent reasonably practicable;</li>
+</ol>
+<li id="s3a1B">indicate if You modified the Licensed Material and retain an indication of any previous modifications; and</li>
+<li id="s3a1C">indicate the Licensed Material is licensed under this Public License,
+and include the text of, or the URI or hyperlink to, this Public
+License.</li>
+</ol>
+</li>
+<li id="s3a2">You may satisfy the conditions in Section <a href="#s3a1">3(a)(1)</a> in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.</li>
+<li id="s3a3">If requested by the Licensor, You must remove any of the information required by Section <a href="#s3a1A">3(a)(1)(A)</a> to the extent reasonably practicable.</li>
+</ol>
+</li>
+<li id="s3b"><strong>ShareAlike</strong>.
+<p>In addition to the conditions in Section <a href="#s3a">3(a)</a>, if You Share Adapted Material You produce, the following conditions also apply.</p>
+<ol>
+<li id="s3b1">The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-SA Compatible License.</li>
+<li id="s3b2">You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.</li>
+<li id="s3b3">You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.</li>
+</ol>
+</li>
+</ol>
+<p id="s4"><strong>Section 4 – Sui Generis Database Rights.</strong></p>
+<p>Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:</p>
+<ol type="a">
+<li id="s4a">for the avoidance of doubt, Section <a href="#s2a1">2(a)(1)</a> grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;</li>
+<li id="s4b">if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section <a href="#s3b">3(b)</a>; and</li>
+<li id="s4c">You must comply with the conditions in Section <a href="#s3a">3(a)</a> if You Share all or a substantial portion of the contents of the database.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s4">4</a> supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
+<p id="s5"><strong>Section 5 – Disclaimer of Warranties and Limitation of Liability.</strong></p>
+<ol style="font-weight: bold;" type="a">
+<li id="s5a"><strong>Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.</strong></li>
+<li id="s5b"><strong>To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.</strong></li>
+</ol>
+<ol start="3" type="a">
+<li id="s5c">The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.</li>
+</ol>
+<p id="s6"><strong>Section 6 – Term and Termination.</strong></p>
+<ol type="a">
+<li id="s6a">This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.</li>
+<li id="s6b">
+<p>Where Your right to use the Licensed Material has terminated under Section <a href="#s6a">6(a)</a>, it reinstates:</p>
+<ol>
+<li id="s6b1">automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or</li>
+<li id="s6b2">upon express reinstatement by the Licensor.</li>
+</ol>
+For the avoidance of doubt, this Section <a href="#s6b">6(b)</a> does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.</li>
+<li id="s6c">For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.</li>
+<li id="s6d">Sections <a href="#s1">1</a>, <a href="#s5">5</a>, <a href="#s6">6</a>, <a href="#s7">7</a>, and <a href="#s8">8</a> survive termination of this Public License.</li>
+</ol>
+<p id="s7"><strong>Section 7 – Other Terms and Conditions.</strong></p>
+<ol type="a">
+<li id="s7a">The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.</li>
+<li id="s7b">Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.</li>
+</ol>
+<p id="s8"><strong>Section 8 – Interpretation.</strong></p>
+<ol type="a">
+<li id="s8a">For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.</li>
+<li id="s8b">To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.</li>
+<li id="s8c">No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.</li>
+<li id="s8d">Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.</li>
+</ol>
+
+<p class="shaded">Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the <a href="//creativecommons.org/publicdomain/zero/1.0/legalcode">CC0 Public Domain Dedication</a>. Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at <a href="//creativecommons.org/policies">creativecommons.org/policies</a>, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.<br><br>
+Creative Commons may be contacted at <a href="//creativecommons.org/">creativecommons.org</a>.</p>
+<p class="shaded"><a id="languages"></a>Additional languages available:
+
+<a href="/licenses/by-sa/4.0/legalcode.ar">العربية</a>,
+<a href="/licenses/by-sa/4.0/legalcode.cs">čeština</a>,
+<a href="/licenses/by-sa/4.0/legalcode.de">Deutsch</a>,
+<a href="/licenses/by-sa/4.0/legalcode.el">Ελληνικά</a>,
+<a href="/licenses/by-sa/4.0/legalcode.es">Español</a>,
+<a href="/licenses/by-sa/4.0/legalcode.eu">euskara</a>,
+<a href="/licenses/by-sa/4.0/legalcode.fi">suomeksi</a>,
+<a href="/licenses/by-sa/4.0/legalcode.fr">français</a>,
+<a href="/licenses/by-sa/4.0/legalcode.hr">hrvatski</a>,
+<a href="/licenses/by-sa/4.0/legalcode.id">Bahasa Indonesia</a>,
+<a href="/licenses/by-sa/4.0/legalcode.it">italiano</a>,
+<a href="/licenses/by-sa/4.0/legalcode.ja">日本語</a>,
+<a href="/licenses/by-sa/4.0/legalcode.ko">한국어</a>,
+<a href="/licenses/by-sa/4.0/legalcode.lt">Lietuvių</a>,
+<a href="/licenses/by-sa/4.0/legalcode.lv">latviski</a>,
+<a href="/licenses/by-sa/4.0/legalcode.mi">te reo Māori</a>,
+<a href="/licenses/by-sa/4.0/legalcode.nl">Nederlands</a>,
+<a href="/licenses/by-sa/4.0/legalcode.no">norsk</a>,
+<a href="/licenses/by-sa/4.0/legalcode.pl">polski</a>,
+<a href="/licenses/by-sa/4.0/legalcode.pt">português</a>,
+<a href="/licenses/by-sa/4.0/legalcode.ro">română</a>,
+<a href="/licenses/by-sa/4.0/legalcode.ru">русский</a>,
+<a href="/licenses/by-sa/4.0/legalcode.sl">Slovenščina</a>,
+<a href="/licenses/by-sa/4.0/legalcode.sv">svenska</a>,
+<a href="/licenses/by-sa/4.0/legalcode.tr">Türkçe</a>,
+<a href="/licenses/by-sa/4.0/legalcode.uk">українська</a>,
+<a href="/licenses/by-sa/4.0/legalcode.zh-Hans">中文</a>,
+<a href="/licenses/by-sa/4.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+
+<div class="site-footer-wrapper">
+<footer id="colophon" class="site-footer sticky-nav-main" role="contentinfo">
+<div class="cc-footer">
+<div class="column cc-footer-main">
+<div class="cc-footer-logo">
+<a href="https://creativecommons.org/" class="custom-logo-link" rel="home" itemprop="url"><img src="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png" class="custom-logo" alt="cc.logo.white" itemprop="logo" srcset="https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_.png 980w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-300x73.png 300w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-768x188.png 768w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-140x34.png 140w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-50x12.png 50w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-270x66.png 270w, https://creativecommons.org/wp-content/uploads/2016/06/cc.logo_.white_-245x60.png 245w" sizes="(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px" height="240" width="980"></a>
+</div>
+<div class="cc-footer-links">
+<div class="menu-footer-links-container">
+<ul id="menu-footer-links" class="menu">
+<li id="menu-item-48794" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48794"><a href="https://creativecommons.org/about/contact/">Contact</a></li>
+<li id="menu-item-48795" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48795"><a href="https://creativecommons.org/privacy/">Privacy</a></li>
+<li id="menu-item-48796" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48796"><a href="https://creativecommons.org/policies/">Policies</a></li>
+<li id="menu-item-48797" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-48797"><a href="https://creativecommons.org/terms/">Terms</a></li>
+</ul>
+</div>
+</div>
+</div>
+<div class="column cc-footer-contact">
+<h6><a href="https://creativecommons.org/about/contact">We'd love to hear from you!</a></h6>
+<address>
+Creative Commons<br>
+PO Box 1866, Mountain View, CA 94042
+</address>
+<ul>
+<li><a href="mailto:info@creativecommons.org" class="mail">info@creativecommons.org</a></li>
+<li><a href="https://creativecommons.org/faq">Frequently Asked Questions</a></li>
+</ul>
+</div>
+<div class="column cc-footer-license">
+<div class="license-icons">
+<a rel="license" href="https://creativecommons.org/licenses/by/4.0/" title="Creative Commons Attribution 4.0 International license">
+<i class="cc-icon-cc"></i>
+<i class="cc-icon-cc-by"></i>
+</a>
+</div>
+<aside>
+<div xmlns:cc="https://creativecommons.org/ns#" about="https://creativecommons.org">
+<p>Except where otherwise <a class="subfoot" href="https://creativecommons.org/policies#license">noted</a>, content on this site is licensed under a <a class="subfoot" href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International license</a>. <a class="subfoot" href="https://creativecommons.org/website-icons" target="blank">Icons</a> by The Noun Project.</p>
+</div>
+</aside>
+</div>
+</div>
+</footer>
+</div>
+<script type='text/javascript'>
+ /* <![CDATA[ */
+ var screenReaderText = {"expand":"expand child menu","collapse":"collapse child menu"};
+ /* ]]> */
+</script>
+<script type='text/javascript' src='https://creativecommons.org/wp-content/themes/twentysixteen/js/functions.js'></script>
+<script type='text/javascript' src='/includes/legalcode.js'></script>
+
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/license-texts/doclicense-CC-zero-1.0-latex.html b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-zero-1.0-latex.html
new file mode 100644
index 0000000000..6f1bb597c9
--- /dev/null
+++ b/macros/latex/contrib/doclicense/license-texts/doclicense-CC-zero-1.0-latex.html
@@ -0,0 +1,200 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Creative Commons Legal Code</title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" type="text/css" href="//creativecommons.org/includes/deed3.css" media="screen" />
+<link rel="stylesheet" type="text/css" href="//creativecommons.org/includes/deed3-print.css" media="print" />
+<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="https://creativecommons.org/includes/deed3-ie.css" media="screen" /><![endif]-->
+<script type="text/javascript" src="https://creativecommons.org/includes/errata.js">
+</script>
+</head>
+<body>
+<p align="center" id="header"><a href="//creativecommons.org/">Creative Commons</a></p>
+
+<div id="deed" class="green">
+<div id="deed-head">
+<div id="cc-logo">
+<img src="//creativecommons.org/images/deed/cc-logo.jpg" alt="" />
+</div>
+<h1><span>Creative Commons Legal Code</span></h1>
+<div id="deed-license">
+<h2>CC0 1.0 Universal</h2>
+</div>
+</div>
+<div id="deed-main">
+<div id="deed-main-content">
+<img src="//creativecommons.org/images/international/unported.png" alt="" />
+<div id="deed-disclaimer">
+<div class="summary">
+Official translations of this legal tool are available <a href="#languages">in other languages</a>.
+</div>
+</div>
+<blockquote>
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT
+PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES
+NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS
+PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE
+COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS
+DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND
+DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF
+THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+HEREUNDER.
+</blockquote>
+<h3><em>Statement of Purpose</em></h3>
+<p>The laws of most jurisdictions throughout the world
+automatically confer exclusive Copyright and Related Rights
+(defined below) upon the creator and subsequent owner(s) (each
+and all, an "owner") of an original work of authorship and/or
+a database (each, a "Work").</p>
+<p>Certain owners wish to permanently relinquish those rights
+to a Work for the purpose of contributing to a commons of
+creative, cultural and scientific works ("Commons") that the
+public can reliably and without fear of later claims of
+infringement build upon, modify, incorporate in other works,
+reuse and redistribute as freely as possible in any form
+whatsoever and for any purposes, including without limitation
+commercial purposes. These owners may contribute to the
+Commons to promote the ideal of a free culture and the further
+production of creative, cultural and scientific works, or to
+gain reputation or greater distribution for their Work in part
+through the use and efforts of others.</p>
+<p>For these and/or other purposes and motivations, and
+without any expectation of additional consideration or
+compensation, the person associating CC0 with a Work (the
+"Affirmer"), to the extent that he or she is an owner of
+Copyright and Related Rights in the Work, voluntarily elects
+to apply CC0 to the Work and publicly distribute the Work
+under its terms, with knowledge of his or her Copyright and
+Related Rights in the Work and the meaning and intended legal
+effect of CC0 on those rights.</p>
+<p><strong>1. Copyright and Related Rights.</strong>
+A Work made available under CC0 may be protected by
+copyright and related or neighboring rights ("Copyright and
+ Related Rights"). Copyright and Related Rights include, but
+are not limited to, the following:
+</p>
+<ol type="i">
+<li>the right to reproduce, adapt, distribute, perform,
+display, communicate, and translate a Work;</li>
+<li> moral rights retained by the original author(s) and/or
+performer(s);</li>
+<li>publicity and privacy rights pertaining to a person's
+image or likeness depicted in a Work;</li>
+<li>rights protecting against unfair competition in regards
+to a Work, subject to the limitations in paragraph 4(a),
+below;</li>
+<li>rights protecting the extraction, dissemination, use and
+reuse of data in a Work;</li>
+<li>database rights (such as those arising under Directive
+96/9/EC of the European Parliament and of the Council of 11
+March 1996 on the legal protection of databases, and under
+any national implementation thereof, including any amended
+or successor version of such directive); and</li>
+<li>other similar, equivalent or corresponding rights
+throughout the world based on applicable law or treaty, and
+any national implementations thereof.</li>
+</ol>
+<p><strong>2. Waiver.</strong> To the greatest extent
+permitted by, but not in contravention of, applicable law,
+Affirmer hereby overtly, fully, permanently, irrevocably and
+unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims
+and causes of action, whether now known or unknown (including
+existing as well as future claims and causes of action), in
+the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty
+(including future time extensions), (iii) in any current or
+future medium and for any number of copies, and (iv) for any
+purpose whatsoever, including without limitation commercial,
+advertising or promotional purposes (the "Waiver"). Affirmer
+makes the Waiver for the benefit of each member of the public
+at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be
+subject to revocation, rescission, cancellation, termination,
+or any other legal or equitable action to disrupt the quiet
+enjoyment of the Work by the public as contemplated by
+Affirmer's express Statement of Purpose.
+</p>
+<p><strong>3. Public License Fallback.</strong> Should any
+part of the Waiver for any reason be judged legally invalid or
+ineffective under applicable law, then the Waiver shall be
+preserved to the maximum extent permitted taking into account
+Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each
+affected person a royalty-free, non transferable, non
+sublicensable, non exclusive, irrevocable and unconditional
+license to exercise Affirmer's Copyright and Related Rights
+in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty
+(including future time extensions), (iii) in any current or
+future medium and for any number of copies, and (iv) for any
+purpose whatsoever, including without limitation commercial,
+advertising or promotional purposes (the "License"). The
+License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the
+License for any reason be judged legally invalid or
+ineffective under applicable law, such partial invalidity or
+ineffectiveness shall not invalidate the remainder of the
+License, and in such case Affirmer hereby affirms that he or
+she will not (i) exercise any of his or her remaining
+Copyright and Related Rights in the Work or (ii) assert any
+associated claims and causes of action with respect to the
+Work, in either case contrary to Affirmer's express Statement
+of Purpose.</p>
+<p><strong>4. Limitations and Disclaimers.</strong></p>
+<ol type="a">
+<li>No trademark or patent rights held by Affirmer are
+waived, abandoned, surrendered, licensed or otherwise
+affected by this document.</li>
+<li>Affirmer offers the Work as-is and makes no
+representations or warranties of any kind concerning the
+Work, express, implied, statutory or otherwise, including
+without limitation warranties of title, merchantability,
+fitness for a particular purpose, non infringement, or the
+absence of latent or other defects, accuracy, or the present
+or absence of errors, whether or not discoverable, all to
+the greatest extent permissible under applicable law.</li>
+<li>Affirmer disclaims responsibility for clearing rights of
+other persons that may apply to the Work or any use thereof,
+including without limitation any person's Copyright and
+Related Rights in the Work. Further, Affirmer disclaims
+responsibility for obtaining any necessary consents,
+permissions or other rights required for any use of the
+Work.</li>
+<li>Affirmer understands and acknowledges that Creative
+Commons is not a party to this document and has no duty or
+obligation with respect to this CC0 or use of the Work.</li>
+</ol>
+
+<blockquote><a id="languages"></a>Additional languages available:
+
+<a href="/publicdomain/zero/1.0/legalcode.el">Ελληνικά</a>,
+<a href="/publicdomain/zero/1.0/legalcode.es">Español</a>,
+<a href="/publicdomain/zero/1.0/legalcode.eu">euskara</a>,
+<a href="/publicdomain/zero/1.0/legalcode.fi">suomeksi</a>,
+<a href="/publicdomain/zero/1.0/legalcode.fr">français</a>,
+<a href="/publicdomain/zero/1.0/legalcode.it">italiano</a>,
+<a href="/publicdomain/zero/1.0/legalcode.ja">日本語</a>,
+<a href="/publicdomain/zero/1.0/legalcode.ko">한국어</a>,
+<a href="/publicdomain/zero/1.0/legalcode.lt">Lietuvių</a>,
+<a href="/publicdomain/zero/1.0/legalcode.lv">latviski</a>,
+<a href="/publicdomain/zero/1.0/legalcode.nl">Nederlands</a>,
+<a href="/publicdomain/zero/1.0/legalcode.pl">polski</a>,
+<a href="/publicdomain/zero/1.0/legalcode.ro">română</a>,
+<a href="/publicdomain/zero/1.0/legalcode.sl">Slovenščina</a>,
+<a href="/publicdomain/zero/1.0/legalcode.sv">svenska</a>,
+<a href="/publicdomain/zero/1.0/legalcode.zh-Hans">中文</a>,
+<a href="/publicdomain/zero/1.0/legalcode.zh-Hant">華語</a>.
+
+Please read the <a href="/faq/#officialtranslations">FAQ</a> for more information about official translations.</blockquote>
+</div>
+</div>
+<div id="deed-foot">
+<p id="footer"><a href="./">« Back to Commons Deed</a></p>
+</div>
+</div>
+</body>
+</html>
diff --git a/macros/latex/contrib/doclicense/manifest.txt b/macros/latex/contrib/doclicense/manifest.txt
new file mode 100644
index 0000000000..424cae1e28
--- /dev/null
+++ b/macros/latex/contrib/doclicense/manifest.txt
@@ -0,0 +1,143 @@
+% SPDX-FileCopyrightText: 2021 Robin Schneider <ypid@riseup.net>
+%
+% SPDX-License-Identifier: LPPL-1.3c
+%
+% This work consists of all files listed in this file (manifest.txt).
+% For more details about the licensing, refer to the README.md file.
+
+% This work consists of the files:
+doclicense/Makefile
+doclicense/README.md
+doclicense/doclicense-UKenglish.ldf
+doclicense/doclicense-USenglish.ldf
+doclicense/doclicense-acadian.ldf
+doclicense/doclicense-american.ldf
+doclicense/doclicense-australian.ldf
+doclicense/doclicense-brazilian.ldf
+doclicense/doclicense-british.ldf
+doclicense/doclicense-bulgarian.ldf
+doclicense/doclicense-canadian.ldf
+doclicense/doclicense-canadien.ldf
+doclicense/doclicense-catalan.ldf
+doclicense/doclicense-chinese-gbk.ldf
+doclicense/doclicense-chinese-utf8.ldf
+doclicense/doclicense-english.ldf
+doclicense/doclicense-french.ldf
+doclicense/doclicense-galician.ldf
+doclicense/doclicense-german.ldf
+doclicense/doclicense-italian.ldf
+doclicense/doclicense-japanese.ldf
+doclicense/doclicense-marathi.ldf
+doclicense/doclicense-newzealand.ldf
+doclicense/doclicense-ngerman.ldf
+doclicense/doclicense-polish.ldf
+doclicense/doclicense-portuguese.ldf
+doclicense/doclicense-russian.ldf
+doclicense/doclicense-spanish.ldf
+doclicense/doclicense.dtx
+doclicense/doclicense.ins
+doclicense/images/doclicense-CC-by-80x15.eps
+doclicense/images/doclicense-CC-by-80x15.pdf
+doclicense/images/doclicense-CC-by-88x31.eps
+doclicense/images/doclicense-CC-by-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-80x15.eps
+doclicense/images/doclicense-CC-by-nc-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-88x31.eps
+doclicense/images/doclicense-CC-by-nc-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-eu-88x31.eps
+doclicense/images/doclicense-CC-by-nc-eu-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-nd-80x15.eps
+doclicense/images/doclicense-CC-by-nc-nd-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-nd-88x31.eps
+doclicense/images/doclicense-CC-by-nc-nd-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-nd-eu-88x31.eps
+doclicense/images/doclicense-CC-by-nc-nd-eu-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-nd-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-nc-nd-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-nd-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-nc-nd-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-sa-80x15.eps
+doclicense/images/doclicense-CC-by-nc-sa-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-sa-88x31.eps
+doclicense/images/doclicense-CC-by-nc-sa-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-sa-eu-88x31.eps
+doclicense/images/doclicense-CC-by-nc-sa-eu-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-sa-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-nc-sa-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-sa-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-nc-sa-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-by-nc-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-nc-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-nc-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-nc-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-by-nd-80x15.eps
+doclicense/images/doclicense-CC-by-nd-80x15.pdf
+doclicense/images/doclicense-CC-by-nd-88x31.eps
+doclicense/images/doclicense-CC-by-nd-88x31.pdf
+doclicense/images/doclicense-CC-by-nd-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-nd-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-nd-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-nd-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-by-sa-80x15.eps
+doclicense/images/doclicense-CC-by-sa-80x15.pdf
+doclicense/images/doclicense-CC-by-sa-88x31.eps
+doclicense/images/doclicense-CC-by-sa-88x31.pdf
+doclicense/images/doclicense-CC-by-sa-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-sa-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-sa-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-sa-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-by-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-by-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-by-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-by-unofficial-mr-88x31.pdf
+doclicense/images/doclicense-CC-cc-zero-unofficial-mr-80x15.eps
+doclicense/images/doclicense-CC-cc-zero-unofficial-mr-80x15.pdf
+doclicense/images/doclicense-CC-zero-80x15.eps
+doclicense/images/doclicense-CC-zero-80x15.pdf
+doclicense/images/doclicense-CC-zero-88x31.eps
+doclicense/images/doclicense-CC-zero-88x31.pdf
+doclicense/images/doclicense-CC-zero-unofficial-mr-88x31.eps
+doclicense/images/doclicense-CC-zero-unofficial-mr-88x31.pdf
+doclicense/license-texts/doclicense-CC-by-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-nd-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-nd-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-sa-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nc-sa-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nd-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nd-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-nd-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-nd-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.html
+doclicense/license-texts/doclicense-CC-by-sa-3.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-sa-3.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.html
+doclicense/license-texts/doclicense-CC-by-sa-4.0-latex.tex
+doclicense/license-texts/doclicense-CC-by-sa-4.0-plaintext.tex
+doclicense/license-texts/doclicense-CC-zero-1.0-latex.html
+doclicense/license-texts/doclicense-CC-zero-1.0-latex.tex
+doclicense/license-texts/doclicense-CC-zero-1.0-plaintext.tex
+doclicense/manifest.txt
+% and the derived files:
+doclicense.sty
+doclicense.pdf
diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.pdf b/macros/latex/contrib/easybook/doc/easybook-demo.pdf
index 2cccc3ed38..0217ebec00 100644
--- a/macros/latex/contrib/easybook/doc/easybook-demo.pdf
+++ b/macros/latex/contrib/easybook/doc/easybook-demo.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/doc/easybook-demo.tex b/macros/latex/contrib/easybook/doc/easybook-demo.tex
index 621c21ece2..9ad0b579c1 100644
--- a/macros/latex/contrib/easybook/doc/easybook-demo.tex
+++ b/macros/latex/contrib/easybook/doc/easybook-demo.tex
@@ -97,7 +97,7 @@
\url{https://latexstudio.net} \\
\url{https://gitee.com/texl3/easybook}\thanks{Gitee为项目的主要发布地址。}
}
-\date{2021/03/13\hskip\ccwd\relax v1.23p}
+\date{2021/03/14\hskip\ccwd\relax v1.23q}
\frontmatter[roman]
\maketitle
diff --git a/macros/latex/contrib/easybook/doc/easybook.pdf b/macros/latex/contrib/easybook/doc/easybook.pdf
index 32776a80be..25192edcd6 100644
--- a/macros/latex/contrib/easybook/doc/easybook.pdf
+++ b/macros/latex/contrib/easybook/doc/easybook.pdf
Binary files differ
diff --git a/macros/latex/contrib/easybook/doc/easybook.tex b/macros/latex/contrib/easybook/doc/easybook.tex
index 0b20284e28..b8b375c333 100644
--- a/macros/latex/contrib/easybook/doc/easybook.tex
+++ b/macros/latex/contrib/easybook/doc/easybook.tex
@@ -2,7 +2,7 @@
\title{\sffamily easybook书籍文档类}
\author{瞿毅}
-\date{2021/03/13\hskip\ccwd\relax v1.23p\thanks{\url{https://gitee.com/texl3/easybook}}}
+\date{2021/03/14\hskip\ccwd\relax v1.23q\thanks{\url{https://gitee.com/texl3/easybook}}}
\begin{document}
\maketitle
@@ -98,7 +98,7 @@
\tn{printindex}\oarg{索引名}
\end{syntax}
\tn{frontmatter} 为前言区命令,章标题不编号,页码可设置为例如 \opt{roman}、\opt{Alph} 等格式,带有星号的命令 \tn{frontmatter*} 不使用 \tn{cleardoublepage}。\tn{mainmatter} 为主文区命令,章标题正常编号且页码为从1开始计数的阿拉伯数字,\tn{mainmatter*} 命令不使用 \tn{cleardoublepage}。\tn{backmatter} 为后记区命令,页码格式与编号保持不变,章标题不编号。\tn{listoffigures} 命令输出图片目录,\tn{listoftables} 命令输出表格目录,\tn{listoflistings} 命令输出代码目录。
-\changes{v1.23p}{2021/02/20}{重新定义文档结构划分命令。}
+\changes{v1.23q}{2021/02/20}{重新定义文档结构划分命令。}
\end{function}
\section{接口选项}
@@ -132,8 +132,8 @@
\end{syntax}
\opt{style} 选项控制文章的风格。
\changes{v1.10}{2021/01/08}{更改颜色实现方式与选项名。}
-\changes{v1.23p}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。}
-\changes{v1.23p}{2021/02/09}{增加控制页面横线粗细的选项。}
+\changes{v1.23q}{2021/02/02}{noto风格的数学字体独立出来,可自定义设置。}
+\changes{v1.23q}{2021/02/09}{增加控制页面横线粗细的选项。}
\end{function}
\begin{optdesc}
@@ -190,7 +190,7 @@
\end{syntax}
行距因子用于设置各种行距倍数,只能是浮点数,不能带有长度单位。\tn{ctexset} 原有的行距选项\opt{linespread}失效。各行距既可在导言区全局设置也可正文中设置对后面生效,行距的意义为
\changes{v1.21}{2021/01/12}{增加脚注线间的距离选项。}
-\changes{v1.23p}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。}
+\changes{v1.23q}{2021/02/09}{取消使用 \pkg{zhlineskip} 宏包设置数学间距。}
\end{function}
\begin{optdesc}
@@ -211,7 +211,7 @@
marginpart = <\tn{rmfamily}\tn{footnotesize}>
\end{syntax}
\changes{v1.10}{2021/01/08}{加入自定义非正文字体选项。}
-\changes{v1.23p}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。}
+\changes{v1.23q}{2021/02/08}{修复使用 \tn{zihao} 命令设置字体失效的问题。}
\end{function}
\begin{optdesc}
@@ -229,10 +229,10 @@
bib-style = <(numerical)|authoryear|其它格式>
cite-style = <标注风格>
bibfile = <refs.bib>
- \tn{printbibliography}\oarg{选项列表}
+ \tn{printbibliography}\oarg{键值列表}
\end{syntax}
\changes{v1.21}{2021/01/11}{增加 \opt{bibset} 选项,可以使用 \hologo{BibTeX} 或 \hologo{biber} 编译参考文献。}
-\changes{v1.23p}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。}
+\changes{v1.23q}{2021/02/23}{使用 \opt{bibset} 选项时可设置标注风格。}
\end{function}
\begin{optdesc}
@@ -260,7 +260,7 @@
\tn{declaretheoremstyle}\oarg{键值列表}\marg{定理样式名}
\end{syntax}
\changes{v1.21}{2021/01/12}{增加配置定理环境样式的选项。}
-\changes{v1.23p}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
+\changes{v1.23q}{2021/03/12}{重新定义了新定理环境命令 \tn{newtheorem}。}
\end{function}
\begin{optdesc}
@@ -285,7 +285,7 @@
\end{optdesc}
\subsubsection{新的定理样式}
-定理由 \pkg{thmtools} 设置,自带定理的样式为 \opt{mythm},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样
+定理由 \pkg{thmtools} 设置,预置定理的样式为 \opt{mythm},上述定理样式选项将对这个定理样式生效。如果使用这个样式而只是增加新的定理名称,可以这样
\begin{ctexexam}
\newtheorem[style = mythm,name = 定理名]{定理环境名}
\end{ctexexam}
@@ -324,15 +324,20 @@
\end{function}
\subsection{页眉页脚}
-\begin{function}[EXP,added = 2021-01-13,updated = 2021-03-08]{hdrset/head-foot,hdrset/chap-mark,hdrset/sec-mark,\easyhead,\easyfoot,...}
+\begin{function}[EXP,added = 2021-01-13,updated = 2021-03-14]{hdrset/head-foot,hdrset/chap-mark,hdrset/sec-mark,hdrset/headrule,hdrset/footrule,hdrset/footnoterule,\easyhead,\easyfoot,...}
\begin{syntax}
head-foot = <页眉页脚中的内容>
chap-mark = <\tn{chaptermark} 标志命令 \tn{markboth} 中的内容>
sec-mark = <\tn{sectionmark} 标志命令 \tn{markright} 中的内容>
+ headrule = <页眉横线格式>
+ footrule = <页脚横线格式>
+ footnoterule = <脚注横线格式>
\tn{easyhead}\oarg{位置}\marg{内容}
\tn{easyfoot}\oarg{位置}\marg{内容}
\end{syntax}
\opt{hdrset} 设置的命令由 \pkg{fancyhdr} 宏包提供支持,命令 \tn{easyhead} 和 \tn{easyfoot} 的含义与 \tn{fancyhead} 和 \tn{fancyfoot} 相同,它们用于 \opt{head-foot} 选项中,设置的是一个名为 \opt{fancy} 的页面风格。\pkg{fancyhdr} 将页眉页脚分成了左中右和奇数页(odd)、偶数页(even)共12个部分,可选参数中E、O代表偶数、奇数,L、C、R代表左、中、右部分。单面打印时,含有偶数的选项无效。
+
+\opt{headrule}、\opt{footrule} 和 \opt{footnoterule} 三个横线选项一般可以使用 \tn{hrule} width \meta{长度} height \meta{高度} 命令来绘制,脚注横线默认为空。当然,手动绘制横线时线条粗细选项 \opt{style/rulewidth} 会失效。
\begin{ctexexam}
\ctexset
{
@@ -343,13 +348,16 @@
\easyhead[ER]{\leftmark}
\easyhead[OL]{\rightmark}
\easyhead[EL,OR]{\textbf{\thepage}}
- }
+ },
+ sec-mark = {\CTEXthesection\hspace{0.5\ccwd}},
+ headrule = {\hrule width \textwidth height 1pt}
}
}
\end{ctexexam}
\changes{v1.21}{2021/01/11}{修复单面文档时页眉横线消失的问题。}
\changes{v1.21}{2021/01/13}{增加配置页眉页脚的选项。}
-\changes{v1.23p}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。}
+\changes{v1.23q}{2021/03/08}{优化页眉页脚设置,增加 \opt{chap-mark} 和 \opt{sec-mark} 选项。}
+\changes{v1.23q}{2021/03/14}{可以手动绘制页眉、页脚和脚注的横线。}
\end{function}
\subsection{目录样式}
@@ -404,7 +412,7 @@
\tn{item} <列表内容>
\tn{end}\marg{环境名}
\end{syntax}
-\pkg{enumitem} 宏包为系统自带的列表环境提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已设置默认格式,若自定义标签可例如
+\pkg{enumitem} 宏包为系统预置的列表环境提供了更灵活的标签以及间距的控制,可使用 \tn{setlist} 命令设置原有的三种列表格式。已设置默认格式,若自定义标签可例如
\begin{ctexexam}
\begin{enumerate}[label = \arabic*(a),leftmargin = 1cm,resume]
\begin{itemize}[label = \textbullet]
@@ -445,7 +453,7 @@
<定理内容>
\tn{end}\marg{环境名}
\end{syntax}
-这些是默认自带的定理环境,定理环境除了注和证明跟随章编号并可带有边框,边框和习题标题盒子可使用 \opt{thmbox = false} 开启,证明末尾会自动添加证明结束符。
+这些是预置的定理环境,定理环境除了注和证明跟随章编号并可带有边框,边框和习题标题盒子可使用 \opt{thmbox = false} 开启,证明末尾会自动添加证明结束符。
\end{function}
\subsection{习题}
@@ -463,11 +471,11 @@
\item 习题内容
\end{exercise}
\end{ctexexam}
-\changes{v1.23p}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
+\changes{v1.23q}{2021/02/08}{增加准确的习题盒子标题目录锚点。}
\end{function}
\subsection{盒子}
-盒子以及小节 \ref{exercise} 中 \opt{exercise} 环境配置的选项由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,一些配置会覆盖之前的默认设置。
+盒子以及小节 \ref{exercise} 中 \opt{exercise} 环境配置的选项由 \pkg{tcolorbox} 提供支持,具体选项可见宏包文档的 Option Keys 一节,可以进行边距、字体及背景颜色等各种个性化设置,一些配置会覆盖之前预置的设置。
\subsubsection{摘要盒子}
\begin{function}[added = 2021-01-05,updated = 2021-03-13]{outline}
@@ -511,7 +519,7 @@
设置了两个参数选项相同的行内盒子,盒子 \opt{concise} 为抄录盒子有三个参数,行内盒子内容是必选参数其他可选。盒子 \opt{fuzzy} 也是抄录盒子,具有模糊边缘类似高亮的效果。
\end{function}
-\section{其它格式}
+\section{其它用法}
\subsection{代码}
\begin{function}[added = 2021-01-05]{\lstinline,lstlisting,\listoflistings}
@@ -585,7 +593,35 @@
\begin{syntax}
\tn{marginnote}\oarg{左文本}\marg{右文本}\oarg{垂直偏移}
\end{syntax}
-命令 \tn{marginnote} 可以生成简单的边注,如果只给定了\meta{右文本},那么边注在奇偶数页文字相同。如果同时给定了\meta{左文本},则偶数页使用\meta{左文本}的文字。
+命令 \tn{marginnote} 可以生成简单的边注,如果只给定了 \meta{右文本},那么边注在奇偶数页文字相同。如果同时给定了 \meta{左文本},则偶数页使用 \meta{左文本} 的文字。
+\end{function}
+
+\subsection{插入文档}
+\begin{function}[added = 2021-03-14]{\includepdf}
+\begin{syntax}
+ \tn{includepdf}\oarg{键值列表}\marg{文档名}
+\end{syntax}
+该命令由 \pkg{pdfpages} 提供,将其他 pdf 文档插入当前文档,可以指定插入页数、逻辑页和横向等,详情查看宏包文档。
+\end{function}
+
+\subsection{横向页面}
+\begin{function}[added = 2021-03-14]{sidewaysfigure,sidewaystable}
+\begin{syntax}
+ \tn{begin}\marg{环境名}\oarg{位置}
+ <插入图片或表格>
+ \tn{end}\marg{环境名}
+\end{syntax}
+该环境由 \pkg{rotfloat} 提供,用于横向插入宽大的图片或表格,用法与 \opt{figure} 和 \opt{table} 环境类似。
+\end{function}
+
+\subsection{指定行距的段落}
+\begin{function}[added = 2021-03-14]{spacing}
+\begin{syntax}
+ \tn{begin}\marg{spacing}\marg{浮点数}
+ <段落内容>
+ \tn{end}\marg{spacing}
+\end{syntax}
+该环境由 \pkg{setspace} 提供,可以指定环境内段落的行距,使用浮点数控制行距倍数。
\end{function}
\IndexLayout
diff --git a/macros/latex/contrib/easybook/easybook.cls b/macros/latex/contrib/easybook/easybook.cls
index a1a78fa847..cfb30bc1ca 100644
--- a/macros/latex/contrib/easybook/easybook.cls
+++ b/macros/latex/contrib/easybook/easybook.cls
@@ -9,7 +9,7 @@
%% https://creativecommons.org/licenses/by/4.0/legalcode
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{l3keys2e}
-\ProvidesExplClass{easybook}{2021/03/13}{1.23p}{}
+\ProvidesExplClass{easybook}{2021/03/14}{1.23q}{}
\cs_generate_variant:Nn \keys_define:nn {nx}
\cs_generate_variant:Nn \int_to_arabic:n {v}
@@ -345,6 +345,21 @@
\CTEXthesection\hspace{0.5\ccwd}
\fi
}
+ },
+ headrule .tl_gset:N = \headrule,
+ headrule .initial:n =
+ {
+ \color{ctex@frame}\vspace{1.5pt}
+ \hrule width \textwidth height \l__rule_width_dim
+ },
+ footrule .tl_gset:N = \footrule,
+ footrule .initial:n = {},
+ footnoterule .tl_gset:N = \footnoterule,
+ footnoterule .initial:n =
+ {
+ \color{ctex@frame}
+ \hrule width 0.35\columnwidth height \l__rule_width_dim
+ \vspace*{2.6pt}\color{black}
}
}
\ctex_at_end_preamble:n
@@ -391,11 +406,6 @@
{\text_titlecase_first:n {\l__fancyhf_sec_mark_tl#1}}
}
}
- \cs_gset:Npn \headrule
- {
- \color{ctex@frame}\vspace{1.5pt}
- \hrule width\textwidth height \l__rule_width_dim
- }
\bool_if:NT \l__draft_bool
{
\bool_if:NTF \l__page_twoside_bool
@@ -629,7 +639,6 @@
\tl_new:N \l__font_figure_tl
\tl_new:N \l__font_listing_tl
\tl_new:N \l__font_footnote_tl
-\tl_new:N \l__font_marginpar_tl
\__ctex_define:nn {elfont}
{
@@ -641,7 +650,7 @@
listing-cap .initial:n = \sffamily\small,
footnote .tl_set:N = \l__font_footnote_tl,
footnote .initial:n = \rmfamily,
- marginpar .tl_set:N = \l__font_marginpar_tl,
+ marginpar .tl_set:N = \marginfont,
marginpar .initial:n = \rmfamily\footnotesize
}
@@ -1135,11 +1144,6 @@
\skip_gset:Nn \footnotesep{\ht\strutbox}
\group_end:
\cs_gset:Npn \hangfootparskip{0ex}
- \cs_gset:Npn \footnoterule
- {
- \color{ctex@frame}\hrule width 0.35\columnwidth height \l__rule_width_dim
- \vspace*{2.6pt}\color{black}
- }
\bool_if:NT \l__lang_chinese_bool
{\cs_gset:Npn \hangfootparindent{2\ccwd}}
\bool_if:NT \l__chap_withpart_bool
@@ -1163,7 +1167,6 @@
{\def\baselinestretch{\fp_use:N \l__spread_footnote_fp}\l__font_footnote_tl}
\__patch_cmd:Nnn \@makefnmark
{\normalfont}{\l__font_footnote_tl}
-\cs_gset:Npn \marginfont{\l__font_marginpar_tl}
\lstdefinestyle{mystyle}
{
diff --git a/macros/latex/contrib/hitreport/LICENSE b/macros/latex/contrib/hitreport/LICENSE
new file mode 100644
index 0000000000..2244313901
--- /dev/null
+++ b/macros/latex/contrib/hitreport/LICENSE
@@ -0,0 +1,416 @@
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % This work 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 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
diff --git a/macros/latex/contrib/hitreport/Makefile b/macros/latex/contrib/hitreport/Makefile
new file mode 100644
index 0000000000..08b80f62f9
--- /dev/null
+++ b/macros/latex/contrib/hitreport/Makefile
@@ -0,0 +1,63 @@
+# Makefile for HITReport
+
+PACKAGE = hitreport
+REPORT = hitreport-example
+
+SOURCES = $(PACKAGE).ins $(PACKAGE).dtx
+CLSFILE = dtx-style.sty $(PACKAGE).cls
+
+LATEXMK = latexmk
+SHELL := /bin/bash
+NPM ?= npm
+
+# make deletion work on Windows
+ifdef SystemRoot
+ RM = del /Q
+else
+ RM = rm -f
+endif
+
+.PHONY: all all-dev clean distclean dist report viewreport spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE
+
+report: $(REPORT).pdf
+
+all: report
+
+all-dev: doc all
+
+cls: $(CLSFILE)
+
+$(CLSFILE): $(SOURCES)
+ xetex $(PACKAGE).ins
+
+doc: $(PACKAGE).pdf
+
+$(PACKAGE).pdf: cls FORCE_MAKE
+ $(LATEXMK) $(PACKAGE).dtx
+
+$(REPORT).pdf: cls FORCE_MAKE
+ $(LATEXMK) $(REPORT)
+
+viewdoc: doc
+ $(LATEXMK) -pv $(PACKAGE).dtx
+
+viewreport: report
+ $(LATEXMK) -pv $(REPORT)
+
+
+clean:
+ $(LATEXMK) -c $(PACKAGE).dtx $(REPORT)
+
+cleanall: clean
+ -@$(RM) $(PACKAGE).pdf $(REPORT).pdf
+
+distclean: cleanall
+ -@$(RM) $(CLSFILE)
+ -@$(RM) -r dist
+
+
+dist: check all-dev
+ # use l3build for CTAN release (zip with .tds.zip)
+ l3build ctan --config build-ctan
+ # use gulp for GitHub release (zip with generated file)
+ $(NPM) run build -- --version=$(version)
diff --git a/macros/latex/contrib/hitreport/README.md b/macros/latex/contrib/hitreport/README.md
new file mode 100644
index 0000000000..86c012fea8
--- /dev/null
+++ b/macros/latex/contrib/hitreport/README.md
@@ -0,0 +1,150 @@
+[![Test](https://github.com/DemerzelSun12/hitreport/actions/workflows/test.yml/badge.svg)](https://github.com/DemerzelSun12/hitreport/actions/workflows/test.yml)
+[![GitHub release](https://img.shields.io/github/v/release/demerzelsun12/hitreport)](https://github.com/demerzelsun12/hitreport/releases/latest)
+
+# hitreport
+
+Scroll down for the English version of README.
+
+# What's hitreport
+
+**hitreport** stands for **H**arbin **I**nstitute of **T**echnology **Report** LaTeX Template.
+
+hitreport是为哈尔滨工业大学一校三区本科生设计的一个免于配置的作业、实验报告模板。希望它可以使你的作业/实验报告不会因形式上的缺陷导致评分的下降。
+
+该文档主要完成了除了主体内容以外的几乎**全部**工作。同时,通过使用 Github 版本宏包,你还可以更好的管理自己的 LaTeX 文档。
+
+## 安装方法
+
+推荐下载**发布版**模板,里面包括具体使用说明以及示例文档:
+
+* 模板使用说明 (hitreport.pdf)
+* 示例文档 (hitreport-example.pdf)
+
+为方便对 LaTeX 不熟悉的用户使用本模板,本模板的发布版也提供预生成的 `cls` 文件、文档和源码。如需使用稳定版本,请从 CTAN 下载(虽然还在申请中)。
+
+下载途径:
+
+* 发布版:
+ * CTAN:暂无,在申请中。
+ * [GitHub Releases](https://github.com/demerzelsun12/hitreport/releases):最新版的及时发布途径之一。
+ * [Gitee Releases](https://gitee.com/demerzel/hitreport/releases):最新版的及时发布途径之二。
+
+## 升级
+
+### 自动更新
+
+通过 TeX 发行版工具(如 `tlmgr`)自动从 [CTAN](https://www.ctan.org/pkg/hitreport) 更新。
+
+### 手动更新
+
+#### 发布版
+
+下载发布版的的 zip 包,使用其中的 `hitreport.cls` 等文件覆盖原有的即可,无须额外操作。
+
+#### 开发版
+
+从 GitHub clone 项目源码或者下载源码 zip 包,执行命令(Windows 用户在文件夹空白处按 `Shift + 鼠标右键`,点击“在此处打开命令行窗口”):
+
+```shell
+xetex hitreport.ins
+```
+
+即可得到 `hitreport.cls` 等模板文件。
+
+## 提问
+
+请在 Github Issues 上提出问题:
+
+* [GitHub Issues](https://github.com/demerzelsun12/hitreport/issues)
+
+## Makefile的用法
+
+```shell
+make [{report|doc|clean|cleanall|distclean}]
+```
+
+### 目标
+
+* `make report` 生成报告 hitreport-example.pdf;
+* `make doc` 生成模板使用说明书 hitreport.pdf;
+* `make clean` 删除示例文件的中间文件(不含 hitreport-example.pdf);
+* `make cleanall` 删除示例文件的中间文件和 hitreport-example.pdf;
+* `make distclean` 删除示例文件和模板的所有中间文件和 PDF。
+
+---
+
+## Contact
+
+如果你使用时发现任何 bug 或得不到的格式,可以联系我或开 issue
+如果你有更好的作业/报告格式,欢迎添加或联系我帮忙添加
+
+## License
+
+LaTeX Project Public License, Version 1.3c (LPPL-1.3c).
+
+# hitreport?
+
+**hitreport** stands for **H**arbin **I**nstitute of **T**echnology **Report** LaTeX Template.
+
+hitreport is an assignment and experiment report template free of configuration designed for undergraduates in the three campus of Harbin Institute of Technology. I hope it can prevent your homework/experiment report from falling down due to formal defects.
+
+This document mainly completes almost **all** work except the main document. At the same time, by using the Github version macro package, you can better manage your own LaTeX documents. An English translation of this README follows the Chinese below.
+
+**This template is subject to frequent changes. Please make sure you have read the usage documentation and example code completely and carefully before using and asking questions.**
+
+## Downloads
+
+**Publish versions** are recommended. Specific usage documentation and examples can be found in the archive. At present, these documents are <b>only available in Chinese</b>:
+
+* Template usage documentation (hitreport.pdf)
+* Template example (hitreport-example.pdf)
+
+For the convenience of users who are not familiar with latex to use this template all versions contain source code, pre-comlied `cls` file and documentations. No warranties are provided.
+
+* Published versions:
+ * CTAN:in application...
+ * [Github Releases](https://github.com/demerzelsun12/hitreport/releases) :
+ * [GitHub Releases](https://github.com/demerzelsun12/hitreport/releases):One of the methods for timely release of the latest version.
+ * [Gitee Releases](https://gitee.com/demerzel/hitreport/releases):Another method for timely release of the latest version.
+
+## Updates
+
+### Automic
+
+Get the most up-to-date published version with your TeX distribution from [CTAN](https://www.ctan.org/pkg/hitreport).
+
+### Manual
+
+#### Published
+
+Download the published zip files, extract `hitreport.cls` and other files (if needed) and override the existing ones in your report.
+
+#### Developer versions
+
+Download the source code package and unzip to the root dictionary of your report (or clone this project), then execute the command (Windows users `Shift + right click` white area in the file window and click "Open command line window here" from the popup menu):
+
+```shell
+xetex hitreport.ins
+```
+
+you'll get `hitreport.cls` along with other template files.
+
+## Reporting Issues
+
+Please report your issues on Github Issues:
+
+* [Github Issues](https://github.com/demerzelsun12/hitreport/issues)
+
+## Makefile Usage
+
+```shell
+make [{report|doc|clean|cleanall|distclean}]
+```
+
+### Targets
+
+* `make report` generate report
+* `make doc` generate template documentation
+* `make clean` delete all examples' files (excluding hitreport-example.pdf)
+* `make cleanall` delete all examples' files and hitreport-example.pdf
+* `make distclean` delete all examples' and templates' files and PDFs.
diff --git a/macros/latex/contrib/hitreport/data/abstract.tex b/macros/latex/contrib/hitreport/data/abstract.tex
new file mode 100644
index 0000000000..11770a0edd
--- /dev/null
+++ b/macros/latex/contrib/hitreport/data/abstract.tex
@@ -0,0 +1,22 @@
+% !TeX root = ../hitreport-example.tex
+
+% 中英文摘要和关键字
+
+\begin{abstract}
+ 论文的摘要是对论文研究内容和成果的高度概括。
+ 摘要应对论文所研究的问题及其研究目的进行描述,对研究方法和过程进行简单介绍,对研究成果和所得结论进行概括。
+ 摘要应具有独立性和自明性,其内容应包含与论文全文同等量的主要信息。
+ 使读者即使不阅读全文,通过摘要就能了解论文的总体内容和主要成果。
+
+ 论文摘要的书写应力求精确、简明。
+ 切忌写成对论文书写内容进行提要的形式,尤其要避免“第 1 章……;第 2 章……;……”这种或类似的陈述方式。
+
+ 关键词是为了文献标引工作、用以表示全文主要内容信息的单词或术语。
+ 关键词不超过 5 个,每个关键词中间用分号分隔。
+
+ % 关键词用“英文逗号”分隔,输出时会自动处理为正确的分隔符
+ \hitsetup{
+ keywords = {关键词 1, 关键词 2, 关键词 3, 关键词 4, 关键词 5},
+ }
+\end{abstract}
+
diff --git a/macros/latex/contrib/hitreport/data/appendix.tex b/macros/latex/contrib/hitreport/data/appendix.tex
new file mode 100644
index 0000000000..4c2ec5dd20
--- /dev/null
+++ b/macros/latex/contrib/hitreport/data/appendix.tex
@@ -0,0 +1,48 @@
+\chapter{附录}
+
+附录是与论文内容密切相关、但编入正文又影响整篇论文编排的条理和逻辑性的资料,例如某些重要的数据表格、计算程序、统计表等,是论文主体的补充内容,可根据需要设置。
+
+
+\section{图表示例}
+
+\subsection{图}
+
+附录中的图片示例(图~\ref{fig:appendix-figure})。
+
+\begin{figure}
+ \centering
+ \includegraphics[width=0.6\linewidth]{example-image-a.pdf}
+ \caption{附录中的图片示例}
+ \label{fig:appendix-figure}
+\end{figure}
+
+
+\subsection{表格}
+
+附录中的表格示例(表~\ref{tab:appendix-table})。
+
+\begin{table}
+ \centering
+ \caption{附录中的表格示例}
+ \begin{tabular}{ll}
+ \toprule
+ 文件名 & 描述 \\
+ \midrule
+ thuthesis.dtx & 模板的源文件,包括文档和注释 \\
+ thuthesis.cls & 模板文件 \\
+ thuthesis-*.bst & BibTeX 参考文献表样式文件 \\
+ thuthesis-*.bbx & BibLaTeX 参考文献表样式文件 \\
+ thuthesis-*.cbx & BibLaTeX 引用样式文件 \\
+ \bottomrule
+ \end{tabular}
+ \label{tab:appendix-table}
+\end{table}
+
+
+\section{数学公式}
+
+附录中的数学公式示例(公式~\eqref{eq:appendix-equation})。
+\begin{equation}
+ \frac{1}{2 \symup{\pi} \symup{i}} \int_\gamma f = \sum_{k=1}^m n(\gamma; a_k) \mathscr{R}(f; a_k)
+ \label{eq:appendix-equation}
+\end{equation}
diff --git a/macros/latex/contrib/hitreport/data/chap01.tex b/macros/latex/contrib/hitreport/data/chap01.tex
new file mode 100644
index 0000000000..505a882a9f
--- /dev/null
+++ b/macros/latex/contrib/hitreport/data/chap01.tex
@@ -0,0 +1,78 @@
+% !TeX root = ../hitreport-example.tex
+
+\chapter{论文主要部分的写法}
+
+研究生学位论文撰写,除表达形式上需要符合一定的格式要求外,内容方面上也要遵循一些共性原则。
+
+通常研究生学位论文只能有一个主题(不能是几块工作拼凑在一起),该主题应针对某学科领域中的一个具体问题展开深入、系统的研究,并得出有价值的研究结论。
+学位论文的研究主题切忌过大,例如,“中国国有企业改制问题研究”这样的研究主题过大,因为“国企改制”涉及的问题范围太广,很难在一本研究生学位论文中完全研究透彻。
+
+
+
+\section{论文的语言及表述}
+
+除国际研究生外,学位论文一律须用汉语书写。
+学位论文应当用规范汉字进行撰写,除古汉语研究中涉及的古文字和参考文献中引用的外文文献之外,均采用简体汉字撰写。
+
+国际研究生一般应以中文或英文书写学位论文,格式要求同上。
+论文须用中文封面。
+
+研究生学位论文是学术作品,因此其表述要严谨简明,重点突出,专业常识应简写或不写,做到立论正确、数据可靠、说明透彻、推理严谨、文字凝练、层次分明,避免使用文学性质的或带感情色彩的非学术性语言。
+
+论文中如出现一个非通用性的新名词、新术语或新概念,需随即解释清楚。
+
+
+
+\section{论文题目的写法}
+
+论文题目应简明扼要地反映论文工作的主要内容,力求精炼、准确,切忌笼统。
+论文题目是对研究对象的准确、具体描述,一般要在一定程度上体现研究结论,因此,论文题目不仅应告诉读者这本论文研究了什么问题,更要告诉读者这个研究得出的结论。
+例如:“在事实与虚构之间:梅乐、卡彭特、沃尔夫的新闻观”就比“三个美国作家的新闻观研究”更专业、更准确。
+
+
+
+\section{摘要的写法}
+
+论文摘要是对论文研究内容的高度概括,应具有独立性和自含性,即应是 一篇简短但意义完整的文章。
+通过阅读论文摘要,读者应该能够对论文的研究 方法及结论有一个整体性的了解,因此摘要的写法应力求精确简明。
+论文摘要 应包括对问题及研究目的的描述、对使用的方法和研究过程进行的简要介绍、 对研究结论的高度凝练等,重点是结果和结论。
+
+论文摘要切忌写成全文的提纲,尤其要避免“第 1 章……;第 2 章……;……”这样的陈述方式。
+
+
+
+\section{引言的写法}
+
+一篇学位论文的引言大致包含如下几个部分:
+1、问题的提出;
+2、选题背 景及意义;
+3、文献综述;
+4、研究方法;
+5、论文结构安排。
+\begin{itemize}
+ \item 问题的提出:要清晰地阐述所要研究的问题“是什么”。
+ \footnote{选题时切记要有“问题意识”,不要选不是问题的问题来研究。}
+ \item 选题背景及意义:论述清楚为什么选择这个题目来研究,即阐述该研究对学科发展的贡献、对国计民生的理论与现实意义等。
+ \item 文献综述:对本研究主题范围内的文献进行详尽的综合述评,“述”的同时一定要有“评”,指出现有研究状态,仍存在哪些尚待解决的问题,讲出自己的研究有哪些探索性内容。
+ \item 研究方法:讲清论文所使用的学术研究方法。
+ \item 论文结构安排:介绍本论文的写作结构安排。
+\end{itemize}
+
+
+
+\section{正文的写法}
+
+本部分是论文作者的研究内容,不能将他人研究成果不加区分地掺和进来。
+已经在引言的文献综述部分讲过的内容,这里不需要再重复。
+各章之间要存在有机联系,符合逻辑顺序。
+
+
+
+\section{结论的写法}
+
+结论是对论文主要研究结果、论点的提炼与概括,应精炼、准确、完整,使读者看后能全面了解论文的意义、目的和工作内容。
+结论是最终的、总体的结论,不是正文各章小结的简单重复。
+结论应包括论文的核心观点,主要阐述作者的创造性工作及所取得的研究成果在本领域中的地位、作用和意义,交代研究工作的局限,提出未来工作的意见或建议。
+同时,要严格区分自己取得的成果与指导教师及他人的学术成果。
+
+在评价自己的研究工作成果时,要实事求是,除非有足够的证据表明自己的研究是“首次”、“领先”、“填补空白”的,否则应避免使用这些或类似词语。
diff --git a/macros/latex/contrib/hitreport/data/chap02.tex b/macros/latex/contrib/hitreport/data/chap02.tex
new file mode 100644
index 0000000000..834789e384
--- /dev/null
+++ b/macros/latex/contrib/hitreport/data/chap02.tex
@@ -0,0 +1,153 @@
+% !TeX root = ../hitreport-example.tex
+
+\chapter{图表示例}
+
+\section{插图}
+
+图片通常在 {figure} 环境中使用 {includegraphics} 插入,如图~\ref{fig:example} 的源代码。
+建议矢量图片使用 PDF 格式,比如数据可视化的绘图;
+照片应使用 JPG 格式;
+其他的栅格图应使用无损的 PNG 格式。
+注意,LaTeX 不支持 TIFF 格式;EPS 格式已经过时。
+
+\begin{figure}
+ \centering
+ \includegraphics[width=0.6\linewidth]{example-image-a.pdf}
+ \caption{示例图片}
+ \label{fig:example}
+\end{figure}
+
+若图或表中有附注,采用英文小写字母顺序编号,附注写在图或表的下方。
+% LaTeX 传统上一般将附注的内容同图表的标题写在一起,形成很长的一段文字。
+
+如果一个图由两个或两个以上分图组成时,各分图分别以(a)、(b)、(c)...... 作为图序,并须有分图题。
+推荐使用 {subcaption} 宏包来处理, 比如图~\ref{fig:subfig-a} 和图~\ref{fig:subfig-b}。
+
+\begin{figure}
+ \centering
+ \subcaptionbox{分图 A\label{fig:subfig-a}}
+ {\includegraphics[width=0.45\linewidth]{example-image-a.pdf}}
+ \subcaptionbox{分图 B\label{fig:subfig-b}}
+ {\includegraphics[width=0.45\linewidth]{example-image-b.pdf}}
+ \caption{多个分图的示例}
+ \label{fig:multi-image}
+\end{figure}
+
+
+
+\section{表格}
+
+表应具有自明性。为使表格简洁易读,尽可能采用三线表,如表~\ref{tab:three-line}。
+三条线可以使用 {booktabs} 宏包提供的命令生成。
+
+\begin{table}
+ \centering
+ \caption{三线表示例}
+ \begin{tabular}{ll}
+ \toprule
+ 文件名 & 描述 \\
+ \midrule
+ thuthesis.dtx & 模板的源文件,包括文档和注释 \\
+ thuthesis.cls & 模板文件 \\
+ thuthesis-*.bst & BibTeX 参考文献表样式文件 \\
+ thuthesis-*.bbx & BibLaTeX 参考文献表样式文件 \\
+ thuthesis-*.cbx & BibLaTeX 引用样式文件 \\
+ \bottomrule
+ \end{tabular}
+ \label{tab:three-line}
+\end{table}
+
+表格如果有附注,尤其是需要在表格中进行标注时,可以使用 {threeparttable} 宏包。
+研究生要求使用英文小写字母 a、b、c……顺序编号,本科生使用圈码 ①、②、③……编号。
+
+\begin{table}
+ \centering
+ \begin{threeparttable}[c]
+ \caption{带附注的表格示例}
+ \label{tab:three-part-table}
+ \begin{tabular}{ll}
+ \toprule
+ 文件名 & 描述 \\
+ \midrule
+ thuthesis.dtx\tnote{a} & 模板的源文件,包括文档和注释 \\
+ thuthesis.cls\tnote{b} & 模板文件 \\
+ thuthesis-*.bst & BibTeX 参考文献表样式文件 \\
+ thuthesis-*.bbx & BibLaTeX 参考文献表样式文件 \\
+ thuthesis-*.cbx & BibLaTeX 引用样式文件 \\
+ \bottomrule
+ \end{tabular}
+ \begin{tablenotes}
+ \item [a] 可以通过 xelatex 编译生成模板的使用说明文档;
+ 使用 xetex 编译 {thuthesis.ins} 时则会从 {.dtx} 中去除掉文档和注释,得到精简的 {.cls} 文件。
+ \item [b] 更新模板时,一定要记得编译生成 {.cls} 文件,否则编译论文时载入的依然是旧版的模板。
+ \end{tablenotes}
+ \end{threeparttable}
+\end{table}
+
+如某个表需要转页接排,可以使用 {longtable} 宏包,需要在随后的各页上重复表的编号。
+编号后跟表题(可省略)和“(续)”,置于表上方。续表均应重复表头。
+
+\begin{longtable}{cccc}
+ \caption{跨页长表格的表题} \\
+ \toprule
+ 表头 1 & 表头 2 & 表头 3 & 表头 4 \\
+ \midrule
+ \endfirsthead
+ \caption[]{跨页长表格的表题(续)} \\
+ \toprule
+ 表头 1 & 表头 2 & 表头 3 & 表头 4 \\
+ \midrule
+ \endhead
+ \bottomrule
+ \endfoot
+ Row 1 & & & \\
+ Row 2 & & & \\
+ Row 3 & & & \\
+ Row 4 & & & \\
+ Row 5 & & & \\
+ Row 6 & & & \\
+ Row 7 & & & \\
+ Row 8 & & & \\
+ Row 9 & & & \\
+ Row 10 & & & \\
+ Row 11 & & & \\
+ Row 12 & & & \\
+ Row 13 & & & \\
+ Row 14 & & & \\
+ Row 15 & & & \\
+ Row 16 & & & \\
+ Row 17 & & & \\
+ Row 18 & & & \\
+ Row 19 & & & \\
+ Row 20 & & & \\
+ Row 21 & & & \\
+ Row 22 & & & \\
+ Row 23 & & & \\
+ Row 24 & & & \\
+ Row 25 & & & \\
+ Row 26 & & & \\
+ Row 27 & & & \\
+ Row 28 & & & \\
+ Row 29 & & & \\
+ Row 30 & & & \\
+ Row 31 & & & \\
+ Row 32 & & & \\
+ Row 33 & & & \\
+ Row 34 & & & \\
+ Row 35 & & & \\
+ Row 36 & & & \\
+ Row 37 & & & \\
+ Row 38 & & & \\
+ Row 39 & & & \\
+ Row 40 & & & \\
+ Row 41 & & & \\
+ Row 42 & & & \\
+ Row 43 & & & \\
+ Row 44 & & & \\
+ Row 45 & & & \\
+ Row 46 & & & \\
+ Row 47 & & & \\
+ Row 48 & & & \\
+ Row 49 & & & \\
+ Row 50 & & & \\
+\end{longtable}
diff --git a/macros/latex/contrib/hitreport/data/chap03.tex b/macros/latex/contrib/hitreport/data/chap03.tex
new file mode 100644
index 0000000000..fff827b9d4
--- /dev/null
+++ b/macros/latex/contrib/hitreport/data/chap03.tex
@@ -0,0 +1,71 @@
+% !TeX root = ../hitreport-example.tex
+
+\chapter{数学符号和公式}
+
+\section{数学符号}
+
+中文论文的数学符号默认采用 GB/T 3102.11—1993《物理科学和技术中使用的数学符号》。
+该标准参照采纳 ISO 31-11:1992(目前最新版为 ISO 80000-2:2019),
+但是与 \TeX{} 默认的英美国家的符号习惯有许多差异,主要有:
+\begin{enumerate}
+ \item 大写希腊字母默认为斜体,如 $\Delta$、$\Sigma$,
+ 有限增量符号 $\increment$({increment})固定使用正体。
+ \item 数学常数和特殊函数名用正体,如 $\symup{\pi} = 3.14\dots$;$\symup{e} = 2.718\dots$。
+ \item 微分号使用正体,比如 $\dif y / \dif x$。
+ \item 向量、矩阵和张量用粗斜体({symbf}),如 $\symbf{x}$、$\symbf{\Sigma}$。
+ \item 省略号按照中文的习惯固定居中,如 $1, 2, \dots, n$。
+\end{enumerate}
+
+英文论文的数学符号使用 \TeX{} 默认的样式。
+如果有必要,也可以通过设置 \verb|math-style| 选择数学符号样式。
+
+关于量和单位推荐使用
+\href{http://mirrors.ctan.org/macros/latex/contrib/siunitx/siunitx.pdf}{{siunitx}}
+宏包,
+可以方便地处理希腊字母以及数字与单位之间的空白,
+比如:
+\SI{6.4e6}{m},
+\SI{9}{\micro\meter},
+\si{kg.m.s^{-1}},
+\SIrange{10}{20}{\degreeCelsius}。
+
+
+
+\section{数学公式}
+
+数学公式可以使用 {equation} 和 {equation*} 环境。
+注意数学公式的引用应前后带括号,建议使用 {eqref} 命令,比如式 \eqref{eq:example}。
+\begin{equation}
+ \frac{1}{2 \symup{\pi} \symup{i}} \int_\gamma f = \sum_{k=1}^m n(\gamma; a_k) \mathscr{R}(f; a_k)
+ \label{eq:example}
+\end{equation}
+注意公式编号的引用应含有圆括号,可以使用 {eqref} 命令。
+
+多行公式尽可能在“=”处对齐,推荐使用 {align} 环境。
+\begin{align}
+ a & = b + c + d + e \\
+ & = f + g
+\end{align}
+
+
+
+\section{数学定理}
+
+定理环境的格式可以使用 {amsthm} 或者 {ntheorem} 宏包配置。
+用户在导言区载入这两者之一后,模板会自动配置 {thoerem}、{proof} 等环境。
+
+\begin{theorem}[Lindeberg--Lévy 中心极限定理]
+ 设随机变量 $X_1, X_2, \dots, X_n$ 独立同分布, 且具有期望 $\mu$ 和有限的方差 $\sigma^2 \ne 0$,
+ 记 $\bar{X}_n = \frac{1}{n} \sum_{i+1}^n X_i$,则
+ \begin{equation}
+ \lim_{n \to \infty} P \left(\frac{\sqrt{n} \left( \bar{X}_n - \mu \right)}{\sigma} \le z \right) = \Phi(z),
+ \end{equation}
+ 其中 $\Phi(z)$ 是标准正态分布的分布函数。
+\end{theorem}
+%\begin{proof}
+% Trivial.
+%\end{proof}
+
+%同时模板还提供了 \env{assumption}、\env{definition}、\env{proposition}、
+%\env{lemma}、\env{theorem}、\env{axiom}、\env{corollary}、\env{exercise}、
+%\env{example}、\env{remar}、\env{problem}、\env{conjecture} 这些相关的环境。
diff --git a/macros/latex/contrib/hitreport/figures/example-image-a.pdf b/macros/latex/contrib/hitreport/figures/example-image-a.pdf
new file mode 100644
index 0000000000..6d7ecb88a0
--- /dev/null
+++ b/macros/latex/contrib/hitreport/figures/example-image-a.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/figures/example-image-b.pdf b/macros/latex/contrib/hitreport/figures/example-image-b.pdf
new file mode 100644
index 0000000000..7b404afa22
--- /dev/null
+++ b/macros/latex/contrib/hitreport/figures/example-image-b.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/figures/scan-copyright.pdf b/macros/latex/contrib/hitreport/figures/scan-copyright.pdf
new file mode 100644
index 0000000000..9d5c5a5665
--- /dev/null
+++ b/macros/latex/contrib/hitreport/figures/scan-copyright.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/figures/scan-record.pdf b/macros/latex/contrib/hitreport/figures/scan-record.pdf
new file mode 100644
index 0000000000..db0dcef7b2
--- /dev/null
+++ b/macros/latex/contrib/hitreport/figures/scan-record.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/figures/scan-statement.pdf b/macros/latex/contrib/hitreport/figures/scan-statement.pdf
new file mode 100644
index 0000000000..25e1494d7a
--- /dev/null
+++ b/macros/latex/contrib/hitreport/figures/scan-statement.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/hitreport-example.pdf b/macros/latex/contrib/hitreport/hitreport-example.pdf
new file mode 100644
index 0000000000..669dc242a1
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitreport-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/hitreport-example.tex b/macros/latex/contrib/hitreport/hitreport-example.tex
new file mode 100644
index 0000000000..9e28cf8fe0
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitreport-example.tex
@@ -0,0 +1,42 @@
+% !TeX encoding = UTF-8
+% !TeX program = xelatex
+
+\documentclass{hitreport}
+
+
+% 报告基本配置,加载宏包等全局配置
+\input{hitsetup}
+
+
+\begin{document}
+
+% 封面
+\maketitle
+
+\frontmatter
+\input{data/abstract}
+
+% 目录
+\tableofcontents
+
+
+% 正文部分
+\mainmatter
+\input{data/chap01}
+\input{data/chap02}
+\input{data/chap03}
+
+
+% 其他部分
+\backmatter
+
+% 参考文献
+%\bibliography{ref/refs} % 参考文献使用 BibTeX 编译
+% \printbibliography % 参考文献使用 BibLaTeX 编译
+
+% 附录
+\appendix
+\input{data/appendix}
+
+
+\end{document}
diff --git a/macros/latex/contrib/hitreport/hitreport.dtx b/macros/latex/contrib/hitreport/hitreport.dtx
new file mode 100644
index 0000000000..326147d327
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitreport.dtx
@@ -0,0 +1,3191 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2021 by Xiao Sun <demerzelsun@gmail.com>
+%
+% This file may be distributed and/or modified under the conditions of
+% the LaTeX Project Public License, either version 1.3c 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.3c or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{hitreport.dtx}[2021/01/14 1.0.0 Harbin Institute of Technology Report Template]
+\documentclass{ltxdoc}
+\usepackage{dtx-style}
+
+\EnableCrossrefs
+\CodelineIndex
+
+\begin{document}
+ \DocInput{hitreport.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \DoNotIndex{\newenvironment,\@bsphack,\@empty,\@esphack,\sfcode}
+% \DoNotIndex{\addtocounter,\label,\let,\linewidth,\newcounter}
+% \DoNotIndex{\noindent,\normalfont,\par,\parskip,\phantomsection}
+% \DoNotIndex{\providecommand,\ProvidesPackage,\refstepcounter}
+% \DoNotIndex{\RequirePackage,\setcounter,\setlength,\string,\strut}
+% \DoNotIndex{\textbackslash,\texttt,\ttfamily,\usepackage}
+% \DoNotIndex{\begin,\end,\begingroup,\endgroup,\par,\\}
+% \DoNotIndex{\if,\ifx,\ifdim,\ifnum,\ifcase,\else,\or,\fi}
+% \DoNotIndex{\let,\def,\xdef,\edef,\newcommand,\renewcommand}
+% \DoNotIndex{\expandafter,\csname,\endcsname,\relax,\protect}
+% \DoNotIndex{\Huge,\huge,\LARGE,\Large,\large,\normalsize}
+% \DoNotIndex{\small,\footnotesize,\scriptsize,\tiny}
+% \DoNotIndex{\normalfont,\bfseries,\slshape,\sffamily,\interlinepenalty}
+% \DoNotIndex{\textbf,\textit,\textsf,\textsc}
+% \DoNotIndex{\hfil,\par,\hskip,\vskip,\vspace,\quad}
+% \DoNotIndex{\centering,\raggedright,\ref}
+% \DoNotIndex{\c@secnumdepth,\@startsection,\@setfontsize}
+% \DoNotIndex{\ ,\@plus,\@minus,\p@,\z@,\@m,\@M,\@ne,\m@ne}
+% \DoNotIndex{\@@par,\DeclareOperation,\RequirePackage,\LoadClass}
+% \DoNotIndex{\AtBeginDocument,\AtEndDocument}
+%
+% \changes{v1.0.0}{2021/01/14}{Initial version}
+%
+% \GetFileInfo{\jobname.dtx}
+%
+% \def\indexname{索引}
+% \def\glossaryname{修改记录}
+% \IndexPrologue{\section{\indexname}}
+% \GlossaryPrologue{\section{\glossaryname}}
+
+% \title{\bfseries\color{violet} \hitreport: 哈尔滨工业大学本科生泛用报告}
+% \author{孙骁 \\[5pt]\texttt{demerzelsun@gmail.com}}
+% \date{\fileversion\ (\filedate)}
+% \maketitle\thispagestyle{empty}
+%
+% \begin{abstract}\noindent
+% 此宏包旨在建立一个免于配置的、指令相对简单的哈尔滨工业大学作业、实验报告通用模板。
+% \end{abstract}
+%
+%
+% \vskip2cm
+% \def\abstractname{免责声明}
+% \begin{abstract}
+% \noindent
+% \begin{enumerate}
+% \item 本模板的发布遵守 \LaTeX\ Project Public License,使用前请认真阅读协议内
+% 容。
+% \item \textbf{本模板为作者编写的报告模板,与哈尔滨工业大学官方没有任何关系}。本模板的格式无法兼顾所有课程要求,
+% 但已经适配了绝大多数的需求场景。
+% 任何使用本宏包进行实验报告制作时,请\textbf{务必根据课程要求进行写作}。
+% 由于使用本模板而引起的作业验收问题,
+% 均与本模板作者无关。
+% \item 任何个人或组织以本模板为基础进行修改、扩展而生成的新的专用模板,
+% 请严格遵守 \LaTeX\ Project Public License 协议。
+% 由于违犯协议而引起的任何纠纷争端均与
+% 本模板作者无关。
+% \end{enumerate}
+% \end{abstract}
+%
+% \clearpage
+% \pagestyle{fancy}
+% \begin{multicols}{2}[
+% \setlength{\columnseprule}{.4pt}
+% \setlength{\columnsep}{18pt}]
+% \tableofcontents
+% \end{multicols}
+% \clearpage
+%
+% \section{模板介绍}
+% \hitreport (\textbf{H}arbin \textbf{I}istitute of \textbf{T}echnology \LaTeX\ Versatile \textbf{Report} Template)是为哈尔滨工业大学一校三区的本科生设计的一个免于配置的作业、实验报告模板。希望它可以使你的作业或实验报告不会因形式上的缺陷导致评分的下降。
+%
+% 该文档格式基于 ctexbook, 主要完成了除了主体内容以外的几乎\textbf{全部}工作。同时,通过使用 Github 版本宏包,你还可以更好的管理自己的 \LaTeX 文档。
+%
+% 本文档将尽量完整的介绍模板的使用方法,如有不清楚之处可以参考示例文档或者根据第 节说明提问,有兴趣者都可以参与完善此手册,也非常欢迎在Github上提出Issues。
+%
+% \section{安装}
+% \label{sec:installation}
+% \subsection{CTAN}
+% 本宏包已被收纳于 CTAN 中,凡安装完整版 Texlive 用户可直接使用:
+% \begin{latex}
+% \usepackage{hitreport}
+% \end{latex}
+% 进行写作,但是通常版本较旧,且不便更新。
+%
+% \subsection{Github}
+% 想获得最新版本的请前往 Github 主页下载:
+% \url{https://github.com/demerzelsun12/hitreport}
+%
+% 同时,面向 Github 版本的说明主要在 README.md 中,
+% 如果使用的是 Github 版本,请阅读 README.md
+%
+% \subsection{Gitee}
+% 为解决部分同学无法正常访问 GitHub 或者下载速度过慢的情况,
+% 本模板在 Gitee 上也做同步更新,Gitee下载地址为:
+% \url{https://gitee.com/demerzel/hitreport}
+%
+% 模板支持在 TeX Live、MacTeX 和 MIKTeX 平台下进行编译,
+% 使用最新版本可以避免 bug。
+%
+% \subsection{模板的组成}
+% 由于报告的短时性的特点,也方便更多零基础的同学使用本模板,
+% 本模板进最大可能简化了非实际报告文字的配置部分。下表列出了模板的主要文件及其功能介绍:
+%
+% \begin{longtable}{l|p{8cm}}
+% \toprule
+% {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule
+% \endfirsthead
+% \midrule
+% {\heiti 文件(夹)} & {\heiti 功能描述}\\\midrule
+% \endhead
+% \endfoot
+% \endlastfoot
+% hitreport.ins & \textsc{DocStrip} 驱动文件(开发用) \\
+% hitreport.dtx & \textsc{DocStrip} 源文件(开发用)\\\midrule
+% ref/ & 示例文档参考文献目录 \\
+% figures/ & 示例文档图片路径 \\
+% data/ & 实例文档各章节路径 \\
+% photo/ & 模板封面引用图片路径 \\
+% code/ & 示例文档引用代码路径 \\\midrule
+% report.tex & 示例文档基本配置 \\
+% hitreport.cls & 模板类文件 \\
+% hitreport-example.tex & 示例文档主文件\\
+% hitreport-example.pdf & 示例文档 \\
+% hitsetup.tex & 示例文档基本配置\\\midrule
+% Makefile & 自动运行脚本 \\
+% latexmkrc & latexmk 配置文件 \\
+% README.md & 说明文件 \\
+% \textbf{hitreport.pdf} & 用户手册(本文档)\\ \bottomrule
+% \end{longtable}
+%
+% 几点说明:
+% \begin{itemize}
+% \item \file{hitreport.cls} 可由 \file{hitreport.ins}
+% 和 \file{hitreport.dtx} 生成,但为了降低新手用户的使用难度,故
+% 将 \file{hitreport.cls} 文件一起发布。新手可直接下载 Release 版
+% 本,Release 版本不包含 \file{hitreport.ins} 和
+% \file{hitreport.dtx}。
+% \item 使用模板文件或对模板文件进行修改前请阅读本文档:
+% \file{hitreport.pdf}。
+% \end{itemize}
+%
+%
+% \subsection{生成模板}
+% \label{sec:generate-cls}
+% 模板的源文件(\file{hitreport.dtx})中包含了大量的注释,需要将注
+% 释去掉生成轻量级的 \file{.cls} 文件供 \cs{documentclass} 调用。
+% 使用Makefile或 \XeLaTeX 生成模板文件。
+% \begin{shell}
+% $ make cls
+% \end{shell}
+% 或
+% \begin{shell}
+% $ xelatex hitreport.ins
+% \end{shell}
+%
+% \note[注意:]{如果没有生成的模板 \file{hitreport.cls} 文件
+% (与 \file{hitreport-example.tex} 在同一目录下),
+% \LaTeX{} 在编译时可能找到发行版中较旧版本的 \file{.cls},从而造成编译冲突。}
+%
+% \subsection{生成报告}
+% \label{sec:gengrate-report}
+% 本节介绍几种常见的生成报告的方法。用户可根据自己的情况选择。
+%
+% 在撰写报告时,需要注意,代码引用可以使用相对路径,但是图片引用则必须
+% 放在 figures 文件夹下。如果需要对校徽以及校名图片名称进行修改,
+% \file{hitreport.cls} 文件中相应位置也需要修改。
+%
+% 在撰写报告时,\textbf{不推荐}使用原有的 \file{hitreport-example.tex} 这一名称。
+% 建议将其复制一份,改为其他的名字(如 \file{report.tex} 或者 \file{main.tex})。
+% 需要注意,如果使用了来自 \file{data} 目录中的 \file{tex} 文件,
+% 则重命名主文件后,其顶端的 \texttt{!TeX root} 选项也需要相应修改。
+%
+% \subsubsection{GNU make}
+% \label{sec:make}
+% 如果用户可以使用 GNU make 工具,这是最方便的办法。
+% 所以 \hitreport 提供了 \file{Makefile}:
+% \begin{shell}
+% $ make report # 生成报告示例 hitreport-example.pdf
+% $ make doc # 生成说明文档 hitreport.pdf
+% $ make clean # 清理编译生成的辅助文件
+% \end{shell}
+%
+% 需要注意,如果更改了主文件的名称,则需要修改 \file{Makefile} 顶端的 \texttt{REPORT} 变量定义。
+%
+% \subsubsection{latexmk}
+% latexmk 命令支持全自动生成\LaTeX{}编写的文档,并且支持使用不同的工具链来进行生成,它会自动运行多次工具直到交叉引用都被解决。下面给出了一个用 latexmk 调用 xelatex 生成最终文档的示例:
+% \begin{shell}
+% $ latexmk hitreport-example.tex # 生成示例报告
+% $ latexmk hitreport.dtx # 生成说明文档hitreport.pdf
+% $ latexmk -c # 清理编译生成的辅助文件
+% \end{shell}
+% \texttt{latexmk} 的编译过程是通过 \file{latexmkrc} 文件来配置的,如果要进一步了解,
+% 可以参考 \pkg{latexmk} 文档。
+%
+%
+% \subsubsection{\XeLaTeX}
+% \label{sec:xelatex}
+% 如果用户无法使用以上两种较为方便的编译方法,就只能按照以下复杂的办法手动编译。
+%
+% 首先,更新模板:
+% \begin{shell}
+% $ xetex hitreport.ins # 生成 hitreport.cls
+% \end{shell}
+%
+% 然后,生成论文:
+% \begin{shell}
+% $ xelatex hitreport-example.tex
+% $ bibtex hitreport-example.aux # 生成 bbl 文件
+% $ xelatex hitreport-example.tex # 解决引用
+% $ xelatex hitreport-example.tex # 生成报告 PDF
+%
+% \end{shell}
+%
+% 使用下面的命令用来生成用户手册:
+% \begin{shell}
+% $ xelatex -shell-escape hitreport.dtx
+% $ makeindex -s gind.ist -o hitreport.ind hitreport.idx
+% $ xelatex -shell-escape hitreport.dtx
+% $ xelatex -shell-escape hitreport.dtx # 生成说明文档 hitreport.pdf
+% \end{shell}
+%
+% \subsection{升级}
+% \label{sec:upgrade}
+% 如果需要升级 \hitreport{},应当从 GitHub 下载最新的版本,
+% 将 \file{hitreport.dtx},\file{hitreport.ins},拷贝至工作目录覆盖相应的文件,然后按照
+% 第~\ref{sec:generate-cls} 节的内容生成新的模板和使用说明。
+%
+% 有时模板可能进行了重要的修改,不兼容已写好的正文内容,用户应按照示例
+% 文档重新调整。
+%
+%
+% \section{使用说明}
+% \label{sec:usage}
+% \subsection{示例文件}
+% 推荐从模板自带的示例文档入手,其中包括了写作用到的所有命令及其使用方法,只需要用自己的内容进行相应替换就可以。对于不清楚的命令可以查阅本手册。下面的例子描述了模板中章节的组织形式,来自于示例文档,具体内容可以参考模板附带的 \file{hitreport-example.tex}。
+%
+% \subsection{选项}
+% \label{sec:option}
+% 报告的语言是中文,暂不支持英文。
+% \DescribeOption{open}
+% 正规出版物的章节出现在奇数页,也就是右手边的页面,这就是 \option{right},。在这种情况下,如果前一章的最后一页也是奇数,那么模板会自动生成一个纯粹的空白页。
+% 提交的作业如果是电子稿的话,可以使用连续页,即使用\option{any}
+% \DescribeOption{wide}
+% 是否使用宽页面。如果生成作业的话,宽页面或许好看。
+% \DescribeOption{draft}
+% 是否生成水印。生成的水印为 Draft 表示此文档尚为草稿
+%
+% \subsection{字体配置}
+% \label{sec:font-config}
+% 模板默认可以自动检测操作系统,并配置改平台上合适的字体,
+% 具体的配置策略如表~\ref{tab:font}。
+% \begin{table}[htb]
+% \centering
+% \caption{hitreport 自动配置字体策略}
+% \label{tab:font}
+% \begin{tabular}{ccc}
+% \toprule
+% Windows & macOS & 其他 \\
+% \midrule
+% Times New Roman & Times New Roman & TeX Gyre Termes \\
+% Arial & Arial & TeX Gyre Heros \\
+% Courier & Menlo & TeX Gyre Cursor \\
+% 中易宋体 & 华文宋体 & Noto 宋体 \\
+% 中易黑体 & 华文黑体 & Noto 黑体 \\
+% \bottomrule
+% \end{tabular}
+% \end{table}
+%
+% 然而自动配置的字体只能保证编译通过,但是还存在一些问题:
+% \begin{enumerate}
+% \item 在其他平台上配置的 TeX Gyre 系列字体,虽然在风格上比较接近 Times 和 Arial,
+% 但是毕竟跟部分课程要求的字体不完全一致;
+% \item 华文字库虽然不违反一般的写作要求,
+% 但是其字形跟中易字库有所差别,可能被批改老师认为格式不符合要求。
+% \end{enumerate}
+%
+% 所以建议在提交最终版前使用 Windows 平台的字体进行编译。
+%
+% 用户也可以在调用 hitreport 时手动指定使用的字库,如:
+%
+% \begin{latex}
+% \documentclass[fontset=windows]{hitreport}
+% \end{latex}
+%
+% 允许的选项有 \option{windows}、\option{mac},详
+% 见 \pkg{ctex}、\pkg{xeCJK}、\pkg{fontspec} 等宏包的使用说明。
+%
+%
+% \subsection{论文设置}
+% 论文的设置可以通过统一命令 \cs{hitsetup} 设置 \emph{key=value} 形式完成。
+%
+% \DescribeMacro{\hitsetup}
+% \cs{hitsetup} 用法与常见 \emph{key=value} 命令相同,如下:
+% \begin{latex}
+% \hitsetup{
+% key1 = value1,
+% key2 = {a value, with comma},
+% }
+% % 可以多次调用
+% \hitsetup{
+% key3 = value3,
+% key1 = value11, % 覆盖 value1
+% }
+% \end{latex}
+%
+% \note[注意:]{\cs{hitsetup} 使用 \pkg{kvsetkeys} 机制,所以配置项之间不能有空行,否则
+% 会报错。}
+%
+%
+%
+% \subsection{封面信息}
+%
+% \label{sec:titlepage}
+% 封面信息可以通过统一设置命令 \cs{hitsetup} 设置 \emph{key=value} 形式完成;
+%
+% \subsubsection{报告校区}
+% 选择不同校区的校名。备选为harbin、shenzhen、weihai。
+% \begin{latex}
+% \hitsetup{
+% campus = {harbin},
+% }
+% \end{latex}
+%
+%
+% \subsubsection{报告主标题}
+% 中文标题。可以在标题内部使用换行|\\|。
+% \begin{latex}
+% \hitsetup{
+% title = {报告主标题},
+% }
+% \end{latex}
+%
+% \subsubsection{报告副标题}
+% 中文标题。可以在标题内部使用换行|\\|。
+% \begin{latex}
+% \hitsetup{
+% expand = {报告副标题},
+% }
+% \end{latex}
+%
+% \subsubsection{院系名称}
+% 院系名称。
+% \begin{latex}
+% \hitsetup{
+% department = {系名全称},
+% }
+% \end{latex}
+%
+% \subsubsection{专业名称}
+%
+% \begin{latex}
+% \hitsetup{
+% discipline = {专业名称},
+% }
+% \end{latex}
+%
+% \subsubsection{作者姓名}
+% 作者姓名。
+% \begin{latex}
+% \hitsetup{
+% author = {中文姓名},
+% }
+% \end{latex}
+%
+% \subsubsection{学号}
+% 学号。
+% \begin{latex}
+% \hitsetup{
+% student-id = {1180310840},
+% }
+% \end{latex}
+%
+% \subsubsection{指导教师}
+% 指导教师。
+% \begin{latex}
+% \hitsetup{
+% supervisor = {指导教师},
+% }
+% \end{latex}
+%
+% \subsubsection{实验地点}
+% 直接中文书写实验地点。
+% \begin{latex}
+% \hitsetup{
+% lablocation = {格物207},
+% }
+% \end{latex}
+%
+% \subsubsection{学期}
+% 课程学期,直接书写中文即可。
+% \begin{latex}
+% \hitsetup{
+% term = {2021春季学期},
+% }
+% \end{latex}
+%
+% \subsubsection{成文日期}
+% 默认为当前日期,也可以自己指定,要求使用 ISO 格式。
+% \begin{latex}
+% \hitsetup{
+% date = {2021-03-01},
+% }
+% \end{latex}
+%
+%
+% \myentry{生成封面}
+% \DescribeMacro{\maketitle}
+% 生成封面。
+% \begin{latex}
+% % 直接生成封面
+% \maketitle
+% \end{latex}
+%
+% \subsection{正文部分}
+% \subsubsection{数学符号}
+% \label{sec:math}
+% 报告的数学符号默认遵循 GB/T 3102.11—1993《物理科学和技术中使用的数学符号》。
+% 该标准参照采纳 ISO 31-11:1992,
+% 但是与 \TeX{} 默认的英美国家的符号习惯有许多差异,主要有:
+% \newcommand\dif{\mathop{}\!\mathrm{d}}
+% \begin{enumerate}
+% \item 大写希腊字母默认为斜体,
+% 有限增量符号 固定使用正体。
+% \item 数学常数和特殊函数名用正体。
+% \item 微分号使用正体。
+% \item 向量、矩阵和张量用粗斜体。
+% \item 省略号按照中文的习惯固定居中。
+% \end{enumerate}
+%
+% \DescribeOption{math-style}
+% 英文论文的数学符号默认使用 \TeX{} 样式。
+% 如果有必要,也可以通过设置 \option{math-style} 选择数学符号样式,
+% 可选:\option{GB}(中文默认),\option{TeX}(英文默认),\option{ISO}。
+% \begin{latex}
+% \hitsetup{
+% math-style = ISO,
+% }
+% \end{latex}
+%
+% 模板使用
+% \href{http://mirrors.ctan.org/macros/latex/contrib/unicode-math/unicode-math.pdf}{\pkg{unicode-math}}
+% 配置数学符号的字体。
+% 全部数学符号的命令参考
+% \href{http://mirrors.ctan.org/macros/latex/contrib/unicode-math/unimath-symbols.pdf}{\pkg{unimath-symbols}}。
+% 注意,\pkg{unicode-math} 宏包与 \pkg{amsfonts}、\pkg{amssymb}、\pkg{bm}、
+% \pkg{mathrsfs}、\pkg{upgreek} 等宏包\emph{不}兼容。
+% 模板作了处理,用户可以直接使用这些宏包的命令,如 \cs{bm}、\cs{mathscr}、
+% \cs{uppi}。
+%
+%
+% \subsubsection{定理环境}
+% \label{sec:theorem}
+% \hitreport 定义了常用的数学环境:
+%
+% \begin{center}
+% \begin{tabular}{*{7}{l}}\toprule
+% axiom & theorem & definition & proposition & lemma & conjecture &\\
+% 公理 & 定理 & 定义 & 命题 & 引理 & 猜想 &\\\midrule
+% proof & corollary & example & assumption & remark & problem & solution\\
+% 证明 & 推论 & 例子 & 假设 & 注释 & 问题 & 解\\\bottomrule
+% \end{tabular}
+% \end{center}
+%
+% 比如:
+% \begin{latex}
+% \begin{definition}
+% 道千乘之国,敬事而信,节用而爱人,使民以时。
+% \end{definition}
+% \end{latex}
+% 产生(自动编号):
+% \medskip
+%
+% \noindent\framebox[\linewidth][l]{{\heiti 定义~1.1~~~} % {道千乘之国,敬事而信,节用而爱人,使民以时。}}
+%
+% \smallskip
+% 列举出来的数学环境毕竟是有限的,如果想用\emph{胡说}这样的数学环境,那么可以定义:
+% \begin{latex}
+% \newtheorem{nonsense}{胡说}[chapter]
+% \end{latex}
+%
+% 然后这样使用:
+% \begin{latex}
+% \begin{nonsense}
+% 契丹武士要来中原夺武林秘笈。—— 慕容博
+% \end{nonsense}
+% \end{latex}
+%
+% 产生(自动编号):
+%
+% \medskip
+% \noindent\framebox[\linewidth][l]{{\heiti 胡说~1.1~~~} % {契丹武士要来中原夺武林秘笈。—— 慕容博}}
+%
+% \subsection{其他部分}
+% \subsubsection{参考文献}
+% \label{sec:bibliography}
+%
+% 参考文献通常可以使用 \hologo{BibTeX} 或 biblatex 生成。
+% \hologo{BibTeX} 是 LaTeX 处理参考文献的传统的方式,
+% 需要在使用 \cs{bibliographystyle}\marg{style} 选择样式
+% 并用 \cs{bibliography} 设置 \file{.bib} 的路径。
+% 然后使用 \texttt{bibtex} 对 \file{.aux} 文件进行编译得到 \file{.bbl} 文件。
+% 其中的参考文献表内容会在后续编译时替换到 \cs{bibliography} 的位置。
+% Biblatex 是较新的方式,需要在载入宏包时通过 \option{style} 选择样式,
+% 在导言区使用 \cs{addbibresource} 声明数据库的路径,
+% 并在输出参考文献表的位置使用 \cs{printbibliography} 命令,
+% 而且编译参考文献的命令需要换为 biber。
+% 这两种方式各有优缺点,比如 BibTeX 无法对中文按照拼音排序,一些样式更新不够及时;
+% Biblatex 运行较缓慢,无法对多个参考文献表使用不同样式。
+% 用户需要根据实际选择合适的方式。
+%
+% 由于报告基本不做参考文献的格式要求,此处的制作较为宽泛,采用 APA 格式,
+% APA 的 BibTeX 样式由 \pkg{apacite} 宏包提供,需要在导言区调用:
+% \begin{latex}
+% \usepackage[natbibapa]{apacite}
+% \bibliographystyle{apacite}
+% \end{latex}
+% 其中 \option{natbibapa} 会调用 \pkg{natbib} 来处理引用,
+% 这也是宏包推荐的用法。
+% 注意目前的 \pkg{apacite} 只支持到 APA 第 6 版。
+% 更推荐使用已经更新到 APA 第 7 版的 \pkg{biblatex-apa}:
+% \begin{latex}
+% \usepackage[style=apa]{biblatex}
+% \addbibresource{refs-apa.bib}
+% \end{latex}
+% 注意,如果参考文献中引用了中文文献的话,这两种方法都不能正确调整格式,
+% 需要手动进行修改 \file{.bbl} 文件的内容,
+% 这时 BibTeX 比 biblatex 更简单些。
+%
+%
+%
+% \subsubsection{附录}
+%
+% 附录由 \cs{appendix} 命令开启,然后像正文一样书写。部分实验报告要求附录
+% 引用代码,可以使用相对路径引用。
+% \begin{latex}
+% \appendix
+% \chapter{...}
+% ...
+% \end{latex}
+%
+%
+% \section{致谢}
+% 报告一般不需要添加致谢的章节,故本模板不做相应的制作。
+% 感谢以下宏包的作者,本宏包从中使用了部分代码和借鉴:
+% \begin{itemize}
+% \item 清华大学\thuthesis \quad https://github.com/tuna/thuthesis
+% \item 哈尔滨工业大学 \hithesis \quad https://github.com/dustincys/hithesis
+% \end{itemize}
+%
+% \StopEventually{\PrintIndex}
+% \clearpage
+%
+% \section{实现细节}
+% \subsection{基本信息}
+% \begin{macrocode}
+%<cls>\NeedsTeXFormat{LaTeX2e}[2017/04/15]
+%<cls>\ProvidesClass{hitreport}
+%<cls>[2020/12/31 v1.1 Standard LaTeX Template for hitreport]
+% \end{macrocode}
+%
+% 报错
+% \begin{macrocode}
+\newcommand\hit@error[1]{%
+ \ClassError{hitreport}{#1}{}%
+}
+\newcommand\hit@warning[1]{%
+ \ClassWarning{hitreport}{#1}%
+}
+\newcommand\hit@patch@error[1]{%
+ \hit@error{Failed to patch command \protect#1}%
+}
+\newcommand\hit@deprecate[2]{%
+ \def\hit@@tmp{#2}%
+ \hit@warning{%
+ The #1 is deprecated%
+ \ifx\hit@@tmp\@empty\else
+ . Use #2 instead%
+ \fi
+ }%
+}
+% \end{macrocode}
+%
+% 检查 \LaTeXe{} kernel 版本
+% \begin{macrocode}
+\@ifl@t@r\fmtversion{2017/04/15}{}{
+ \hit@error{%
+ TeX Live 2017 or later version is required to compile this document%
+ }
+}
+% \end{macrocode}
+%
+% 检查编译引擎,要求使用 \XeLaTeX。
+% \begin{macrocode}
+\RequirePackage{ifxetex}
+\RequireXeTeX
+\ifxetex\else
+\ClassError{hitreport}{You must use the `xelatex' driver\MessageBreak
+Please choose `xelatex'}{Just choose `xelatex', no `pdflatex' or `latex' and so on.}
+\fi
+% \end{macrocode}
+%
+% \subsection{定义选项}
+% \label{sec:defoption}
+% 初始化信息
+% \begin{macrocode}
+%<*cls>
+\RequirePackage{kvdefinekeys}
+\RequirePackage{kvsetkeys}
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{
+ family=hit,
+ prefix=hit@,
+ setkeys=\kvsetkeys}
+% \end{macrocode}
+%
+% \begin{macro}{\hitsetup}
+% 提供一个 \cs{hitsetup} 命令支持 \emph{key-value} 的方式来设置。
+% \begin{macrocode}
+\newcommand\hitsetup[1]{%
+ \kvsetkeys{hit}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% 同时用 \emph{key-value} 的方式来定义这些接口:
+% \begin{latex}
+% \hit@define@key{
+% <key> = {
+% name = <name>,
+% choices = {
+% <choice1>,
+% <choice2>,
+% },
+% default = <default>,
+% },
+% }
+% \end{latex}
+%
+% 其中 |choices| 设置允许使用的值,默认为第一个(或者 \meta{default});
+% \meta{code} 是相应的内容被设置时执行的代码。
+%
+% \begin{macrocode}
+\newcommand\hit@define@key[1]{%
+ \kvsetkeys{hit@key}{#1}%
+}
+\kv@set@family@handler{hit@key}{%
+% \end{macrocode}
+%
+% \cs{hitsetup} 会将 \meta{value} 存到 \cs{hit@\meta{key}},
+% 但是宏的名字包含 “-” 这样的特殊字符时不方便直接调用,比如 |key = math-style|,
+% 这时可以用 |name| 设置 \meta{key} 的别称,比如 |key = math@style|,
+% 这样就可以通过 \cs{hit@math@style} 来引用。
+% |default| 是定义该 \meta{key} 时默认的值,缺省为空。
+%
+% \begin{macrocode}
+ \@namedef{hit@#1@@name}{#1}%
+ \def\hit@@default{}%
+ \def\hit@@choices{}%
+ \kv@define@key{hit@value}{name}{%
+ \@namedef{hit@#1@@name}{##1}%
+ }%
+% \end{macrocode}
+%
+% 由于在定义接口时,\cs{hit@\meta{key}@@code} 不一定有定义,
+% 而且在文档类/宏包中还有可能对该 |key| 的 |code| 进行添加。
+% 所以 \cs{hit@\meta{key}@@code} 会检查如果在定义文档类/宏包时则推迟执行,否则立即执行。
+%
+% \begin{macrocode}
+ \@namedef{hit@#1@@check}{}%
+ \@namedef{hit@#1@@code}{}%
+% \end{macrocode}
+%
+% 保存下 |choices = {}| 定义的内容,在定义 \cs{hit@\meta{name}} 后再执行。
+%
+% \begin{macrocode}
+ \kv@define@key{hit@value}{choices}{%
+ \def\hit@@choices{##1}%
+ \@namedef{hit@#1@@reset}{}%
+% \end{macrocode}
+%
+% \cs{hit@\meta{key}@check} 检查 |value| 是否有效,
+% 并设置 \cs{ifhit@\meta{name}@\meta{value}}。
+%
+% \begin{macrocode}
+ \@namedef{hit@#1@@check}{%
+ \@ifundefined{%
+ ifhit@\@nameuse{hit@#1@@name}@\@nameuse{hit@\@nameuse{hit@#1@@name}}%
+ }{%
+ \hit@error{Invalid value "#1 = \@nameuse{hit@\@nameuse{hit@#1@@name}}"}%
+ }%
+ \@nameuse{hit@#1@@reset}%
+ \@nameuse{hit@\@nameuse{hit@#1@@name}@\@nameuse{hit@\@nameuse{hit@#1@@name}}true}%
+ }%
+ }%
+ \kv@define@key{hit@value}{default}{%
+ \def\hit@@default{##1}%
+ }%
+ \kvsetkeys{hit@value}{#2}%
+ \@namedef{hit@\@nameuse{hit@#1@@name}}{}%
+% \end{macrocode}
+%
+% 第一个 \meta{choice} 设为 \meta{default},
+% 并且对每个 \meta{choice} 定义 \cs{ifhit@\meta{name}@\meta{choice}}。
+%
+% \begin{macrocode}
+ \kv@set@family@handler{hit@choice}{%
+ \ifx\hit@@default\@empty
+ \def\hit@@default{##1}%
+ \fi
+ \expandafter\newif\csname ifhit@\@nameuse{hit@#1@@name}@##1\endcsname
+ \expandafter\g@addto@macro\csname hit@#1@@reset\endcsname{%
+ \@nameuse{hit@\@nameuse{hit@#1@@name}@##1false}%
+ }%
+ }%
+ \kvsetkeys@expandafter{hit@choice}{\hit@@choices}%
+% \end{macrocode}
+%
+% 将 \meta{default} 赋值到 \cs{hit@\meta{name}},如果非空则执行相应的代码。
+%
+% \begin{macrocode}
+ \expandafter\let\csname hit@\@nameuse{hit@#1@@name}\endcsname\hit@@default
+ \expandafter\ifx\csname hit@\@nameuse{hit@#1@@name}\endcsname\@empty\else
+ \@nameuse{hit@#1@@check}%
+ \fi
+% \end{macrocode}
+%
+% 定义 \cs{hitsetup} 接口。
+%
+% \begin{macrocode}
+ \kv@define@key{hit}{#1}{%
+ \@namedef{hit@\@nameuse{hit@#1@@name}}{##1}%
+ \@nameuse{hit@#1@@check}%
+ \@nameuse{hit@#1@@code}%
+ }%
+}
+% \end{macrocode}
+%
+% 定义接口向 |key| 添加 |code|:
+%
+% \begin{macrocode}
+\newcommand\hit@option@hook[2]{%
+ \expandafter\g@addto@macro\csname hit@#1@@code\endcsname{#2}%
+}
+% \end{macrocode}
+% 报告撰写的校区
+% \begin{macrocode}
+\hit@define@key{
+ campus = {
+ name = campus,
+ choices = {
+ harbin,
+ shenzhen,
+ weihai,
+ },
+ },
+% \end{macrocode}
+%
+% 字体
+% \begin{macrocode}
+ fontset = {
+ choices = {
+ windows,
+ mac,
+ ubuntu,
+ fandol,
+ none,
+ },
+ default = none,
+ },
+ system = {
+ choices = {
+ mac,
+ unix,
+ windows,
+ auto,
+ },
+ default = auto,
+ },
+ font = {
+ choices = {
+ times,
+ termes,
+ xits,
+ libertinus,
+ lm,
+ auto,
+ none,
+ },
+ default = auto,
+ },
+ cjk-font = {
+ name = cjk@font,
+ choices = {
+ windows,
+ mac,
+ noto,
+ fandol,
+ auto,
+ none,
+ },
+ default = auto,
+ },
+ math-font = {
+ name = math@font,
+ choices = {
+ xits,
+ stix,
+ libertinus,
+ lm,
+ none,
+ },
+ default = xits,
+ },
+ math-style = {
+ name = math@style,
+ choices = {
+ GB,
+ ISO,
+ TeX,
+ },
+ default = GB,
+ },
+}
+% \end{macrocode}
+%
+%
+% 定义关键字
+% \begin{macrocode}
+\newcommand\hit@tokens@keywords{}
+\ProcessOptions\relax
+% \end{macrocode}
+%
+%
+%
+% \subsection{装载宏包}
+% \label{sec:loadpackage}
+%
+% 设置默认 \option{openany}。
+% \begin{macrocode}
+\DeclareBoolOption[false]{openright}
+\DeclareComplementaryOption{openany}{openright}
+% \end{macrocode}
+%
+% \option{raggedbottom} 选项(默认打开)
+% \begin{macrocode}
+\DeclareBoolOption[true]{raggedbottom}
+% \end{macrocode}
+% 将选项传递给 \pkg{ctexbook}。
+% \begin{macrocode}
+\DeclareDefaultOption{\PassOptionsToClass{\CurrentOption}{ctexbook}}
+% \end{macrocode}
+%
+% 解析用户传递过来的选项,并加载 \pkg{ctexbook}。
+% \begin{macrocode}
+\ProcessKeyvalOptions*
+% \end{macrocode}
+%
+% 设置默认 \option{openany}。
+% \begin{macrocode}
+\ifhit@openright
+ \PassOptionsToClass{openright}{book}
+\else
+ \PassOptionsToClass{openany}{book}
+\fi
+% \end{macrocode}
+%
+% 使用 \pkg{ctexbook} 宏包,优于调用 \pkg{ctex} 宏包
+% \begin{macrocode}
+\PassOptionsToPackage{quiet}{fontspec}
+\LoadClass[a4paper,UTF8,zihao=-4,scheme=plain,fontset=none]{ctexbook}[2017/04/01]
+% \end{macrocode}
+%
+% 引用宏包和相关定义
+% \begin{macrocode}
+\RequirePackage{etoolbox}
+\RequirePackage{filehook}
+\RequirePackage{xparse}
+% \end{macrocode}
+%
+% 设置页面布局
+% \begin{macrocode}
+\RequirePackage{geometry}
+\geometry{
+ paper = a4paper, % 210 * 297mm
+ marginparwidth = 2cm,
+ marginparsep = 0.5cm,
+}
+\newcommand\hit@set@geometry{%
+ \geometry{
+ margin = 3cm,
+ headheight = 0.5cm,
+ headsep = 0.3cm,
+ footskip = 0.8cm,
+ }%
+}
+\hit@set@geometry
+% \end{macrocode}
+%
+% 利用 \pkg{fancyhdr} 设置页眉页脚。
+% \begin{macrocode}
+\RequirePackage{fancyhdr}
+% \end{macrocode}
+%
+% 设置目录
+% \begin{macrocode}
+\RequirePackage{titletoc}
+% \end{macrocode}
+%
+% 利用 \pkg{notoccite} 避免目录中引用编号混乱。
+% \begin{macrocode}
+\RequirePackage{notoccite}
+% \end{macrocode}
+%
+%
+% 数学宏包,\AmSTeX\ 宏包,用来排公式。
+% \begin{macrocode}
+\RequirePackage{amsmath}
+% \end{macrocode}
+%
+% 使用 \pkg{unicode-math} 处理数学字体。
+% \begin{macrocode}
+\RequirePackage{unicode-math}
+% \end{macrocode}
+%
+% 支持tikz画图
+% \begin{macrocode}
+\RequirePackage{tikz}
+% \end{macrocode}
+%
+% \pkg{pdfpages} 宏包便于插入 PDF 文档。
+% \begin{macrocode}
+\RequirePackage{pdfpages}
+\includepdfset{fitpaper=true}
+% \end{macrocode}
+%
+% 设置颜色
+% \begin{macrocode}
+\RequirePackage{xcolor}
+% \end{macrocode}
+%
+% 支持插入图片
+% \begin{macrocode}
+\RequirePackage{graphicx}
+% \end{macrocode}
+%
+% 并排图形。\pkg{subfigure}、\pkg{subfig} 已经不再推荐,用新的 \pkg{subcaption}。
+% 浮动图形和表格标题样式。\pkg{caption2} 已经不推荐使用,采用新的 \pkg{caption}。
+% \begin{macrocode}
+\RequirePackage[labelformat=simple]{subcaption}
+% \end{macrocode}
+%
+% 支持文章内部引用
+% \begin{macrocode}
+\RequirePackage{hyperref}
+% \end{macrocode}
+%
+% 支持添加表格
+% \begin{macrocode}
+\RequirePackage{array}
+% \end{macrocode}
+%
+% 支持表格跨页显示,booktabs 提供了 \cs{toprule} 等命令.
+% \begin{macrocode}
+\RequirePackage{longtable}
+\RequirePackage{booktabs}
+% \end{macrocode}
+%
+% multirow 支持在表格中跨行
+% \begin{macrocode}
+\RequirePackage{multirow}
+% \end{macrocode}
+%
+% 支持表格过长跨页显示
+% \begin{macrocode}
+\RequirePackage{threeparttable}
+% \end{macrocode}
+%
+% 调整间隔, 让表格更好看些
+% \begin{macrocode}
+\RequirePackage{bigstrut}
+% \end{macrocode}
+%
+% 在跨行表格中输入定界符
+% \begin{macrocode}
+\RequirePackage{bigdelim}
+% \end{macrocode}
+%
+% 设置代码环境
+% \begin{macrocode}
+\RequirePackage{listings}
+% \end{macrocode}
+%
+% 支持代码根据语言类型高亮
+% \begin{macrocode}
+\RequirePackage{xcolor}
+% \end{macrocode}
+%
+% 支持url引用
+% \begin{macrocode}
+\RequirePackage{url}
+% \end{macrocode}
+%
+%
+% \subsubsection{\pkg{algorithm} 宏包}
+%
+% 使 \env{algorithm} 和 \env{listing} 环境的名称随语言设置而改变,
+% 并使其在附录中的编号规则与图、表等一致。
+%
+% \begin{macro}{\listofalgorithm}
+% \begin{macro}{\listofalgorithm*}
+% \begin{macrocode}
+\PassOptionsToPackage{chapter}{algorithm}
+\AtEndOfPackageFile*{algorithm}{
+ \floatname{algorithm}{\thu@algorithm@name}
+ \renewcommand\listofalgorithms{%
+ \hit@listof{algorithm}%
+ }
+ \renewcommand\listalgorithmname{\hit@list@algorithm@name}
+ \def\ext@algorithm{loa}
+ \contentsuse{algorithm}{loa}
+ \titlecontents{algorithm}
+ [\z@]{}
+ {\contentspush{\fname@algorithm~\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{\pkg{algorithm2e} 宏包}
+%
+% \begin{macrocode}
+\PassOptionsToPackage{algochapter}{algorithm2e}
+\AtEndOfPackageFile*{algorithm2e}{
+ \renewcommand\algorithmcfname{\hit@algorithm@name}
+ \SetAlgoCaptionLayout{thu@caption@font}
+ \SetAlCapSty{relax}
+ \SetAlgoCaptionSeparator{\hspace*{1em}}
+ \SetAlFnt{\fontsize{11bp}{14.3bp}\selectfont}
+ \renewcommand\listofalgorithms{%
+ \hit@listof{algorithmcf}%
+ }
+ \renewcommand\listalgorithmcfname{\hit@list@algorithm@name}
+ \def\ext@algorithmcf{loa}
+ \contentsuse{algocf}{loa}
+ \titlecontents{algocf}
+ [\z@]{}
+ {\contentspush{\algorithmcfname~\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}
+}
+% \end{macrocode}
+%
+% \subsubsection{\pkg{minted} 宏包}
+%
+% \begin{macrocode}
+\AtEndOfPackageFile*{minted}{
+ \newcommand\hit@set@listing@language{%
+ \floatname{listing}{代码}%
+ }
+ \hit@set@listing@language
+}
+% \end{macrocode}
+%
+%
+%
+% 如果用户在导言区未调用 \pkg{biblatex},则自动调用 \pkg{natbib}。
+% \begin{macrocode}
+\AtEndPreamble{
+ \@ifpackageloaded{biblatex}{}{
+ \@ifpackageloaded{apacite}{}{
+ \RequirePackage{natbib}
+ }
+ }
+}
+\AtEndOfPackageFile*{natbib}{
+ \@ifpackageloaded{apacite}{}{
+ \RequirePackage{bibunits}
+ }
+}
+% \end{macrocode}
+%
+% 对冲突的宏包报错。
+% \begin{macrocode}
+\newcommand\hit@package@conflict[2]{
+ \AtBeginOfPackageFile*{#2}{
+ \hit@error{The "#2" package is incompatible with required "#1"}
+ }
+}
+\hit@package@conflict{unicode-math}{amscd}
+\hit@package@conflict{unicode-math}{amsfonts}
+\hit@package@conflict{unicode-math}{amssymb}
+\hit@package@conflict{unicode-math}{bbm}
+\hit@package@conflict{unicode-math}{bm}
+\hit@package@conflict{unicode-math}{eucal}
+\hit@package@conflict{unicode-math}{eufrak}
+\hit@package@conflict{unicode-math}{mathrsfs}
+% \end{macrocode}
+%
+% 支持文中引用
+% \begin{macrocode}
+\RequirePackage{cite}
+% \end{macrocode}
+%
+% 插入代码,进行设置
+% \begin{macrocode}
+\RequirePackage{listings}
+\lstset{
+ numbers=left, %设置行号位置
+ numberstyle=\tiny, %设置行号大小
+ keywordstyle=\color{blue}, %设置关键字颜色
+ commentstyle=\color[cmyk]{1,0,1,0}, %设置注释颜色
+ frame=single, %设置边框格式
+ escapeinside=``, %逃逸字符(1左面的键),用于显示中文
+ breaklines, %自动折行
+ extendedchars=false, %解决代码跨页时,章节标题,页眉等汉字不显示的问题
+ xleftmargin=2em,
+ xrightmargin=2em,
+ aboveskip=1em, %设置边距
+ tabsize=4, %设置tab空格数
+ showspaces=false, %不显示空格
+ belowskip=3mm,
+ showstringspaces=false,columns=flexible,
+ framerule=1pt,
+ rulecolor=\color{gray!35},
+ backgroundcolor=\color{gray!5},
+ basicstyle={\small\ttfamily},
+ stringstyle=\color{mauve},
+ breakatwhitespace=true
+}
+% \end{macrocode}
+%
+% 重定义颜色
+% \begin{macrocode}
+\definecolor{dkgreen}{rgb}{0,0.6,0}
+\definecolor{gray}{rgb}{0.5,0.5,0.5}
+\definecolor{mauve}{rgb}{0.58,0,0.82}
+% \end{macrocode}
+% 定义首行缩进
+% \begin{macrocode}
+\RequirePackage{indentfirst}
+% \end{macrocode}
+% 设置浮动体标题
+% \begin{macrocode}
+\RequirePackage{caption}
+% \end{macrocode}
+% 设置列表环境
+% \begin{macrocode}
+\RequirePackage[shortlabels]{enumitem}
+\RequirePackage{environ}
+% \end{macrocode}
+%
+% 禁止 \LaTeX{} 自动调整多余的页面底部空白,并保持脚注仍然在底部。
+% 脚注按页编号。
+% \begin{macrocode}
+\ifhit@raggedbottom
+ \RequirePackage[bottom,perpage,hang]{footmisc}
+ \raggedbottom
+\else
+ \RequirePackage[perpage,hang]{footmisc}
+\fi
+% \end{macrocode}
+%
+% 利用 \pkg{xeCJKfntef} 实现汉字的下划线和盒子内两段对齐,并可以避免
+% \cs{makebox}\oarg{width}\oarg{s} 可能产生的 underful boxes。
+% \begin{macrocode}
+\RequirePackage{xeCJKfntef}
+\RequirePackage{soul}
+% \end{macrocode}
+%
+% 下划线
+% \begin{macrocode}
+\RequirePackage{ulem}
+%
+% \end{macrocode}
+% 尺寸计算
+% \begin{macrocode}
+\RequirePackage{calc}
+% \end{macrocode}
+% 支持插入附录
+% \begin{macrocode}
+\RequirePackage[titletoc,title]{appendix}
+\AtBeginEnvironment{thebibliography}{%
+ \phantomsection
+ \addcontentsline{toc}{section}{\refname}
+ }
+% \end{macrocode}
+%
+% 修改tabular 环境, 设置表格中的行间距为正文行间距.
+% \begin{macrocode}
+\let\hitreport@oldtabular\tabular
+\let\hitreport@endoldtabular\endtabular
+\renewenvironment{tabular}%
+ {\bgroup%
+ \renewcommand{\arraystretch}{1.2}%
+ \hitreport@oldtabular}%
+ {\hitreport@endoldtabular\egroup}
+% \end{macrocode}
+% 段首缩进两个汉字
+% \begin{macrocode}
+\setlength\parindent{2em}
+% \end{macrocode}
+%
+% \subsection{主文档格式}
+% \label{sec:mainbody}
+%
+% \subsubsection{Three matters}
+% \begin{macro}{\cleardoublepage}
+% 对于 \textsl{openright} 选项,必须保证章首页右开,且如果前章末页无内容须
+% 清空其页眉页脚。
+% \begin{macrocode}
+\def\cleardoublepage{%
+ \clearpage
+ \if@twoside
+ \ifodd\c@page
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\frontmatter}
+% \begin{macro}{\mainmatter}
+% \begin{macro}{\backmatter}
+% 我们的单面和双面模式与常规的不太一样。
+% \begin{macrocode}
+\renewcommand\frontmatter{%
+ \cleardoublepage
+ \@mainmatterfalse
+ \pagenumbering{Roman}%
+}
+\renewcommand\mainmatter{%
+ \cleardoublepage
+ \@mainmattertrue
+ \pagenumbering{arabic}%
+}
+\renewcommand\backmatter{%
+ \if@openright
+ \cleardoublepage
+ \else
+ \clearpage
+ \fi
+ \@mainmatterfalse
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{字体}
+% \label{sec:font}
+% 使用 \pkg{fontspec} 配置字体。
+% \begin{macrocode}
+\ifhit@fontset@mac
+ \hitsetup{
+ font = times,
+ cjk-font = mac,
+ }
+\else
+ \ifhit@fontset@windows
+ \hitsetup{
+ font = times,
+ cjk-font = windows,
+ }
+ \else
+ \ifhit@fontset@fandol
+ \hitsetup{
+ font = termes,
+ cjk-font = fandol,
+ }
+ \else
+ \ifhit@fontset@ubuntu
+ \hitsetup{
+ font = termes,
+ cjk-font = noto,
+ }
+ \fi
+ \fi
+ \fi
+\fi
+% \end{macrocode}
+%
+% 检测系统
+% \begin{macrocode}
+\ifhit@system@auto
+ \IfFileExists{/System/Library/Fonts/Menlo.ttc}{
+ \hitsetup{system = mac}
+ }{
+ \IfFileExists{/dev/null}{
+ \IfFileExists{null:}{
+ \hitsetup{system = windows}
+ }{
+ \hitsetup{system = unix}
+ }
+ }{
+ \hitsetup{system = windows}
+ }
+ }
+\fi
+% \end{macrocode}
+%
+% XITS 字体于 2018-10-03 更改了字体的文件名,所以需要判断。
+% 原文件名为 \file{xits-regular.otf}、\file{xits-math.otf} 等,
+% 后改为 \file{XITS-Regular.otf}、\file{XITSMath-Regular.otf} 等。
+%
+% Libertinus 字体同样。
+% \begin{macrocode}
+\let\hit@font@family@xits\@empty
+\newcommand\hit@set@xits@names{%
+ \ifx\hit@font@family@xits\@empty
+ \IfFontExistsTF{XITSMath-Regular.otf}{%
+ \gdef\hit@font@family@xits{XITS}%
+ \gdef\hit@font@style@xits@rm{Regular}%
+ \gdef\hit@font@style@xits@bf{Bold}%
+ \gdef\hit@font@style@xits@it{Italic}%
+ \gdef\hit@font@style@xits@bfit{BoldItalic}%
+ \gdef\hit@font@name@xits@math@rm{XITSMath-Regular}%
+ \gdef\hit@font@name@xits@math@bf{XITSMath-Bold}%
+ }{%
+ \gdef\hit@font@family@xits{xits}%
+ \gdef\hit@font@style@xits@rm{regular}%
+ \gdef\hit@font@style@xits@bf{bold}%
+ \gdef\hit@font@style@xits@it{italic}%
+ \gdef\hit@font@style@xits@bfit{bolditalic}%
+ \gdef\hit@font@name@xits@math@rm{xits-math}%
+ \gdef\hit@font@name@xits@math@bf{xits-mathbold}%
+ }%
+ \fi
+}
+\let\hit@font@family@libertinus\@empty
+\newcommand\hit@set@libertinus@names{%
+ \ifx\hit@font@family@libertinus\@empty
+ \IfFontExistsTF{LibertinusSerif-Regular.otf}{%
+ \gdef\hit@font@family@libertinus@serif{LibertinusSerif}%
+ \gdef\hit@font@family@libertinus@sans{LibertinusSans}%
+ \gdef\hit@font@name@libertinus@math{LibertinusMath-Regular}%
+ \gdef\hit@font@style@libertinus@rm{Regular}%
+ \gdef\hit@font@style@libertinus@bf{Bold}%
+ \gdef\hit@font@style@libertinus@it{Italic}%
+ \gdef\hit@font@style@libertinus@bfit{BoldItalic}%
+ }{%
+ \gdef\hit@font@family@libertinus@serif{libertinusserif}%
+ \gdef\hit@font@family@libertinus@sans{libertinussans}%
+ \gdef\hit@font@name@libertinus@math{libertinusmath-regular}%
+ \gdef\hit@font@style@libertinus@rm{regular}%
+ \gdef\hit@font@style@libertinus@bf{bold}%
+ \gdef\hit@font@style@libertinus@it{italic}%
+ \gdef\hit@font@style@libertinus@bfit{bolditalic}%
+ }%
+ \fi
+}
+% \end{macrocode}
+%
+% 一般的报告要求西文字体使用 Times New Roman 和 Arial,
+% 但是在 Linux 下没有这两个字体,所以使用它们的克隆版 TeX Gyre Termes 和
+% TeX Gyre Heros。
+% \begin{macrocode}
+\ifhit@font@auto
+ \ifhit@system@unix
+ \hitsetup{font=termes}
+ \else
+ \hitsetup{font=times}
+ \fi
+\fi
+\newcommand\hit@load@font@times{%
+ \setmainfont{Times New Roman}%
+ \setsansfont{Arial}%
+ \ifhit@system@mac
+ \setmonofont{Menlo}[Scale = MatchLowercase]%
+ \else
+ \setmonofont{Courier New}[Scale = MatchLowercase]%
+ \fi
+}
+\newcommand\hit@load@font@termes{%
+ \setmainfont{texgyretermes}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-italic,
+ BoldItalicFont = *-bolditalic,
+ ]%
+ \hit@load@texgyre@sans@mono
+}
+\newcommand\hit@load@texgyre@sans@mono{%
+ \setsansfont{texgyreheros}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-italic,
+ BoldItalicFont = *-bolditalic,
+ ]%
+ \setmonofont{texgyrecursor}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-italic,
+ BoldItalicFont = *-bolditalic,
+ Ligatures = CommonOff,
+ ]%
+}
+\newcommand\hit@load@font@xits{%
+ \hit@set@xits@names
+ \setmainfont{\hit@font@family@xits}[
+ Extension = .otf,
+ UprightFont = *-\hit@font@style@xits@rm,
+ BoldFont = *-\hit@font@style@xits@bf,
+ ItalicFont = *-\hit@font@style@xits@it,
+ BoldItalicFont = *-\hit@font@style@xits@bfit,
+ ]%
+ \hit@load@texgyre@sans@mono
+}
+\newcommand\hit@load@font@libertinus{%
+ \hit@set@libertinus@names
+ \setmainfont{\hit@font@family@libertinus@serif}[
+ Extension = .otf,
+ UprightFont = *-\hit@font@style@libertinus@rm,
+ BoldFont = *-\hit@font@style@libertinus@bf,
+ ItalicFont = *-\hit@font@style@libertinus@it,
+ BoldItalicFont = *-\hit@font@style@libertinus@bfit,
+ ]%
+ \setsansfont{\hit@font@family@libertinus@sans}[
+ Extension = .otf,
+ UprightFont = *-\hit@font@style@libertinus@rm,
+ BoldFont = *-\hit@font@style@libertinus@bf,
+ ItalicFont = *-\hit@font@style@libertinus@it,
+ ]%
+ \setmonofont{lmmonolt10}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-oblique,
+ BoldItalicFont = *-boldoblique,
+ ]%
+}
+\@namedef{hit@load@font@lm}{%
+ \setmainfont{lmroman10}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-italic,
+ BoldItalicFont = *-bolditalic,
+ ]%
+ \setsansfont{lmsans10}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-oblique,
+ BoldItalicFont = *-boldoblique,
+ ]%
+ \setmonofont{lmmonolt10}[
+ Extension = .otf,
+ UprightFont = *-regular,
+ BoldFont = *-bold,
+ ItalicFont = *-oblique,
+ BoldItalicFont = *-boldoblique,
+ ]%
+}
+\newcommand\hit@load@font{%
+ \@nameuse{hit@load@font@\hit@font}%
+}
+\hit@load@font
+\hit@option@hook{font}{\hit@load@font}
+% \end{macrocode}
+%
+% 使用 \pkg{unicode-math} 配置数学符号格式。
+% \begin{macrocode}
+\newcommand\hit@stix@stylistic@set{%
+ \ifhit@math@style@TeX\else
+ 8
+ \fi
+}
+\newcommand\hit@set@math@style{%
+ \ifhit@math@style@TeX
+ \unimathsetup{
+ math-style = TeX,
+ bold-style = TeX,
+ partial = italic,
+ }%
+ \else
+ \unimathsetup{
+ math-style = ISO,
+ bold-style = ISO,
+ partial = upright,
+ }%
+ \fi
+ \ifhit@math@style@GB
+ \protected\def\le{\leqslant}%
+ \protected\def\ge{\geqslant}%
+ \DeclareRobustCommand\mathellipsis{\mathinner{\unicodecdots}}%
+ \else
+ \protected\def\le{\leq}%
+ \protected\def\ge{\geq}%
+ \DeclareRobustCommand\mathellipsis{\mathinner{\unicodeellipsis}}%
+ \fi
+}
+\hitsetup{math-style=GB}%
+\hit@set@math@style
+\hit@option@hook{math-style}{\hit@set@math@style}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\hit@load@math@font@xits{%
+ \hit@set@xits@names
+ \setmathfont{\hit@font@name@xits@math@rm}[
+ Extension = .otf,
+ StylisticSet = \hit@stix@stylistic@set,
+ ]%
+ \setmathfont{\hit@font@name@xits@math@rm}[
+ Extension = .otf,
+ StylisticSet = 1,
+ range = {cal,bfcal},
+ ]%
+}
+\newcommand\hit@load@math@font@stix{%
+ \setmathfont{STIX2Math}[
+ Extension = .otf,
+ StylisticSet = \hit@stix@stylistic@set,
+ ]%
+ \setmathfont{STIX2Math}[
+ Extension = .otf,
+ StylisticSet = 1,
+ range = {cal,bfcal},
+ ]%
+}
+\newcommand\hit@load@math@font@libertinus{%
+ \hit@set@libertinus@names
+ \setmathfont{\hit@font@name@libertinus@math .otf}%
+}
+\newcommand\hit@load@math@font@lm{%
+ \setmathfont{latinmodern-math.otf}%
+}
+\newcommand\hit@load@math@font{%
+ \@nameuse{hit@load@math@font@\hit@math@font}
+}
+\hit@load@math@font
+\hit@option@hook{math-font}{\hit@load@math@font}
+\hit@option@hook{math-style}{\hit@load@math@font}
+% \end{macrocode}
+%
+%
+% 中文字体
+% \begin{macrocode}
+\ifhit@cjk@font@auto
+ \ifhit@system@mac
+ \hitsetup{cjk-font = mac}
+ \else
+ \ifhit@system@windows
+ \hitsetup{cjk-font = windows}
+ \else
+ \IfFontExistsTF{Noto Serif CJK SC}{
+ \hitsetup{cjk-font = noto}
+ }{
+ \hitsetup{cjk-font = fandol}
+ }
+ \fi
+ \fi
+\fi
+\newcommand\hit@load@cjk@font@windows{%
+ \xeCJKsetup{EmboldenFactor=3}%
+ \setCJKmainfont{SimSun}[
+ AutoFakeBold = true,
+ ItalicFont = KaiTi,
+ ]%
+ \setCJKsansfont{SimHei}[AutoFakeBold]%
+ \setCJKmonofont{FangSong}%
+ \setCJKfamilyfont{zhsong}{SimSun}[AutoFakeBold]%
+ \setCJKfamilyfont{zhhei}{SimHei}[AutoFakeBold]%
+ \setCJKfamilyfont{zhkai}{KaiTi}%
+ \setCJKfamilyfont{zhfs}{FangSong}%
+ \setCJKfamilyfont{hwxk}{STXingkai}%
+}
+\newcommand\hit@load@cjk@font@mac{%
+ \setCJKmainfont{Songti SC}[
+ UprightFont = * Light,
+ BoldFont = * Bold,
+ ItalicFont = Kaiti SC,
+ BoldItalicFont = Kaiti SC Bold,
+ ]%
+ \setCJKsansfont{Heiti SC}[BoldFont=* Medium]%
+ \setCJKmonofont{STFangsong}
+ \setCJKfamilyfont{zhsong}{Songti SC}[
+ UprightFont = * Light,
+ BoldFont = * Bold,
+ ]%
+ \setCJKfamilyfont{zhhei}{Heiti SC}[
+ UprightFont = * Light,
+ BoldFont = * Medium,
+ ]%
+ \setCJKfamilyfont{zhfs}{STFangsong}%
+ \setCJKfamilyfont{hwxk}{STXingkai}%
+ \setCJKfamilyfont{zhkai}{Kaiti SC}[BoldFont = * Bold]%
+ \setCJKfamilyfont{zhli}{Baoli SC}%
+ \setCJKfamilyfont{zhyuan}{Yuanyi SC}[
+ UprightFont = * Light,
+ BoldFont = * Bold,
+ ]%
+}
+% \end{macrocode}
+%
+% 注意 Noto CJK 的 regular 字重名字不带“Regular”。
+% \begin{macrocode}
+\newcommand\hit@load@cjk@font@noto{%
+ \setCJKmainfont{Noto Serif CJK SC}[
+ UprightFont = * Light,
+ BoldFont = * Bold,
+ ItalicFont = FandolKai-Regular,
+ ItalicFeatures = {Extension = .otf},
+ ]%
+ \setCJKsansfont{Noto Sans CJK SC}[
+ BoldFont = * Medium,
+ ]%
+ \setCJKmonofont{Noto Sans Mono CJK SC}%
+ \setCJKfamilyfont{zhsong}{Noto Serif CJK SC}[
+ UprightFont = * Light,
+ UprightFont = * Bold,
+ ]%
+ \setCJKfamilyfont{zhhei}{Noto Sans CJK SC}[
+ BoldFont = * Medium,
+ ]%
+ \setCJKfamilyfont{zhfs}{FandolFang}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+ \setCJKfamilyfont{zhkai}{FandolKai}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+ \setCJKfamilyfont{hwxk}{STXingkai}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+}
+\newcommand\hit@load@cjk@font@fandol{%
+ \setCJKmainfont{FandolSong}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = FandolKai-Regular,
+ ]%
+ \setCJKsansfont{FandolHei}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]%
+ \setCJKmonofont{FandolFang}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+ \setCJKfamilyfont{zhsong}{FandolSong}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]%
+ \setCJKfamilyfont{zhhei}{FandolHei}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]%
+ \setCJKfamilyfont{zhfs}{FandolFang}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+ \setCJKfamilyfont{zhkai}{FandolKai}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+ \setCJKfamilyfont{hwxk}{FandolKai}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]%
+}
+\ifhit@cjk@font@none\else
+ \providecommand\songti{\CJKfamily{zhsong}}
+ \providecommand\heiti{\CJKfamily{zhhei}}
+ \providecommand\fangsong{\CJKfamily{zhfs}}
+ \providecommand\kaishu{\CJKfamily{zhkai}}
+ \providecommand\huawenxingkai{\CJKfamily{hwxk}}
+\fi
+\newcommand\hit@load@cjk@font{%
+ \@nameuse{hit@load@cjk@font@\hit@cjk@font}%
+}
+\hit@load@cjk@font
+\hit@option@hook{cjk-font}{\hit@load@cjk@font}
+% \end{macrocode}
+%
+% \begin{macro}{\normalsize}
+% 正文小四号 (12bp) 字,行距为固定值 20 bp。
+% 其他字号的行距按照相同的比例设置。
+%
+% 表达式行的行距为单倍行距,段前空 6 磅,段后空 6 磅。
+% \begin{macrocode}
+\renewcommand\normalsize{%
+ \@setfontsize\normalsize{12bp}{20bp}%
+ \abovedisplayskip 6bp%
+ \abovedisplayshortskip 6bp%
+ \belowdisplayskip 6bp
+ \belowdisplayshortskip \abovedisplayshortskip}
+
+\normalsize
+\ifx\MakeRobust\@undefined \else
+ \MakeRobust\normalsize
+\fi
+\DeclareRobustCommand\small{%
+ \@setfontsize\small{10.5bp}{17.5bp}%
+ \abovedisplayskip 6bp%
+ \abovedisplayshortskip 6bp%
+ \belowdisplayshortskip 6bp%
+ \def\@listi{\leftmargin\leftmargini
+ \topsep \z@skip
+ \parsep \z@skip
+ \itemsep \z@skip}%
+ \belowdisplayskip \abovedisplayskip
+}
+\DeclareRobustCommand\footnotesize{%
+ \@setfontsize\footnotesize{9bp}{15bp}%
+ \abovedisplayskip 6bp%
+ \abovedisplayshortskip 6bp%
+ \belowdisplayshortskip 6bp%
+ \def\@listi{\leftmargin\leftmargini
+ \topsep \z@skip
+ \parsep \z@skip
+ \itemsep \z@skip}%
+ \belowdisplayskip \abovedisplayskip
+}
+\DeclareRobustCommand\scriptsize{\@setfontsize\scriptsize{7.5bp}{12.5bp}}
+\DeclareRobustCommand\tiny{\@setfontsize\tiny{6.5bp}{10.83bp}}
+\DeclareRobustCommand\large{\@setfontsize\large{15bp}{25bp}}
+\DeclareRobustCommand\Large{\@setfontsize\Large{18bp}{30bp}}
+\DeclareRobustCommand\LARGE{\@setfontsize\LARGE{22bp}{36.67bp}}
+\DeclareRobustCommand\huge{\@setfontsize\huge{24bp}{40bp}}
+\DeclareRobustCommand\Huge{\@setfontsize\Huge{26bp}{43.33bp}}
+% \end{macrocode}
+% \end{macro}
+%
+% WORD 中的字号对应该关系如下(1bp = 72.27/72 pt):
+% \begin{center}
+% \begin{longtable}{llll}
+% \toprule
+% 初号 & 42bp & 14.82mm & 42.1575pt \\
+% 小初 & 36bp & 12.70mm & 36.135 pt \\
+% 一号 & 26bp & 9.17mm & 26.0975pt \\
+% 小一 & 24bp & 8.47mm & 24.09pt \\
+% 二号 & 22bp & 7.76mm & 22.0825pt \\
+% 小二 & 18bp & 6.35mm & 18.0675pt \\
+% 三号 & 16bp & 5.64mm & 16.06pt \\
+% 小三 & 15bp & 5.29mm & 15.05625pt \\
+% 四号 & 14bp & 4.94mm & 14.0525pt \\
+% 小四 & 12bp & 4.23mm & 12.045pt \\
+% 五号 & 10.5bp & 3.70mm & 10.59375pt \\
+% 小五 & 9bp & 3.18mm & 9.03375pt \\
+% 六号 & 7.5bp & 2.56mm & \\
+% 小六 & 6.5bp & 2.29mm & \\
+% 七号 & 5.5bp & 1.94mm & \\
+% 八号 & 5bp & 1.76mm & \\\bottomrule
+% \end{longtable}
+% \end{center}
+%
+% \begin{macro}{\hit@def@fontsize}
+% 根据习惯定义字号。用法:
+%
+% \cs{hit@def@fontsize}\marg{字号名称}\marg{磅数}
+%
+% 避免了字号选择和行距的紧耦合。所有字号定义时为单倍行距,并提供选项指定行距倍数。
+% \begin{macrocode}
+\def\hit@def@fontsize#1#2{%
+ \expandafter\newcommand\csname #1\endcsname[1][1.3]{%
+ \fontsize{#2}{##1\dimexpr #2}\selectfont}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\chuhao}
+% \begin{macro}{\xiaochu}
+% \begin{macro}{\yihao}
+% \begin{macro}{\xiaoyi}
+% \begin{macro}{\erhao}
+% \begin{macro}{\xiaoer}
+% \begin{macro}{\sanhao}
+% \begin{macro}{\xiaosan}
+% \begin{macro}{\sihao}
+% \begin{macro}{\xiaosi}
+% \begin{macro}{\wuhao}
+% \begin{macro}{\xiaowu}
+% \begin{macro}{\liuhao}
+% \begin{macro}{\xiaoliu}
+% \begin{macro}{\qihao}
+% \begin{macro}{\bahao}
+% 一组字号定义。
+% \begin{macrocode}
+\hit@def@fontsize{chuhao}{42bp}
+\hit@def@fontsize{xiaochu}{36bp}
+\hit@def@fontsize{yihao}{26bp}
+\hit@def@fontsize{xiaoyi}{24bp}
+\hit@def@fontsize{erhao}{22bp}
+\hit@def@fontsize{xiaoer}{18bp}
+\hit@def@fontsize{sanhao}{16bp}
+\hit@def@fontsize{xiaosan}{15bp}
+\hit@def@fontsize{sihao}{14bp}
+\hit@def@fontsize{xiaosi}{12bp}
+\hit@def@fontsize{wuhao}{10.5bp}
+\hit@def@fontsize{xiaowu}{9bp}
+\hit@def@fontsize{liuhao}{7.5bp}
+\hit@def@fontsize{xiaoliu}{6.5bp}
+\hit@def@fontsize{qihao}{5.5bp}
+\hit@def@fontsize{bahao}{5bp}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+%
+% \subsubsection{文章标题设置}
+% \label{sec:paragraphlanguage}
+%
+% 。
+% \begin{macrocode}
+\newcommand\hit@set@chapter@names{%
+ \ctexset{
+ chapter/name = {第,章},
+ }%
+ \def\bibname{参考文献}%
+ \def\appendixname{附录}%
+ \def\indexname{索引}%
+ \def\contentsname{目\quad 录}%
+ \def\listfigurename{插图索引}%
+ \def\listtablename{表格索引}%
+ \def\hit@list@figure@table@name{插图和附表索引}%
+ \def\hit@list@algorithm@name{算法索引}%
+ \def\listequationname{公式索引}%
+}
+\hit@set@chapter@names
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand\hit@set@names{%
+ \ctexset{
+ figurename = 图,
+ tablename = 表,
+ }%
+ \def\hit@algorithm@name{算法}%
+ \def\hit@equation@name{公式}%
+ \def\hit@assumption@name{假设}%
+ \def\hit@definition@name{定义}%
+ \def\hit@proposition@name{命题}%
+ \def\hit@lemma@name{引理}%
+ \def\hit@theorem@name{定理}%
+ \def\hit@axiom@name{公理}%
+ \def\hit@corollary@name{推论}%
+ \def\hit@exercise@name{练习}%
+ \def\hit@example@name{例}%
+ \def\hit@remark@name{注释}%
+ \def\hit@problem@name{问题}%
+ \def\hit@conjecture@name{猜想}%
+ \def\hit@proof@name{证明}%
+ \def\hit@theorem@separator{:}%
+}
+\hit@set@names
+% \end{macrocode}
+%
+% 带圈数字和星号使用中文字体。
+% \begin{macrocode}
+\xeCJKDeclareCharClass{CJK}{"2460 -> "2473}
+\xeCJKDeclareCharClass{CJK}{"2605}
+% \end{macrocode}
+%
+% \newcommand\unicodechar[1]{U+#1(\symbol{"#1})}
+% 由于 Unicode 的一些标点符号是中西文混用的:
+% \unicodechar{00B7}、
+% \unicodechar{2013}、
+% \unicodechar{2014}、
+% \unicodechar{2018}、
+% \unicodechar{2019}、
+% \unicodechar{201C}、
+% \unicodechar{201D}、
+% \unicodechar{2025}、
+% \unicodechar{2026}、
+% \unicodechar{2E3A},
+% 所以要根据语言设置正确的字体。
+% \footnote{\url{https://github.com/CTeX-org/ctex-kit/issues/389}}
+% 此外切换语言时,有一部分名称是需要被重新定义的。
+% \begin{macrocode}
+\newcommand\hit@set@punctuations{%
+ \xeCJKDeclareCharClass{FullLeft}{"2018, "201C}%
+ \xeCJKDeclareCharClass{FullRight}{
+ "00B7, "2019, "201D, "2013, "2014, "2025, "2026, "2E3A,
+ }%
+}
+\hit@set@punctuations
+% \end{macrocode}
+%
+% \subsubsection{页眉页脚}
+% \label{sec:headerfooter}
+%
+% \pkg{fancyhdr} 定义页眉页脚很方便,但是有一个非常隐蔽的坑。
+% 第一次调用 \pkg{fancyhdr} 定义的样式时会修改 \cs{chaptermark},
+% 这会导致页眉信息错误(多余章号并且英文大写)。
+% 这是因为在 \cs{ps@fancy} 中对 \cs{chaptermark} 进行重定义,
+% 所以我们先调用 \cs{ps@fancy},再修改 \cs{chaptermark}。
+% \begin{macrocode}
+\pagestyle{fancy}
+% \end{macrocode}
+%
+% 定义页眉和页脚。
+% 页眉宋体五号字,居中书写;
+% 页码五号 Times New Roman ,位于页面底端,居中书写。
+%
+% \begin{macrocode}
+\fancypagestyle{plain}{%
+ \fancyhf{}%
+ \renewcommand\footrulewidth{0pt}%
+ \renewcommand\headrulewidth{0.75bp}%
+ \fancyhead[C]{%
+ \wuhao
+ \leftmark
+ }%
+ \fancyfoot[C]{\wuhao\thepage}%
+ \let\@mkboth\markboth
+ \def\chaptermark##1{%
+ \markboth{\CTEXifname{\CTEXthechapter\quad}{}##1}{}%
+ }%
+ \let\sectionmark\@gobble
+}
+\pagestyle{plain}
+% \end{macrocode}
+%
+% \cs{chapter} 会调用特殊的 page style。
+% \begin{macrocode}
+\ctexset{chapter/pagestyle = plain}
+% \end{macrocode}
+%
+%
+% \subsubsection{段落}
+% \label{sec:paragraph}
+%
+% 全文首行缩进 2 字符,标点符号用全角
+% \begin{macrocode}
+\ctexset{%
+ punct=quanjiao,
+ space=auto,
+}
+\newcommand\hit@set@indent{%
+ \ctexset{autoindent=2}%
+}
+\hit@set@indent
+% \end{macrocode}
+%
+% 设置 url 样式,与上下文一致
+% \begin{macrocode}
+\urlstyle{same}
+% \end{macrocode}
+%
+% 使用 \pkg{xurl} 的方法,增加 URL 可断行的位置。
+% \begin{macrocode}
+\g@addto@macro\UrlBreaks{%
+ \do0\do1\do2\do3\do4\do5\do6\do7\do8\do9%
+ \do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M
+ \do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z
+ \do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m
+ \do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z
+}
+\Urlmuskip=0mu plus 0.1mu
+% \end{macrocode}
+%
+% 取消列表的间距,以符合中文习惯。
+% \begin{macrocode}
+\partopsep=\z@skip
+\def\@listi{\leftmargin\leftmargini
+ \parsep \z@skip
+ \topsep \z@skip
+ \itemsep\z@skip}
+\let\@listI\@listi
+\@listi
+\def\@listii {\leftmargin\leftmarginii
+ \labelwidth\leftmarginii
+ \advance\labelwidth-\labelsep
+ \topsep \z@skip
+ \parsep \z@skip
+ \itemsep \z@skip}
+\def\@listiii{\leftmargin\leftmarginiii
+ \labelwidth\leftmarginiii
+ \advance\labelwidth-\labelsep
+ \topsep \z@skip
+ \parsep \z@skip
+ \partopsep \z@skip
+ \itemsep \z@skip}
+% \end{macrocode}
+%
+% 使用 \pkg{enumitem} 命令调整默认列表环境间的距离,
+% \begin{macrocode}
+\setlist{nosep}
+% \end{macrocode}
+%
+%
+% \subsubsection{脚注}
+% \label{sec:footnote}
+% 脚注内容采用小五号字,中文用宋体,英文和数字用 Times New Roman 体按两端对齐格式书写,
+% 单倍行距,段前段后均空 0 磅。
+% 脚注的序号按页编排,不同页的脚注序号不需要连续。
+%
+% 脚注处序号“1,……,10”的字体是“正文”,不是“上标”,序号与脚注内容文字之间空半个汉字符,
+% 脚注的段落格式为:单倍行距,段前空 0 磅,段后空 0 磅,悬挂缩进 1.5 字符;
+% 字号为小五号字,汉字用宋体,外文用 Times New Roman 体。
+%
+% 脚注序号使用带圈数字。
+% \begin{macro}{\hit@circled}
+% 生成带圈的脚注数字,最多处理到 10。
+% \begin{macrocode}
+\newcommand\hit@circled[1]{%
+ \ifnum#1 >10\relax
+ \hit@error{%
+ Too many footnotes in this page.
+ Keep footnote less than 10%
+ }%
+ \fi
+ {\symbol{\the\numexpr#1+"245F\relax}}%
+}
+\renewcommand{\thefootnote}{\hit@circled{\c@footnote}}
+\renewcommand{\thempfootnote}{\hit@circled{\c@mpfootnote}}
+% \end{macrocode}
+% \end{macro}
+%
+% 定义脚注分割线,字号(宋体小五),以及悬挂缩进(1.5字符)。
+% \begin{macrocode}
+\def\footnoterule{\vskip-3\p@\hrule\@width0.3\textwidth\@height0.4\p@\vskip2.6\p@}
+\footnotemargin=13.5bp
+% \end{macrocode}
+%
+% 修改 \pkg{footmisc} 定义的脚注格式。
+% \begin{macrocode}
+\long\def\@makefntext#1{%
+ \begingroup
+ % 序号取消上标
+ \def\@makefnmark{\hbox{\normalfont\@thefnmark}}%
+ \xiaowu
+ \ifFN@hangfoot
+ \bgroup
+ \setbox\@tempboxa\hbox{%
+ \ifdim\footnotemargin>\z@
+ \hb@xt@\footnotemargin{\@makefnmark\hss}%
+ \else
+ \@makefnmark
+ \fi
+ }%
+ \leftmargin\wd\@tempboxa
+ \rightmargin\z@
+ \linewidth \columnwidth
+ \advance \linewidth -\leftmargin
+ \parshape \@ne \leftmargin \linewidth
+ % \footnotesize
+ \xiaowu
+ \@setpar{{\@@par}}%
+ \leavevmode
+ \llap{\box\@tempboxa}%
+ \parskip\hangfootparskip\relax
+ \parindent\hangfootparindent\relax
+ \else
+ \parindent1em%
+ \noindent
+ \ifdim\footnotemargin>\z@
+ \hb@xt@ \footnotemargin{\hss\@makefnmark}%
+ \else
+ \ifdim\footnotemargin=\z@
+ \llap{\@makefnmark}%
+ \else
+ \llap{\hb@xt@ -\footnotemargin{\@makefnmark\hss}}%
+ \fi
+ \fi
+ \fi
+ \footnotelayout#1%
+ \ifFN@hangfoot
+ \par\egroup
+ \fi
+ \endgroup
+}
+% \end{macrocode}
+%
+%
+% \subsubsection{摘要}
+% \label{sec:abstractformat}
+% 摘要两个字设置为 3 号.
+% 定义摘要环境
+%
+% \begin{macro}{\hit@clist@use}
+% 不同论文格式关键词之间的分割不太相同,我们用 \option{keywords}
+% 来收集关键词列表,然后用本命令来生成符合要求的格式,
+% 类似于 \LaTeX3 的 \cs{clist\_use:Nn}。
+% \begin{macrocode}
+\hit@define@key{
+ keywords,
+}
+\newcommand\hit@clist@use[2]{%
+ \def\hit@@tmp{}%
+ \def\hit@clist@processor##1{%
+ \ifx\hit@@tmp\@empty
+ \def\hit@@tmp{#2}%
+ \else
+ #2%
+ \fi
+ ##1%
+ }%
+ \expandafter\comma@parse\expandafter{#1}{\hit@clist@processor}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{abstract}
+% 中文摘要部分的标题为“\textbf{摘要}”,用黑体三号字。
+% 摘要内容用小四号字书写,两端对齐,汉字用宋体,外文字用 Times New Roman 体,
+% 标点符号一律用中文输入状态下的标点符号。
+% \begin{macrocode}
+\newenvironment{abstract}{%
+ \cleardoublepage
+ \begingroup
+ \hit@chapter*{\hit@abstract@name}%
+ \endgroup
+}{%
+% \end{macrocode}
+%
+% 每个关键词之间空两个汉字符宽度, 且为悬挂缩进。
+% \begin{macrocode}
+ \par
+ \null\par
+ \textbf{关键词:}%
+ \hit@clist@use{\hit@keywords}{;}%
+ \cleardoublepage
+}
+% \end{macrocode}
+% \end{environment}
+%
+%
+% \subsection{数学环境、定理设置}
+% \label{sec:mathenv}
+%
+% \begin{macro}{\bm}
+% \begin{macro}{\boldsymbol}
+% 兼容旧的粗体命令:\pkg{bm} 的 \cs{bm} 和 \pkg{amsmath} 的 \cs{boldsymbol}。
+% \begin{macrocode}
+\DeclareRobustCommand\bm[1]{{\symbf{#1}}}
+\DeclareRobustCommand\boldsymbol[1]{{\symbf{#1}}}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\square}
+% 兼容 \pkg{amssymb} 中的命令。
+% \begin{macrocode}
+\newcommand\square{\mdlgwhtsquare}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\checkmark}
+% 允许在文本模式中使用 \cs{checkmark}。
+% \begin{macrocode}
+\AtBeginDocument{%
+ \renewcommand\checkmark{\ensuremath{✓}}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% 允许太长的公式断行、分页等。
+% \begin{macrocode}
+\allowdisplaybreaks[4]
+% \end{macrocode}
+%
+% \subsubsection{浮动对象:插图和表格}
+% \label{sec:float}
+%
+% 图表浮动体的默认位置设为 |h|。
+% \begin{macrocode}
+\def\fps@figure{h}
+\def\fps@table{h}
+% \end{macrocode}
+%
+% 设置浮动对象和文字之间的距离
+% \begin{macrocode}
+\setlength{\floatsep}{6bp}
+\setlength{\textfloatsep}{6bp}
+\setlength{\intextsep}{6bp}
+\setlength{\@fptop}{0bp \@plus1.0fil}
+\setlength{\@fpsep}{12bp \@plus2.0fil}
+\setlength{\@fpbot}{0bp \@plus1.0fil}
+% \end{macrocode}
+%
+% 下面这组命令使浮动对象的缺省值稍微宽松一点,从而防止幅度对象占据过多的文本页面,
+% 也可以防止在很大空白的浮动页上放置很小的图形。
+% \begin{macrocode}
+\renewcommand{\textfraction}{0.15}
+\renewcommand{\topfraction}{0.85}
+\renewcommand{\bottomfraction}{0.65}
+\renewcommand{\floatpagefraction}{0.60}
+% \end{macrocode}
+%
+% 允许用户设置图表编号的连接符。
+% \begin{macrocode}
+\hit@define@key{
+ figure-number-separator = {
+ name = figure@number@separator,
+ default = {.},
+ },
+ table-number-separator = {
+ name = table@number@separator,
+ default = {.},
+ },
+ equation-number-separator = {
+ name = equation@number@separator,
+ default = {.},
+ },
+ number-separator = {
+ name = number@separator,
+ default = {.},
+ },
+}
+\renewcommand\thefigure{%
+ \ifnum\c@chapter>\z@
+ \thechapter
+ \hit@figure@number@separator
+ \fi
+ \@arabic\c@figure
+}
+\renewcommand\thetable{%
+ \ifnum\c@chapter>\z@
+ \thechapter
+ \hit@table@number@separator
+ \fi
+ \@arabic\c@table
+}
+\renewcommand\theequation{%
+ \ifnum\c@chapter>\z@
+ \thechapter
+ \hit@equation@number@separator
+ \fi
+ \@arabic\c@equation
+}
+\newcommand\hit@set@number@separator{%
+ \let\hit@figure@number@separator\hit@number@separator
+ \let\hit@table@number@separator\hit@number@separator
+ \let\hit@equation@number@separator\hit@number@separator
+}
+\hit@option@hook{number-separator}{\hit@set@number@separator}
+% \end{macrocode}
+%
+%
+% 对 \pkg{longtable} 跨页表格进行相同的设置。
+% \begin{macrocode}
+\AtEndOfPackageFile*{longtable}{
+ \AtBeginEnvironment{longtable}{%
+ \fontsize{11bp}{20.3bp}\selectfont
+ }
+}
+% \end{macrocode}
+%
+% 定制浮动图形和表格标题样式,以及改变附录中浮动体的编号规则:
+% \begin{itemize}
+% \item 图表标题字体为 11pt
+% \item 去掉图表号后面的冒号,图序与图名文字之间空一个汉字符宽度
+% \item 图:caption 在下,段前空 6 磅,段后空 12 磅
+% \item 表:caption 在上,段前空 12 磅,段后空 6 磅
+% \end{itemize}
+% \begin{macrocode}
+\DeclareCaptionFont{hit}{%
+ \fontsize{11bp}{15bp}\selectfont
+}
+\captionsetup{
+ font = hit,
+ labelsep = quad,
+ aboveskip = 6bp,
+ belowskip = 6bp,
+ figureposition = bottom,
+ tableposition = top,
+}
+\captionsetup[sub]{font=hit}
+\renewcommand{\thesubfigure}{(\alph{subfigure})}
+\renewcommand{\thesubtable}{(\alph{subtable})}
+% \renewcommand{\p@subfigure}{:}
+% \end{macrocode}
+%
+% 研究生和本科生都推荐使用三线表,并且要求表的上、下边线为单直线,线粗为 1.5 磅;
+% 第三条线为单直线,线粗为 1 磅。
+% 这里设置 \pkg{booktabs} 线粗的默认值。
+% \begin{macrocode}
+\heavyrulewidth=1.5bp
+\lightrulewidth=1bp
+% \end{macrocode}
+%
+% \begin{macrocode}
+\AtEndOfPackageFile*{threeparttable}{
+ \g@addto@macro\TPT@defaults{\wuhao}
+}
+% \end{macrocode}
+%
+% \subsubsection{章节标题}
+% \label{sec:theor}
+% \begin{macrocode}
+\newcommand{\hit@abstract@name}{摘 \quad 要}
+\newcommand{\hit@abstract@name@en}{Abstract}
+% \end{macrocode}
+%
+% 各级标题格式设置。
+% \begin{macrocode}
+\ctexset{%
+ chapter = {
+ nameformat = {},
+ numberformat = {},
+ titleformat = {},
+ fixskip = true,
+ afterindent = true,
+ lofskip = 0pt,
+ lotskip = 0pt,
+ },
+ section = {
+ afterindent = true,
+ },
+ subsection = {
+ afterindent = true,
+ },
+ subsubsection = {
+ afterindent = true,
+ },
+ paragraph/afterindent = true,
+ subparagraph/afterindent = true,
+}
+% \end{macrocode}
+%
+% 本模板设置:
+% \begin{itemize}
+% \item 各章标题,例如:“\textsf{第 1 章 引言}”。
+%
+% 章序号与章名之间空一个汉字符。
+% 采用黑体三号字,居中书写,单倍行距,
+% 段前空 24 磅,段后空 18 磅。
+%
+% \item 一级节标题,例如:“\textsf{2.1 实验装置与实验方法}”。
+%
+% 节标题序号与标题名之间空一个汉字符(下同)。
+% 采用黑体四号(14pt)字居左书写,行距为固定值 20 磅,
+% 段前空 24 磅,段后空 6 磅。
+%
+% \item 二级节标题,例如:“\textsf{2.1.1 实验装置}”。
+%
+% 采用黑体 13pt 字居左书写,行距为固定值 20 磅,
+% 段前空 12 磅,段后空 6 磅。
+%
+% \item 三级节标题,例如:“\textsf{2.1.2.1 归纳法}”。
+%
+% 采用黑体小四号(12pt)字居左书写,行距为固定值 20 磅,
+% 段前空 12 磅,段后空 6 磅。
+% \end{itemize}
+%
+% 这里三级节标题的“中文黑体小四号”取 13pt。
+% \begin{macrocode}
+\newcommand\hit@set@section@format{%
+ \ctexset{%
+ chapter = {
+ format = \centering\sffamily\sanhao,
+ nameformat = {},
+ titleformat = {},
+ beforeskip = 27bp,
+ afterskip = 27bp,
+ aftername = \quad,
+ },
+ section = {
+ format = \sffamily\fontsize{14bp}{20bp}\selectfont,
+ beforeskip = 24bp,
+ afterskip = 6bp,
+ aftername = \quad,
+ },
+ subsection = {
+ format = \sffamily\fontsize{13bp}{20bp}\selectfont,
+ beforeskip = 12bp,
+ afterskip = 6bp,
+ aftername = \quad,
+ },
+ subsubsection = {
+ format = \sffamily\fontsize{12bp}{20bp}\selectfont,
+ beforeskip = 12bp,
+ afterskip = 6bp,
+ aftername = \quad,
+ },
+ }%
+ \ctexset{chapter/number = \thechapter}%
+}
+\hit@set@section@format
+% \end{macrocode}
+%
+% \begin{macro}{\hit@chapter*}
+% 模板定义所有的章都出现在目录里,比如摘要、Abstract、主要符号表等。
+%
+% \begin{macrocode}
+\newcommand\hit@pdfbookmark[2]{}
+\newcommand\hit@phantomsection{}
+\NewDocumentCommand\hit@chapter{s o m o}{%
+ \IfBooleanF{#1}{%
+ \hit@error{You have to use the star form: \string\hit@chapter*}%
+ }%
+ \if@openright\cleardoublepage\else\clearpage\fi%
+ \IfValueTF{#2}{%
+ \ifthenelse{\equal{#2}{}}{%
+ \hit@pdfbookmark{0}{#3}%
+ }{%
+ \hit@phantomsection
+ \addcontentsline{toc}{chapter}{#2}%
+ }%
+ }{%
+ \hit@phantomsection
+ \addcontentsline{toc}{chapter}{#3}%
+ }%
+ \ctexset{chapter/beforeskip=40bp}
+ \chapter*{#3}%
+ \ctexset{chapter/beforeskip=30bp}
+ \IfValueTF{#4}{%
+ \ifthenelse{\equal{#4}{}}{%
+ \@mkboth{}{}%
+ }{%
+ \@mkboth{#4}{#4}%
+ }%
+ }{%
+ \@mkboth{#3}{#3}%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsubsection{目录}
+% \label{sec:toc}
+% 最多 4 层,即: x.x.x.x,对应的命令和层序号分别是:
+% \cs{chapter}(0), \cs{section}(1), \cs{subsection}(2), \cs{subsubsection}(3)。
+% \begin{macrocode}
+\setcounter{secnumdepth}{3}
+\setcounter{tocdepth}{2}
+% \end{macrocode}
+%
+% \begin{macro}{\tableofcontents}
+% 目录生成命令。
+% \begin{macrocode}
+\renewcommand\tableofcontents{%
+ \hit@chapter*[]{\contentsname}%
+ \@starttoc{toc}%
+}
+\hit@define@key{
+ toc-chapter-style = {
+ name = toc@chapter@style,
+ choices = {
+ arial,
+ times,
+ },
+ default = arial,
+ },
+}
+\newcommand\hit@leaders{\titlerule*[4bp]{.}}
+\newcommand\hit@set@toc@format{%
+ \contentsmargin{\z@}%
+% \end{macrocode}
+%
+% 目录从第 1 章开始,每章标题用黑体小四号字,行间距为 20pt,
+% 行前空 6pt,行后空 0pt。
+% 其它级节标题用宋体小四字,行间距为 20pt。
+%
+% 注意示例中章标题的字母和数字是衬线体,所以这里用 \cs{heiti}。
+% 示例中的一级和二级节标题分别缩进 1 和 1.5 个汉字符。
+% \begin{macrocode}
+\titlecontents{chapter}
+ [\z@]{\addvspace{6bp}\sffamily}
+ {\contentspush{\thecontentslabel\quad}}{}
+ {\rmfamily\hit@leaders\thecontentspage}%
+\titlecontents{section}
+ [1em]{}
+ {\contentspush{\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}%
+\titlecontents{subsection}
+ [2em]{}
+ {\contentspush{\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}%
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\hit@set@toc@format
+% \end{macrocode}
+% \end{macro}
+%
+%
+%
+% \subsection{参考文献环境设置}
+% \label{sec:bib}
+%
+% 重定义参考文献环境
+% \begin{macrocode}
+\renewenvironment{thebibliography}[1]
+ {\section*{\refname}%
+ \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m}
+ {\def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist}
+% \end{macrocode}
+%
+%
+% \subsection{其他环境设置}
+% \label{sec:config}
+%
+% \subsubsection{\pkg{amsthm} 宏包}
+%
+% 定理标题使用黑体,正文使用宋体,冒号隔开。
+% \begin{macrocode}
+\AtEndOfPackageFile*{amsthm}{%
+ \newtheoremstyle{hit}
+ {\z@}{\z@}
+ {\normalfont}{\z@}
+ {\normalfont\sffamily}{\hit@theorem@separator}
+ {0.5em}{}
+ \theoremstyle{hit}
+ \newtheorem{assumption}{\hit@assumption@name}[chapter]%
+ \newtheorem{definition}{\hit@definition@name}[chapter]%
+ \newtheorem{proposition}{\hit@proposition@name}[chapter]%
+ \newtheorem{lemma}{\hit@lemma@name}[chapter]%
+ \newtheorem{theorem}{\hit@theorem@name}[chapter]%
+ \newtheorem{axiom}{\hit@axiom@name}[chapter]%
+ \newtheorem{corollary}{\hit@corollary@name}[chapter]%
+ \newtheorem{exercise}{\hit@exercise@name}[chapter]%
+ \newtheorem{example}{\hit@example@name}[chapter]%
+ \newtheorem{remark}{\hit@remark@name}[chapter]%
+ \newtheorem{problem}{\hit@problem@name}[chapter]%
+ \newtheorem{conjecture}{\hit@conjecture@name}[chapter]%
+ \renewenvironment{proof}[1][\hit@proof@name]{\par
+ \pushQED{\qed}%
+ % \normalfont \topsep6\p@\@plus6\p@\relax
+ \normalfont \topsep\z@\relax
+ \trivlist
+ \item[\hskip\labelsep
+ % \itshape
+ % #1\@addpunct{.}]\ignorespaces
+ \sffamily
+ #1\@addpunct{\hit@theorem@separator}]\ignorespaces
+ }{%
+ \popQED\endtrivlist\@endpefalse
+ }
+ \renewcommand\qedsymbol{\ensuremath{\QED}}
+}
+% \end{macrocode}
+%
+% \subsubsection{\pkg{ntheorem} 宏包}
+%
+% 定理标题使用黑体,正文使用宋体,冒号隔开。
+% \begin{macrocode}
+\AtEndOfPackageFile*{ntheorem}{%
+ \theorembodyfont{\normalfont}%
+ \theoremheaderfont{\normalfont\sffamily}%
+ \theoremsymbol{\ensuremath{\QED}}%
+ \newtheorem*{proof}{\hit@proof@name}%
+ \theoremstyle{plain}%
+ \theoremsymbol{}%
+ \theoremseparator{\hit@theorem@separator}%
+ \newtheorem{assumption}{\hit@assumption@name}[chapter]%
+ \newtheorem{definition}{\hit@definition@name}[chapter]%
+ \newtheorem{proposition}{\hit@proposition@name}[chapter]%
+ \newtheorem{lemma}{\hit@lemma@name}[chapter]%
+ \newtheorem{theorem}{\hit@theorem@name}[chapter]%
+ \newtheorem{axiom}{\hit@axiom@name}[chapter]%
+ \newtheorem{corollary}{\hit@corollary@name}[chapter]%
+ \newtheorem{exercise}{\hit@exercise@name}[chapter]%
+ \newtheorem{example}{\hit@example@name}[chapter]%
+ \newtheorem{remark}{\hit@remark@name}[chapter]%
+ \newtheorem{problem}{\hit@problem@name}[chapter]%
+ \newtheorem{conjecture}{\hit@conjecture@name}[chapter]%
+}
+% \end{macrocode}
+%
+% \subsubsection{\pkg{algorithm} 宏包}
+%
+% 使 \env{algorithm} 和 \env{listing} 环境的名称随语言设置而改变,
+% 并使其在附录中的编号规则与图、表等一致。
+%
+% \begin{macro}{\listofalgorithm}
+% \begin{macro}{\listofalgorithm*}
+% \begin{macrocode}
+\PassOptionsToPackage{chapter}{algorithm}
+\AtEndOfPackageFile*{algorithm}{
+ \floatname{algorithm}{\hit@algorithm@name}
+ \renewcommand\listofalgorithms{%
+ \hit@listof{algorithm}%
+ }
+ \renewcommand\listalgorithmname{\hit@list@algorithm@name}
+ \def\ext@algorithm{loa}
+ \contentsuse{algorithm}{loa}
+ \titlecontents{algorithm}
+ [\z@]{}
+ {\contentspush{\fname@algorithm~\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \subsubsection{\pkg{algorithm2e} 宏包}
+%
+% \begin{macrocode}
+\PassOptionsToPackage{algochapter}{algorithm2e}
+\AtEndOfPackageFile*{algorithm2e}{
+ \renewcommand\algorithmcfname{\hit@algorithm@name}
+ \SetAlgoCaptionLayout{hit@caption@font}
+ \SetAlCapSty{relax}
+ \SetAlgoCaptionSeparator{\hspace*{1em}}
+ \SetAlFnt{\fontsize{11bp}{14.3bp}\selectfont}
+ \renewcommand\listofalgorithms{%
+ \hit@listof{algorithmcf}%
+ }
+ \renewcommand\listalgorithmcfname{\hit@list@algorithm@name}
+ \def\ext@algorithmcf{loa}
+ \contentsuse{algocf}{loa}
+ \titlecontents{algocf}
+ [\z@]{}
+ {\contentspush{\algorithmcfname~\thecontentslabel\quad}}{}
+ {\hit@leaders\thecontentspage}
+}
+% \end{macrocode}
+%
+% \subsubsection{\pkg{minted} 宏包}
+%
+% \begin{macrocode}
+\AtEndOfPackageFile*{minted}{
+ \newcommand\hit@set@listing@language{%
+ \floatname{listing}{代码}%
+ }
+ \hit@set@listing@language
+}
+% \end{macrocode}
+%
+%
+% \subsubsection{\pkg{hyperref} 宏包}
+%
+% \begin{macrocode}
+\AtEndOfPackageFile*{hyperref}{
+ \hypersetup{
+ linktoc = all,
+ bookmarksnumbered = true,
+ bookmarksopen = true,
+ bookmarksopenlevel = 1,
+ unicode = true,
+ psdextra = true,
+ breaklinks = true,
+ plainpages = false,
+ pdfdisplaydoctitle = true,
+ hidelinks,
+ }%
+% \end{macrocode}
+%
+% \pkg{hyperref} 与 \pkg{unicode-math} 存在一些兼容性问题,见
+% \href{https://github.com/ustctug/ustcthesis/issues/223}{%
+% ustctug/ustcthesis\#223},
+% \href{https://github.com/ho-tex/hyperref/pull/90}{ho-tex/hyperref\#90} 和
+% \href{https://github.com/ustctug/ustcthesis/issues/235}{%
+% ustctug/ustcthesis/\#235}。
+% \begin{macrocode}
+ \@ifpackagelater{hyperref}{2019/04/27}{}{%
+ \g@addto@macro\psdmapshortnames{\let\mu\textmu}
+ }%
+ \hypersetup{
+ pdflang = zh-CN,
+ }%
+ \AtBeginDocument{%
+ \hypersetup{
+ pdftitle = \hit@title,
+ pdfauthor = \hit@author,
+ }%
+ \hypersetup{
+ pdfcreator={hitreport-v1.0}}
+ }%
+}
+% \end{macrocode}
+%
+%
+% 浮动环境设置
+% 默认情况下, \LaTeX{} 要求每页的文字至少占据 20\%,否则该页就只单独放置一个浮动环境,
+% 而这通常不是我们想要的, 我们将这个要求降低到 5\%.
+% \begin{macrocode}
+\renewcommand*{\textfraction}{0.05}
+% \end{macrocode}
+% 有时如果多个浮动环境连续放在一起, \LaTeX{}会将它们分在几个不同页,即使它们可在同一页放
+% 得下. 我们可以通过修改 |\topfraction| 和 |\bottomfraction| 分别设置顶端和底端的浮动环境的最大比例.
+% \begin{macrocode}
+\renewcommand*{\topfraction}{0.9}
+\renewcommand*{\bottomfraction}{0.8}
+% \end{macrocode}
+% 有时\LaTeX{}会把一个浮动环境单独放在一页,
+% 我们要求这个环境至少要占据 85% 才能单独放在一页.
+% 注意: |\floatpagefraction| 的数值必须小于 |\topfraction|.
+% \begin{macrocode}
+\renewcommand*{\floatpagefraction}{0.85}
+% \end{macrocode}
+% 关于图片 graphicx
+% 如果图片没有指定后缀, 依次按下列顺序搜索
+% \begin{macrocode}
+\DeclareGraphicsExtensions{.pdf,.eps,.jpg,.png}
+% \end{macrocode}
+% 设置图表搜索路径, 可以给图表文件夹取如下名字
+% \begin{macrocode}
+\graphicspath{{figures/}{figure/}{pictures/}{picture/}{pic/}{pics/}{image/}{images/}}
+% \end{macrocode}
+% 图表标题
+% \begin{macrocode}
+\DeclareCaptionFont{song}{\songti}
+\DeclareCaptionFont{minusfour}{\zihao{-4}}
+\captionsetup[figure]{
+ format=hang, %标题从第二行开始都有缩进, 应该和 justification=raggedright 的效果一样.
+ labelsep=quad, %分隔符是一个空格
+ font={song,minusfour,bf}, %图的字体, 宋体小四
+ position=bottom %position=bottom, 不代表标题放在下面, 标题仍放在你放\caption的位置.
+}
+\captionsetup[table]{%
+ format=hang, % 标题从第二行开始都有缩进, 应该和 justification=raggedright 的效果一样.
+ labelsep=quad, % 分隔符是一个空格
+ font={song,minusfour,bf}, % 表的字体, 宋体小四
+ position=top % position=bottom, 不代表标题放在下面, 标题仍放在你放\caption的位置.
+}
+% \end{macrocode}
+%
+% 列表环境设置
+% \begin{macrocode}
+\setlist{%
+ topsep=0.3em, % 列表顶端的垂直空白
+ partopsep=0pt, % 列表环境前面紧接着一个空白行时其顶端的额外垂直空白
+ itemsep=0ex plus 0.1ex, % 列表项之间的额外垂直空白
+ parsep=0pt, % 列表项内的段落之间的垂直空白
+ leftmargin=1.5em, % 环境的左边界和列表之间的水平距离
+ rightmargin=0em, % 环境的右边界和列表之间的水平距离
+ labelsep=0.5em, % 包含标签的盒子与列表项的第一行文本之间的间隔
+ labelwidth=2em % 包含标签的盒子的正常宽度;若实际宽度更宽,则使用实际宽度。
+}
+% \end{macrocode}
+%
+% \subsection{封面信息}
+% \label{sec:cover}
+%
+%
+% 报告题目。
+% \begin{macrocode}
+\hit@define@key{
+ title = {
+ default = {标题},
+ },
+% \end{macrocode}
+%
+% 报告小标题
+% \begin{macrocode}
+ expand = {
+ default = {小标题},
+ },
+% \end{macrocode}
+%
+% 姓名、学号、指导老师。
+% \begin{macrocode}
+ author = {
+ default = {姓名},
+ },
+ student-id = {
+ name = student@id,
+ },
+ supervisor = {
+ default = {导师姓名},
+ },
+% \end{macrocode}
+%
+% 院系名称。
+% \begin{macrocode}
+ department = {
+ default = {计算学部},
+ },
+% \end{macrocode}
+%
+% 专业名称。
+% \begin{macrocode}
+ discipline = {
+ default = {计算机科学与技术},
+ },
+% \end{macrocode}
+%
+% 班级序号
+% \begin{macrocode}
+ classnum = {
+ default = {1803105}
+ },
+% \end{macrocode}
+%
+% 实验地点
+% \begin{macrocode}
+ lablocation = {
+ default = {格物207}
+ },
+% \end{macrocode}
+%
+% 学期
+% \begin{macrocode}
+ term = {
+ default = {2021春}
+ },
+% \end{macrocode}
+%
+% 报告成文日期。
+% \begin{macrocode}
+ date = {
+ default = {\the\year-\two@digits{\month}-\two@digits{\day}},
+ }
+}
+% \end{macrocode}
+%
+% 输出日期的给定格式:\cs{hit@format@date}\marg{format}\marg{date},
+% 其中格式 \meta{format} 接受三个参数分别对应年、月、日,
+% \meta{date} 是 ISO 格式的日期(yyyy-mm-dd)。
+% \begin{macrocode}
+\newcommand\hit@format@date[2]{%
+ \edef\hit@@date{#2}%
+ \def\hit@@process@date##1-##2-##3\@nil{%
+ #1{##1}{##2}{##3}%
+ }%
+ \expandafter\hit@@process@date\hit@@date\@nil
+}
+\newcommand\hit@date@zh@digit[3]{#1 年 \number#2 月 \number#3 日}
+\newcommand\hit@date@zh@digit@short[3]{#1 年 \number#2 月}
+\newcommand\hit@date@zh@short[3]{\zhdigits{#1}年\zhnumber{#2}月}
+\newcommand\hit@date@month[1]{%
+ \ifcase\number#1\or
+ January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or December%
+ \fi
+}
+\newcommand\hit@date@en@short[3]{\hit@date@month{#2}, #1}
+% \end{macrocode}
+%
+%
+% 下划线命令
+% \begin{macrocode}
+\newcommand\hit@underline[2][6em]{\hskip1pt\underline{\hb@xt@ #1{\hss#2\hss}}\hskip3pt}
+\newcommand\hit@CJKunderline[2][6em]{\CJKunderline*{\hb@xt@ #1{\hss#2\hss}}}
+% \end{macrocode}
+%
+%
+% 封面表格信息
+% \begin{macrocode}
+\newcommand\hit@titlepage@info{%
+ \large
+ \renewcommand{\arraystretch}{1}
+ \begin{tabular}{lp{3.5cm}<{\centering}lc}
+ \makebox[4em][s]{学\hspace{\fill}院}\hit@theorem@separator & {\hit@department} & \hspace{1em} \makebox[4em][s]{专\hspace{\fill}业}\hit@theorem@separator & {\hit@discipline} \\ \cline{2-2} \cline{4-4}
+ \makebox[4em][s]{班\hspace{\fill}级}\hit@theorem@separator & {\hit@classnum} & \hspace{1em} \makebox[4em][s]{学\hspace{\fill}号}\hit@theorem@separator & {\hit@student@id} \\ \cline{2-2} \cline{4-4}
+ \makebox[4em][s]{姓\hspace{\fill}名}\hit@theorem@separator & {\hit@author} &\hspace{1em} \makebox[4em][s]{实验地点}\hit@theorem@separator& {\hit@lablocation} \\ \cline{2-2} \cline{4-4}
+ \makebox[4em][s]{指导老师}\hit@theorem@separator& {\hit@supervisor} &\hspace{1em} \makebox[4em][s]{学\hspace{\fill}期}\hit@theorem@separator & {\hit@term} \\ \cline{2-2} \cline{4-4}
+ \end{tabular}
+}
+% \end{macrocode}
+%
+%
+% 论文成文打印的日期,用三号宋体汉字,字距延伸 0.5bp,
+% 所以 \cs{CJKglue} 应该设为 1 bp。
+% \begin{macrocode}
+\newcommand\hit@titlepage@date{%
+ \begingroup
+ \sanhao
+ \def\CJKglue{\hskip 1bp}%
+ \hit@format@date{\hit@date@zh@short}{\hit@date}\par
+ \endgroup
+}
+% \end{macrocode}
+%
+% 生成封面,使用\cs{maketitle}命令
+% \begin{macrocode}
+\renewcommand\maketitle{
+ \cleardoublepage
+ \pagenumbering{Alph}%
+ \hit@maketitlepage
+ \clearpage
+}
+% \end{macrocode}
+%
+%
+% 根据校区选择校区校徽及校名图片
+% \begin{macrocode}
+\newcommand\hit@titlepage@fig{
+ \ifhit@campus@harbin
+ \begin{center}
+ \begin{figure}[h]
+ \includegraphics[scale=0.5]{photo/hithrb.pdf} % 本部校徽图片
+ \end{figure}
+ \end{center}
+ \else
+ \ifhit@campus@shenzhen
+ \begin{center}
+ \begin{figure}[h]
+ \includegraphics[scale=0.26]{photo/hitsz.pdf} % 深圳校区校徽图片
+ \end{figure}
+ \end{center}
+ \else
+ \ifhit@campus@weihai
+ \begin{center}
+ \begin{figure}[h]
+ \includegraphics[scale=0.26]{photo/hitwh.pdf} % 校徽图片
+ \end{figure}
+ \end{center}
+ \fi
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% 定义封面
+% \begin{macrocode}
+\newcommand\hit@maketitlepage{%
+\newgeometry{
+ vmargin = 2.54cm,
+ hmargin = 3.17cm,
+}
+ \newpage
+ \hit@titlepage@fig
+ \vspace{1.5cm}
+ \begingroup
+ \centering
+ \textbf{\huawenxingkai \fontsize{32}{0} \selectfont \hit@title}\\
+ \endgroup
+ \vspace{2cm}
+ \begingroup
+ \centering
+ \textbf{\heiti \fontsize{20}{0} \selectfont \hit@expand}\\
+ \endgroup
+ \vspace{2.5cm}
+ \parbox[h][10cm][t]{\textwidth}{\centering\hit@titlepage@info}\par
+ \begingroup
+ \centering
+ {\heiti \sihao\hit@format@date{\hit@date@zh@digit}{\hit@date}\par}%
+ \endgroup
+ \thispagestyle{empty}
+ \restoregeometry
+}
+% \end{macrocode}
+%
+% 定义附录
+% \begin{macrocode}
+\renewcommand{\setthesection}{\appendixname\Alph{section}}
+\renewcommand\appendix{\par
+\setcounter{section}{0}%
+\setcounter{subsection}{0}%
+\gdef\thesection{\appendixname\@Alph\c@section}}
+% \end{macrocode}
+%
+% \subsection{其它}
+% \label{sec:other}
+%
+% 借用 \cls{ltxdoc} 和 \cls{l3doc} 里面的几个命令方便写文档。
+% \begin{macrocode}
+\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
+\DeclareRobustCommand\file{\nolinkurl}
+\DeclareRobustCommand\env{\textsf}
+\DeclareRobustCommand\pkg{\textsf}
+\DeclareRobustCommand\cls{\textsf}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\sloppy
+%</cls>
+% \end{macrocode}
+%
+%
+% \iffalse
+% \begin{macrocode}
+%<*dtx-style>
+\ProvidesPackage{dtx-style}
+\RequirePackage{hypdoc}
+\RequirePackage{ifthen}
+\RequirePackage{fontspec}[2017/01/20]
+\RequirePackage{amsmath}
+\RequirePackage{unicode-math}
+\RequirePackage[UTF8,scheme=chinese]{ctex}
+\RequirePackage[
+ top=25mm, bottom=25mm,
+ left=40mm, right=20mm,
+ headsep=3mm]{geometry}
+\RequirePackage{hologo}
+\RequirePackage{array,longtable,booktabs}
+\RequirePackage{listings}
+\RequirePackage{fancyhdr}
+\RequirePackage{xcolor}
+\RequirePackage{enumitem}
+\RequirePackage{etoolbox}
+\RequirePackage{metalogo}
+
+\unimathsetup{
+ math-style=ISO,
+ bold-style=ISO,
+}
+
+\DeclareRobustCommand\mathellipsis{\mathinner{\unicodecdots}}
+\IfFontExistsTF{XITSMath-Regular.otf}{
+ \setmathfont[
+ Extension = .otf,
+ BoldFont = XITSMath-Bold,
+ StylisticSet = 8,
+ ]{XITSMath-Regular}
+ \setmathfont[range={cal,bfcal},StylisticSet=1]{XITSMath-Regular.otf}
+}{
+ \setmathfont[
+ Extension = .otf,
+ BoldFont = *bold,
+ StylisticSet = 8,
+ ]{xits-math}
+ \setmathfont[range={cal,bfcal},StylisticSet=1]{xits-math.otf}
+}
+
+\colorlet{hit@macro}{blue!60!black}
+\colorlet{hit@env}{blue!70!black}
+\colorlet{hit@option}{purple}
+\patchcmd{\PrintMacroName}{\MacroFont}{\MacroFont\bfseries\color{hit@macro}}{}{}
+\patchcmd{\PrintDescribeMacro}{\MacroFont}{\MacroFont\bfseries\color{hit@macro}}{}{}
+\patchcmd{\PrintDescribeEnv}{\MacroFont}{\MacroFont\bfseries\color{hit@env}}{}{}
+\patchcmd{\PrintEnvName}{\MacroFont}{\MacroFont\bfseries\color{hit@env}}{}{}
+
+\def\DescribeOption{%
+ \leavevmode\@bsphack\begingroup\MakePrivateLetters%
+ \Describe@Option}
+\def\Describe@Option#1{\endgroup
+ \marginpar{\raggedleft\PrintDescribeOption{#1}}%
+ \hit@special@index{option}{#1}\@esphack\ignorespaces}
+\def\PrintDescribeOption#1{\strut \MacroFont\bfseries\sffamily\color{hit@option} #1\ }
+\def\hit@special@index#1#2{\@bsphack
+ \begingroup
+ \HD@target
+ \let\HDorg@encapchar\encapchar
+ \edef\encapchar usage{%
+ \HDorg@encapchar hdclindex{\the\c@HD@hypercount}{usage}%
+ }%
+ \index{#2\actualchar{\string\ttfamily\space#2}
+ (#1)\encapchar usage}%
+ \index{#1:\levelchar#2\actualchar
+ {\string\ttfamily\space#2}\encapchar usage}%
+ \endgroup
+ \@esphack}
+
+\lstdefinestyle{lstStyleBase}{%
+ basicstyle=\small\ttfamily,
+ aboveskip=\medskipamount,
+ belowskip=\medskipamount,
+ lineskip=0pt,
+ boxpos=c,
+ showlines=false,
+ extendedchars=true,
+ upquote=true,
+ tabsize=2,
+ showtabs=false,
+ showspaces=false,
+ showstringspaces=false,
+ numbers=none,
+ linewidth=\linewidth,
+ xleftmargin=4pt,
+ xrightmargin=0pt,
+ resetmargins=false,
+ breaklines=true,
+ breakatwhitespace=false,
+ breakindent=0pt,
+ breakautoindent=true,
+ columns=flexible,
+ keepspaces=true,
+ gobble=4,
+ framesep=3pt,
+ rulesep=1pt,
+ framerule=1pt,
+ backgroundcolor=\color{gray!5},
+ stringstyle=\color{green!40!black!100},
+ keywordstyle=\bfseries\color{blue!50!black},
+ commentstyle=\slshape\color{black!60}}
+
+\lstdefinestyle{lstStyleShell}{%
+ style=lstStyleBase,
+ frame=l,
+ rulecolor=\color{purple},
+ language=bash}
+
+\lstdefinestyle{lstStyleLaTeX}{%
+ style=lstStyleBase,
+ frame=l,
+ rulecolor=\color{violet},
+ language=[LaTeX]TeX}
+
+\lstnewenvironment{latex}{\lstset{style=lstStyleLaTeX}}{}
+\lstnewenvironment{shell}{\lstset{style=lstStyleShell}}{}
+
+\setlist{nosep}
+
+\DeclareDocumentCommand{\option}{m}{\textsf{#1}}
+\DeclareDocumentCommand{\env}{m}{\texttt{#1}}
+\DeclareDocumentCommand{\pkg}{s m}{%
+ \textsf{#2}\IfBooleanF#1{\hit@special@index{package}{#2}}}
+\DeclareDocumentCommand{\cls}{s m}{%
+ \textsf{#2}\IfBooleanF#1{\hit@special@index{package}{#2}}}
+\DeclareDocumentCommand{\file}{s m}{%
+ \nolinkurl{#2}\IfBooleanF#1{\hit@special@index{file}{#2}}}
+\newcommand{\myentry}[1]{%
+ \marginpar{\raggedleft\color{purple}\bfseries\strut #1}}
+\newcommand{\note}[2][Note]{{%
+ \color{magenta}{\bfseries #1}\emph{#2}}}
+
+\DeclareDocumentCommand{\githubuser}{m}{\href{https://github.com/#1}{@#1}}
+
+\def\thuthesis{\textsc{Thu}\-\textsc{Thesis}}
+\def\hitreport{\textsc{Hit}\-\textsc{Report}}
+\def\hithesis{\textsc{hi}\-\textsc{Thesis}}
+%</dtx-style>
+% \end{macrocode}
+% \fi
+%
+% \Finale
+%
+\endinput
+% \iffalse
+% Local Variables:
+% mode: doctex
+% TeX-master: t
+% End:
+% \fi
diff --git a/macros/latex/contrib/hitreport/hitreport.ins b/macros/latex/contrib/hitreport/hitreport.ins
new file mode 100644
index 0000000000..a416f9cfbc
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitreport.ins
@@ -0,0 +1,54 @@
+%%
+%% Copyright (C) 2021 by Xiao Sun <demerzelsun@gmail.com>
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% 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.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+
+\input docstrip
+\keepsilent
+
+\usedir{tex/latex/hitreport}
+
+\preamble
+
+This is a generated file.
+
+Copyright (C) 2021 by Xiao Sun <demerzelsun@gmail.com>
+
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+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.3c or later is part of all distributions of LaTeX
+version 2005/12/01 or later.
+
+\endpreamble
+\askforoverwritefalse
+\generate{\file{\jobname.cls}{\from{\jobname.dtx}{cls}}
+ \file{dtx-style.sty}{\from{\jobname.dtx}{dtx-style}}
+ }
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* files into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* hitreport.cls *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file hitreport.dtx *}
+\Msg{* through LaTeX. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile \ No newline at end of file
diff --git a/macros/latex/contrib/hitreport/hitreport.pdf b/macros/latex/contrib/hitreport/hitreport.pdf
new file mode 100644
index 0000000000..2abe53c09f
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitreport.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/hitsetup.tex b/macros/latex/contrib/hitreport/hitsetup.tex
new file mode 100644
index 0000000000..518c978e68
--- /dev/null
+++ b/macros/latex/contrib/hitreport/hitsetup.tex
@@ -0,0 +1,109 @@
+% !TeX root = ./hitreport-example.tex
+
+% 基本信息配置
+
+\hitsetup{
+ %******************************
+ % 注意:
+ % 1. 配置里面不要出现空行
+ % 2. 不需要的配置信息可以删除
+ % 3. 建议先阅读文档中所有关于选项的说明
+ %******************************
+ %
+ % 校区选择
+ % 可供选择为harbin, shenzhen, weihai,必须填写
+ campus = {harbin},
+ %
+ % 标题
+ % 可使用“\\”命令手动控制换行
+ %
+ title = {哈尔滨工业大学报告 \LaTeX{} \\ 模板使用示例文档},
+ %
+ % 副标题
+ % 可使用“\\”命令手动控制换行
+ %
+ expand = {实验一},
+ %
+ % 所在学院(部)
+ % 填写所属学院(部)的全名
+ %
+ department = {计算学部},
+ %
+ % 专业
+ % 填写专业名称
+ %
+ discipline = {计算机科学与技术},
+ %
+ % 姓名
+ %
+ author = {孙骁},
+ %
+ % 学号
+ %
+ student-id = {1180310840},
+ %
+ % 指导教师
+ %
+ supervisor = {XX},
+ %
+ % 实验地点
+ % 暂未区分课程报告封面与实验报告封面,课程报告可随意填写
+ %
+ lablocation = {格物207},
+ %
+ % 报告学期
+ %
+ term = {2021春季学期},
+ %
+ % 日期
+ % 使用 ISO 格式;默认为当前时间
+ %
+ % date = {2019-07-07},
+ %
+}
+
+% 载入所需的宏包
+
+% 可以使用 nomencl 生成符号和缩略语说明
+% \usepackage{nomencl}
+% \makenomenclature
+
+% 表格加脚注
+\usepackage{threeparttable}
+
+% 表格中支持跨行
+\usepackage{multirow}
+
+% 固定宽度的表格。
+% \usepackage{tabularx}
+
+% 跨页表格
+\usepackage{longtable}
+
+% 量和单位
+\usepackage{siunitx}
+
+% 定理类环境宏包
+\usepackage{amsthm}
+% 也可以使用 ntheorem
+% \usepackage[amsmath,thmmarks,hyperref]{ntheorem}
+
+% 参考文献使用 BibTeX + natbib 宏包
+% 顺序编码制
+%\usepackage[sort]{natbib}
+%\bibliographystyle{thuthesis-numeric}
+
+% 著者-出版年制
+% \usepackage{natbib}
+
+% 声明 BibLaTeX 的数据库
+% \addbibresource{ref/refs.bib}
+
+% 定义所有的图片文件在 figures 子目录下
+\graphicspath{{figures/}}
+
+% 数学命令
+\newcommand\dif{\mathop{}\!\mathrm{d}} % 微分符号
+
+% hyperref 宏包在最后调用
+\usepackage{hyperref}
diff --git a/macros/latex/contrib/hitreport/latexmkrc b/macros/latex/contrib/hitreport/latexmkrc
new file mode 100644
index 0000000000..17e9557a5e
--- /dev/null
+++ b/macros/latex/contrib/hitreport/latexmkrc
@@ -0,0 +1,18 @@
+# vim: set ft=perl:
+
+$pdf_mode = 5;
+
+$xelatex = "xelatex -shell-escape -file-line-error -halt-on-error -interaction=nonstopmode -no-pdf -synctex=1 %O %S";
+$xdvipdfmx = "xdvipdfmx -q -E -o %D %O %S";
+
+$bibtex_use = 1.5;
+
+$clean_ext = "hd loe ptc run.xml synctex.gz thm xdv";
+
+$makeindex = "makeindex -s gind.ist %O -o %D %S";
+
+add_cus_dep('nlo', 'nls', 0, 'nlo2nls');
+sub nlo2nls {
+ system("makeindex -s nomencl.ist -o \"$_[0].nls\" \"$_[0].nlo\"");
+}
+push @generated_exts, 'nlo', 'nls';
diff --git a/macros/latex/contrib/hitreport/photo/hithrb.pdf b/macros/latex/contrib/hitreport/photo/hithrb.pdf
new file mode 100644
index 0000000000..46d4fc2ece
--- /dev/null
+++ b/macros/latex/contrib/hitreport/photo/hithrb.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/photo/hitsz.pdf b/macros/latex/contrib/hitreport/photo/hitsz.pdf
new file mode 100644
index 0000000000..acea1c82b0
--- /dev/null
+++ b/macros/latex/contrib/hitreport/photo/hitsz.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/photo/hitwh.pdf b/macros/latex/contrib/hitreport/photo/hitwh.pdf
new file mode 100644
index 0000000000..31d9993d8c
--- /dev/null
+++ b/macros/latex/contrib/hitreport/photo/hitwh.pdf
Binary files differ
diff --git a/macros/latex/contrib/hitreport/ref/appendix.bib b/macros/latex/contrib/hitreport/ref/appendix.bib
new file mode 100644
index 0000000000..1e4cc0daef
--- /dev/null
+++ b/macros/latex/contrib/hitreport/ref/appendix.bib
@@ -0,0 +1,14 @@
+@book{abrahams99tex,
+ author = {Paul W. Abrahams and Karl Berry and Kathryn A. Hargreaves},
+ title = {{\TeX} for the Impatient},
+ publisher = {Addison-Wesley},
+ year = 1990,
+}
+
+@incollection{salomon1995advanced,
+ author = {David Salomon},
+ title = {The advanced {\TeX}book},
+ address = {New York},
+ publisher = {Springer},
+ year = 1995,
+}
diff --git a/macros/latex/contrib/hitreport/ref/refs.bib b/macros/latex/contrib/hitreport/ref/refs.bib
new file mode 100644
index 0000000000..4ca6bccded
--- /dev/null
+++ b/macros/latex/contrib/hitreport/ref/refs.bib
@@ -0,0 +1,331 @@
+@article{zhangkun1994,
+ author = {张昆 and 冯立群 and 余昌钰 and others},
+ title = {机器人柔性手腕的球面齿轮设计研究},
+ journal = {清华大学学报: 自然科学版},
+ volume = {34},
+ number = {2},
+ pages = {1--7},
+ year = {1994},
+ key = {zhang1 kun1},
+}
+
+@book{zhukezhen1973,
+ author = {竺可桢},
+ title = {物理学论},
+ address = {北京},
+ publisher = {科学出版社},
+ year = {1973},
+ pages = {56--60},
+ key = {zhu2 ke3 zhen1},
+}
+
+@inproceedings{dupont1974bone,
+ author = {Dupont, B},
+ title = {Bone marrow transplantation in severe combined immunodeficiency with an unrelated MLC compatible donor},
+ editor = {White, H J and Smith, R},
+ booktitle = {Proceedings of the third annual meeting of the International Society for Experimental Hematology},
+ address = {Houston},
+ publisher = {International Society for Experimental Hematology},
+ year = {1974},
+ pages = {44--46},
+}
+
+@mastersthesis{zhengkaiqing1987,
+ author = {郑开青},
+ title = {通讯系统模拟及软件},
+ address = {北京},
+ school = {清华大学无线电系},
+ year = {1987},
+ key = {zheng4 kai1 qing1},
+}
+
+@patent{jiangxizhou1980,
+ author = {姜锡洲},
+ title = {一种温热外敷药制备方案: 中国, 88105607.3},
+ date = {1980-07-26},
+ key = {jiang1 xi1 zhou1},
+}
+
+@standard{jianduju1994,
+ author = {中华人民共和国国家技术监督局},
+ title = {GB3100-3102. 中华人民共和国国家标准-量与单位},
+ address = {北京},
+ publisher = {中国标准出版社},
+ year = {1994},
+ key = {zhong1 hua2 ren2 min2 gong4 he2 guo2},
+}
+
+@article{merkt1995rotational,
+ author = {Merkt, Fr{\'e}d{\'e}ric and Mackenzie, S R and Softley, Timothy P},
+ title = {Rotational Autoionization Dynamics in High Rydberg States of Nitrogen},
+ journal = {J Chem Phys},
+ year = {1995},
+ volume = {103},
+ pages = {4509--4518},
+}
+
+@article{mellinger1996laser,
+ author = {Mellinger, A and Vidal, C R and Jungen, {Ch}},
+ title = {Laser reduced fluorescence study of the carbon monoxide nd triplet Rydberg series - Experimental results and multichannel quantum defect analysis},
+ journal = {J Chem Phys},
+ year = {1996},
+ volume = {104},
+ pages = {8913--8921},
+}
+
+@article{bixon1996dynamics,
+ author = {Bixon, M and Jortner, Joshua},
+ title = {The dynamics of predissociating high {Rydberg} states of {NO}},
+ journal = {J Chem Phys},
+ year = {1996},
+ volume = {105},
+ pages = {1363--1382},
+}
+
+@article{mahui1995,
+ author = {马辉 and 李俭 and 刘耀明 and others},
+ title = {利用 {REMPI} 方法测量 {BaF} 高里德堡系列光谱},
+ journal = {化学物理学报},
+ year = {1995},
+ volume = {8},
+ pages = {308--311},
+ key = {ma3 hui1},
+}
+
+@article{carlson1981two,
+ author = {Carlson, N W and Taylor, A J and Jones, K M and Schawlow, A L},
+ title = {Two-step polarization-labeling spectroscopy of excited states of {Na2}},
+ journal = {Phys Rev A},
+ year = {1981},
+ volume = {24},
+ pages = {822--834},
+}
+
+@article{taylor1983scanning,
+ author = {Taylor, A J and Jones, K M and Schawlow, A L},
+ title = {Scanning pulsed-polarization spectrometer applied to {Na2}},
+ journal = {J Opt Soc Am},
+ year = {1983},
+ volume = {73},
+ pages = {994--998},
+}
+
+@article{taylor1981study,
+ author = {Taylor, A J and Jones, K M and Schawlow, A L},
+ title = {A study of the excited {1$\Sigma$g+} states in {Na2}},
+ journal = {Opt Commun},
+ year = {1981},
+ volume = {39},
+ pages = {47--50},
+}
+
+@article{shimizu1983laser,
+ author = {Shimizu, Kazuko and Shimizu, Fujio},
+ title = {Laser induced fluorescence spectra of the a {3$\Pi$u--X 1$\Sigma$g+} band of {Na2} by molecular beam},
+ journal = {J Chem Phys},
+ year = {1983},
+ volume = {78},
+ pages = {1126--1131},
+}
+
+@article{atkinson1982experimental,
+ author = {Atkinson, J B and Becker, J and Demtr{\"o}der, W},
+ title = {Experimental observation of the a {3$\Pi$u} state of {Na2}},
+ journal = {Chem Phys Lett},
+ year = {1982},
+ volume = {87},
+ pages = {92--97},
+}
+
+@article{kusch1975perturbations,
+ author = {Kusch, P and Hessel, M M},
+ title = {Perturbations in the A {1$\Sigma$u+} state of {Na2}},
+ journal = {J Chem Phys},
+ year = {1975},
+ volume = {63},
+ pages = {4087--4088},
+}
+
+@book{guangxi1993,
+ author = {广西壮族自治区林业厅},
+ title = {广西自然保护区},
+ address = {北京},
+ publisher = {中国林业出版社},
+ year = {1993},
+ key = {guang3 xi1 zhuang4 zu2 zi4 zhi4 qu1},
+}
+
+@book{huosini1989guwu,
+ author = {霍斯尼},
+ title = {谷物科学与工艺学原理},
+ translator = {李庆龙},
+ edition = {2},
+ address = {北京},
+ publisher = {中国食品出版社},
+ year = {1989},
+ pages = {15--20},
+ key = {huo4 si1 ni2},
+}
+
+@book{wangfuzhi1865songlun,
+ author = {王夫之},
+ title = {宋论},
+ edition = {刻本},
+ address = {金陵},
+ publisher = {曾氏},
+ year = {1865(清同治四年)},
+ key = {wang2 fu1 zhi1},
+}
+
+@book{zhaoyaodong1998xinshidai,
+ author = {赵耀东},
+ title = {新时代的工业工程师},
+ address = {台北},
+ publisher = {天下文化出版社},
+ year = {1998},
+ urldate = {1998-09-26},
+ url = {http://www.ie.nthu.edu.tw/info/ie.newie.htm},
+ key = {zhao4 yao4 dong1},
+}
+
+@standard{biaozhunhua2002tushu,
+ author = {全国信息与文献工作标准化技术委员会出版物格式分委员会},
+ title = {GB/T 12450-2001 图书书名页},
+ address = {北京},
+ publisher = {中国标准出版社},
+ year = {2002},
+ pages = {1},
+ key = {quan2 guo2 xin4 xi1},
+}
+
+@book{chubanzhuanye2004,
+ author = {全国出版专业职业资格考试办公室},
+ title = {全国出版专业职业资格考试辅导教材: 出版专业理论与实务•中级},
+ edition = {2014},
+ address = {上海},
+ publisher = {上海辞书出版社},
+ year = {2004},
+ pages = {299--307},
+ key = {quan2 guo2 chu1 ban3 ye4},
+}
+
+@techreport{who1970factors,
+ author = {{World Health Organization}},
+ title = {Factors Regulating the Immune Response: Report of {WHO Scientific Group}},
+ address = {Geneva},
+ publisher = {WHO},
+ year = {1970},
+}
+
+@book{peebles2001probability,
+ author = {Peebles, Jr, Peyton Z.},
+ title = {Probability, Random Variables, and Random Signal Principles},
+ edition = {4},
+ address = {New York},
+ publisher = {McGraw Hill},
+ year = {2001},
+}
+
+@incollection{baishunong1998zhiwu,
+ author = {白书农},
+ title = {植物开花研究},
+ editor = {李承森},
+ booktitle = {植物科学进展},
+ address = {北京},
+ publisher = {高等教育出版社},
+ year = {1998},
+ pages = {146--163},
+ key = {bai2 shu1 nong2},
+}
+
+@incollection{weinstein1974pathogenic,
+ author = {Weinstein, L and Swertz, M N},
+ title = {Pathogenic Properties of Invading Microorganism},
+ editor = {Sodeman, Jr, William A and Sodeman, William A},
+ booktitle = {Pathologic physiology: mechanisms of disease},
+ address = {Philadelphia},
+ publisher = {Saunders},
+ year = {1974},
+ pages = {745--772},
+}
+
+@inproceedings{hanjiren1985lun,
+ author = {韩吉人},
+ title = {论职工教育的特点},
+ editor = {中国职工教育研究会},
+ booktitle = {职工教育研究论文集},
+ address = {北京},
+ publisher = {人民教育出版社},
+ year = {1985},
+ pages = {90--99},
+ key = {han2 ji2 ren2},
+}
+
+@periodical{dizhi1936dizhi,
+ author = {中国地质学会},
+ title = {地质评论},
+ year = {1936},
+ volume = {1},
+ number = {1},
+ address = {北京},
+ publisher = {地质出版社},
+ key = {zhong1 guo2 di4 zhi3 xue2 hui4},
+}
+
+@periodical{tushuguan1957tushuguanxue,
+ author = {中国图书馆学会},
+ title = {图书馆学通讯},
+ year = {1957/1990},
+ number = {1--4},
+ address = {北京},
+ publisher = {北京图书馆},
+ key = {zhong1 guo2 tu2 shu1 guan3 xue2 hui4},
+}
+
+@periodical{aaas1883science,
+ author = {{American Association for the Advancement of Science}},
+ title = {Science},
+ year = {1883},
+ volume = {1},
+ number = {1},
+ address = {Washington, D.C.},
+ publisher = {American Association for the Advancement of Science},
+}
+
+@newspaper{fugang2000fengsha,
+ author = {傅刚 and 赵承 and 李佳路},
+ title = {大风沙过后的思考},
+ journal = {北京青年报},
+ date = {2000-04-12},
+ number = {14},
+ urldate = {2002-03-06},
+ url = {http://www.bjyouth.com.cn/Bqb/20000412/B/4216%5ED0412B1401.htm},
+ key = {fu4 gang1},
+}
+
+@online{xiaoyu2001chubanye,
+ author = {萧钰},
+ title = {出版业信息化迈入快车道},
+ year = {2001},
+ date = {2001-12-19},
+ urldate = {2002-04-15},
+ url = {http://www.creader.com/news/20011219/200112190019.htm},
+ key = {xiao1 yu4},
+}
+
+@online{oclc2000about,
+ author = {{Online Computer Library Center, Inc}},
+ title = {About {OCLC}: History of Cooperation},
+ year = {2000},
+ urldate = {2000-01-08},
+ url = {http://www.oclc.org/about/cooperation.en.htm},
+}
+
+@software{scitor2000project,
+ author = {{Scitor Corporation}},
+ title = {Project scheduler},
+ address = {Sunnyvale, Calif.},
+ publisher = {Scitor Corporation},
+ year = {1983},
+ medium = {DK},
+}
diff --git a/macros/latex/contrib/parskip/changes.txt b/macros/latex/contrib/parskip/changes.txt
index f8f1141e68..5233f581ed 100644
--- a/macros/latex/contrib/parskip/changes.txt
+++ b/macros/latex/contrib/parskip/changes.txt
@@ -1,3 +1,9 @@
+#### placed on CTAN as 2.0h ####
+
+2021-03-14 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
+
+ * parskip.dtx: correct doco to refer to new repository
+
#### placed on CTAN as 2.0g ####
2021-03-02 Frank Mittelbach <Frank.Mittelbach@latex-project.org>
diff --git a/macros/latex/contrib/parskip/parskip-code.pdf b/macros/latex/contrib/parskip/parskip-code.pdf
index 35f6d63c41..e6c3bbe148 100644
--- a/macros/latex/contrib/parskip/parskip-code.pdf
+++ b/macros/latex/contrib/parskip/parskip-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/parskip/parskip.dtx b/macros/latex/contrib/parskip/parskip.dtx
index 09638ae207..bf193051d2 100644
--- a/macros/latex/contrib/parskip/parskip.dtx
+++ b/macros/latex/contrib/parskip/parskip.dtx
@@ -149,15 +149,15 @@
% The official production version is available from CTAN.
% The latest (development) sources are maintained at GitHub at:
% \begin{quote}
-% \url{https://github.com/FrankMittelbach/fmitex/tree/parskip/parskip}
+% \url{https://github.com/FrankMittelbach/fmitex-parskip}
% \end{quote}
% In case of problems with the package you can report them at
% \begin{quote}
-% \url{https://github.com/FrankMittelbach/fmitex/issues}
+% \url{https://github.com/FrankMittelbach/fmitex-parskip/issues}
% \end{quote}
% Please provide a minimal test example that can be run and doesn't
-% use packages not in a standard \LaTeX{} distribution (and as little
-% as possible to show the issue).
+% use packages not in a standard \LaTeX{} distribution (and only those
+% that are needed to show the issue).
%
% \StopEventually{}
%
@@ -183,7 +183,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-\ProvidesPackage{parskip}[2021-03-02 v2.0g non-zero parskip adjustments]
+\ProvidesPackage{parskip}[2021-03-14 v2.0h non-zero parskip adjustments]
% \end{macrocode}
%
%
diff --git a/macros/latex/contrib/parskip/parskip.pdf b/macros/latex/contrib/parskip/parskip.pdf
index 49f937d927..3ac334e77f 100644
--- a/macros/latex/contrib/parskip/parskip.pdf
+++ b/macros/latex/contrib/parskip/parskip.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
index 941ccd943f..0238567ab0 100644
--- a/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
+++ b/macros/latex/contrib/profcollege/doc/ProfCollege-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/profcollege/latex/PfC-EquationComposition1.tex b/macros/latex/contrib/profcollege/latex/PfC-EquationComposition2.tex
index b513a6b116..38493f8996 100644
--- a/macros/latex/contrib/profcollege/latex/PfC-EquationComposition1.tex
+++ b/macros/latex/contrib/profcollege/latex/PfC-EquationComposition2.tex
@@ -8,7 +8,7 @@
\else%cas ax+b=d
\xintifboolexpr{#2=0}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\num{#3}=\num{#5}$ a une infinité de solution.}%
+ L'équation $\num{#3}=\num{#5}$ a une infinité de solutions.}%
{%b<>d
L'équation $\num{#3}=\num{#5}$ n'a aucune solution.%
}%
@@ -47,7 +47,7 @@
}{}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\num{#5}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\num{#5}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.
}{}
}
}
@@ -58,99 +58,99 @@
\useKVdefault[ClesEquation]%
\setKV[ClesEquation]{#1}%
\ifx\bla#3\bla%on inverse en faisant attention à la boucle #3<->#5
- \ifx\bla#5\bla%
- %% paramètre oublié
- \else
- \EquaTroisComposition[#1]{#4}{#5}{#2}{}%
- \fi
+ \ifx\bla#5\bla%
+ %% paramètre oublié
+ \else
+ \EquaTroisComposition[#1]{#4}{#5}{#2}{}%
+ \fi
\else
\xintifboolexpr{#2=0}{%b=cx
\EquaBase[#1]{#4}{}{}{#3}
}{%
\xintifboolexpr{#4=0}{%ax+b=0
\EquaDeuxComposition[#1]{#2}{#3}{}{0}
- }{%ax+b=cx
- \xintifboolexpr{#2=#4}{%
- \xintifboolexpr{#3=0}{%ax=ax
- L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une infinité de solution.}%
- {%ax+b=ax
- L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ n'a aucune solution.%
- }%
- }{%% Cas délicat
- \xintifboolexpr{#2>#4}{%ax+b=cx avec a>c
- \ifboolKV[ClesEquation]{Decomposition}{\colorlet{Ccompo}{\useKV[ClesEquation]{CouleurCompo}}}{}
- \begin{align*}
- \tikzmark{A-\theNbequa}\mathcolor{Ccompo}{\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\tikzmark{E-\theNbequa}\\
- \mathcolor{Ccompo}{\num{\fpeval{#2-#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#4>0}{+\num{#4}\useKV[ClesEquation]{Lettre}}{-\num{\fpeval{0-#4}}\useKV[ClesEquation]{Lettre}}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\\
- \tikzmark{B-\theNbequa}\xdef\Coeffa{\fpeval{#2-#4}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{0}\tikzmark{F-\theNbequa}\\
- \xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\num{\fpeval{0-#3}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}}\tikzmark{F-\theNbequa}\\
- \tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{0-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
- \xintifboolexpr{\Coeffa=1}{}{\\}
- \ifboolKV[ClesEquation]{Fleches}{%
- \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
- \rightcomment{E-\theNbequa}{F-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
- \leftcomment{B-\theNbequa}{C-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}$}%
- \rightcomment{F-\theNbequa}{G-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}$}%
- }{}
- \xintifboolexpr{\Coeffa=1}{}{%\ifnum\cmtd>1
- \tikzmark{D-\theNbequa}\useKV[ClesEquation]{Lettre}&=\frac{\num{\Coeffb}}{\num{\Coeffa}}\tikzmark{H-\theNbequa}%\\
- \ifboolKV[ClesEquation]{Fleches}{%
- \leftcomment{C-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- \rightcomment{G-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- }{
- \ifboolKV[ClesEquation]{FlecheDiv}{%
- \leftcomment{C-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- \rightcomment{G-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- }{}
- }
- \ifboolKV[ClesEquation]{Entier}{%
- \SSimpliTest{\Coeffb}{\Coeffa}%
- \ifboolKV[ClesEquation]{Simplification}{%
- \ifthenelse{\boolean{Simplification}}{\\\useKV[ClesEquation]{Lettre}&=\SSimplifie{\Coeffb}{\Coeffa}}{}%\\
- }{}
- }{}
- }
- \ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
- \end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
- }{%ax+b=cx+d avec a<c % Autre cas délicat
- \ifboolKV[ClesEquation]{Decomposition}{\colorlet{Ccompo}{\useKV[ClesEquation]{CouleurCompo}}}{}
- \begin{align*}%
- \tikzmark{A-\theNbequa}\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}}\tikzmark{E-\theNbequa}\\
- \xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\num{\fpeval{#4-#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#2>0}{+\num{#2}\useKV[ClesEquation]{Lettre}}{-\num{\fpeval{0-#2}}\useKV[ClesEquation]{Lettre}}}\\
- \tikzmark{B-\theNbequa}\xdef\Coeffb{#3}\xdef\Coeffa{\fpeval{#4-#2}}\xintifboolexpr{#3>0}{\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\tikzmark{F-\theNbequa}
- \xintifboolexpr{\Coeffa=1}{}{\\}
- \ifboolKV[ClesEquation]{Fleches}{%
- \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
- \rightcomment{E-\theNbequa}{F-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
- }{}
- \xintifboolexpr{\Coeffa=1}{}{%\ifnum\cmtd>1
- \tikzmark{D-\theNbequa}\frac{\num{\Coeffb}}{\num{\Coeffa}}&=\useKV[ClesEquation]{Lettre}\tikzmark{H-\theNbequa}%\\
- \ifboolKV[ClesEquation]{Fleches}{%
- \leftcomment{B-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- \rightcomment{F-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- }{
- \ifboolKV[ClesEquation]{FlecheDiv}{%
- \leftcomment{B-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- \rightcomment{F-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
- }{}
- }
- \ifboolKV[ClesEquation]{Entier}{%
- \SSimpliTest{\Coeffb}{\Coeffa}%
- \ifboolKV[ClesEquation]{Simplification}{%
- \ifthenelse{\boolean{Simplification}}{\\\SSimplifie{\Coeffb}{\Coeffa}&=\useKV[ClesEquation]{Lettre}}{}%\\
- }{}
- }{}
- }
- \ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
- \end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
- }%
- }%
+ }{%ax+b=cx
+ \xintifboolexpr{#2=#4}{%
+ \xintifboolexpr{#3=0}{%ax=ax
+ L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une infinité de solutions.}%
+ {%ax+b=ax
+ L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ n'a aucune solution.%
+ }%
+ }{%% Cas délicat
+ \xintifboolexpr{#2>#4}{%ax+b=cx avec a>c
+ \ifboolKV[ClesEquation]{Decomposition}{\colorlet{Ccompo}{\useKV[ClesEquation]{CouleurCompo}}}{}
+ \begin{align*}
+ \tikzmark{A-\theNbequa}\mathcolor{Ccompo}{\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\tikzmark{E-\theNbequa}\\
+ \mathcolor{Ccompo}{\num{\fpeval{#2-#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#4>0}{+\num{#4}\useKV[ClesEquation]{Lettre}}{-\num{\fpeval{0-#4}}\useKV[ClesEquation]{Lettre}}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\\
+ \tikzmark{B-\theNbequa}\xdef\Coeffa{\fpeval{#2-#4}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{0}\tikzmark{F-\theNbequa}\\
+ \xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\num{\fpeval{0-#3}}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}}\tikzmark{F-\theNbequa}\\
+ \tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{0-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
+ \xintifboolexpr{\Coeffa=1}{}{\\}
+ \ifboolKV[ClesEquation]{Fleches}{%
+ \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
+ \rightcomment{E-\theNbequa}{F-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
+ \leftcomment{B-\theNbequa}{C-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}$}%
+ \rightcomment{F-\theNbequa}{G-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}$}%
+ }{}
+ \xintifboolexpr{\Coeffa=1}{}{%\ifnum\cmtd>1
+ \tikzmark{D-\theNbequa}\useKV[ClesEquation]{Lettre}&=\frac{\num{\Coeffb}}{\num{\Coeffa}}\tikzmark{H-\theNbequa}%\\
+ \ifboolKV[ClesEquation]{Fleches}{%
+ \leftcomment{C-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ \rightcomment{G-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ }{
+ \ifboolKV[ClesEquation]{FlecheDiv}{%
+ \leftcomment{C-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ \rightcomment{G-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ }{}
+ }
+ \ifboolKV[ClesEquation]{Entier}{%
+ \SSimpliTest{\Coeffb}{\Coeffa}%
+ \ifboolKV[ClesEquation]{Simplification}{%
+ \ifthenelse{\boolean{Simplification}}{\\\useKV[ClesEquation]{Lettre}&=\SSimplifie{\Coeffb}{\Coeffa}}{}%\\
+ }{}
+ }{}
+ }
+ \ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
+ \end{align*}
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
+ }{%ax+b=cx+d avec a<c % Autre cas délicat
+ \ifboolKV[ClesEquation]{Decomposition}{\colorlet{Ccompo}{\useKV[ClesEquation]{CouleurCompo}}}{}
+ \begin{align*}%
+ \tikzmark{A-\theNbequa}\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}}\tikzmark{E-\theNbequa}\\
+ \xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\mathcolor{Ccompo}{\num{\fpeval{#4-#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#2>0}{+\num{#2}\useKV[ClesEquation]{Lettre}}{-\num{\fpeval{0-#2}}\useKV[ClesEquation]{Lettre}}}\\
+ \tikzmark{B-\theNbequa}\xdef\Coeffb{#3}\xdef\Coeffa{\fpeval{#4-#2}}\xintifboolexpr{#3>0}{\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\tikzmark{F-\theNbequa}
+ \xintifboolexpr{\Coeffa=1}{}{\\}
+ \ifboolKV[ClesEquation]{Fleches}{%
+ \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
+ \rightcomment{E-\theNbequa}{F-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
+ }{}
+ \xintifboolexpr{\Coeffa=1}{}{%\ifnum\cmtd>1
+ \tikzmark{D-\theNbequa}\frac{\num{\Coeffb}}{\num{\Coeffa}}&=\useKV[ClesEquation]{Lettre}\tikzmark{H-\theNbequa}%\\
+ \ifboolKV[ClesEquation]{Fleches}{%
+ \leftcomment{B-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ \rightcomment{F-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ }{
+ \ifboolKV[ClesEquation]{FlecheDiv}{%
+ \leftcomment{B-\theNbequa}{D-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ \rightcomment{F-\theNbequa}{H-\theNbequa}{E-\theNbequa}{$\div\xintifboolexpr{\Coeffa<0}{(\num{\Coeffa})}{\num{\Coeffa}}$}%
+ }{}
+ }
+ \ifboolKV[ClesEquation]{Entier}{%
+ \SSimpliTest{\Coeffb}{\Coeffa}%
+ \ifboolKV[ClesEquation]{Simplification}{%
+ \ifthenelse{\boolean{Simplification}}{\\\SSimplifie{\Coeffb}{\Coeffa}&=\useKV[ClesEquation]{Lettre}}{}%\\
+ }{}
+ }{}
+ }
+ \ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
+ \end{align*}
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
}%
}%
- \fi
+ }%
}%
+ \fi
+}%
\newcommand{\ResolEquationComposition}[5][]{%
@@ -159,7 +159,7 @@
\xintifboolexpr{#2=0}{%
\xintifboolexpr{#4=0}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\num{#3}=\num{#5}$ a une infinité de solution.}%
+ L'équation $\num{#3}=\num{#5}$ a une infinité de solutions.}%
{%b<>d
L'équation $\num{#3}=\num{#5}$ n'a aucune solution.%
}%
@@ -186,7 +186,7 @@
{%ax+b=cx+d -- ici
\xintifboolexpr{#2=#4}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une infinité de solution.}%
+ L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une infinité de solutions.}%
{%b<>d
L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ n'a aucune solution.%
}%
@@ -227,7 +227,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
}{}
}{%ax+b=cx+d avec a<c % Autre cas délicat
\ifboolKV[ClesEquation]{Decomposition}{\colorlet{Ccompo}{\useKV[ClesEquation]{CouleurCompo}}}{}%
@@ -264,7 +264,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
}{}%
}%
}%
@@ -272,6 +272,4 @@
}%
}%
}%
-}%
-
-
+}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction1.tex b/macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction2.tex
index 034aa7e2ed..f3ffd9453d 100644
--- a/macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction1.tex
+++ b/macros/latex/contrib/profcollege/latex/PfC-EquationSoustraction2.tex
@@ -11,15 +11,15 @@
% si non, on est dans le cas ax=d
\xintifboolexpr{#2=0}{%
\xintifboolexpr{#5=0}{%
- L'équation $0\useKV[ClesEquation]{ELettre}=0$ a une infinité de solution.}{L'équation $0\useKV[ClesEquation]{Lettre}=\num{#5}$ n'a aucune solution.}%
+ L'équation $0\useKV[ClesEquation]{ELettre}=0$ a une infinité de solutions.}{L'équation $0\useKV[ClesEquation]{Lettre}=\num{#5}$ n'a aucune solution.}%
}{%\else
\xintifboolexpr{#5=0}{L'équation $\num{#2}\useKV[ClesEquation]{Lettre}=0$ a une unique solution : $\useKV[ClesEquation]{Lettre}=0$.}{%\else
\begin{align*}%
\tikzmark{A-\theNbequa}\xintifboolexpr{#2=1}{\useKV[ClesEquation]{Lettre}}{\num{#2}\useKV[ClesEquation]{Lettre}}&=\num{#5}\tikzmark{C-\theNbequa}\\
\tikzmark{B-\theNbequa}\useKV[ClesEquation]{Lettre}&=\frac{\num{#5}}{\num{#2}}\tikzmark{D-\theNbequa}%\\
\ifboolKV[ClesEquation]{Fleches}{%
- \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}$}%
- \rightcomment{C-\theNbequa}{D-\theNbequa}{D-\theNbequa}{$\div\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}$}%
+ \leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}$}%
+ \rightcomment{C-\theNbequa}{D-\theNbequa}{D-\theNbequa}{$\div\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}$}%
}{%
\ifboolKV[ClesEquation]{FlecheDiv}{%
\Leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\div\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}$}%
@@ -27,17 +27,17 @@
}{}%
}%%
\ifboolKV[ClesEquation]{Entier}{%
- \SSimpliTest{#5}{#2}%
- \ifboolKV[ClesEquation]{Simplification}{%
- \ifthenelse{\boolean{Simplification}}{\\\useKV[ClesEquation]{Lettre}&=\SSimplifie{#5}{#2}}{}%\\
- }{}
- }{}
+ \SSimpliTest{#5}{#2}%
+ \ifboolKV[ClesEquation]{Simplification}{%
+ \ifthenelse{\boolean{Simplification}}{\\\useKV[ClesEquation]{Lettre}&=\SSimplifie{#5}{#2}}{}%\\
+ }{}
+ }{}
\ifboolKV[ClesEquation]{Fleches}{%
\stepcounter{Nbequa}}%
{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}
}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{\useKV[ClesEquation]{Lettre}=\num{#5}}{\num{#2}\useKV[ClesEquation]{Lettre}=\num{#5}}$ a une unique solution : $\displaystyle\useKV[ClesEquation]{Lettre}=\opdiv*{#5}{#2}{numequa}{resteequa}\opcmp{resteequa}{0}\ifopeq\opexport{numequa}{\numequa}\num{\numequa}\else\ifboolKV[ClesEquation]{Simplification}{\SSimplifie{#5}{#2}}{\frac{\num{#5}}{\num{#2}}}\fi$.%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{\useKV[ClesEquation]{Lettre}=\num{#5}}{\num{#2}\useKV[ClesEquation]{Lettre}=\num{#5}}$ a une unique solution : $\displaystyle\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\opdiv*{#5}{#2}{numequa}{resteequa}\opcmp{resteequa}{0}\ifopeq\opexport{numequa}{\numequa}\num{\numequa}\else\ifboolKV[ClesEquation]{Simplification}{\SSimplifie{#5}{#2}}{\frac{\num{#5}}{\num{#2}}}\fi$.%
}{}
}
}
@@ -52,7 +52,7 @@
\else%cas ax+b=d
\xintifboolexpr{#2=0}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\num{#3}=\num{#5}$ a une infinité de solution.}%
+ L'équation $\num{#3}=\num{#5}$ a une infinité de solutions.}%
{%b<>d
L'équation $\num{#3}=\num{#5}$ n'a aucune solution.%
}%
@@ -65,7 +65,8 @@
\ifboolKV[ClesEquation]{Decomposition}{%
\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}&=\num{#5}\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}\\
}{}%
- \tikzmark{C-\theNbequa}\xdef\Coeffa{#2}\xdef\Coeffb{\fpeval{#5-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
+ \tikzmark{C-\theNbequa}\xdef\Coeffa{#2}\xdef\Coeffb{\fpeval{#5-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}
+ \ifboolKV[ClesEquation]{Decomposition}{\\\xintifboolexpr{\Coeffa=1}{}{\frac{\num{\Coeffa}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}\useKV[ClesEquation]{Lettre}&=\frac{\num{\Coeffb}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}}}{}
\xintifboolexpr{\Coeffa=1}{}{\\}
\ifboolKV[ClesEquation]{Fleches}{%
\leftcomment{A-\theNbequa}{C-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}$}%
@@ -92,7 +93,7 @@
}{}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\num{#5}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\num{#5}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.
}{}
}
}
@@ -117,7 +118,7 @@
}{%ax+b=cx
\xintifboolexpr{#2=#4}{%
\xintifboolexpr{#3=0}{%ax=ax
- L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une infinité de solution.}%
+ L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une infinité de solutions.}%
{%ax+b=ax
L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ n'a aucune solution.%
}%
@@ -132,7 +133,10 @@
\ifboolKV[ClesEquation]{Decomposition}{%
\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}&=0\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}\tikzmark{F-\theNbequa}\\
}{}%
- \tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{0-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
+ \tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{0-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
+ %eric
+ \ifboolKV[ClesEquation]{Decomposition}{\\\xintifboolexpr{\Coeffa=1}{}{\frac{\num{\Coeffa}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}\useKV[ClesEquation]{Lettre}&=\frac{\num{\Coeffb}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}}}{}
+ % eric
\xintifboolexpr{\Coeffa=1}{}{\\}
\ifboolKV[ClesEquation]{Fleches}{%
\leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
@@ -160,7 +164,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}
}{%ax+b=cx+d avec a<c % Autre cas délicat
\begin{align*}%
\tikzmark{A-\theNbequa}\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}&=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\tikzmark{E-\theNbequa}\\
@@ -173,6 +177,9 @@
\leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
\rightcomment{E-\theNbequa}{F-\theNbequa}{E-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
}{}
+ % eric
+ \ifboolKV[ClesEquation]{Decomposition}{\\\xintifboolexpr{\Coeffa=1}{}{\frac{\num{\Coeffb}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}&=\frac{\num{\Coeffa}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}\useKV[ClesEquation]{Lettre}}}{}
+ % eric
\xintifboolexpr{\Coeffa=1}{}{%\ifnum\cmtd>1
\tikzmark{D-\theNbequa}\frac{\num{\Coeffb}}{\num{\Coeffa}}&=\useKV[ClesEquation]{Lettre}\tikzmark{H-\theNbequa}%\\
\ifboolKV[ClesEquation]{Fleches}{%
@@ -193,7 +200,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.}{}%
}%
}%
}%
@@ -208,7 +215,7 @@
\xintifboolexpr{#2=0}{%
\xintifboolexpr{#4=0}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\num{#3}=\num{#5}$ a une infinité de solution.}%
+ L'équation $\num{#3}=\num{#5}$ a une infinité de solutions.}%
{%b<>d
L'équation $\num{#3}=\num{#5}$ n'a aucune solution.%
}%
@@ -235,7 +242,7 @@
{%ax+b=cx+d -- ici
\xintifboolexpr{#2=#4}{%
\xintifboolexpr{#3=#5}{%b=d
- L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une infinité de solution.}%
+ L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une infinité de solutions.}%
{%b<>d
L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ n'a aucune solution.%
}%
@@ -252,6 +259,9 @@
\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}&=\num{#5}\mathcolor{Cdecomp}{\xintifboolexpr{#3>0}{-\num{#3}}{+\num{\fpeval{0-#3}}}}\\
}{}%
\tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{#5-#3}}\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}&=\num{\Coeffb}\tikzmark{G-\theNbequa}%\\
+ % eric
+ \ifboolKV[ClesEquation]{Decomposition}{\\\xintifboolexpr{\Coeffa=1}{}{\frac{\num{\Coeffa}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}\useKV[ClesEquation]{Lettre}&=\frac{\num{\Coeffb}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}}}{}
+ % eric
\xintifboolexpr{\Coeffa=1}{}{\\}
\ifboolKV[ClesEquation]{Fleches}{%
\leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#4>0}{-\num{#4}}{+\num{\fpeval{0-#4}}}\useKV[ClesEquation]{Lettre}$}
@@ -279,7 +289,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
}{}
}{%ax+b=cx+d avec a<c % Autre cas délicat
\begin{align*}%
@@ -292,6 +302,9 @@
\num{#3}\mathcolor{Cdecomp}{\xintifboolexpr{#5>0}{-\num{#5}}{+\num{\fpeval{0-#5}}}}&=\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}\mathcolor{Cdecomp}{\xintifboolexpr{#5>0}{-\num{#5}}{+\num{\fpeval{0-#5}}}}\\
}{}%
\tikzmark{C-\theNbequa}\xdef\Coeffb{\fpeval{#3-#5}}\num{\Coeffb}&=\xintifboolexpr{\Coeffa=1}{}{\num{\Coeffa}}\useKV[ClesEquation]{Lettre}\tikzmark{G-\theNbequa}%\\
+ % eric
+ \ifboolKV[ClesEquation]{Decomposition}{\\\xintifboolexpr{\Coeffa=1}{}{\frac{\num{\Coeffb}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}&=\frac{\num{\Coeffa}}{\mathcolor{Cdecomp}{\num{\Coeffa}}}\useKV[ClesEquation]{Lettre}}}{}
+ % eric
\xintifboolexpr{\Coeffa=1}{}{\\}
\ifboolKV[ClesEquation]{Fleches}{%
\leftcomment{A-\theNbequa}{B-\theNbequa}{A-\theNbequa}{$\xintifboolexpr{#2>0}{-\num{#2}}{+\num{\fpeval{0-#2}}}\useKV[ClesEquation]{Lettre}$}
@@ -319,7 +332,7 @@
}
\ifboolKV[ClesEquation]{Fleches}{\stepcounter{Nbequa}}{\ifboolKV[ClesEquation]{FlecheDiv}{\stepcounter{Nbequa}}{}}
\end{align*}
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}=\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}$ a une unique solution : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$.%
}{}%
}%
}%
diff --git a/macros/latex/contrib/profcollege/latex/ProfCollege.sty b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
index 121428955b..215caf5503 100644
--- a/macros/latex/contrib/profcollege/latex/ProfCollege.sty
+++ b/macros/latex/contrib/profcollege/latex/ProfCollege.sty
@@ -1,65 +1,11 @@
% Author : Christophe Poulain
% Licence : Released under the LaTeX Project Public License v1.3c
% or later, see http://www.latex-project.org/lppl.txtf
-%%%%%%%
-% 90 : Reprise d'une partie de la doc. Quelques ajouts.
-% 87-88 : amélioration \Thales. \Labyrinthe.
-% 85 : passage à lua.
-% 75 : plein de choses que j'ai oubliées :(
-% 71 : Possibilité de choisir les fontes pour les figures MP
-% 70 : Ajout de la commande \calculatrice. Coupure des calculs longs
-% pour la moyenne et médiane. Egalités remarquables pour le
-% développement. Tableau vide pour les stats.
-% 67 : préparation au dépôt sur ctan.org
-% 66 : Ajout de la commande \Ratio.
-% 62 : Refonte des commandes !\Result! - Ajout d'une commande \Result
-% dans SommeAngles. Rectification espace dans \Distri avec Reduction active.
-% 61 : Simplication d'une fraction en version longue :) - Ajout
-% d'options à la commande \lstinline!\Stat!. Ajout d'options à la
-% commande \lstinline!\Thales!.
-% 60 : Nouvelle présentation de la résolution d'une équation. Reprise
-% et ajout d'une clé à la commande \SommeAngles.
-% 59 : amélioration de la macro \Pythagore pour pouvoir enchaîner les
-% calculs. Amélioration de la macro \Reperage pour améliorer
-% la gestion de l'affichage sur les droites graduées.
-% 58 : ajout d'un affichage des angles dans les diagrammes circulaires.
-% 57 : ajout de la commande \Fraction. Ajout d'un VF dans la macro \QCM
-% 56 : ajout de commandes "utiles" :) / Modification de \SommeAngles
-% pour éviter les conflits.
-% 55 : ajout d'une clé \Cle{Longue} dans la commande \Décomposition
-% 54 : adaptations mineures :) à gmp
-% 53 : ajout de la commande \QFlash
-% 52 : ajout de la macro \QCM
-% 51 : ajout de la macro \Relie
-% 50 : Changement des clés.
-% 37 : Reprise de la macro \Distri pour qu'elle accepte des valeurs
-%décimales.
-% 36 : Ajout d'un développement numérique. Reprise de la décomposition
-% des nombres premiers (pour éviter conflit entre \newcount\c et la
-% commande \c... Suppression de "spurious blank"
-% 35 : Ajout d'une quatrième version de présentation de la résolution
-% d'une équation - Nouvelle macro : Puissances. Ajout d'une option
-% \EFacteurs pour les équations produit nul. Amélioration (rédaction)
-% de \FonctionAffine - Ajout de la couleur de fond paramétrable dans
-% les fleches PH et BH de \Propor
-% 34 : Ajout de la commande \ResultatTrigo, \ResultatThalesx... Suppression de spurious blank. Corrections typographiques. Reprise de l'affichage de la moyenne dans la commande \Stat
-% 33 : MAJ Distri : Problème d'espace en utilisant les nombres négatifs (1ere étape).
-% 32 : MAJ Pythagore : Ajout de la clé PUnite - Possibilité de récupérer la valeur numérique obtenue par la macro Pythagore - Justification des textes dans les bulles. Ajout d'un FlecheCoefDebut dans \Propor.
-% 31 : MAJ Pourcentage. Correction quelques bugs. Correction de \og spurious blank\fg. Oubli du RequirePackage{multido} :(
-% 29 : MAJ Trigo (figure reprise pour utiliser \num de siunitx)
-% 28 : Mise à jour de \Propor : flèches inversées \FlechesPH et \FlechesPB, homogénéité des flèches. Pourcentage.
-% 27 : ajout du repérage
-% 26 : ajout des schémas de proba + MAJ avec geometriesyr16 + MAJ Nombre premier.
-% 25 : ajout des formules
-% 24 : ajout d'une option pour les équations $X^2=a$
-% 23 : ajout d'une option pour les équations produit.
-% 22 : ajout d'une option TColonnes dans la macro Tableaux
-% 21 : Ajout d'une vérification dans la macro \ResolEquation - Correction de quelques bugs dans la résolution d'équation.
-% 20: ajout d'une macro simpliste (car pas beaucoup d'utilité) sur les fonctions.
-% 19 : Modification AAntécédent dans Affine + Amélioration Pythagore (Cas des triangles rectangles isocèles, dans le calcul de la longueur d'un côté)
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfCollege}[2021/01/30 v0.90 Aide pour l'utilisation de LaTeX au collège]
+\ProvidesPackage{ProfCollege}[2021/03/10 v0.95 Aide pour l'utilisation de LaTeX au collège]
+
+\RequirePackage{verbatim}
\RequirePackage{mathtools}%Amélioration des rendus
\RequirePackage{amssymb}
@@ -77,6 +23,14 @@
\newcommand\speed[1]{\SI{#1}{\kmh}}
\newcommand\Speed[1]{\SI[per-mode=symbol]{#1}{\kmh}}
+\DeclareSIUnit{\are}{a}
+\DeclareSIUnit{\annee}{an}
+\DeclareSIUnit{\mois}{mois}
+\DeclareSIUnit{\jour}{j}
+\DeclareSIUnit{\quintal}{q}
+\DeclareSIUnit{\octet}{o}
+\DeclareSIUnit{\fahrenheit}{\degree F}
+
\RequirePackage[table,svgnames]{xcolor}%Gestion des couleurs
\RequirePackage{xstring}%Gestion de chaines de caractères
\RequirePackage{simplekv}%Gestion de paramètres sous forme de clés
@@ -90,24 +44,24 @@
\if@shellescape
\RequirePackage[shellescape,latex]{gmp}%inclusion de figures metapost "à la volée"%
-\gmpoptions{everymp={prologues:=3; input PfC-LaTeX; input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie;}}
+\gmpoptions{everymp={prologues:=3; input PfC-LaTeX; input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie; input PfC-Afficheur;}}
\usempxclass{article}
+\usempxpackage{ProfCollege}
\usempxpackage[utf8]{inputenc}
\usempxpackage[T1]{fontenc}
\usempxpackage{fourier}
\usempxpackage[french]{babel}
\usempxpackage{pifont}
-\usempxpackage[locale=FR]{siunitx}
\else
\RequirePackage[latex]{gmp}%inclusion de figures metapost "à la volée"%
-\gmpoptions{everymp={prologues:=3; input PfC-LaTeX; input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie;}}
+\gmpoptions{everymp={prologues:=3; input PfC-LaTeX; input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie; input PfC-Afficheur;}}
\usempxclass{article}
+\usempxpackage{ProfCollege}
\usempxpackage[utf8]{inputenc}
\usempxpackage[T1]{fontenc}
\usempxpackage{fourier}
\usempxpackage[french]{babel}
\usempxpackage{pifont}
-\usempxpackage[locale=FR]{siunitx}
\fi
\RequirePackage{xintexpr}
@@ -138,17 +92,15 @@
\RequirePackage{stackengine}
\RequirePackage[thicklines]{cancel}
-%\ifpdftex
-%\RequirePackage[babel=true,kerning=true]{microtype}%Pour gérer le souci du ; dans tikz avec pdftex...
-%\fi
+\RequirePackage{nicematrix}%pour le tableur
% https://stackoverflow.com/questions/3391103/how-to-make-the-grayed-round-box-using-tiks
\RequirePackage{environ}
+%
-%%% 80
\ifluatex
\RequirePackage{luamplib}
-\everymplib{input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie; beginfig(1);}
+\everymplib{input PfC-Svgnames; input PfC-Constantes; input PfC-Geometrie; input PfC-Afficheur; beginfig(1);}
\everyendmplib{endfig;}
\fi
@@ -180,9 +132,9 @@
\hfil\crcr #1\crcr}}\,}
\catcode`\@=12
-%%%%%%%%%%%%%%%%%%%%%
+%%%
%% Commandes "utiles"
-%%%%%%%%%%%%%%%%%%%%%
+%%%
%encadrer avec des "sommets arrondis"
\newsavebox{\logobox}
@@ -217,9 +169,28 @@
}
}
-%%%%%%%%%%%%%%%%%
+\newcommand\MultiCol[2]{%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNombreCol{#1}%
+ \setsepchar[*]{§}%
+ \readlist*\ListeContenuCol{#2}%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeNombreCollen}}\do{%
+ \begin{minipage}{\ListeNombreCol[##1]\linewidth}
+ \ListeContenuCol[##1]
+ \end{minipage}%
+ \xintifboolexpr{##1<\ListeNombreCollen}{\hfill}{}%
+ }%
+}%
+
+\newcommand\Demain{%
+ \advance\day by 1%
+ \today%
+ \advance\day by -1%
+}
+
+%%%
% Tables Addition-Multiplication
-%%%%%%%%%%%%%%%%%
+%%%
\setKVdefault[Tables]{Addition=false,Multiplication=true,Seul=false,Debut=0,Fin=10,Couleur=white}
% pour mémoire
@@ -303,7 +274,6 @@
}%
}%
-
\newcommand\Tables[2][]{%
\useKVdefault[Tables]%
\setKV[Tables]{#1}%
@@ -322,15 +292,82 @@
}%
}%
-%%%%%%%%%%%%%%
+%%%
+% Rangement des nombres
+%%%
+\setKVdefault[ClesRgt]{Croissant,Decroissant=false,Strict,Fraction=false,Details=false}
+
+\DTLgnewdb{mtnumedb}%
+\DTLgnewdb{mtnumeretourdb}%
+
+\newcommand\Rangement[2][]{%
+ \useKVdefault[ClesRgt]%
+ \setKV[ClesRgt]{#1}%
+ \ifboolKV[ClesRgt]{Fraction}{%
+ \setsepchar[*]{,*/}%\ignoreemptyitems%
+ \readlist*\ListeRgt{#2}%
+ % on cherche le dénominateur commun
+ \ppcm=1\relax
+ \foreachitem\x\in\ListeRgt{%
+ \PPCM{\fpeval{\ListeRgt[\xcnt,2]}}{\fpeval{\the\ppcm}}%
+ }%
+ % On crée la liste des rangements.
+ \DTLcleardb{mtnumedb}%
+ % on les trie pour les ranger par ordre croissant
+ \foreachitem\x\in\ListeRgt{%
+ \DTLnewrow{mtnumedb}%
+ \itemtomacro\ListeRgt[\xcnt,1]\y%
+ \DTLnewdbentry{mtnumedb}{Numeric}{\fpeval{\y*\the\ppcm/\ListeRgt[\xcnt,2]}}%
+ }%
+ % On trie
+ \ifboolKV[ClesRgt]{Decroissant}{%
+ % On trie la liste
+ \dtlsort{Numeric=descending}{mtnumedb}{\dtlicompare}%
+ \ifboolKV[ClesRgt]{Details}{\ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=Numeric}{\frac{\num{\numeroDonnee}}{\num{\the\ppcm}}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}}{%
+ \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=Numeric}{\Simplification{\numeroDonnee}{\ppcm}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}%
+ }
+ }{%
+ % On trie la liste
+ \dtlsort{Numeric}{mtnumedb}{\dtlicompare}%
+ \ifboolKV[ClesRgt]{Details}{%
+ \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=Numeric}{\frac{\num{\numeroDonnee}}{\num{\the\ppcm}}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}%
+ }{%
+ \ensuremath{\DTLforeach{mtnumedb}{\numeroDonnee=Numeric}{\Simplification{\numeroDonnee}{\ppcm}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}%
+ }
+ }%
+ }{%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\ListeRgt{#2}%
+ % on crée la base de données des valeurs
+ \DTLcleardb{mtdb}%
+ % on les trie pour les ranger par ordre croissant
+ \foreachitem\x\in\ListeRgt{%
+ \DTLnewrow{mtdb}%
+ \itemtomacro\ListeRgt[\xcnt]\y%
+ \DTLnewdbentry{mtdb}{Numeric}{\y}%
+ }%
+ %
+ \ifboolKV[ClesRgt]{Decroissant}{%
+ % On trie la liste
+ \dtlsort{Numeric=descending}{mtdb}{\dtlicompare}%
+ \ensuremath{\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{>}{\geqslant}}}}%
+ }{%
+ % On trie la liste
+ \dtlsort{Numeric}{mtdb}{\dtlicompare}%
+ \ensuremath{\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\num{\numeroDonnee}\DTLiflastrow{}{\ifboolKV[ClesRgt]{Strict}{<}{\leqslant}}}}%
+ }%
+ }
+}%
+
+%%%
% Labyrinthe
-%%%%%%%%%%%%%%
+%%%
\setKVdefault[Labyrinthe]{Lignes=6,Colonnes=3,Longueur=4,Hauteur=2,Passages=false,EcartH=1,EcartV=1,CouleurF=gray!50,Texte=\color{black}}
\newcommand\Labyrinthe[3][]{%
\useKVdefault[Labyrinthe]%
\setKV[Labyrinthe]{#1}%
- \setsepchar[*]{,*/}%\ignoreemptyitems%
+ \setsepchar[*]{,*/}%
\readlist*\ListeLaby{#2}%
\ifboolKV[Labyrinthe]{Passages}{%
\readlist*\ListeLabySol{#3}%
@@ -393,21 +430,21 @@
définitions de {\ttfamily Colonnes} et {\ttfamily Lignes} !}}%
}
-%%%%%%%%%%%%%%%
+%%%
% Calculatrice
-%%%%%%%%%%%%%%%
+%%%
%https://tex.stackexchange.com/questions/290321/mimicking-a-calculator-inputs-and-screen
-\definecolor{lightorange}{rgb}{0.9,0.4,0}
-\definecolor{lightestorange}{rgb}{1,0.8,0.5}
-\definecolor{darkorange}{rgb}{0.2,0.1,0}
-
-\colorlet{blackened}{black!90!white}
-\colorlet{blackish}{black!70!white}
-\colorlet{greyish}{black!60!white}
-\colorlet{whiteish}{white}
-\colorlet{orangeish}{yellow!90!red}
-\colorlet{greenish}{green!16!gray}
-\colorlet{redish}{red!80!black}
+\definecolor{lightorange}{rgb}{0.9,0.4,0}%
+\definecolor{lightestorange}{rgb}{1,0.8,0.5}%
+\definecolor{darkorange}{rgb}{0.2,0.1,0}%
+
+\colorlet{blackened}{black!90!white}%
+\colorlet{blackish}{black!70!white}%
+\colorlet{greyish}{black!60!white}%
+\colorlet{whiteish}{white}%
+\colorlet{orangeish}{yellow!90!red}%
+\colorlet{greenish}{green!16!gray}%
+\colorlet{redish}{red!80!black}%
\tcbset{calbackground/.style={
enhanced,
@@ -427,7 +464,7 @@
colbacklower=greenish,
colframe=white,
autoparskip,
- }}
+ }}%
\newtcbox{\KY}[1][]{
enhanced,
@@ -444,7 +481,7 @@
fontupper=\footnotesize\sffamily,
coltext=orangeish,
before upper=\vrule width 0pt height 2ex depth 1ex\relax,
-}
+}%
\newtcbox{\KYm}[1][]{
enhanced,
@@ -462,7 +499,7 @@
coltext=orangeish,
before upper=\vrule width 0pt height 2ex depth 1ex\relax$,
after upper=$,
-}
+}%
\newtcbox{\KN}{
enhanced,
@@ -479,9 +516,7 @@
fontupper=\footnotesize\sffamily,
coltext=whiteish,
before upper=\vrule width 0pt height 2ex depth 1ex\relax,
-}
-
-\parindent0pt
+}%
\newtcolorbox{calc}[1][]{%
enhanced,bicolor,
@@ -504,13 +539,13 @@
at (frame.north east) {#1};}
}
-\def\MPCalculatrice#1#2{
+\def\MPCalculatrice#1#2#3{
% #1 Calcul %2 réponse
\ifluatex
\mplibforcehmode
\begin{mplibcode}
input PfC-Calculatrice;
- LCD(#1)(#2);
+ LCD(#1)(#2)(#3);
\end{mplibcode}
\else
\begin{mpost}[mpsettings={input PfC-Calculatrice;}]
@@ -519,7 +554,7 @@
\fi
}
-\setKVdefault[ClesCalculatrice]{Ecran=false}
+\setKVdefault[ClesCalculatrice]{Ecran=false,NbLignes=0}
\newcommand\Calculatrice[2][]{%
\setstackgap{L}{0.775\baselineskip}%
@@ -528,7 +563,7 @@
\ifboolKV[ClesCalculatrice]{Ecran}{%
\setsepchar[*]{,*/}%
\readlist\ListeCalc{#2}%
- \MPCalculatrice{\ListeCalc[1,1]}{\ListeCalc[1,2]}%
+ \MPCalculatrice{\ListeCalc[1,1]}{\ListeCalc[1,2]}{\useKV[ClesCalculatrice]{NbLignes}}%
}{%
\setsepchar[*]{,*/}%
\readlist\ListeCalc{#2}%
@@ -538,34 +573,49 @@
\setstackgap{L}{\baselineskip}%
}%
-
-%%%%%%%%%%%%%%%%
-%%% Questions Flash
-%%%%%%%%%%%%%%%%
+%%%
+% Questions Flash
+%%%
\tcbset{Expression/.style={colback=white,valign=center,left=0mm,right=0mm,top=1mm,bottom=1mm,colframe=white}}%
\tcbset{ExpressionSerie1/.style={colback=\useKV[ClesFlash]{Couleur1},left=0mm,right=0mm,top=1mm,bottom=1mm}}%
\tcbset{ExpressionSerie2/.style={colback=\useKV[ClesFlash]{Couleur2},left=0mm,right=0mm,top=1mm,bottom=1mm}}%
\tcbset{ExpressionSerie3/.style={colback=\useKV[ClesFlash]{Couleur3},left=0mm,right=0mm,top=1mm,bottom=1mm}}
\tcbset{ExpressionSerie4/.style={colback=\useKV[ClesFlash]{Couleur4},left=0mm,right=0mm,top=1mm,bottom=1mm}}
-\tcbset{BoiteExpression/.style={enhanced,nobeforeafter,tcbox raise
- base,colback=white,right=3.5mm,left=3.5mm,halign=center,colframe=black}}
+\tcbset{BoiteExpression/.style={enhanced,nobeforeafter,tcbox raise base,colback=white,right=3.5mm,left=3.5mm,halign=center,colframe=black}}
\newtcolorbox{CadreNombre}[1][]{%
Expression,#1}
-\setKVdefault[ClesFlash]{Hauteur=0.2\textheight,Simple=false,Intrus=false,Kahout=false,Daily=false,Expression=false,Mental=false,Mesure=false,Heure=false,Decimal=false,Operation=Multiplie,Numeration=false,Evaluation=false,Pause=false,Couleur1=blue!10,Couleur2=orange!10,Couleur3=green!10,Couleur4=yellow!10}
+\setKVdefault[ClesFlash]{Hauteur=0.2\textheight,Simple=false,Intrus=false,Kahout=false,Daily=false,Expression=false,Mental=false,Mesure=false,Heure=false,Decimal=false,Operation=Multiplie,Numeration=false,Evaluation=false,Pause=false,Couleur1=blue!10,Couleur2=orange!10,Couleur3=green!10,Couleur4=yellow!10,Numerique=false,Seul=false}
\newlength{\HauteurFlash}
-\tikzset{
- arrow/.style={
- draw,
- minimum height=1.25cm,
- inner sep=0.25em,
- shape=signal,
- signal from=west,
- signal to=east,
- signal pointer angle=150,
- }
+\def\MPAfficheur#1#2#3{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ u:=0.5u;
+ draw Afficheur(#1 div10,0);
+ draw Afficheur(#1 mod10,0) shifted(u*(1,0));
+ draw Afficheur(10,0) shifted(u*(2,0));
+ draw Afficheur(#2 div10,0) shifted(u*(3,0));
+ draw Afficheur(#2 mod10,0) shifted(u*(4,0));
+ draw Afficheur(10,0) shifted(u*(5,0));
+ draw Afficheur(#3 div10,0) shifted(u*(6,0));
+ draw Afficheur(#3 mod10,0) shifted(u*(7,0));
+ \end{mplibcode}
+ \else
+ \begin{mpost}
+ u:=0.5u;
+ draw Afficheur(#1 div10,0);
+ draw Afficheur(#1 mod10,0) shifted(u*(1,0));
+ draw Afficheur(10,0) shifted(u*(2,0));
+ draw Afficheur(#2 div10,0) shifted(u*(3,0));
+ draw Afficheur(#2 mod10,0) shifted(u*(4,0));
+ draw Afficheur(10,0) shifted(u*(5,0));
+ draw Afficheur(#3 div10,0) shifted(u*(6,0));
+ draw Afficheur(#3 mod10,0) shifted(u*(7,0));
+ \end{mpost}
+ \fi
}
\def\MPHorloge#1#2#3{
@@ -683,7 +733,7 @@
\newcommand\QFHeure{%
\begin{CadreNombre}
- {\Large L'HEURE DU JOUR est : }\raisebox{-0.9cm}{\MPHorloge{\NbHeures}{\NbMinutes}{\NbSecondes}}
+ {\Large L'HEURE DU JOUR est : }\ifboolKV[ClesFlash]{Numerique}{\raisebox{-0.3cm}{\MPAfficheur{\NbHeures}{\NbMinutes}{\NbSecondes}}}{\raisebox{-0.9cm}{{\MPHorloge{\NbHeures}{\NbMinutes}{\NbSecondes}}}}
\ifboolKV[ClesFlash]{Pause}{\pause}{}
\begin{tcolorbox}[ExpressionSerie1]
$\square$ \textbf{\ListeFlash[1,2] :}
@@ -734,26 +784,37 @@
\end{CadreNombre}
}
+\tikzset{
+ arrow/.style={
+ draw,
+ minimum height=1.25cm,
+ inner sep=0.25em,
+ shape=signal,
+ signal from=west,
+ signal to=east,
+ signal pointer angle=150,
+ }
+}
+
\newcommand\QFDaily{%
- \begin{tikzpicture}
- \begin{scope}[start chain=transition going right,node
- distance=-\pgflinewidth]
- \foreach \s in {1,...,\ListeFlashlen}{%
- \xintifboolexpr{\s = 1}{%
- \node[arrow,on chain] {\Huge\bfseries\ListeFlash[\s]};
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{tikzpicture}%
+ \begin{scope}[start chain=transition going right,node distance=-\pgflinewidth]%
+ \foreach \s in {1,...,\ListeFlashlen}{%
+ \xintifboolexpr{\s = 1}{%
+ \node[arrow,on chain] {\Huge\bfseries\ListeFlash[\s]};%
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}%
+ }{%
+ \xintifboolexpr{\s = \ListeFlashlen}{%
+ \node[arrow,on chain] {\Huge\bfseries?};%
}{%
- \xintifboolexpr{\s = \ListeFlashlen}{%
- \node[arrow,on chain] {\Huge\bfseries?};
- }{%
- \node[arrow,on chain] {\ListeFlash[\s]};
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- }
- }
- }
- \end{scope}
- \end{tikzpicture}
-}
+ \node[arrow,on chain] {\ListeFlash[\s]};%
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}%
+ }%
+ }%
+ }%
+ \end{scope}%
+ \end{tikzpicture}%
+}%
\newcommand\QFDecimal{%
\begin{CadreNombre}
@@ -761,7 +822,7 @@
\tcbox[BoiteExpression]{\num{\ListeFlash[1,1]}}
\ifboolKV[ClesFlash]{Pause}{\pause}{}
\begin{tcolorbox}[ExpressionSerie1]
- $\square$ \textbf{\'Ecriture en fraction décimale :}
+ $\square$ \textbf{\'Ecris-le en fraction décimale :}
\tcbox[BoiteExpression]{$\dfrac{\phantom{1000000}}{\phantom{1000000}}$}
\end{tcolorbox}
\ifboolKV[ClesFlash]{Pause}{\pause}{}
@@ -845,264 +906,296 @@
\end{CadreNombre}
}
+\newcommand\BoiteFlash[1]{%
+ \ifx\bla#1\bla%
+ \tcbox[BoiteExpression]{\phantom{10000000}}%
+ \else
+ \tcbox[BoiteExpression]{#1}%
+ \fi
+}
+
+\newcommand\QFVide{%
+ \begin{CadreNombre}
+ {\ListeFlash[1]}
+ \xintFor* ##1 in {\xintSeq {1}{\ListeFlashlen-1}}\do{%
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{tcolorbox}[ExpressionSerie##1]
+ \ListeFlash[1+##1]
+ \end{tcolorbox}
+ }
+ \end{CadreNombre}
+}
+
\newcommand\QFlash[2][]{%
- \useKVdefault[ClesFlash]
- \setKV[ClesFlash]{#1}
- \setlength{\HauteurFlash}{\useKV[ClesFlash]{Hauteur}}
- \colorlet{CouleurUn}{\useKV[ClesFlash]{Couleur1}}
- \colorlet{CouleurDeux}{\useKV[ClesFlash]{Couleur2}}
- \colorlet{CouleurTrois}{\useKV[ClesFlash]{Couleur3}}
- \colorlet{CouleurQuatre}{\useKV[ClesFlash]{Couleur4}}
+ \useKVdefault[ClesFlash]%
+ \setKV[ClesFlash]{#1}%
+ \setlength{\HauteurFlash}{\useKV[ClesFlash]{Hauteur}}%
+ \colorlet{CouleurUn}{\useKV[ClesFlash]{Couleur1}}%
+ \colorlet{CouleurDeux}{\useKV[ClesFlash]{Couleur2}}%
+ \colorlet{CouleurTrois}{\useKV[ClesFlash]{Couleur3}}%
+ \colorlet{CouleurQuatre}{\useKV[ClesFlash]{Couleur4}}%
\ifboolKV[ClesFlash]{Evaluation}{%
- \ifboolKV[ClesFlash]{Numeration}{%
- \setsepchar[*]{,*/}%
+ \ifboolKV[ClesFlash]{Seul}{%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
- \QFNumeration%
+ \QFVide%
}{%
- \ifboolKV[ClesFlash]{Heure}{%
+ \ifboolKV[ClesFlash]{Numeration}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \StrMid{\ListeFlash[1,1]}{1}{2}[\NbHeures]%
- \StrMid{\ListeFlash[1,1]}{3}{4}[\NbMinutes]%
- \StrMid{\ListeFlash[1,1]}{5}{6}[\NbSecondes]%
- \QFHeure%
+ \QFNumeration%
}{%
- \ifboolKV[ClesFlash]{Mesure}{%
+ \ifboolKV[ClesFlash]{Heure}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \QFMesure%
+ \StrMid{\ListeFlash[1,1]}{1}{2}[\NbHeures]%
+ \StrMid{\ListeFlash[1,1]}{3}{4}[\NbMinutes]%
+ \StrMid{\ListeFlash[1,1]}{5}{6}[\NbSecondes]%
+ \QFHeure%
}{%
- \ifboolKV[ClesFlash]{Daily}{%
- \setsepchar[*]{/}%
+ \ifboolKV[ClesFlash]{Mesure}{%
+ \setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \QFDaily%
+ \QFMesure%
}{%
- \ifboolKV[ClesFlash]{Decimal}{%
- \setsepchar[*]{,*/}%
+ \ifboolKV[ClesFlash]{Daily}{%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
- \begin{frame}
- \QFDecimal%
- \end{frame}
+ \QFDaily%
}{%
- \ifboolKV[ClesFlash]{Mental}{%
+ \ifboolKV[ClesFlash]{Decimal}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \QFMental%
+ \QFDecimal%
}{%
- \ifboolKV[ClesFlash]{Expression}{%
+ \ifboolKV[ClesFlash]{Mental}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \QFExpression%
+ \QFMental%
}{%
- \setsepchar[*]{/}%
- \readlist*\ListeFlash{#2}%
- \ifboolKV[ClesFlash]{Simple}{%
- \ListeFlash[1]
- \begin{tcolorbox}[valign=center]
- \ListeFlash[2]
- \end{tcolorbox}
+ \ifboolKV[ClesFlash]{Expression}{%
+ \setsepchar[*]{,*/}%
+ \readlist*\ListeFlash{#2}%
+ \QFExpression%
}{%
- \setsepchar[*]{*/}%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
- \ifboolKV[ClesFlash]{Kahout}{%
- \setsepchar[*]{*/}%
- \readlist*\ListeFlash{#2}%
- \begin{tcolorbox}[halign=center,valign=center]
- \ListeFlash[1,1]
+ \ifboolKV[ClesFlash]{Simple}{%
+ \ListeFlash[1]
+ \begin{tcolorbox}[valign=center]
+ \ListeFlash[2]
\end{tcolorbox}
- % \par
- \begin{multicols}{4}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=CouleurUn,halign=center,valign=center]
- \ListeFlash[1,2]
- \end{tcolorbox}
- % \hfill%
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=CouleurDeux,halign=center,valign=center]
- \ListeFlash[1,3]
- \end{tcolorbox}
- % \hfill%
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,colback=CouleurTrois,halign=center,valign=center]
- \ListeFlash[1,4]
- \end{tcolorbox}
- % \hfill%
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=CouleurQuatre,halign=center,valign=center]
- \ListeFlash[1,5]
- \end{tcolorbox}
- \end{multicols}
}{%
\setsepchar[*]{*/}%
\readlist*\ListeFlash{#2}%
- \begin{tcolorbox}[halign=center,valign=center]
- \ListeFlash[1,1]
- \end{tcolorbox}
- \begin{multicols}{4}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,2]
- \end{tcolorbox}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,3]
- \end{tcolorbox}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,boxrule=1mm,colback=white,halign=center,valign=center]
- \ListeFlash[1,4]
+ \ifboolKV[ClesFlash]{Kahout}{%
+ \setsepchar[*]{*/}%
+ \readlist*\ListeFlash{#2}%
+ \begin{tcolorbox}[halign=center,valign=center]
+ \ListeFlash[1,1]
\end{tcolorbox}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,5]
+ % \par
+ \begin{multicols}{4}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=CouleurUn,halign=center,valign=center]
+ \ListeFlash[1,2]
+ \end{tcolorbox}
+ % \hfill%
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=CouleurDeux,halign=center,valign=center]
+ \ListeFlash[1,3]
+ \end{tcolorbox}
+ % \hfill%
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,colback=CouleurTrois,halign=center,valign=center]
+ \ListeFlash[1,4]
+ \end{tcolorbox}
+ % \hfill%
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=CouleurQuatre,halign=center,valign=center]
+ \ListeFlash[1,5]
+ \end{tcolorbox}
+ \end{multicols}
+ }{%
+ \setsepchar[*]{*/}%
+ \readlist*\ListeFlash{#2}%
+ \begin{tcolorbox}[halign=center,valign=center]
+ \ListeFlash[1,1]
\end{tcolorbox}
- \end{multicols}
+ \begin{multicols}{4}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,2]
+ \end{tcolorbox}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,3]
+ \end{tcolorbox}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,boxrule=1mm,colback=white,halign=center,valign=center]
+ \ListeFlash[1,4]
+ \end{tcolorbox}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,5]
+ \end{tcolorbox}
+ \end{multicols}
+ }%
}%
}%
}%
}%
- }
+ }%
}%
}%
}%
}%
}{%
- \ifboolKV[ClesFlash]{Numeration}{%
- \setsepchar[*]{,*/}%
+ \ifboolKV[ClesFlash]{Seul}{%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
\begin{frame}
- \QFNumeration%
+ \QFVide%
\end{frame}
}{%
- \ifboolKV[ClesFlash]{Heure}{%
+ \ifboolKV[ClesFlash]{Numeration}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \StrMid{\ListeFlash[1,1]}{1}{2}[\NbHeures]%
- \StrMid{\ListeFlash[1,1]}{3}{4}[\NbMinutes]%
- \StrMid{\ListeFlash[1,1]}{5}{6}[\NbSecondes]%
\begin{frame}
- \QFHeure%
+ \QFNumeration%
\end{frame}
}{%
- \ifboolKV[ClesFlash]{Mesure}{%
+ \ifboolKV[ClesFlash]{Heure}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
+ \StrMid{\ListeFlash[1,1]}{1}{2}[\NbHeures]%
+ \StrMid{\ListeFlash[1,1]}{3}{4}[\NbMinutes]%
+ \StrMid{\ListeFlash[1,1]}{5}{6}[\NbSecondes]%
\begin{frame}
- \QFMesure%
+ \QFHeure%
\end{frame}
}{%
- \ifboolKV[ClesFlash]{Daily}{%
- \setsepchar[*]{/}%
+ \ifboolKV[ClesFlash]{Mesure}{%
+ \setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
\begin{frame}
- \QFDaily
+ \QFMesure%
\end{frame}
}{%
- \ifboolKV[ClesFlash]{Decimal}{%
- \setsepchar[*]{,*/}%
+ \ifboolKV[ClesFlash]{Daily}{%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
\begin{frame}
- \QFDecimal%
+ \QFDaily%
\end{frame}
}{%
- \ifboolKV[ClesFlash]{Mental}{%
+ \ifboolKV[ClesFlash]{Decimal}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
\begin{frame}
- \QFMental%
+ \QFDecimal%
\end{frame}
- }{
- \ifboolKV[ClesFlash]{Expression}{%
+ }{%
+ \ifboolKV[ClesFlash]{Mental}{%
\setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
\begin{frame}
- \QFExpression%
+ \QFMental%
\end{frame}
}{%
- \setsepchar[*]{/}%
- \readlist*\ListeFlash{#2}%
- \ifboolKV[ClesFlash]{Simple}{%
+ \ifboolKV[ClesFlash]{Expression}{%
+ \setsepchar[*]{,*/}%
+ \readlist*\ListeFlash{#2}%
\begin{frame}
- \ListeFlash[1]
- \begin{tcolorbox}[valign=center]
- \ListeFlash[2]
- \end{tcolorbox}
+ \QFExpression%
\end{frame}
}{%
- \setsepchar[*]{,*/}%
+ \setsepchar[*]{/}%
\readlist*\ListeFlash{#2}%
- \ifboolKV[ClesFlash]{Kahout}{%
- \setsepchar[*]{*/}%
- \readlist*\ListeFlash{#2}%
+ \ifboolKV[ClesFlash]{Simple}{%
\begin{frame}
+ \ListeFlash[1]
\begin{tcolorbox}[valign=center]
- \ListeFlash[1,1]
+ \ListeFlash[2]
\end{tcolorbox}
- \vfill
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{columns}[T]
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=CouleurUn,halign=center,valign=center]
- \ListeFlash[1,2]
- \end{tcolorbox}
- \end{column}
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=CouleurDeux,halign=center,valign=center]
- \ListeFlash[1,3]
- \end{tcolorbox}
- \end{column}
- \end{columns}
- \bigskip
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{columns}[T]
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,colback=CouleurTrois,halign=center,valign=center]
- \ListeFlash[1,4]
- \end{tcolorbox}
- \end{column}
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=CouleurQuatre,halign=center,valign=center]
- \ListeFlash[1,5]
- \end{tcolorbox}
- \end{column}
- \end{columns}
\end{frame}
}{%
- \setsepchar[*]{*/}%
+ \setsepchar[*]{,*/}%
\readlist*\ListeFlash{#2}%
- \begin{frame}
- \begin{tcolorbox}[valign=center]
- \ListeFlash[1,1]
- \end{tcolorbox}
- \vfill
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{columns}[T]
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,2]
- \end{tcolorbox}
- \end{column}
+ \ifboolKV[ClesFlash]{Kahout}{%
+ \setsepchar[*]{*/}%
+ \readlist*\ListeFlash{#2}%
+ \begin{frame}
+ \begin{tcolorbox}[valign=center]
+ \ListeFlash[1,1]
+ \end{tcolorbox}
+ \vfill
\ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,3]
- \end{tcolorbox}
- \end{column}
- \end{columns}
- \bigskip
- \ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{columns}[T]
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,boxrule=1mm,colback=white,halign=center,valign=center]
- \ListeFlash[1,4]
- \end{tcolorbox}
- \end{column}
+ \begin{columns}[T]
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=CouleurUn,halign=center,valign=center]
+ \ListeFlash[1,2]
+ \end{tcolorbox}
+ \end{column}
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=CouleurDeux,halign=center,valign=center]
+ \ListeFlash[1,3]
+ \end{tcolorbox}
+ \end{column}
+ \end{columns}
+ \bigskip
\ifboolKV[ClesFlash]{Pause}{\pause}{}
- \begin{column}{0.45\linewidth}
- \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=white,boxrule=1mm,halign=center,valign=center]
- \ListeFlash[1,5]
- \end{tcolorbox}
- \end{column}
- \end{columns}
- \end{frame}
+ \begin{columns}[T]
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,colback=CouleurTrois,halign=center,valign=center]
+ \ListeFlash[1,4]
+ \end{tcolorbox}
+ \end{column}
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=CouleurQuatre,halign=center,valign=center]
+ \ListeFlash[1,5]
+ \end{tcolorbox}
+ \end{column}
+ \end{columns}
+ \end{frame}
+ }{%
+ \setsepchar[*]{*/}%
+ \readlist*\ListeFlash{#2}%
+ \begin{frame}
+ \begin{tcolorbox}[valign=center]
+ \ListeFlash[1,1]
+ \end{tcolorbox}
+ \vfill
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{columns}[T]
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurUn!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,2]
+ \end{tcolorbox}
+ \end{column}
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurDeux!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,3]
+ \end{tcolorbox}
+ \end{column}
+ \end{columns}
+ \bigskip
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{columns}[T]
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurTrois!150,boxrule=1mm,colback=white,halign=center,valign=center]
+ \ListeFlash[1,4]
+ \end{tcolorbox}
+ \end{column}
+ \ifboolKV[ClesFlash]{Pause}{\pause}{}
+ \begin{column}{0.45\linewidth}
+ \begin{tcolorbox}[height=\HauteurFlash,colframe=CouleurQuatre!150,colback=white,boxrule=1mm,halign=center,valign=center]
+ \ListeFlash[1,5]
+ \end{tcolorbox}
+ \end{column}
+ \end{columns}
+ \end{frame}
+ }%
}%
}%
}%
}%
- }
+ }%
}%
}%
}%
@@ -1110,12 +1203,209 @@
}%
}%
-%%%%%%%%%%%%%
-%%% Fractions
-%%%%%%%%%%%%%
-\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1}
+%%%
+% Fractions
+%%%
+\setKVdefault[ClesFraction]{Rayon=2cm,Disque,Regulier=false,Segment=false,Rectangle=false,Longueur=5cm,Largeur=2cm,Cotes=5,Triangle=false,Parts=3,Couleur=green,Reponse=false,Multiple=1,Hachures=false,Epaisseur=1}
+
+\def\MPFractionTriangle#1#2#3#4#5{
+ % #1 longueur du côté
+ % #2 partage sur le côté
+ % #3 num
+ % #4 déno (attention : = #2^2)
+ % #5 couleur
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ nbtriangle=0;
+
+ vardef Ligne(expr longueur)=
+ for k=0 upto 2*(longueur-1):
+ nbtriangle:=nbtriangle+1;
+ if (k mod 2)=0:
+ M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ else:
+ M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ fi;
+ endfor;
+ enddef;
+
+ pair A,B,C;
+ A=u*(0.5,0.5);
+ B-A=(#1,0);
+ C=rotation(B,A,60);
+
+ nbparts:=#2;
+
+ path M[];
+
+ path Tria,Trir;
+ Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+
+ for k=nbparts downto 1:
+ Ligne(k);
+ endfor;
+
+ for k=1 upto #3:
+ fill M[k] withcolor #5;
+ endfor;
+
+ for k=1 upto nbparts:
+ trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
+ trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
+ trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
+ endfor;
+ \end{mplibcode}
+ \else
+ \begin{mpost}
+ nbtriangle=0;
+
+ vardef Ligne(expr longueur)=
+ for k=0 upto 2*(longueur-1):
+ nbtriangle:=nbtriangle+1;
+ if (k mod 2)=0:
+ M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ else:
+ M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ fi;
+ endfor;
+ enddef;
+
+ pair A,B,C;
+ A=u*(0.5,0.5);
+ B-A=(#1,0);
+ C=rotation(B,A,60);
+
+ nbparts:=#2;
-\def\MPFractionRegulier#1#2#3#4#5{
+ path M[];
+
+ path Tria,Trir;
+ Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+
+ for k=nbparts downto 1:
+ Ligne(k);
+ endfor;
+
+ for k=1 upto #3:
+ fill M[k] withcolor #5;
+ endfor;
+
+ for k=1 upto nbparts:
+ trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
+ trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
+ trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
+ endfor;
+ \end{mpost}
+ \fi
+ }
+
+ \def\MPFractionTriangleH#1#2#3#4#5#6{
+ % #1 longueur du côté
+ % #2 partage sur le côté
+ % #3 num
+ % #4 déno (attention : = #2^2)
+ % #5 couleur
+ % #6 épaisseur
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ nbtriangle=0;
+
+ vardef Ligne(expr longueur)=
+ for k=0 upto 2*(longueur-1):
+ nbtriangle:=nbtriangle+1;
+ if (k mod 2)=0:
+ M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ else:
+ M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ fi;
+ endfor;
+ enddef;
+
+ pair A,B,C;
+ A=u*(0.5,0.5);
+ B-A=(#1,0);
+ C=rotation(B,A,60);
+
+ nbparts:=#2;
+
+ path M[];
+
+ path Tria,Trir;
+ Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+
+ for k=nbparts downto 1:
+ Ligne(k);
+ endfor;
+
+ diversite=floor(uniformdeviate(#2**2-#3-1));
+
+ for k=(1+diversite) upto (#3+diversite):
+ drawoptions(withpen pencircle scaled #6);
+ trace hachurage(M[k],90,0.2,0) withcolor #5;
+ endfor;
+ drawoptions(withpen pencircle scaled #6);
+ for k=1 upto nbparts:
+ trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
+ trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
+ trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
+ endfor;
+ \end{mplibcode}
+ \else
+ \begin{mpost}
+ nbtriangle=0;
+
+ vardef Ligne(expr longueur)=
+ for k=0 upto 2*(longueur-1):
+ nbtriangle:=nbtriangle+1;
+ if (k mod 2)=0:
+ M[nbtriangle]=(Tria shifted(0.5*k*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ else:
+ M[nbtriangle]=(Trir shifted(0.5*(k-1)*(1/nbparts)*(B-A))) shifted((nbparts-longueur)*(1/nbparts)*(C-A));
+ fi;
+ endfor;
+ enddef;
+
+ pair A,B,C;
+ A=u*(0.5,0.5);
+ B-A=(#1,0);
+ C=rotation(B,A,60);
+
+ nbparts:=#2;
+
+ path M[];
+
+ path Tria,Trir;
+ Tria=polygone(A,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+ Trir=symetrie(Tria,(1/nbparts)[A,B],(1/nbparts)[A,C]);
+
+ for k=nbparts downto 1:
+ Ligne(k);
+ endfor;
+
+ diversite=floor(uniformdeviate(#2**2-#3-1));
+
+ for k=(1+diversite) upto (#3+diversite):
+ drawoptions(withpen pencircle scaled #6);
+ trace hachurage(M[k],90,0.2,0) withcolor #5;
+ endfor;
+ drawoptions(withpen pencircle scaled #6);
+
+ for k=1 upto nbparts:
+ trace segment((k/nbparts)[A,B],(k/nbparts)[A,C]);
+ trace segment((k/nbparts)[B,A],(k/nbparts)[B,C]);
+ trace segment((k/nbparts)[C,A],(k/nbparts)[C,B]);
+ endfor;
+ \end{mpost}
+ \fi
+ }
+
+
+\def\MPFractionRegulier#1#2#3#4#5{%
% #1 rayon, #2 nb côtés, #3 num, #4 deno, #5 couleur
\ifluatex
\mplibforcehmode
@@ -1506,47 +1796,99 @@
\fi
}
+\def\MPFractionSegmentH#1#2#3#4#5{
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ pair A,C,B[];
+ A=(0,0);
+ C-A=(#1,0);
+ for k=0 upto #3:
+ B[k]=(k/#3)[A,C];
+ endfor;
+ drawoptions(withpen pencircle scaled#5);
+ draw hachurage(polygone(B[0]+u*(0,-0.15),B[#2]+u*(0,-0.15),B[#2]+u*(0,0.15),B[0]+u*(0,0.15)),120,0.2,0)
+ withcolor #4;
+ drawoptions(withpen pencircle scaled#5);
+ draw segment(A,C);
+ marque_p:="tiretv";
+ for k=0 upto #3:
+ pointe(B[k]);
+ endfor;
+ \end{mplibcode}
+ \else
+ \begin{mpost}
+ pair A,C,B[];
+ A=(0,0);
+ C-A=(#1,0);
+ for k=0 upto #3:
+ B[k]=(k/#3)[A,C];
+ endfor;
+ drawoptions(withpen pencircle scaled#5);
+ draw hachurage(polygone(B[0]+u*(0,-0.15),B[#2]+u*(0,-0.15),B[#2]+u*(0,0.15),B[0]+u*(0,0.15)),120,0.2,0)
+ withcolor #4;
+ drawoptions(withpen pencircle scaled#5);
+ draw segment(A,C);
+ marque_p:="tiretv";
+ for k=0 upto #3:
+ pointe(B[k]);
+ endfor;
+ \end{mpost}
+ \fi
+}
+
\newcommand\Fraction[2][]{%
\useKVdefault[ClesFraction]%
\setKV[ClesFraction]{#1}%
\setsepchar[*]{/}%
\readlist*\ListeFraction{#2}%
- %\ListeFractionlen -- Le numérateur est \ListeFraction[1] et le
- %dénominateur est \ListeFraction[2].
- \ifboolKV[ClesFraction]{Regulier}{%
+ \ifboolKV[ClesFraction]{Triangle}{%
\ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
- \ifboolKV[ClesFraction]{Hachures}{%
- \MPFractionRegulierH{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
+ \ifboolKV[ClesFraction]{Hachures}{%
+ \MPFractionTriangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
}{%
- \MPFractionRegulier{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
+ \MPFractionTriangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Parts}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
}
}{%
- \ifboolKV[ClesFraction]{Segment}{%
+ \ifboolKV[ClesFraction]{Regulier}{%
\ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
- \MPFractionSegment{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
- }{
- \ifboolKV[ClesFraction]{Rectangle}{%rectangle
+ \ifboolKV[ClesFraction]{Hachures}{%
+ \MPFractionRegulierH{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
+ }{%
+ \MPFractionRegulier{\useKV[ClesFraction]{Rayon}}{\useKV[ClesFraction]{Cotes}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
+ }
+ }{%
+ \ifboolKV[ClesFraction]{Segment}{%
\ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
\ifboolKV[ClesFraction]{Hachures}{%
- \MPFractionRectangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}{\useKV[ClesFraction]{Epaisseur}}%
+ \MPFractionSegmentH{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
}{%
- \MPFractionRectangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}%
+ \MPFractionSegment{\useKV[ClesFraction]{Longueur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
}
- }{%disque
- \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
- \ifboolKV[ClesFraction]{Hachures}{%
- \MPFractionDisqueH{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
- }{%
- \MPFractionDisque{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
+ }{
+ \ifboolKV[ClesFraction]{Rectangle}{%rectangle
+ \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
+ \ifboolKV[ClesFraction]{Hachures}{%
+ \MPFractionRectangleH{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}{\useKV[ClesFraction]{Epaisseur}}%
+ }{%
+ \MPFractionRectangle{\useKV[ClesFraction]{Longueur}}{\useKV[ClesFraction]{Largeur}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Multiple}}%
+ }
+ }{%disque
+ \ifboolKV[ClesFraction]{Reponse}{}{\setKV[ClesFraction]{Couleur=white}}%
+ \ifboolKV[ClesFraction]{Hachures}{%
+ \MPFractionDisqueH{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}{\useKV[ClesFraction]{Epaisseur}}%
+ }{%
+ \MPFractionDisque{\useKV[ClesFraction]{Rayon}}{\ListeFraction[1]}{\ListeFraction[2]}{\useKV[ClesFraction]{Couleur}}%
+ }%
}%
}%
}%
}%
}%
-%%%%%%%%%%%%%%%%
-%%% Réponses à relier
-%%%%%%%%%%%%%%%%
+%%%
+% Réponses à relier
+%%%
\setKVdefault[ClesRelie]{Solution=false,LargeurG=5cm,LargeurD=2cm,Stretch=1.5,Ecart=2cm}
\newcommand\Relie[2][]{%
@@ -1603,63 +1945,86 @@
\setcounter{NbRelie}{0}%
}%
-%%%%%%%%%%%%%%%%%%
-%% QCM
-%%%%%%%%%%%%%%%%%%
-\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=2cm,Couleur=gray!15,Titre=false,Nom=Réponse,Alph=false,VF=false,Depart=1,Alterne=false}
+%%%
+% QCM
+%%%
+\setKVdefault[ClesQCM]{Reponses=3,Solution=false,Stretch=1,Largeur=2cm,Couleur=gray!15,Titre=false,Nom=Réponse,NomV=Vrai,NomF=Faux,Alph=false,AlphT=false,VF=false,Depart=1,Alterne=false,Noms={A/B/C},Multiple=false}
\newlength{\LargeurQCM}
\newcounter{QuestionQCM}
+\newcounter{TitreQCM}
\newcommand\QCM[2][]{%
\useKVdefault[ClesQCM]%
\setKV[ClesQCM]{#1}%
\setcounter{QuestionQCM}{\fpeval{\useKV[ClesQCM]{Depart}-1}}%
+ \setcounter{TitreQCM}{0}
\setsepchar[*]{,*&}\ignoreemptyitems%
\readlist*\ListeQCM{#2}%
- \ifboolKV[ClesQCM]{VF}{%
- \setKV[ClesQCM]{Reponses=2}
+ \ifboolKV[ClesQCM]{Multiple}{%
\renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
\setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
\xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \xdef\ListeNom{\useKV[ClesQCM]{Noms}}%
+ \setsepchar[*]{/}%
+ \readlist*\ListeNomsMul{\ListeNom}%
\begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
\cline{2-\NBcases}%
- \multicolumn{1}{c|}{}&Vrai&Faux\\
- \hline%
- \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2=\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
- }\\
- }%
- \hline%
- \end{tabular}
- }{%
- \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
- \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
- \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
- \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
- \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
\multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\useKV[ClesQCM]{Nom} ##2}%
+ &\ListeNomsMul[##2]}%
\\
- }{}
\hline%
\xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
- \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
- &\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2=\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{\ListeQCM[##1,\fpeval{##2+1}]=1}{$\boxtimes$}{$\square$}}{$\square$}%
}\\
}%
\hline%
\end{tabular}%
+ }{%
+ \ifboolKV[ClesQCM]{VF}{%
+ \setKV[ClesQCM]{Reponses=2}
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}&\useKV[ClesQCM]{NomV}&\useKV[ClesQCM]{NomF}\\
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xintifboolexpr{##2=\ListeQCM[##1,2]}{$\boxtimes$}{$\square$}}{$\square$}%
+ }\\
+ }%
+ \hline%
+ \end{tabular}
+ }{%
+ \renewcommand{\arraystretch}{\useKV[ClesQCM]{Stretch}}%
+ \setlength{\LargeurQCM}{\fpeval{(\linewidth-\useKV[ClesQCM]{Reponses}*(3*\tabcolsep+\useKV[ClesQCM]{Largeur}))}pt}%
+ \xdef\NBcases{\fpeval{\useKV[ClesQCM]{Reponses}+1}}%
+ \begin{tabular}{|p{\LargeurQCM}|*{\useKV[ClesQCM]{Reponses}}{>{\centering\arraybackslash}p{\useKV[ClesQCM]{Largeur}}|}}%
+ \ifboolKV[ClesQCM]{Titre}{\cline{2-\NBcases}%
+ \multicolumn{1}{c|}{}\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\stepcounter{TitreQCM}\useKV[ClesQCM]{Nom} \ifboolKV[ClesQCM]{AlphT}{\Alph{TitreQCM}}{##2}}%
+ \\
+ }{}
+ \hline%
+ \xintFor* ##1 in {\xintSeq {1}{\ListeQCMlen}}\do{%
+ \stepcounter{QuestionQCM}\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Alph}{\textbf{\Alph{QuestionQCM}}/}{\textbf{\theQuestionQCM/}}~\ListeQCM[##1,1]\xintFor* ##2 in {\xintSeq {1}{\useKV[ClesQCM]{Reponses}}}\do{%
+ &\ifboolKV[ClesQCM]{Alterne}{\modulo{\theQuestionQCM}{2}\ifnum\remainder=0\cellcolor{gray!15}\fi}{}\ifboolKV[ClesQCM]{Solution}{\xdef\NumeroReponse{\fpeval{\useKV[ClesQCM]{Reponses}+2}}\xintifboolexpr{##2=\ListeQCM[##1,\NumeroReponse]}{\cellcolor{\useKV[ClesQCM]{Couleur}}}{}}{}\ListeQCM[##1,##2+1]%
+ }\\
+ }%
+ \hline%
+ \end{tabular}%
+ }%
}%
}
-%%%%%%%%%%%%%%%%%%%%%
-%%%% Somme des angles
-%%%%%%%%%%%%%%%%%%%%%
+%%%
+% Somme des angles
+%%%
-\setKVdefault[ClesSommeAngle]{Detail=true,Figure=false,Isocele=false}%
+\setKVdefault[ClesSommeAngle]{Detail=true,Isocele=false,Figure=false,FigureSeule=false,Angle=0}%
-% On définit la figure à utiliser
-\def\MPFigureSommeAngle#1#2#3#4#5#6{
+\def\MPFigureSommeAngle#1#2#3#4#5#6#7{
% #1 Premier sommet
% #2 Deuxième sommet
% #3 Troisième sommet
@@ -1679,11 +2044,9 @@
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#7);
+ B:=B rotatedabout(O,#7);
+ C:=C rotatedabout(O,#7);
% On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
@@ -1715,16 +2078,13 @@
draw Codelongueur(A,B,A,C,2);
marque_s:=marque_s*2;
label(btex $\ang{#4}$ etex,B+0.95u*unitvector(I-B));
- % label(btex $\ang{#5}$ etex,C+0.95u*unitvector(I-C));
label(btex ? etex,A+0.95u*unitvector(I-A));
else:
-% if (#4=180-#5-#4) or (#5=180-#5-#4):
marque_s:=marque_s/2;
draw Codelongueur(A,B,A,C,2);
marque_s:=marque_s*2;
label(btex $\ang{#4}$ etex,A+0.95u*unitvector(I-A));
label(btex ? etex,B+0.95u*unitvector(I-B));
- % label(btex $\ang{#5}$ etex,C+0.95u*unitvector(I-C));
fi;
else:
label(btex $\ang{#4}$ etex,B+0.95u*unitvector(I-B));
@@ -1747,11 +2107,9 @@
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#7);
+ B:=B rotatedabout(O,#7);
+ C:=C rotatedabout(O,#7);
% On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
@@ -1783,16 +2141,13 @@
draw Codelongueur(A,B,A,C,2);
marque_s:=marque_s*2;
label(btex $\ang{#4}$ etex,B+0.95u*unitvector(I-B));
- % label(btex $\ang{#5}$ etex,C+0.95u*unitvector(I-C));
label(btex ? etex,A+0.95u*unitvector(I-A));
else:
- %if (#4=180-#5-#4) or (#5=180-#5-#4):
marque_s:=marque_s/2;
draw Codelongueur(A,B,A,C,2);
marque_s:=marque_s*2;
label(btex $\ang{#4}$ etex,A+0.95u*unitvector(I-A));
label(btex ? etex,B+0.95u*unitvector(I-B));
- % label(btex $\ang{#5}$ etex,C+0.95u*unitvector(I-C));
fi;
else:
label(btex $\ang{#4}$ etex,B+0.95u*unitvector(I-B));
@@ -1863,33 +2218,45 @@
\StrMid{#2}{2}{2}[\NomB]%
\StrMid{#2}{3}{3}[\NomC]%
% Figure ou pas ?
- \ifboolKV[ClesSommeAngle]{Figure}{%
- \begin{multicols}{2}%
- {\em La figure est donnée à titre indicatif.}%
- \ifx#3\bla\bla%
- \xdef\Intermed{\fpeval{0.5*(180-#4)}}%
- \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#4}{\Intermed}{0}\]%
- \else%
- \ifx#4\bla\bla%
- \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#3}{0}\]%
- \else%
- \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{1}\]%
- \fi%
- \fi%
- \par\columnbreak\par%
- % on rédige
+ \ifboolKV[ClesSommeAngle]{FigureSeule}{%
+ \ifx#3\bla\bla%
+ \xdef\Intermed{\fpeval{0.5*(180-#4)}}%
+ \MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#4}{\Intermed}{0}{\useKV[ClesSommeAngle]{Angle}}%
+ \else%
+ \ifx#4\bla\bla%
+ \MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#3}{0}{\useKV[ClesSommeAngle]{Angle}}%
+ \else%
+ \MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{1}{\useKV[ClesSommeAngle]{Angle}}%
+ \fi%
+ \fi%
+ }{%
+ \ifboolKV[ClesSommeAngle]{Figure}{%
+ \begin{multicols}{2}%
+ {\em La figure est donnée à titre indicatif.}%
+ \ifx#3\bla\bla%
+ \xdef\Intermed{\fpeval{0.5*(180-#4)}}%
+ \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#4}{\Intermed}{0}{\useKV[ClesSommeAngle]{Angle}}\]%
+ \else%
+ \ifx#4\bla\bla%
+ \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#3}{0}{\useKV[ClesSommeAngle]{Angle}}\]%
+ \else%
+ \[\MPFigureSommeAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{1}{\useKV[ClesSommeAngle]{Angle}}\]%
+ \fi%
+ \fi%
+ \par\columnbreak\par%
+ % on rédige
+ \RedactionSomme[#1]{#2}{#3}{#4}%
+ \end{multicols}%
+ }{% on rédige
\RedactionSomme[#1]{#2}{#3}{#4}%
- \end{multicols}%
- }{% on rédige
- \RedactionSomme[#1]{#2}{#3}{#4}%
+ }%
}%
}%
-%%%%%%%%%%%%%%%%
-%% Le théorème de Pythagore
-%%%%%%%%%%%%%%%%
-% On définit le trousseau de clés optionnelles
-\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,Angle=0,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0}
+%%%
+% Le théorème de Pythagore
+%%%
+\setKVdefault[ClesPythagore]{Exact=false,AvantRacine=false,Racine=false,Entier=false,Egalite=false,Precision=2,Soustraction=false,Figure=false,FigureSeule=false,Angle=0,Reciproque=false,ReciColonnes=false,Faible=false,Unite=cm,EnchaineA=false,EnchaineB=false,EnchaineC=false,ValeurA=0,ValeurB=0,ValeurC=0}
% On définit les figures à utiliser
\def\MPFigurePytha#1#2#3#4#5#6{%
@@ -1926,19 +2293,20 @@
decalage=3mm;
if #4<#5 :
if ypart(B)>ypart(O) :
- label(btex \num{#4} etex rotated angle(C-B),1/2[C,B]-decalage*(unitvector(A-B)));
- label(btex \num{#5} etex rotated(angle(B-A)),1/2[A,B]-decalage*(unitvector(C-B)));
- else:
- label(btex \num{#4} etex rotated angle(B-C),1/2[C,B]-decalage*(unitvector(A-B)));
- label(btex \num{#5} etex rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
- fi
+ label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
+ else:
+ label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
+ fi
else:
if ypart(B)>ypart(O) :
- label(btex \num{#4} etex rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
- label(btex \num{#5} etex rotated(angle(C-B)),1/2[C,B]-decalage*(unitvector(C-B)));
- else:
- label(btex \num{#4} etex rotated angle(A-C),1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
- label(btex \num{#5} etex rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
+ label(btex \num{#5} etex,1/2[C,B]+decalage*(unitvector(B-A)));
+ else:
+ label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C)
+ rotated 90));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
fi;
label(btex #3 etex,1.2[O,A]);
@@ -1971,20 +2339,20 @@
decalage=3mm;
if #4<#5 :
if ypart(B)>ypart(O) :
- label(LATEX("\num{"&decimal(#4)&"}") rotated
- angle(C-B),1/2[C,B]-decalage*(unitvector(A-B)));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(B-A)),1/2[A,B]-decalage*(unitvector(C-B)));
- else:
- label(LATEX("\num{"&decimal(#4)&"}") rotated angle(B-C),1/2[C,B]-decalage*(unitvector(A-B)));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
- fi
+ label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
+ else:
+ label(btex \num{#4} etex,1/2[C,B]-decalage*(unitvector(A-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
+ fi
else:
if ypart(B)>ypart(O) :
- label(LATEX("\num{"&decimal(#4)&"}") rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(C-B)),1/2[C,B]-decalage*(unitvector(C-B)));
- else:
- label(LATEX("\num{"&decimal(#4)&"}") rotated angle(A-C),1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
- label(LATEX("\num{"&decimal(#5)&"}") rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
+ label(btex \num{#5} etex,1/2[C,B]+decalage*(unitvector(B-A)));
+ else:
+ label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C)
+ rotated 90));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
fi;
label(btex #3 etex,1.2[O,A]);
@@ -2018,23 +2386,18 @@
A:=A rotatedabout(O,#7);
B:=B rotatedabout(O,#7);
C:=C rotatedabout(O,#7);
- % On définit l'angle droit
- % D-B=7*unitvector(C-B);
- % F-B=7*unitvector(A-B);
- % E-D=F-B;
draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)};
- % draw D--E--F;
decalage=3mm;
if ypart(B)>ypart(O) :
- label(btex \num{#4} etex rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
- label(btex \num{#5} etex rotated(angle(C-B)),1/2[C,B]-decalage*(unitvector(C-B)));
- label(btex \num{#6} etex rotated(angle(B-A)),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#4} etex,1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
+ label(btex \num{#5} etex,1/2[C,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#6} etex,1/2[A,B]-decalage*(unitvector(C-B)));
else:
- label(btex \num{#4} etex rotated angle(A-C),1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
- label(btex \num{#5} etex rotated(angle(A-B)),1/2[A,B]-decalage*(unitvector(C-B)));
- label(btex \num{#6} etex rotated angle(C-B),1/2[C,B]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[A,C]+decalage*(unitvector(A-C) rotated 90));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#6} etex,1/2[C,B]-decalage*(unitvector(A-B)));
fi;
label(btex #1 etex,1.2[O,A]);
label(btex #2 etex,1.2[O,B]);
@@ -2055,14 +2418,9 @@
A:=A rotatedabout(O,#7);
B:=B rotatedabout(O,#7);
C:=C rotatedabout(O,#7);
- % On définit l'angle droit
- % D-B=7*unitvector(C-B);
- % F-B=7*unitvector(A-B);
- % E-D=F-B;
draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)};
- % draw D--E--F;
decalage=3mm;
if ypart(B)>ypart(O) :
label(LATEX("\num{"&decimal(#4)&"}") rotated angle(C-A),1/2[C,A]-decalage*(unitvector(C-A) rotated 90));
@@ -2098,20 +2456,54 @@
\opcopy{#4}{A2}%
\opcopy{#5}{A3}%
% On trace une figure ou pas ?
- \ifboolKV[ClesPythagore]{Figure}{%Utilisation obligatoire de l'option --shell-escape de la compilation
- \begin{multicols}{2}
- {\em La figure est donnée à titre indicatif.}%
- \[\MPFigureReciPytha{\NomA}{\NomB}{\NomC}{#3}{#4}{#5}{\useKV[ClesPythagore]{Angle}}\]%
- \par\columnbreak\par%
- % on rédige
+ \ifboolKV[ClesPythagore]{FigureSeule}{%
+ \MPFigureReciPytha{\NomA}{\NomB}{\NomC}{#3}{#4}{#5}{\useKV[ClesPythagore]{Angle}}%
+ }{%
+ \ifboolKV[ClesPythagore]{Figure}{%Utilisation obligatoire de l'option --shell-escape de la compilation
+ \begin{multicols}{2}
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigureReciPytha{\NomA}{\NomB}{\NomC}{#3}{#4}{#5}{\useKV[ClesPythagore]{Angle}}\]%
+ \par\columnbreak\par%
+ % on rédige
+ Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand côté.%
+ \ifboolKV[ClesPythagore]{ReciColonnes}{%
+ \[
+ \begin{array}{cccc|cccc}
+ &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\
+ &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\
+ &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\
+ &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\
+ \end{array}
+ \]
+ }{%
+ \[\left.
+ \begin{array}{l}
+ \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\
+ \\
+ \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\
+ \end{array}
+ \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi
+ \]
+ }
+ \ifboolKV[ClesPythagore]{Egalite}{%
+ \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore est vérifiée. Donc le triangle $#2$ est rectangle en $\NomB$.\fi%
+ \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore n'est pas vérifiée. Donc le triangle $#2$ n'est pas rectangle.\fi%
+ }{%
+ \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle
+ en $\NomB$ d'après la réciproque du théorème de Pythagore.\fi%
+ \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le
+ triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'après la contraposée du théorème de Pythagore.}\fi%
+ }
+ \end{multicols}
+ }{%
Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand côté.%
\ifboolKV[ClesPythagore]{ReciColonnes}{%
\[
\begin{array}{cccc|cccc}
- \NomA\NomC^2&&&&&\NomA\NomB^2&+&\NomB\NomC^2\\
- \opexport{A1}{\Aun}\num{\Aun}^2&&&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\
- \opmul*{A1}{A1}{a1}&&&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\
- \opexport{a1}{\Aun}\num{\Aun}&&&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\
+ &&\NomA\NomC^2&&&\NomA\NomB^2&+&\NomB\NomC^2\\
+ &&\opexport{A1}{\Aun}\num{\Aun}^2&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\
+ &&\opmul*{A1}{A1}{a1}&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\
+ &&\opexport{a1}{\Aun}\num{\Aun}&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\
\end{array}
\]
}{%
@@ -2123,7 +2515,7 @@
\end{array}
\right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi
\]
- }
+ }%
\ifboolKV[ClesPythagore]{Egalite}{%
\opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore est vérifiée. Donc le triangle $#2$ est rectangle en $\NomB$.\fi%
\opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore n'est pas vérifiée. Donc le triangle $#2$ n'est pas rectangle.\fi%
@@ -2132,39 +2524,9 @@
en $\NomB$ d'après la réciproque du théorème de Pythagore.\fi%
\opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le
triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'après la contraposée du théorème de Pythagore.}\fi%
- }
- \end{multicols}
- }{%
- Dans le triangle $#2$, $[\NomA\NomC]$ est le plus grand côté.%
- \ifboolKV[ClesPythagore]{ReciColonnes}{%
- \[
- \begin{array}{cccc|cccc}
- \NomA\NomC^2&&&&&\NomA\NomB^2&+&\NomB\NomC^2\\
- \opexport{A1}{\Aun}\num{\Aun}^2&&&&&\opexport{A2}{\Adeux}\num{\Adeux}^2&+&\opexport{A3}{\Atrois}\num{\Atrois}^2\\
- \opmul*{A1}{A1}{a1}&&&&&\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}&+&\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}\\
- \opexport{a1}{\Aun}\num{\Aun}&&&&&\multicolumn{3}{c}{\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}}\\
- \end{array}
- \]
- }{%
- \[\left.
- \begin{array}{l}
- \NomA\NomC^2=\opexport{A1}{\Aun}\num{\Aun}^2=\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}\\
- \\
- \NomA\NomB^2+\NomB\NomC^2=\opexport{A2}{\Adeux}\num{\Adeux}^2+\opexport{A3}{\Atrois}\num{\Atrois}^2=\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}+\opmul*{A3}{A3}{a3}\opexport{a3}{\Atrois}\num{\Atrois}=\opadd*{a2}{a3}{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}\\
- \end{array}
- \right\}\opcmp{a1}{a4}\ifopeq\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2\fi\opcmp{a1}{a4}\ifopneq\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2\fi
- \]
- }
- \ifboolKV[ClesPythagore]{Egalite}{%
- \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore est vérifiée. Donc le triangle $#2$ est rectangle en $\NomB$.\fi%
- \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors l'égalité de Pythagore n'est pas vérifiée. Donc le triangle $#2$ n'est pas rectangle.\fi%
- }{%
- \opcmp{a1}{a4}\ifopeq Comme $\NomA\NomC^2=\NomA\NomB^2+\NomB\NomC^2$, alors le triangle $#2$ est rectangle
- en $\NomB$ d'après la réciproque du théorème de Pythagore.\fi%
- \opcmp{a1}{a4}\ifopneq Comme $\NomA\NomC^2\not=\NomA\NomB^2+\NomB\NomC^2$, alors le
- triangle $#2$ n'est pas rectangle\ifboolKV[ClesPythagore]{Faible}{.}{ d'après la contraposée du théorème de Pythagore.}\fi%
- }
- }
+ }%
+ }%
+ }%
}{%
% [xlop] paramètres de calcul
\opcopy{#3}{A1}%
@@ -2175,74 +2537,73 @@
\StrMid{#2}{2}{2}[\NomB]%
\StrMid{#2}{3}{3}[\NomC]%
% On trace une figure ou pas ?
- \ifboolKV[ClesPythagore]{Figure}{%Utilisation obligatoire de l'option --shell-escape de la compilation
- \begin{multicols}{2}%
- {\em La figure est donnée à titre indicatif.}%
- \[\MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}\]
- \par\columnbreak\par%
+ \ifboolKV[ClesPythagore]{FigureSeule}{%
+ \MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}
+ }{%
+ \ifboolKV[ClesPythagore]{Figure}{%Utilisation obligatoire de l'option --shell-escape de la compilation
+ \begin{multicols}{2}%
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigurePytha{\NomA}{\NomB}{\NomC}{#3}{#4}{\useKV[ClesPythagore]{Angle}}\]
+ \par\columnbreak\par%
+ % On démarre la résolution
+ \ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
+ }%
+ \xintifboolexpr{#3<#4 || #3=#4}{%\ifnum#3<#4%
+ \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
+ \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
+ \begin{align*}
+ \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\
+ \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opcopy{\useKV[ClesPythagore]{ValeurA}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
+ \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
+ \NomA\NomC^2&=\opadd*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
+ \ifboolKV[ClesPythagore]{AvantRacine}{}{%
+ \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}
+ \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
+ }%
+ \end{align*}
+ }{%\else%
+ \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}%
+ \begin{align*}
+ \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\
+ \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
+ \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
+ \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
+ \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
+ \ifboolKV[ClesPythagore]{AvantRacine}{}{%
+ \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}
+ \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
+ }%
+ \end{align*}
+ }%\fi%
+ \end{multicols}
+ }{%
% On démarre la résolution
\ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
}%
\xintifboolexpr{#3<#4 || #3=#4}{%\ifnum#3<#4%
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
- \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
\begin{align*}
\NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\
\NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opcopy{\useKV[ClesPythagore]{ValeurA}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
\NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
\NomA\NomC^2&=\opadd*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
- \ifboolKV[ClesPythagore]{AvantRacine}{}{%
- \\
- \ifboolKV[ClesPythagore]{Entier}{}{\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}\\}
- \ifboolKV[ClesPythagore]{Racine}{}{\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
+ \ifboolKV[ClesPythagore]{AvantRacine}{}{%
+ \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}
+ \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
}
\end{align*}
- }{%\else%
+ }{%\else
\xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}%
- \begin{align*}
- \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\
- \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
- \ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}&=\NomA\NomB^2+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
- \NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
- \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
- \ifboolKV[ClesPythagore]{AvantRacine}{}{%
- \\
- \ifboolKV[ClesPythagore]{Entier}{}{\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}\\}
- \ifboolKV[ClesPythagore]{Racine}{}{\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
- }
- \end{align*}
- }%\fi%
- \end{multicols}
- }{%
- % On démarre la résolution
- \ifboolKV[ClesPythagore]{Egalite}{Comme le triangle $#2$ est rectangle en $\NomB$, alors l'égalité de Pythagore est vérifiée :}{Dans le triangle $#2$ rectangle en $\NomB$, le th\'eor\`eme de Pythagore permet d'\'ecrire :%
- }%
- \xintifboolexpr{#3<#4 || #3=#4}{%\ifnum#3<#4%
- \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2+#4^2),\useKV[ClesPythagore]{Precision})}}%
- \begin{align*}
- \NomA\NomC^2&=\NomA\NomB^2+\NomB\NomC^2\\
- \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opcopy{\useKV[ClesPythagore]{ValeurA}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}+\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
- \NomA\NomC^2&=\ifboolKV[ClesPythagore]{EnchaineA}{\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}+\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
- \NomA\NomC^2&=\opadd*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
- \ifboolKV[ClesPythagore]{AvantRacine}{}{%
- \\
- \ifboolKV[ClesPythagore]{Entier}{}{\NomA\NomC&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}\\}
- \ifboolKV[ClesPythagore]{Racine}{}{\ifboolKV[ClesPythagore]{Exact}{\NomA\NomC&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomC&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
- }
- \end{align*}
- }{%\else
- \xdef\ResultatPytha{\fpeval{round(sqrt(#3^2-#4^2),\useKV[ClesPythagore]{Precision})}}%
- \ifboolKV[ClesPythagore]{Soustraction}{%
- \begin{align*}
+ \ifboolKV[ClesPythagore]{Soustraction}{%
+ \begin{align*}
\NomA\NomB^2&=\NomA\NomC^2-\NomB\NomC^2\\
\NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opexport{A1}{\Aun}\num{\Aun}^2}-\ifboolKV[ClesPythagore]{EnchaineB}{\opcopy{\useKV[ClesPythagore]{ValeurB}}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}{\opexport{A2}{\Adeux}\num{\Adeux}^2}\\
\NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
- \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
- \ifboolKV[ClesPythagore]{AvantRacine}{}{%
- \\
- \ifboolKV[ClesPythagore]{Entier}{}{\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}\\}
- \ifboolKV[ClesPythagore]{Racine}{}{\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
- }
+ \NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
+ \ifboolKV[ClesPythagore]{AvantRacine}{}{%
+ \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}
+ \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
+ }
\end{align*}
}{%
\begin{align*}
@@ -2252,20 +2613,20 @@
\NomA\NomB^2&=\ifboolKV[ClesPythagore]{EnchaineC}{\opcopy{\useKV[ClesPythagore]{ValeurC}}{a1}\opexport{a1}{\Aun}\num{\Aun}}{\opmul*{A1}{A1}{a1}\opexport{a1}{\Aun}\num{\Aun}}-\ifboolKV[ClesPythagore]{EnchaineB}{\opexport{a2}{\Adeux}\num{\Adeux}}{\opmul*{A2}{A2}{a2}\opexport{a2}{\Adeux}\num{\Adeux}}\\
\NomA\NomB^2&=\opsub*{a1}{a2}{a3}\opexport{a3}{\Atrois}\num{\Atrois}%\\
\ifboolKV[ClesPythagore]{AvantRacine}{}{%
- \\
- \ifboolKV[ClesPythagore]{Entier}{}{\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}\\}
- \ifboolKV[ClesPythagore]{Racine}{}{\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
+ \ifboolKV[ClesPythagore]{Entier}{}{\\\NomA\NomB&=\sqrt{\opexport{a3}{\Atrois}\num{\Atrois}}}%
+ \ifboolKV[ClesPythagore]{Racine}{}{\\\ifboolKV[ClesPythagore]{Exact}{\NomA\NomB&=\opsqrt[maxdivstep=3]{a3}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}{\NomA\NomB&\approx\opsqrt[maxdivstep=5]{a3}{a4}\opround{a4}{pres}{a4}\opunzero{a4}\opexport{a4}{\Aquatre}\num{\Aquatre}~\text{\useKV[ClesPythagore]{Unite}}}}%\\
}
\end{align*}
}%
- }%\fi%
+ }%\fi%
+ }%
}%
}%
}%
-%%%%%%%%%%%%%%%%%
-%% Distributivité
-%%%%%%%%%%%%%%%%%
+%%%
+% Distributivité
+%%%
% https://tex.stackexchange.com/questions/168972/draw-arrows-to-show-multiplication-pattern-distributive-property/169278?noredirect=1
\newcommand{\Tikzmark}[1]{%
\tikz[remember picture,baseline,inner sep=0pt]{%
@@ -2303,8 +2664,7 @@
% y a dans un "seul calcul".
\setcounter{NbCalculDistri}{0}
-\setKVdefault[ClesDistributivite]{Etape=1,Lettre=x,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurReduction=black,CouleurFH=blue,CouleurFB=red,Somme=false,Difference=false,RAZ=false,Oppose=false,All=false,NomExpression=A,Fin=4,Numerique=false,Remarquable=false,Echange=0}%,AideAdd=false
- %inutile ?
+\setKVdefault[ClesDistributivite]{Etape=1,Lettre=x,Fleches=false,AideMul=false,Reduction=false,AideAdda=false,AideAddb=false,CouleurAide=red,CouleurReduction=black,CouleurFH=blue,CouleurFB=red,Somme=false,Difference=false,RAZ=false,Oppose=false,All=false,NomExpression=A,Fin=4,Numerique=false,Remarquable=false,Echange=0}%,AideAdd=false:inutile ?
\newcommand\Affichage[4][]{%
\setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
@@ -2332,9 +2692,7 @@
\useKVdefault[ClesDistributivite]%obligatoire car la macro n'est pas dans un groupe.
\setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
\ifboolKV[ClesDistributivite]{RAZ}{\xdef\SommeA{0}\xdef\SommeB{0}\xdef\SommeC{0}%
- % 80
\setcounter{NbCalculDistri}{0}%
- % fin 80
}{}%
\colorlet{DCAide}{\useKV[ClesDistributivite]{CouleurAide}}%
\colorlet{DCReduction}{\useKV[ClesDistributivite]{CouleurReduction}}%
@@ -2343,193 +2701,183 @@
\xintifboolexpr{\useKV[ClesDistributivite]{Echange}>0}{%
\DistriEchange[#1]{#2}{#3}{#4}{#5}%
}{%
- \ifboolKV[ClesDistributivite]{Remarquable}{%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{%
- \ifx\bla#4\bla(\Affichage{0}{#2}{#3})^2\else(\Affichage{0}{#2}{#3})(\Affichage{0}{#4}{#5})\fi%
- }{}
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{\ifx\bla#4\bla\xintifboolexpr{#3>0}{\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2+2\times\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{#3}+\num{#3}^2}{\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2-2\times\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{\fpeval{0-#3}}+\num{\fpeval{0-#3}}^2}\else\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2-\num{#3}^2\fi}{}
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
- %80
- \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
- \stepcounter{NbCalculDistri}%
- % fin 80
- \ifx\bla#4\bla%
- \xdef\Multi{\fpeval{#2*#2}}%
- \xdef\Multij{\fpeval{#2*#3}}%
- \xdef\Multik{\fpeval{#3*#2}}%
- \xdef\Multil{\fpeval{#3*#3}}%
- %% ils sont redéfinis pour pouvoir envisager la somme de deux
- %% expressions à développer
- \xdef\Multim{\fpeval{#2*#3+#3*#2}}%
- \ifboolKV[ClesDistributivite]{Oppose}{%
- \xdef\Multi{\fpeval{-\Multi}}%
- \xdef\Multim{\fpeval{-\Multim}}%
- \xdef\Multil{\fpeval{-\Multil}}%
- \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
- \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
- \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
- }{%
- \Affichage{\Multi}{\Multim}{\Multil}%
- }
- \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#2}}\xdef\SommeB{\fpeval{\SommeB+#2*#3+#3*#2}}\xdef\SommeC{\fpeval{\SommeC+#3*#3}}}{}%
- \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#2}}\xdef\SommeB{\fpeval{\SommeB-#2*#3-#3*#2}}\xdef\SommeC{\fpeval{\SommeC-#3*#3}}}{}%
- \else%
- \xdef\Multi{\fpeval{#2*#4}}%
- \xdef\Multij{\fpeval{#2*#5}}%
- \xdef\Multik{\fpeval{#3*#4}}%
- \xdef\Multil{\fpeval{#3*#5}}%
- %% ils sont redéfinis pour pouvoir envisager la somme de deux
- %% expressions à développer
- \xdef\Multim{\fpeval{#2*#5+#3*#4}}%
- \ifboolKV[ClesDistributivite]{Oppose}{%
- \xdef\Multi{\fpeval{-\Multi}}%
- \xdef\Multim{\fpeval{-\Multim}}%
- \xdef\Multil{\fpeval{-\Multil}}%
- \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
- \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
- \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
- }{%
- \Affichage{\Multi}{\Multim}{\Multil}%
- }
- \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}%
- \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}%
- \fi%
- }{}%
- }{%
- \ifboolKV[ClesDistributivite]{Numerique}{%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=0}{%
- \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
- }{%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=-1}{%
- \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+ \ifboolKV[ClesDistributivite]{Remarquable}{%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{%
+ \ifx\bla#4\bla(\Affichage{0}{#2}{#3})^2\else(\Affichage{0}{#2}{#3})(\Affichage{0}{#4}{#5})\fi%
+ }{}
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{\ifx\bla#4\bla\xintifboolexpr{#3>0}{\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2+2\times\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{#3}+\num{#3}^2}{\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2-2\times\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesDistributivite]{Lettre}\times\num{\fpeval{0-#3}}+\num{\fpeval{0-#3}}^2}\else\xintifboolexpr{#2=1}{}{(\num{#2}}\useKV[ClesDistributivite]{Lettre}\xintifboolexpr{#2=1}{}{)}^2-\num{#3}^2\fi}{}
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
+ \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
+ \stepcounter{NbCalculDistri}%
+ \ifx\bla#4\bla%
+ \xdef\Multi{\fpeval{#2*#2}}%
+ \xdef\Multij{\fpeval{#2*#3}}%
+ \xdef\Multik{\fpeval{#3*#2}}%
+ \xdef\Multil{\fpeval{#3*#3}}%
+ %% ils sont redéfinis pour pouvoir envisager la somme de deux
+ %% expressions à développer
+ \xdef\Multim{\fpeval{#2*#3+#3*#2}}%
+ \ifboolKV[ClesDistributivite]{Oppose}{%
+ \xdef\Multi{\fpeval{-\Multi}}%
+ \xdef\Multim{\fpeval{-\Multim}}%
+ \xdef\Multil{\fpeval{-\Multil}}%
+ \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
+ \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
+ \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
}{%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{\num{#3}\times\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{#3}\times\num{\fpeval{abs(#5)}}}{}%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=4}{\num{\fpeval{#3*#4}}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#3*#5)}}}{}%
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=5}{\num{\fpeval{#3*#4+#3*#5}}}{}%
- }%
- }%
+ \Affichage{\Multi}{\Multim}{\Multil}%
+ }
+ \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#2}}\xdef\SommeB{\fpeval{\SommeB+#2*#3+#3*#2}}\xdef\SommeC{\fpeval{\SommeC+#3*#3}}}{}%
+ \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#2}}\xdef\SommeB{\fpeval{\SommeB-#2*#3-#3*#2}}\xdef\SommeC{\fpeval{\SommeC-#3*#3}}}{}%
+ \else%
+ \xdef\Multi{\fpeval{#2*#4}}%
+ \xdef\Multij{\fpeval{#2*#5}}%
+ \xdef\Multik{\fpeval{#3*#4}}%
+ \xdef\Multil{\fpeval{#3*#5}}%
+ %% ils sont redéfinis pour pouvoir envisager la somme de deux
+ %% expressions à développer
+ \xdef\Multim{\fpeval{#2*#5+#3*#4}}%
+ \ifboolKV[ClesDistributivite]{Oppose}{%
+ \xdef\Multi{\fpeval{-\Multi}}%
+ \xdef\Multim{\fpeval{-\Multim}}%
+ \xdef\Multil{\fpeval{-\Multil}}%
+ \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
+ \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
+ \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
+ }{%
+ \Affichage{\Multi}{\Multim}{\Multil}%
+ }
+ \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}%
+ \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}%
+ \fi%
+ }{}%
}{%
- \ifboolKV[ClesDistributivite]{All}{%
- \xdef\NomLettre{\useKV[ClesDistributivite]{NomExpression}}%
- \xdef\NomFin{\useKV[ClesDistributivite]{Fin}}%
- \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesDistributivite]{Fin}-1}}\do
- {\NomLettre&=\Distri[Etape=##1]{#2}{#3}{#4}{#5}\\}%
- \NomLettre&=\Distri[Etape=\NomFin]{#2}{#3}{#4}{#5}%
+ \ifboolKV[ClesDistributivite]{Numerique}{%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=0}{%
+ \num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}\multido{\i=2+1}{4}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}%
+ }{%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=-1}{%
+ \Distri[Numerique,Etape=3]{#2}{#3}{#4}{#5}\multido{\i=2+-1}{2}{=\Distri[Numerique,Etape=\i]{#2}{#3}{#4}{#5}}=\num{\fpeval{(#2+#3)*(#4+#5)}}%
+ }{%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{\num{\fpeval{#2+#3}}\times\num{\fpeval{#4+#5}}}{}%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{\num{\fpeval{#2+#3}}\times(\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#5)}})}{}%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{\num{#3}\times\num{#4}\xintifboolexpr{#5>0}{+}{-}\num{#3}\times\num{\fpeval{abs(#5)}}}{}%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=4}{\num{\fpeval{#3*#4}}\xintifboolexpr{#5>0}{+}{-}\num{\fpeval{abs(#3*#5)}}}{}%
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=5}{\num{\fpeval{#3*#4+#3*#5}}}{}%
+ }%
+ }%
}{%
- % Etape 1
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{%
- \xintifboolexpr{#2=0}{%
- }{\xintifboolexpr{#3=0}{}{(}}\Tikzmark{\Affichage[#1]{0}{#2}{0}}%
- \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}%
- \xintifboolexpr{#3>0}{\xintifboolexpr{#2=0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#3)}}}%
- \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}%
- \xintifboolexpr{#2=0}{}{\xintifboolexpr{#3=0}{}{)}}%
- %
- \ifboolKV[ClesDistributivite]{AideMul}{\times}{}%on aide dans le cas double
- \xdef\Multi{\fpeval{#4*#5}}%affichage auto si (a+b)xk
- %
- \xintifboolexpr{\Multi=0}{\times%
- \xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}%
- \Tikzmark{\Affichage[#1]{0}{#4}{0}}%
- \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}%
- \xintifboolexpr{#5>0}{\xintifboolexpr{#4=0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4=0}{{-}}{-}}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#5)}}}%
- \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}%
- \xintifboolexpr{\Multi=0}{%
- \xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}%
- \ifboolKV[ClesDistributivite]{Fleches}{%
- \xdef\Multi{\fpeval{#2*#3*#4*#5}}%
+ \ifboolKV[ClesDistributivite]{All}{%
+ \xdef\NomLettre{\useKV[ClesDistributivite]{NomExpression}}%
+ \xdef\NomFin{\useKV[ClesDistributivite]{Fin}}%
+ \xintFor* ##1 in {\xintSeq {1}{\useKV[ClesDistributivite]{Fin}-1}}\do
+ {\NomLettre&=\Distri[Etape=##1]{#2}{#3}{#4}{#5}\\}%
+ \NomLettre&=\Distri[Etape=\NomFin]{#2}{#3}{#4}{#5}%
+ }{%
+ % Etape 1
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=1}{%
+ \xintifboolexpr{#2=0}{%
+ }{\xintifboolexpr{#3=0}{}{(}}\Tikzmark{\Affichage[#1]{0}{#2}{0}}%
+ \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{+(}}{}%
+ \xintifboolexpr{#3>0}{\xintifboolexpr{#2=0}{}{+}}{\xintifboolexpr{#3<0}{-}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#3)}}}%
+ \ifboolKV[ClesDistributivite]{AideAdda}{\mathcolor{DCAide}{)}}{}%
+ \xintifboolexpr{#2=0}{}{\xintifboolexpr{#3=0}{}{)}}%
+ %
+ \ifboolKV[ClesDistributivite]{AideMul}{\times}{}%on aide dans le cas double
+ \xdef\Multi{\fpeval{#4*#5}}%affichage auto si (a+b)xk
+ %
+ \xintifboolexpr{\Multi=0}{\times%
+ \xintifboolexpr{#4<0}{(}{\xintifboolexpr{#5<0}{(}{}}}{(}%
+ \Tikzmark{\Affichage[#1]{0}{#4}{0}}%
+ \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{+(}}{}%
+ \xintifboolexpr{#5>0}{\xintifboolexpr{#4=0}{}{+}}{\xintifboolexpr{#5<0}{\xintifboolexpr{#4=0}{{-}}{-}}{}}\Tikzmark{\Affichage[#1]{0}{0}{\fpeval{abs(#5)}}}%
+ \ifboolKV[ClesDistributivite]{AideAddb}{\mathcolor{DCAide}{)}}{}%
\xintifboolexpr{\Multi=0}{%
- \xdef\Multij{\fpeval{#2*#3}}%\relax
- \xintifboolexpr{\Multij=0}{\xintifboolexpr{#2=0}{\DrawArrowSimple{1}}{\DrawArrowSimple{0}}}{\xintifboolexpr{#4=0}{\DrawArrowSimpleRenverse{3}}{\DrawArrowSimpleRenverse{2}}}%
- }{%
- \DrawArrow%
+ \xintifboolexpr{#4<0}{)}{\xintifboolexpr{#5<0}{)}{}}}{)}%
+ \ifboolKV[ClesDistributivite]{Fleches}{%
+ \xdef\Multi{\fpeval{#2*#3*#4*#5}}%
+ \xintifboolexpr{\Multi=0}{%
+ \xdef\Multij{\fpeval{#2*#3}}%\relax
+ \xintifboolexpr{\Multij=0}{\xintifboolexpr{#2=0}{\DrawArrowSimple{1}}{\DrawArrowSimple{0}}}{\xintifboolexpr{#4=0}{\DrawArrowSimpleRenverse{3}}{\DrawArrowSimpleRenverse{2}}}%
+ }{%
+ \DrawArrow%
+ }%
+ }{}\setcounter{NbDistri}{0}%
+ }{}
+ % Etape 2
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{%
+ \xdef\Multi{\fpeval{#2*#4}}%
+ \xintifboolexpr{\Multi=0}{}{%
+ \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}%
+ }
+ \xdef\Multij{\fpeval{#2*#5}}%
+ \xintifboolexpr{\Multij=0}{}{%
+ \xintifboolexpr{\Multi=0}{}{+}%
+ \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}%
}%
- }{}\setcounter{NbDistri}{0}%
- }{}
- % Etape 2
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=2}{%
- \xdef\Multi{\fpeval{#2*#4}}%
- \xintifboolexpr{\Multi=0}{}{%
- \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}%
- }
- \xdef\Multij{\fpeval{#2*#5}}%
- \xintifboolexpr{\Multij=0}{}{%
- \xintifboolexpr{\Multi=0}{}{+}%
- \xintifboolexpr{#2<0}{(}{}\Affichage[#1]{0}{#2}{0}\xintifboolexpr{#2<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}%
- }%
- \xdef\Multik{\fpeval{#3*#4}}%
- \xintifboolexpr{\Multik=0}{}{%
- \xintifboolexpr{\Multi=0}{}{+}%
- \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}%
- }%
- \xdef\Multil{\fpeval{#3*#5}}%
- \xintifboolexpr{\Multil=0}{}{+%
- \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}%
- }%
- }{}%
- % Etape 3
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
- %80
- \stepcounter{NbCalculDistri}%
- % fin 80
- \xdef\Multi{\fpeval{#2*#4}}%
- \xdef\Multij{\fpeval{#2*#5}}%
- \xdef\Multik{\fpeval{#3*#4}}%
- \xdef\Multil{\fpeval{#3*#5}}%
- %% ils sont redéfinis pour pouvoir envisager la somme de deux
- %% expressions à développer
- %80
- \xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\Affichage{\Multi}{0}{0})}{\Affichage{\Multi}{0}{0}}}{\Affichage{\Multi}{0}{0}}%
- %fin 80
- \ifboolKV[ClesDistributivite]{Reduction}{\mathunderline{DCReduction}{%
- \xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{{}+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}%
- \xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}%
+ \xdef\Multik{\fpeval{#3*#4}}%
+ \xintifboolexpr{\Multik=0}{}{%
+ \xintifboolexpr{\Multi=0}{}{+}%
+ \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#4<0}{(}{}\Affichage[#1]{0}{#4}{0}\xintifboolexpr{#4<0}{)}{}%
}%
- }{%
- \xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}%
- \xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}%
- }%
- \xintifboolexpr{\Multil=0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}%
- }{}%
- % Etape 4
- \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=4}{%
- \xdef\Multi{\fpeval{#2*#4}}%
- \xdef\Multij{\fpeval{#2*#5}}%
- \xdef\Multik{\fpeval{#3*#4}}%
- \xdef\Multil{\fpeval{#3*#5}}%
- %% ils sont redéfinis pour pouvoir envisager la somme de deux
- %% expressions à développer
- \xdef\Multim{\fpeval{#2*#5+#3*#4}}%
- %80
- \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
- \stepcounter{NbCalculDistri}%
- %fin 80
- \ifboolKV[ClesDistributivite]{Oppose}{%
- \xdef\Multi{\fpeval{-\Multi}}%
- \xdef\Multim{\fpeval{-\Multim}}%
- \xdef\Multil{\fpeval{-\Multil}}%
- \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
- \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
- \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
- }{%
- %80
+ \xdef\Multil{\fpeval{#3*#5}}%
+ \xintifboolexpr{\Multil=0}{}{+%
+ \xintifboolexpr{#3<0}{(}{}\Affichage[#1]{0}{0}{#3}\xintifboolexpr{#3<0}{)}{}\times\xintifboolexpr{#5<0}{(}{}\Affichage[#1]{0}{0}{#5}\xintifboolexpr{#5<0}{)}{}%
+ }%
+ }{}%
+ % Etape 3
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
+ \stepcounter{NbCalculDistri}%
+ \xdef\Multi{\fpeval{#2*#4}}%
+ \xdef\Multij{\fpeval{#2*#5}}%
+ \xdef\Multik{\fpeval{#3*#4}}%
+ \xdef\Multil{\fpeval{#3*#5}}%
+ %% ils sont redéfinis pour pouvoir envisager la somme de deux
+ %% expressions à développer
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\Affichage{\Multi}{0}{0})}{\Affichage{\Multi}{0}{0}}}{\Affichage{\Multi}{0}{0}}%
- \xintifboolexpr{\Multim=0}{}{%
- \xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
+ \ifboolKV[ClesDistributivite]{Reduction}{\mathunderline{DCReduction}{%
+ \xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{{}+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}%
+ \xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}%
+ }%
+ }{%
+ \xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\Affichage{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}%
+ \xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{\xintifboolexpr{#2=0}{}{+}}\xintifboolexpr{\Multik<0}{(}{}\Affichage{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}%
}%
- \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil<0}{-\Affichage{0}{0}{\fpeval{-\Multil}}}{+\Affichage{0}{0}{\Multil}}}%\Affichage{\Multi}{\Multim}{\Multil}%
- % fin 80
- }
- \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}%
- \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}%
- }{}%
+ \xintifboolexpr{\Multil=0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}%
+ }{}%
+ % Etape 4
+ \xintifboolexpr{\useKV[ClesDistributivite]{Etape}=4}{%
+ \xdef\Multi{\fpeval{#2*#4}}%
+ \xdef\Multij{\fpeval{#2*#5}}%
+ \xdef\Multik{\fpeval{#3*#4}}%
+ \xdef\Multil{\fpeval{#3*#5}}%
+ %% ils sont redéfinis pour pouvoir envisager la somme de deux
+ %% expressions à développer
+ \xdef\Multim{\fpeval{#2*#5+#3*#4}}%
+ \xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
+ \stepcounter{NbCalculDistri}%
+ \ifboolKV[ClesDistributivite]{Oppose}{%
+ \xdef\Multi{\fpeval{-\Multi}}%
+ \xdef\Multim{\fpeval{-\Multim}}%
+ \xdef\Multil{\fpeval{-\Multil}}%
+ \xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{(}{}\Affichage{\Multi}{0}{0}\xintifboolexpr{\Multi<0}{)}{}}%
+ \xintifboolexpr{\Multim=0}{}{\xintifboolexpr{\Multim>0}{+}{+(}\Affichage{0}{\Multim}{0}\xintifboolexpr{\Multim<0}{)}{}}%
+ \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil>0}{+}{+(}\Affichage{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}}%
+ }{%
+ \xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\Affichage{\Multi}{0}{0})}{\Affichage{\Multi}{0}{0}}}{\Affichage{\Multi}{0}{0}}%
+ \xintifboolexpr{\Multim=0}{}{%
+ \xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
+ }%
+ \xintifboolexpr{\Multil=0}{}{\xintifboolexpr{\Multil<0}{-\Affichage{0}{0}{\fpeval{-\Multil}}}{+\Affichage{0}{0}{\Multil}}}%
+ }
+ \ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+#2*#4}}\xdef\SommeB{\fpeval{\SommeB+#2*#5+#3*#4}}\xdef\SommeC{\fpeval{\SommeC+#3*#5}}}{}%
+ \ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-#2*#4}}\xdef\SommeB{\fpeval{\SommeB-#2*#5-#3*#4}}\xdef\SommeC{\fpeval{\SommeC-#3*#5}}}{}%
+ }{}%
+ }%
}%
}%
}%
}%
- }%
}%
\newcommand{\Resultat}[1][]{%
@@ -2560,9 +2908,7 @@
\useKVdefault[ClesDistributivite]%obligatoire car la macro n'est pas dans un groupe.
\setKV[ClesDistributivite]{#1}%On lit les arguments optionnels
\ifboolKV[ClesDistributivite]{RAZ}{\xdef\SommeA{0}\xdef\SommeB{0}\xdef\SommeC{0}%
- % 80
\setcounter{NbCalculDistri}{0}%
- % fin 80
}{}%
\colorlet{DCAide}{\useKV[ClesDistributivite]{CouleurAide}}%
\colorlet{DCReduction}{\useKV[ClesDistributivite]{CouleurReduction}}%
@@ -2583,10 +2929,8 @@
\fi%
}{}
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
\stepcounter{NbCalculDistri}%
- % fin 80
\ifx\bla#4\bla%
\xdef\Multi{\fpeval{#2*#2}}%
\xdef\Multij{\fpeval{#2*#3}}%
@@ -2776,9 +3120,7 @@
}{}
% Etape 3
\xintifboolexpr{\useKV[ClesDistributivite]{Etape}=3}{%
- % 80
\stepcounter{NbCalculDistri}%
- % fin 80
\xdef\Multi{\fpeval{#2*#4}}%
\xdef\Multij{\fpeval{#2*#5}}%
\xdef\Multik{\fpeval{#3*#4}}%
@@ -2786,9 +3128,7 @@
%% ils sont redéfinis pour pouvoir envisager la somme de deux
%% expressions à développer
\xintifboolexpr{\useKV[ClesDistributivite]{Echange}=1}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\AffichageEchange{0}{\Multi}{0})}{\AffichageEchange{0}{\Multi}{0}}}{\AffichageEchange{0}{\Multi}{0}}%
- %fin 80\AffichageEchange{0}{\Multi}{0}%pas de soulignement de réduction ici
\xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\AffichageEchange{\Multij}{0}{0}\xintifboolexpr{\Multij<0}{)}{}}%
\xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\AffichageEchange{0}{0}{\Multik}\xintifboolexpr{\Multik<0}{)}{}}%
\xintifboolexpr{\Multil=0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\AffichageEchange{0}{\Multil}{0}\xintifboolexpr{\Multil<0}{)}{}%
@@ -2797,9 +3137,7 @@
\ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-\Multik}}\xdef\SommeB{\fpeval{\SommeB-\Multim}}\xdef\SommeC{\fpeval{\SommeC-\Multij}}}{}%
}{}%
\xintifboolexpr{\useKV[ClesDistributivite]{Echange}=2}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\AffichageEchange{0}{\Multi}{0})}{\AffichageEchange{0}{\Multi}{0}}}{\AffichageEchange{0}{\Multi}{0}}%
- %fin 80\AffichageEchange{0}{\Multi}{0}%pas de soulignement de réduction ici
\xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\AffichageEchange{0}{0}{\Multij}\xintifboolexpr{\Multij<0}{)}{}}%
\xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\AffichageEchange{\Multik}{0}{0}\xintifboolexpr{\Multik<0}{)}{}}%
\xintifboolexpr{\Multil=0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\AffichageEchange{0}{\Multil}{0}\xintifboolexpr{\Multil<0}{)}{}%
@@ -2808,9 +3146,7 @@
\ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-\Multij}}\xdef\SommeB{\fpeval{\SommeB-\Multim}}\xdef\SommeC{\fpeval{\SommeC-\Multik}}}{}%
}{}%
\xintifboolexpr{\useKV[ClesDistributivite]{Echange}=3}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multi<0}{(\AffichageEchange{\Multi}{0}{0})}{\AffichageEchange{\Multi}{0}{0}}}{\AffichageEchange{\Multi}{0}{0}}%
- %fin 80\AffichageEchange{\Multi}{0}{0}%pas de soulignement de réduction ici
\xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multi=0}{}{+}\xintifboolexpr{\Multij<0}{(}{}\AffichageEchange{0}{\Multij}{0}\xintifboolexpr{\Multij<0}{)}{}}%
\xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multil=0}{\xintifboolexpr{#2=0}{}{+}}{+}\xintifboolexpr{\Multik<0}{(}{}\AffichageEchange{0}{\Multik}{0}\xintifboolexpr{\Multik<0}{)}{}}%
\xintifboolexpr{\Multil=0}{}{+}\xintifboolexpr{\Multil<0}{(}{}\AffichageEchange{0}{0}{\Multil}\xintifboolexpr{\Multil<0}{)}{}%
@@ -2827,10 +3163,8 @@
\xdef\Multil{\fpeval{#3*#5}}%
%% ils sont redéfinis pour pouvoir envisager la somme de deux
%% expressions à développer
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\setcounter{NbCalculDistri}{0}}{}%
\stepcounter{NbCalculDistri}%
- %fin 80
\xintifboolexpr{\useKV[ClesDistributivite]{Echange}=1}{%
\xdef\Multim{\fpeval{#2*#4+#3*#5}}%
\ifboolKV[ClesDistributivite]{Oppose}{%
@@ -2841,13 +3175,11 @@
\xintifboolexpr{\Multimo=0}{}{\xintifboolexpr{\Multimo>0}{+}{+(}\Affichage{0}{\Multimo}{0}\xintifboolexpr{\Multimo<0}{)}{}}%
\xintifboolexpr{\Multijo=0}{}{\xintifboolexpr{\Multijo>0}{+}{+(}\Affichage{0}{0}{\Multijo}\xintifboolexpr{\Multijo<0}{)}{}}%
}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multik<0}{(\Affichage{\Multik}{0}{0})}{\Affichage{\Multik}{0}{0}}}{\Affichage{\Multik}{0}{0}}%
\xintifboolexpr{\Multim=0}{}{%
\xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
}%
\xintifboolexpr{\Multij=0}{}{\xintifboolexpr{\Multij<0}{-\Affichage{0}{0}{\fpeval{-\Multij}}}{+\Affichage{0}{0}{\Multij}}}%
- % fin 80
}%
\ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+\Multik}}\xdef\SommeB{\fpeval{\SommeB+\Multim}}\xdef\SommeC{\fpeval{\SommeC+\Multij}}}{}%
\ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-\Multik}}\xdef\SommeB{\fpeval{\SommeB-\Multim}}\xdef\SommeC{\fpeval{\SommeC-\Multij}}}{}%
@@ -2862,13 +3194,11 @@
\xintifboolexpr{\Multimo=0}{}{\xintifboolexpr{\Multimo>0}{+}{+(}\Affichage{0}{\Multimo}{0}\xintifboolexpr{\Multimo<0}{)}{}}%
\xintifboolexpr{\Multiko=0}{}{\xintifboolexpr{\Multiko>0}{+}{+(}\Affichage{0}{0}{\Multiko}\xintifboolexpr{\Multiko<0}{)}{}}%
}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multij<0}{(\Affichage{\Multij}{0}{0})}{\Affichage{\Multij}{0}{0}}}{\Affichage{\Multij}{0}{0}}%
\xintifboolexpr{\Multim=0}{}{%
\xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
}%
\xintifboolexpr{\Multik=0}{}{\xintifboolexpr{\Multik<0}{-\Affichage{0}{0}{\fpeval{-\Multik}}}{+\Affichage{0}{0}{\Multik}}}%
- % fin 80\Affichage{\Multij}{\Multim}{\Multik}%
}%
\ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+\Multij}}\xdef\SommeB{\fpeval{\SommeB+\Multim}}\xdef\SommeC{\fpeval{\SommeC+\Multik}}}{}%
\ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-\Multij}}\xdef\SommeB{\fpeval{\SommeB-\Multim}}\xdef\SommeC{\fpeval{\SommeC-\Multik}}}{}%
@@ -2883,13 +3213,11 @@
\xintifboolexpr{\Multimo=0}{}{\xintifboolexpr{\Multimo>0}{+}{+(}\Affichage{0}{\Multimo}{0}\xintifboolexpr{\Multimo<0}{)}{}}%
\xintifboolexpr{\Multio=0}{}{\xintifboolexpr{\Multio>0}{+}{+(}\Affichage{0}{0}{\Multio}\xintifboolexpr{\Multio<0}{)}{}}%
}{%
- % 80
\xintifboolexpr{\theNbCalculDistri>1}{\xintifboolexpr{\Multil<0}{(\Affichage{\Multil}{0}{0})}{\Affichage{\Multil}{0}{0}}}{\Affichage{\Multil}{0}{0}}%
\xintifboolexpr{\Multim=0}{}{%
\xintifboolexpr{\Multim>0}{+\Affichage{0}{\Multim}{0}}{-\Affichage{0}{\fpeval{-\Multim}}{0}}%
}%
\xintifboolexpr{\Multi=0}{}{\xintifboolexpr{\Multi<0}{-\Affichage{0}{0}{\fpeval{-\Multi}}}{+\Affichage{0}{0}{\Multi}}}%
- % fin 80\Affichage{\Multil}{\Multim}{\Multi}%
}
\ifboolKV[ClesDistributivite]{Somme}{\xdef\SommeA{\fpeval{\SommeA+\Multil}}\xdef\SommeB{\fpeval{\SommeB+\Multim}}\xdef\SommeC{\fpeval{\SommeC+\Multi}}}{}%
\ifboolKV[ClesDistributivite]{Difference}{\xdef\SommeA{\fpeval{\SommeA-\Multil}}\xdef\SommeB{\fpeval{\SommeB-\Multim}}\xdef\SommeC{\fpeval{\SommeC-\Multi}}}{}%
@@ -2901,9 +3229,9 @@
}%
}%
-%%%%%%%%%%%%%%%
-%Nombre Premier
-%%%%%%%%%%%%%%%
+%%%
+% Nombre Premier
+%%%
\setKVdefault[ClesNombrePremier]{Tableau=false,TableauVertical=false,TableauVerticalVide=false,Exposant=false,Longue=false,All=false,Arbre=false,ArbreVide=false,ArbreComplet=false,Diviseurs=false,DiviseursT=false,Dot=\dotfill}
\newcommand\Decomposition[2][]{%
@@ -2930,7 +3258,7 @@
pair Ancre[];
numeric decalage;
decalage=10mm;
-
+
vardef PremierSimple(expr NB)=
b:=2;
depart:=NB;
@@ -3393,7 +3721,6 @@ vardef Positions(expr Step)=
\dnpvv=\numexpr\dnpvv+1\relax
\cnpvv=\numexpr\anpvv/\bnpvv\relax
\anpvv=\cnpvv\relax
- %\num{\the\bnpvv}%
\else%
\bnpvv=\numexpr\bnpvv+1\relax%
\fi%
@@ -3419,7 +3746,6 @@ vardef Positions(expr Step)=
\dnpmv=\numexpr\dnpmv+1\relax
\cnpmv=\numexpr\anpmv/\bnpmv\relax
\anpmv=\cnpmv\relax
- %\num{\the\bnpmv}
\else%
\bnpmv=\numexpr\bnpmv+1\relax%
\fi%
@@ -3469,7 +3795,7 @@ vardef Positions(expr Step)=
\anp=#1\relax%
\bnp=2\relax%
\premier=-1\relax%
- % Pour déterminer le nombre d'étapes
+ % Pour déterminer le nombre d'étapes
\whiledo{\anp > 1}{%
\modulo{\the\anp}{\the\bnp}
\ifnum\remainder=0\relax%
@@ -3479,7 +3805,7 @@ vardef Positions(expr Step)=
\else%
\bnp=\numexpr\bnp+1\relax%
\fi%
- }
+ }%
\ifnum\premier=0%
Le nombre \num{#1} est un nombre premier.%
\else%
@@ -3536,22 +3862,21 @@ vardef Positions(expr Step)=
\else%
\ifnum\exposant>0\relax
\num{\the\pileb}\ifnum\exposant>1 ^{\num{\the\exposant}}\fi\times%
- %\pilea=\anp\relax
\fi
\bnp=\numexpr\bnp+1\relax%
\pileb=\bnp\relax%
- \exposant=0\relax
+ \exposant=0\relax%
\fi%
- }
+ }%
\num{\the\pileb}\ifnum\exposant>1^{\num{\the\exposant}}\fi%
- }
-}
+ }%
+}%
\newcommand{\PremierLong}[1]{%
%#1 : le nombre entier à tester
\ensuremath{%
\newcount\anpl\newcount\bnpl\newcount\cnpl%
- \newcount\pilebl
+ \newcount\pilebl%
\anpl=#1\relax%
\bnpl=2\relax%
\pilebl=2\relax%
@@ -3564,7 +3889,7 @@ vardef Positions(expr Step)=
\else%
\bnpl=\numexpr\bnpl+1\relax%
\pilebl=\bnpl\relax%
- \fi%
+ \fi%
}
}
}
@@ -3635,9 +3960,9 @@ vardef Positions(expr Step)=
}%
}
-%%%%%%%%%%%%%%%%%%%
+%%%
% Simplification
-%%%%%%%%%%%%%%%%%%%
+%%%
\makeatletter%by christian Tellechea
% Calcul du PGCD de #1 et #2
\newcount\cnt@a\newcount\cnt@b\newcount\pgcd
@@ -3675,6 +4000,11 @@ vardef Positions(expr Step)=
\numerateur=\valabsnum
\denominateur=\valabsdeno
\fi
+ \else
+ \ifnum\the\denominateur<0\relax
+ \numerateur=-\valabsnum
+ \denominateur=\valabsdeno
+ \fi
\fi
\ifnum\number#2=0\relax
\text{\bfseries(???)}
@@ -3718,6 +4048,17 @@ vardef Positions(expr Step)=
\else
\valabsdeno=\number#2
\fi
+ \ifnum\the\numerateur<0\relax
+ \ifnum\the\denominateur<0\relax
+ \numerateur=\valabsnum
+ \denominateur=\valabsdeno
+ \fi
+ \else
+ \ifnum\the\denominateur<0\relax
+ \numerateur=-\valabsnum
+ \denominateur=\valabsdeno
+ \fi
+ \fi
\ifnum\number#2=0\relax
\ensuremath{\text{\bfseries(???)}}
\else
@@ -3743,49 +4084,50 @@ vardef Positions(expr Step)=
\fi
}
+\newcount\anpdc\newcount\bnpdc\newcount\cnpdc\newcount\dnpdc%
+\newcount\DivCom
\newcommand\DiviseurCommun[2]{%
% #1 : le premier nombre entier
- % #2 : le deuxième nombre entier
- \newcount\anpdc\newcount\bnpdc\newcount\cnpdc%
+ % #2 : le deuxième nombre entier
+ % nombre 1 vaut #1 - Nombre 2 vaut #2
\anpdc=#1%
\cnpdc=#2%
\bnpdc=2\relax%
- \whiledo{\bnpdc<\anpdc}{%
- \modulo{\the\anpdc}{\the\bnpdc}{}%
+ \dnpdc=\numexpr#1+1\relax%
+ \DivCom=1\relax%
+ \whiledo{\bnpdc<\dnpdc}{%
+ \modulo{\the\anpdc}{\the\bnpdc}\relax
\ifnum\remainder=0%
- \modulo{\the\cnpdc}{\the\bnpdc}{}
+ \modulo{\the\cnpdc}{\the\bnpdc}
\ifnum\remainder=0%
- \xdef\DivCom{\the\bnpdc}%
+ \DivCom=\bnpdc%
\bnpdc=\anpdc%
\else%
- \xdef\DivCom{1}%
- \bnpdc=\numexpr\bnpdc+1%
- \fi%
+ \DivCom=1%
+ \fi
\else%
- \xdef\DivCom{1}%
- \bnpdc=\numexpr\bnpdc+1%
+ \DivCom=1%
\fi
+ \bnpdc=\numexpr\bnpdc+1\relax%
}%
}
\newcommand\LongueSimplification[2]{%
- \DiviseurCommun{#1}{#2}%
\xdef\NumerateurDiv{#1}%
\xdef\DenominateurDiv{#2}%
+ \DiviseurCommun{#1}{#2}%
\ensuremath{%
- \whiledo{\DivCom > 1}{%
- \xdef\DivComa{\DivCom}\xdef\MulComa{\fpeval{\NumerateurDiv/\DivComa}}
- \xdef\DivComb{\DivCom}\xdef\MulComb{\fpeval{\DenominateurDiv/\DivComb}}
- \frac{\num{\DivComa}\times\num{\MulComa}}{\num{\DivComb}\times\num{\MulComb}}=\frac{\num{\MulComa}}{\num{\MulComb}}%
- \xdef\NumerateurDiv{\MulComa}%
- \xdef\DenominateurDiv{\MulComb}%
+ \whiledo{\DivCom>1}{%
+ \frac{\num{\fpeval{\NumerateurDiv/\the\DivCom}}\times\num{\the\DivCom}}{\num{\fpeval{\DenominateurDiv/\the\DivCom}}\times\num{\the\DivCom}}=\frac{\num{\fpeval{\NumerateurDiv/\DivCom}}}{\num{\fpeval{\DenominateurDiv/\DivCom}}}%
+ \xdef\NumerateurDiv{\fpeval{\NumerateurDiv/\DivCom}}%
+ \xdef\DenominateurDiv{\fpeval{\DenominateurDiv/\DivCom}}%
\DiviseurCommun{\NumerateurDiv}{\DenominateurDiv}%
\xintifboolexpr{\DivCom>1}{=}{}%
- }
- }
-}
+ }%
+ }%
+}%
-\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false}
+\setKVdefault[ClesSimplification]{Details=false,All=false,Longue=false,Fleches=false,Contraire=0}
\newcounter{NbFrac}%
\setcounter{NbFrac}{0}%
@@ -3814,17 +4156,23 @@ vardef Positions(expr Step)=
\draw[out=-45,in=-135,-stealth,transform canvas={yshift=-0.25em}] (pic cs:B-\theNbFrac) to node[midway,below]{\Listeb[1,2]}(pic cs:D-\theNbFrac);%
\end{tikzpicture}%
}{%
- \ifboolKV[ClesSimplification]{Longue}{%
- \LongueSimplification{#2}{#3}%
+ \xintifboolexpr{\useKV[ClesSimplification]{Contraire}>1}{%
+ \ensuremath{%
+ \frac{\num{#2}}{\num{#3}}=\frac{\num{#2}\times\num{\useKV[ClesSimplification]{Contraire}}}{\num{#3}\times\num{\useKV[ClesSimplification]{Contraire}}}=\frac{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#2}}}{\num{\fpeval{\useKV[ClesSimplification]{Contraire}*#3}}}%
+ }%
}{%
- \ifboolKV[ClesSimplification]{Details}{\SSimpli{#2}{#3}}{\ifboolKV[ClesSimplification]{All}{\ensuremath{\SSimpli{#2}{#3}=\SSimplifie{#2}{#3}}}{\SSimplifie{#2}{#3}}}%
+ \ifboolKV[ClesSimplification]{Longue}{%
+ \LongueSimplification{#2}{#3}%
+ }{%
+ \ifboolKV[ClesSimplification]{Details}{\SSimpli{#2}{#3}}{\ifboolKV[ClesSimplification]{All}{\ensuremath{\SSimpli{#2}{#3}=\SSimplifie{#2}{#3}}}{\SSimplifie{#2}{#3}}}%
+ }%
}%
}%
}%
-%%%%%%%%%%%%%%%%%%%%%
-%%% Thales
-%%%%%%%%%%%%%%%%%%%%%
+%%%
+% Thales
+%%%
\newcount\ppcm
\newcommand\PPCM[2]{%
@@ -3832,10 +4180,10 @@ vardef Positions(expr Step)=
\ppcm=\numexpr#1*#2/\pgcd\relax
}
-\setKVdefault[ClesThales]{Calcul=true,Droites=false,Propor=false,Segment=false,Figure=false,Figurecroisee=false,Precision=2,Entier=false,Unite=cm,Reciproque=false,Produit=false,ChoixCalcul=0,Simplification,Redaction=false,Remediation=false}
+\setKVdefault[ClesThales]{Calcul=true,Droites=false,Propor=false,Segment=false,Figure=false,FigureSeule=false,Figurecroisee=false,FigurecroiseeSeule=false,Angle=0,Precision=2,Entier=false,Unite=cm,Reciproque=false,Produit=false,ChoixCalcul=0,Simplification,Redaction=false,Remediation=false}
%On définit la figure à utiliser
-\def\MPFigThales#1#2#3#4#5{
+\def\MPFigThales#1#2#3#4#5#6{
% #1 Premier sommet
% #2 Deuxième sommet
% #3 Troisième sommet
@@ -3855,15 +4203,10 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
- % On définit le centre du cercle inscrit
- %(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
- %(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
- %on dessine à main levée :)
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
+ % on dessine à main levée :)
path cotes[];
cotes1=A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
cotes2=B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
@@ -3909,14 +4252,10 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
- % On définit le centre du cercle inscrit
- %(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
- %(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
- %on dessine à main levée :)
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
+ % on dessine à main levée :)
path cotes[];
cotes1=A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
cotes2=B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
@@ -3953,7 +4292,7 @@ vardef Positions(expr Step)=
}
%On définit la figure à utiliser
-\def\MPFigReciThales#1#2#3#4#5{
+\def\MPFigReciThales#1#2#3#4#5#6{
% #1 Premier sommet
% #2 Deuxième sommet
% #3 Troisième sommet
@@ -3973,15 +4312,10 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
- % On définit le centre du cercle inscrit
- %(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
- %(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
- %on dessine à main levée :)
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
+ % on dessine à main levée :)
path cotes[];
cotes1=A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
cotes2=B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
@@ -4015,14 +4349,10 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
- % On définit le centre du cercle inscrit
- %(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
- %(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
- %on dessine à main levée :)
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
+ % on dessine à main levée :)
path cotes[];
cotes1=A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
cotes2=B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
@@ -4042,24 +4372,12 @@ vardef Positions(expr Step)=
label(btex #5 etex,1.1[B,N]);
fill (fullcircle scaled 0.75mm) shifted (cotes1 intersectionpoint cotes4);
fill (fullcircle scaled 0.75mm) shifted (cotes3 intersectionpoint cotes4);
-% pair I,J,K;
-% I=1/2[M,N];
-% J=1/2[B,C];
-% K=1/2[I,J];
-% path cd;
-% cd=(fullcircle scaled 6mm) shifted K;
-% drawoptions(withcolor 0.75*white);
-% drawarrow reverse((I{dir(210+angle(I-J))}..{dir(150+angle(I-J))}K) cutafter cd);
-% drawarrow reverse((J{dir(210+angle(J-I))}..{dir(150+angle(J-I))}K) cutafter cd);
-% draw cd;
-% label(btex $//$ etex ,K);
-% drawoptions();
\end{mpost}
\fi
}
%On définit la deuxième figure à utiliser
-\def\MPFigThalesCroisee#1#2#3#4#5{%
+\def\MPFigThalesCroisee#1#2#3#4#5#6{%
% #1 Premier sommet
% #2 Deuxième sommet
% #3 Troisième sommet
@@ -4079,11 +4397,9 @@ vardef Positions(expr Step)=
B=A rotatedabout(O,130);
C=(A--2[A,B rotatedabout(A,45)]) intersectionpoint (B--2[B,A rotatedabout(B,-60)]);
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
% on dessine à main levée :)
M=1.4[B,A];
N=1.4[C,A];
@@ -4102,7 +4418,6 @@ vardef Positions(expr Step)=
(I-C) rotated ((angle(A-C)-angle(M-C))/2) shifted C=whatever[A,C];
(I-M) rotated ((angle(C-M)-angle(A-M))/2) shifted M=whatever[M,C];
%on labelise
- %label(btex #1 etex,1.15[1/2[B,C],A]);
label(btex #1 etex,I);
label(btex #2 etex,1.2[M,B]);
label(btex #3 etex,1.2[N,C]);
@@ -4136,10 +4451,9 @@ vardef Positions(expr Step)=
B=A rotatedabout(O,130);
C=(A--2[A,B rotatedabout(A,45)]) intersectionpoint (B--2[B,A rotatedabout(B,-60)]);
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
% on dessine à main levée :)
M=1.4[B,A];
N=1.4[C,A];
@@ -4158,7 +4472,6 @@ vardef Positions(expr Step)=
(I-C) rotated ((angle(A-C)-angle(M-C))/2) shifted C=whatever[A,C];
(I-M) rotated ((angle(C-M)-angle(A-M))/2) shifted M=whatever[M,C];
%on labelise
- %label(btex #1 etex,1.15[1/2[B,C],A]);
label(btex #1 etex,I);
label(btex #2 etex,1.2[M,B]);
label(btex #3 etex,1.2[N,C]);
@@ -4183,7 +4496,7 @@ vardef Positions(expr Step)=
}
%On définit la deuxième figure à utiliser
-\def\MPFigReciThalesCroisee#1#2#3#4#5{%
+\def\MPFigReciThalesCroisee#1#2#3#4#5#6{%
% #1 Premier sommet
% #2 Deuxième sommet
% #3 Troisième sommet
@@ -4203,11 +4516,9 @@ vardef Positions(expr Step)=
B=A rotatedabout(O,130);
C=(A--2[A,B rotatedabout(A,45)]) intersectionpoint (B--2[B,A rotatedabout(B,-60)]);
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
% on dessine à main levée :)
M=1.4[B,A];
N=1.4[C,A];
@@ -4226,7 +4537,6 @@ vardef Positions(expr Step)=
(I-C) rotated ((angle(A-C)-angle(M-C))/2) shifted C=whatever[A,C];
(I-M) rotated ((angle(C-M)-angle(A-M))/2) shifted M=whatever[M,C];
%on labelise
- %label(btex #1 etex,1.15[1/2[B,C],A]);
label(btex #1 etex,I);
label(btex #2 etex,1.2[M,B]);
label(btex #3 etex,1.2[N,C]);
@@ -4250,10 +4560,9 @@ vardef Positions(expr Step)=
B=A rotatedabout(O,130);
C=(A--2[A,B rotatedabout(A,45)]) intersectionpoint (B--2[B,A rotatedabout(B,-60)]);
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#6);
+ B:=B rotatedabout(O,#6);
+ C:=C rotatedabout(O,#6);
% on dessine à main levée :)
M=1.4[B,A];
N=1.4[C,A];
@@ -4272,7 +4581,6 @@ vardef Positions(expr Step)=
(I-C) rotated ((angle(A-C)-angle(M-C))/2) shifted C=whatever[A,C];
(I-M) rotated ((angle(C-M)-angle(A-M))/2) shifted M=whatever[M,C];
%on labelise
- %label(btex #1 etex,1.15[1/2[B,C],A]);
label(btex #1 etex,I);
label(btex #2 etex,1.2[M,B]);
label(btex #3 etex,1.2[N,C]);
@@ -4291,7 +4599,7 @@ vardef Positions(expr Step)=
\useKVdefault[ClesThales]%
\setKV[ClesThales]{#1}%
\ifboolKV[ClesThales]{Droites}{%
- Les droites $(#3#5)$ et $(#4#6)$ sont sécantes en $#2$.%
+ Les droites \ifboolKV[ClesThales]{Remediation}{\pointilles[2cm]}{$(#3#5)$} et \ifboolKV[ClesThales]{Remediation}{\pointilles[2cm]}{$(#4#6)$} sont sécantes en \ifboolKV[ClesThales]{Remediation}{\pointilles[2cm]}{$#2$}.%
}{%
Dans le triangle \ifboolKV[ClesThales]{Remediation}{\pointilles[2cm]}{$#2#3#4$}, \ifboolKV[ClesThales]{Remediation}{\pointilles[1cm]}{$#5$} est un point \ifboolKV[ClesThales]{Segment}{du segment}{de la
droite}
@@ -4869,23 +5177,31 @@ vardef Positions(expr Step)=
\newcommand{\TThales}[8][]{%
\setKV[ClesThales]{#1}%
- \ifboolKV[ClesThales]{Figure}{%
- \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
- \begin{multicols}{2}%
- {\em La figure est donnée à titre indicatif.}%
- \[\MPFigThales\NomA\NomB\NomC\NomM\NomN\]%
- \par\columnbreak\par%
- \ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
- \end{multicols}%
- }{\ifboolKV[ClesThales]{Figurecroisee}{%
- \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
- \begin{multicols}{2}%
- {\em La figure est donnée à titre indicatif.}%
- \[\MPFigThalesCroisee\NomA\NomB\NomC\NomM\NomN\]%
- \par\columnbreak\par%
- \ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
- \end{multicols}%
- }{\ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \ifboolKV[ClesThales]{FigureSeule}{%
+ \MPFigThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
+ }{\ifboolKV[ClesThales]{FigurecroiseeSeule}{%
+ \MPFigThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
+ }{%
+ \ifboolKV[ClesThales]{Figure}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \begin{multicols}{2}%
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]%
+ \par\columnbreak\par%
+ \ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
+ \end{multicols}%
+ }{\ifboolKV[ClesThales]{Figurecroisee}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \begin{multicols}{2}%
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]%
+ \par\columnbreak\par%
+ \ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}%
+ \end{multicols}%
+ }{\ifboolKV[ClesThales]{Entier}{\TThalesCalculsE[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}{\TThalesCalculsD[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}%
+ }%
+ }%
}%
}%
%%%%
@@ -4984,31 +5300,40 @@ vardef Positions(expr Step)=
% #4 longueur AB
% #5 longueur AF
% #6 longueur AC
- \ifboolKV[ClesThales]{Figure}{%
+ \ifboolKV[ClesThales]{FigureSeule}{%
\StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
- \begin{multicols}{2}
- {\em La figure est donnée à titre indicatif.}
- \[\MPFigReciThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}\]
- \par\columnbreak\par
- \ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
- \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}
- \end{multicols}
- }{\ifboolKV[ClesThales]{Figurecroisee}{%
- \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]
- \begin{minipage}{0.4\linewidth}
- {\em La figure est donnée à titre indicatif.}
- \[\MPFigReciThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}\]
- \end{minipage}
- \hfill
- \begin{minipage}{0.55\linewidth}
- \ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
- \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}
- \end{minipage}\\%
- }{\ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
- \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}
- }
- }
-}
+ \MPFigReciThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
+ }{\ifboolKV[ClesThales]{FigurecroiseeSeule}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \MPFigReciThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
+ }{%
+ \ifboolKV[ClesThales]{Figure}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \begin{multicols}{2}
+ {\em La figure est donnée à titre indicatif.}
+ \[\MPFigReciThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]
+ \par\columnbreak\par
+ \ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
+ \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}
+ \end{multicols}
+ }{\ifboolKV[ClesThales]{Figurecroisee}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]
+ \begin{minipage}{0.4\linewidth}
+ {\em La figure est donnée à titre indicatif.}
+ \[\MPFigReciThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]
+ \end{minipage}
+ \hfill
+ \begin{minipage}{0.55\linewidth}
+ \ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
+ \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \end{minipage}\\%
+ }{\ReciThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}\par
+ \ReciThalesCalculs[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ }%
+ }%
+ }%
+ }%
+}%
\newcommand{\Thales}[8][]{%
\useKVdefault[ClesThales]%
@@ -5016,18 +5341,48 @@ vardef Positions(expr Step)=
\ifboolKV[ClesThales]{Reciproque}{%
\ReciproqueThales[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
}{%
- \ifboolKV[ClesThales]{Redaction}{%
- \TTThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}%
+ \ifboolKV[ClesThales]{FigureSeule}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \MPFigThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
}{%
- \TThales[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
- }
+ \ifboolKV[ClesThales]{FigurecroiseeSeule}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \MPFigThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}%
+ }{%
+ \ifboolKV[ClesThales]{Redaction}{%
+ \ifboolKV[ClesThales]{Figure}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \begin{multicols}{2}
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigThales{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]%
+ \par\columnbreak\par%
+ \TTThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}%
+ \end{multicols}%
+ }{%
+ \ifboolKV[ClesThales]{Figurecroisee}{%
+ \StrMid{#2}{1}{1}[\NomA]\StrMid{#2}{2}{2}[\NomB]\StrMid{#2}{3}{3}[\NomC]\StrMid{#2}{4}{4}[\NomM]\StrMid{#2}{5}{5}[\NomN]%
+ \begin{multicols}{2}
+ {\em La figure est donnée à titre indicatif.}%
+ \[\MPFigThalesCroisee{\NomA}{\NomB}{\NomC}{\NomM}{\NomN}{\useKV[ClesThales]{Angle}}\]%
+ \par\columnbreak\par%
+ \TTThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}%
+ \end{multicols}
+ }{%
+ \TTThales[#1]{\StrMid{#2}{1}{1}}{\StrMid{#2}{2}{2}}{\StrMid{#2}{3}{3}}{\StrMid{#2}{4}{4}}{\StrMid{#2}{5}{5}}%
+ }
+ }
+ }{%
+ \TThales[#1]{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ }%
+ }%
+ }%
}%
}%
-%%%%%%%%%%%%%%%%
-%% Trigonométrie
-%%%%%%%%%%%%%%%%
-\def\MPFigTrigo#1#2#3#4#5#6#7{%
+%%%
+% Trigonométrie
+%%%
+\def\MPFigTrigo#1#2#3#4#5#6#7#8{%
\ifluatex
\mplibcodeinherit{enable}
\mplibforcehmode
@@ -5042,11 +5397,9 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Angle;
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#8);
+ B:=B rotatedabout(O,#8);
+ C:=C rotatedabout(O,#8);
% On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
@@ -5065,8 +5418,6 @@ vardef Positions(expr Step)=
picture MAngle;
MAngle=image(
draw (cc shifted A);
- % draw (cc shifted B);
- % draw (cc shifted C);
);
draw MAngle;
clip currentpicture to triangle;
@@ -5084,15 +5435,15 @@ vardef Positions(expr Step)=
else:
if angle(1/2[A,C]-B)>0:
if #6=0:
- label(btex ? etex rotated angle(C-A),1.1[B,1/2[A,C]]);
+ label(btex ? etex,1.1[B,1/2[A,C]]);
else:
- label(btex \num{#6} etex rotated angle(C-A),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
fi;
else:
if #6=0:
- label(btex ? etex rotated angle(A-C),1.1[B,1/2[A,C]]);
+ label(btex ? etex,1.1[B,1/2[A,C]]);
else:
- label(btex \num{#6} etex rotated angle(A-C),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
fi;
fi;
fi;
@@ -5100,15 +5451,15 @@ vardef Positions(expr Step)=
else:
if angle(1/2[B,C]-A)>0:
if #4=0:
- label(btex ? etex rotated(angle(B-C)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex ? etex,1/2[B,C]-decalage*(unitvector(A-B)));
else:
- label(btex \num{#4} etex rotated(angle(B-C)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
fi;
else:
if #4=0:
- label(btex ? etex rotated(angle(C-B)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex ? etex,1/2[B,C]-decalage*(unitvector(A-B)));
else:
- label(btex \num{#4} etex rotated(angle(C-B)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
fi;
fi;
fi;
@@ -5116,15 +5467,15 @@ vardef Positions(expr Step)=
else:
if angle(1/2[A,B]-C)>0:
if #5=0:
- label(btex ? etex rotated angle(A-B),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex ? etex,1/2[A,B]-decalage*(unitvector(C-B)));
else:
- label(btex \num{#5} etex rotated angle(A-B),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
else:
if #5=0:
- label(btex ? etex rotated angle(B-A),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex ? etex,1/2[A,B]-decalage*(unitvector(C-B)));
else:
- label(btex \num{#5} etex rotated angle(B-A),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
fi;
fi;
@@ -5142,10 +5493,9 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#8);
+ B:=B rotatedabout(O,#8);
+ C:=C rotatedabout(O,#8);
% On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
@@ -5231,7 +5581,7 @@ vardef Positions(expr Step)=
\fi
}
-\def\MPFigTrigoAngle#1#2#3#4#5#6{%
+\def\MPFigTrigoAngle#1#2#3#4#5#6#7{%
% #1 A
% #2 B
% #3 C
@@ -5252,12 +5602,10 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- numeric Anglelua;
- Anglelua=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Anglelua);
- B:=B rotatedabout(O,Anglelua);
- C:=C rotatedabout(O,Anglelua);
- % On définit le centre du cercle inscrit
+ A:=A rotatedabout(O,#7);
+ B:=B rotatedabout(O,#7);
+ C:=C rotatedabout(O,#7);
+ % On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
%on dessine à main levée :)
@@ -5275,34 +5623,32 @@ vardef Positions(expr Step)=
picture MAngle;
MAngle=image(
draw (cc shifted A);
-% draw (cc shifted B);
-% draw (cc shifted C);
);
draw MAngle;
clip currentpicture to triangle;
draw A{dir(angle(B-A)+5)}..B{dir(angle(B-A)+5)};
draw B{dir(angle(C-B)+5)}..C{dir(angle(C-B)+5)};
draw C{dir(angle(A-C)+5)}..A{dir(angle(A-C)+5)};
- %on labelise
+ % on labelise
label(btex #1 etex,1.15[O,A]);
label(btex #2 etex,1.15[O,B]);
label(btex #3 etex,1.15[O,C]);
label(btex ? etex,A+0.95u*unitvector(I-A));
decalage:=3mm;
if angle(1/2[A,C]-B)>0:
- label(btex \num{#6} etex rotated angle(C-A),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
else:
- label(btex \num{#6} etex rotated angle(A-C),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
fi;
if angle(1/2[B,C]-A)>0:
- label(btex \num{#4} etex rotated(angle(B-C)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
else:
- label(btex \num{#4} etex rotated(angle(C-B)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
fi;
if angle(1/2[A,B]-C)>0:
- label(btex \num{#5} etex rotated angle(A-B),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
else:
- label(btex \num{#5} etex rotated angle(B-A),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
\end{mplibcode}
\mplibcodeinherit{disable}
@@ -5318,10 +5664,9 @@ vardef Positions(expr Step)=
O - .5[A,B] = whatever * (B-A) rotated 90;
O - .5[B,C] = whatever * (C-B) rotated 90;
% On tourne pour éventuellement moins de lassitude :)
- Angle=uniformdeviate(180);%Caractère aléatoire
- A:=A rotatedabout(O,Angle);
- B:=B rotatedabout(O,Angle);
- C:=C rotatedabout(O,Angle);
+ A:=A rotatedabout(O,#7);
+ B:=B rotatedabout(O,#7);
+ C:=C rotatedabout(O,#7);
% On définit le centre du cercle inscrit
(I-C) rotated ((angle(A-C)-angle(B-C))/2) shifted C=whatever[A,C];
(I-B) rotated ((angle(C-B)-angle(A-B))/2) shifted B=whatever[B,C];
@@ -5340,8 +5685,6 @@ vardef Positions(expr Step)=
picture MAngle;
MAngle=image(
draw (cc shifted A);
-% draw (cc shifted B);
-% draw (cc shifted C);
);
draw MAngle;
clip currentpicture to triangle;
@@ -5355,25 +5698,25 @@ vardef Positions(expr Step)=
label(btex ? etex,A+0.95u*unitvector(I-A));
decalage:=3mm;
if angle(1/2[A,C]-B)>0:
- label(btex \num{#6} etex rotated angle(C-A),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
else:
- label(btex \num{#6} etex rotated angle(A-C),1.1[B,1/2[A,C]]);
+ label(btex \num{#6} etex,1.1[B,1/2[A,C]]);
fi;
if angle(1/2[B,C]-A)>0:
- label(btex \num{#4} etex rotated(angle(B-C)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
else:
- label(btex \num{#4} etex rotated(angle(C-B)),1/2[B,C]-decalage*(unitvector(A-B)));
+ label(btex \num{#4} etex,1/2[B,C]-decalage*(unitvector(A-B)));
fi;
if angle(1/2[A,B]-C)>0:
- label(btex \num{#5} etex rotated angle(A-B),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
else:
- label(btex \num{#5} etex rotated angle(B-A),1/2[A,B]-decalage*(unitvector(C-B)));
+ label(btex \num{#5} etex,1/2[A,B]-decalage*(unitvector(C-B)));
fi;
\end{mpost}
\fi
}
-\setKVdefault[ClesTrigo]{Angle=false,Propor=false,Figure=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false}%
+\setKVdefault[ClesTrigo]{Angle=0,Propor=false,Figure=false,FigureSeule=false,Precision=2,Unite=cm,Sinus=false,Cosinus=false,Tangente=false}%
\newcommand\TrigoCalculs[5][]{%
\setKV[ClesTrigo]{#1}%
@@ -5381,18 +5724,19 @@ vardef Positions(expr Step)=
% #2 Nom du triangle ABC, rectangle en B, angle connu ou pas : BAC
% #3 Longueur
% #4 Longueur
- %#5 angle
+ % #5 angle
% On définit les points
\StrMid{#2}{1}{1}[\NomA]%
\StrMid{#2}{2}{2}[\NomB]%
\StrMid{#2}{3}{3}[\NomC]%
- Dans le triangle $\NomA\NomB\NomC$, rectangle en $\NomB$, on a :
+ Dans le triangle $\NomA\NomB\NomC$, rectangle en $\NomB$, on a :%
\ifboolKV[ClesTrigo]{Cosinus}{%
\ifx\bla#3\bla%on calcule le côté adjacent
- \ifboolKV[ClesTrigo]{Propor}{%
- \begin{align*}
- \NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\
- \num{#4}\times\cos(\ang{#5})&=\NomA\NomB\\
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}%
+ \ifboolKV[ClesTrigo]{Propor}{%
+ \begin{align*}
+ \NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\
+ \num{#4}\times\cos(\ang{#5})&=\NomA\NomB\\
\num{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(\fpeval{#4*cosd(#5)},2)}}{=}{\approx}\NomA\NomB%
\end{align*}%
}{%
@@ -5400,12 +5744,12 @@ vardef Positions(expr Step)=
\cos(\widehat{\NomB\NomA\NomC})&=\frac{\NomA\NomB}{\NomA\NomC}\\
\cos(\ang{#5})&=\frac{\NomA\NomB}{\num{#4}}\\
\num{#4}\times\cos(\ang{#5})&=\NomA\NomB\\
- \num{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(\fpeval{#4*cosd(#5)},2)}}{=}{\approx}\NomA\NomB%
- \end{align*}%
+ \num{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(\fpeval{#4*cosd(#5)},2)}}{=}{\approx}\NomA\NomB
+ \end{align*}
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*cosd(#5)},\useKV[ClesTrigo]{Precision})}}%
- \else
+ \else%
\ifx\bla#4\bla%on calcule l'hypothénuse
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/cosd(#5)},\useKV[ClesTrigo]{Precision})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\
@@ -5421,8 +5765,8 @@ vardef Positions(expr Step)=
\NomA\NomC&\IfInteger{\fpeval{round(\fpeval{#3/cosd(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/cosd(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/cosd(#5)},\useKV[ClesTrigo]{Precision})}}%
\else%on calcule l'angle
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{acosd(#3/#4)})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomC\times\cos(\widehat{\NomB\NomA\NomC})&=\NomA\NomB\\
@@ -5437,12 +5781,12 @@ vardef Positions(expr Step)=
\widehat{\NomB\NomA\NomC}&\IfInteger{\fpeval{round(\fpeval{acosd(#3/#4)},2)}}{=}{\approx}\ang{\fpeval{round(\fpeval{acosd(#3/#4)})}}%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{acosd(#3/#4)})}}%
- \fi
- \fi
- }{}
+ \fi%
+ \fi%
+ }{}%
\ifboolKV[ClesTrigo]{Sinus}{%
\ifx\bla#3\bla%on calcule le côté opposé
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*sind(#5)},\useKV[ClesTrigo]{Precision})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
@@ -5457,26 +5801,26 @@ vardef Positions(expr Step)=
\num{\fpeval{round(\fpeval{#4*sind(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(\fpeval{#4*sind(#5)},2)}}{=}{\approx}\NomB\NomC%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*sind(#5)},\useKV[ClesTrigo]{Precision})}}%
\else
\ifx\bla#4\bla%on calcule l'hypothénuse
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}%
\ifboolKV[ClesTrigo]{Propor}{%
- \begin{align*}
- \NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
- \NomA\NomC\times\sin(\ang{#5})&=\num{#3}\\
- \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\
- \NomA\NomC&\IfInteger{\fpeval{round(\fpeval{#3/sind(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
- \end{align*}%
- }{
- \begin{align*}
- \sin(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomC}\\
- \sin(\ang{#5})&=\frac{\num{#3}}{\NomA\NomC}\\
- \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\
- \NomA\NomC&\IfInteger{\fpeval{round(\fpeval{#3/sind(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
- \end{align*}%
- }%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}%
- \else%on calcule l'angle
+ \begin{align*}
+ \NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
+ \NomA\NomC\times\sin(\ang{#5})&=\num{#3}\\
+ \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\
+ \NomA\NomC&\IfInteger{\fpeval{round(\fpeval{#3/sind(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
+ \end{align*}%
+ }{%
+ \begin{align*}
+ \sin(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomC}\\
+ \sin(\ang{#5})&=\frac{\num{#3}}{\NomA\NomC}\\
+ \NomA\NomC&=\frac{\num{#3}}{\sin(\ang{#5})}\\
+ \NomA\NomC&\IfInteger{\fpeval{round(\fpeval{#3/sind(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/sind(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
+ \end{align*}%
+ }%
+ \else%on calcule l'angle
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{asind(#3/#4)})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomC\times\sin(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
@@ -5491,12 +5835,12 @@ vardef Positions(expr Step)=
\widehat{\NomB\NomA\NomC}&\IfInteger{\fpeval{round(\fpeval{asind(#3/#4)},2)}}{=}{\approx}\ang{\fpeval{round(\fpeval{asind(#3/#4)})}}%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{asind(#3/#4)})}}%
- \fi
- \fi
- }{}
+ \fi%
+ \fi%
+ }{}%
\ifboolKV[ClesTrigo]{Tangente}{%
\ifx\bla#3\bla%on calcule le côté opposé
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*tand(#5)},\useKV[ClesTrigo]{Precision})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\%
@@ -5511,26 +5855,26 @@ vardef Positions(expr Step)=
\num{\fpeval{round(\fpeval{#4*tand(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}&\IfInteger{\fpeval{round(\fpeval{#4*tand(#5)},2)}}{=}{\approx}\NomB\NomC%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#4*tand(#5)},\useKV[ClesTrigo]{Precision})}}%
\else
\ifx\bla#4\bla%on calcule l'adjacent
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}%
\ifboolKV[ClesTrigo]{Propor}{%
- \begin{align*}
- \NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
- \NomA\NomB\times\tan(\ang{#5})&=\num{#3}\\
- \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\
- \NomA\NomB&\IfInteger{\fpeval{round(\fpeval{#3/tand(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
- \end{align*}%
- }{
- \begin{align*}
- \tan(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomB}\\
- \tan(\ang{#5})&=\frac{\num{#3}}{\NomA\NomB}\\
- \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\
- \NomA\NomB&\IfInteger{\fpeval{round(\fpeval{#3/tand(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
- \end{align*}%
- }%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}%
+ \begin{align*}
+ \NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
+ \NomA\NomB\times\tan(\ang{#5})&=\num{#3}\\
+ \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\
+ \NomA\NomB&\IfInteger{\fpeval{round(\fpeval{#3/tand(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
+ \end{align*}%
+ }{%
+ \begin{align*}
+ \tan(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomB}\\
+ \tan(\ang{#5})&=\frac{\num{#3}}{\NomA\NomB}\\
+ \NomA\NomB&=\frac{\num{#3}}{\tan(\ang{#5})}\\
+ \NomA\NomB&\IfInteger{\fpeval{round(\fpeval{#3/tand(#5)},2)}}{=}{\approx}\num{\fpeval{round(\fpeval{#3/tand(#5)},\useKV[ClesTrigo]{Precision})}}~\text{\useKV[ClesTrigo]{Unite}}%
+ \end{align*}%
+ }%
\else%on calcule l'angle
+ \xdef\ResultatTrigo{\fpeval{round(\fpeval{atand(#3/#4)})}}%
\ifboolKV[ClesTrigo]{Propor}{%
\begin{align*}
\NomA\NomB\times\tan(\widehat{\NomB\NomA\NomC})&=\NomB\NomC\\
@@ -5538,18 +5882,17 @@ vardef Positions(expr Step)=
\tan(\widehat{\NomB\NomA\NomC})&=\frac{\num{#3}}{\num{#4}}\\
\widehat{\NomB\NomA\NomC}&\IfInteger{\fpeval{round(\fpeval{atand(#3/#4)},2)}}{=}{\approx}\ang{\fpeval{round(\fpeval{atand(#3/#4)})}}%
\end{align*}%
- }{
+ }{%
\begin{align*}
\tan(\widehat{\NomB\NomA\NomC})&=\frac{\NomB\NomC}{\NomA\NomB}\\
\tan(\widehat{\NomB\NomA\NomC})&=\frac{\num{#3}}{\num{#4}}\\
\widehat{\NomB\NomA\NomC}&\IfInteger{\fpeval{round(\fpeval{atand(#3/#4)},2)}}{=}{\approx}\ang{\fpeval{round(\fpeval{atand(#3/#4)})}}%
\end{align*}%
}%
- \xdef\ResultatTrigo{\fpeval{round(\fpeval{atand(#3/#4)})}}%
- \fi
- \fi
- }{}
-}
+ \fi%
+ \fi%
+ }{}%
+}%
\newcommand\Trigo[5][]{%
\useKVdefault[ClesTrigo]%
@@ -5557,77 +5900,114 @@ vardef Positions(expr Step)=
% #1 Clés
% #2 Nom du triangle ABC, rectangle en B, angle connu ou pas : BAC
% #3 Longueur
- % #4 Longueur ou angle en fonction du calcul à faire. Si longueur, #3<#4
+ % #4 Longueur
+ % #5 angle
% On définit les points
\StrMid{#2}{1}{1}[\NomA]%
\StrMid{#2}{2}{2}[\NomB]%
\StrMid{#2}{3}{3}[\NomC]%
% On rédige
- \ifboolKV[ClesTrigo]{Figure}{%
- \begin{multicols}{2}%
- {\em La figure est donnée à titre indicatif.}%
- \ifboolKV[ClesTrigo]{Angle}{%figure pour calculer un angle
+ \ifboolKV[ClesTrigo]{FigureSeule}{%
+ \ifx#5\bla\bla%
+ \ifboolKV[ClesTrigo]{Cosinus}{%
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{}{#3}{#4}{\useKV[ClesTrigo]{Angle}}
+ }{}%
+ \ifboolKV[ClesTrigo]{Sinus}{%
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{}{#4}{\useKV[ClesTrigo]{Angle}}
+ }{}%
+ \ifboolKV[ClesTrigo]{Tangente}{%
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{}{\useKV[ClesTrigo]{Angle}}
+ }{}%
+ \else%}{%figure pour calculer une longueur
+ \ifboolKV[ClesTrigo]{Cosinus}{%
+ \ifx#3\bla\bla%adjacent inconnu
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{0}{#4}{#5}{\useKV[ClesTrigo]{Angle}}
+ \else
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{#3}{0}{#5}{\useKV[ClesTrigo]{Angle}}
+ \fi
+ }{}%
+ \ifboolKV[ClesTrigo]{Sinus}{%
+ \ifx#3\bla\bla%adjacent inconnu
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{-1}{#4}{#5}{\useKV[ClesTrigo]{Angle}}
+ \else
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{-1}{0}{#5}{\useKV[ClesTrigo]{Angle}}
+ \fi
+ }{}%
+ \ifboolKV[ClesTrigo]{Tangente}{%
+ \ifx#3\bla\bla%adjacent inconnu
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{#4}{-1}{#5}{\useKV[ClesTrigo]{Angle}}
+ \else%
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{0}{-1}{#5}{\useKV[ClesTrigo]{Angle}}
+ \fi%
+ }{}%
+ \fi%
+ }{%
+ \ifboolKV[ClesTrigo]{Figure}{%
+ \begin{multicols}{2}%
+ {\em La figure est donnée à titre indicatif.}%
+ \ifx#5\bla\bla%
\ifboolKV[ClesTrigo]{Cosinus}{%
\begin{center}
- \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{}{#3}{#4}
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{}{#3}{#4}{\useKV[ClesTrigo]{Angle}}
\end{center}
}{}%
\ifboolKV[ClesTrigo]{Sinus}{%
\begin{center}
- \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{}{#4}
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{}{#4}{\useKV[ClesTrigo]{Angle}}
\end{center}
}{}%
\ifboolKV[ClesTrigo]{Tangente}{%
\begin{center}
- \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{}
+ \MPFigTrigoAngle{\NomA}{\NomB}{\NomC}{#3}{#4}{}{\useKV[ClesTrigo]{Angle}}
\end{center}
}{}%
- }{%figure pour calculer une longueur
+ \else%}{%figure pour calculer une longueur
\ifboolKV[ClesTrigo]{Cosinus}{%
\ifx#3\bla\bla%adjacent inconnu
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{0}{#4}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{0}{#4}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\else
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{#3}{0}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{-1}{#3}{0}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\fi
}{}%
\ifboolKV[ClesTrigo]{Sinus}{%
\ifx#3\bla\bla%adjacent inconnu
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{-1}{#4}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{-1}{#4}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\else
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{-1}{0}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{-1}{0}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\fi
}{}%
\ifboolKV[ClesTrigo]{Tangente}{%
\ifx#3\bla\bla%adjacent inconnu
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{#4}{-1}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{0}{#4}{-1}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\else%
\begin{center}
- \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{0}{-1}{#5}
+ \MPFigTrigo{\NomA}{\NomB}{\NomC}{#3}{0}{-1}{#5}{\useKV[ClesTrigo]{Angle}}
\end{center}
\fi%
}{}%
- }%
- \par\columnbreak\par
- \TrigoCalculs{#2}{#3}{#4}{#5}%
- \end{multicols}
- }{%
- \TrigoCalculs{#2}{#3}{#4}{#5}%
+ \fi%
+ \par\columnbreak\par
+ \TrigoCalculs[#1]{#2}{#3}{#4}{#5}%
+ \end{multicols}
+ }{%
+ \TrigoCalculs[#1]{#2}{#3}{#4}{#5}%
+ }%
}%
}%
-%%%%%%%%%%%%%%%
-%% Statistiques
-%%%%%%%%%%%%%%%
+%%%
+% Statistiques
+%%%
\newcommand\NbDonnees{}
\newcommand\SommeDonnees{}%
\newcommand\EffectifTotal{}%
@@ -5638,104 +6018,183 @@ vardef Positions(expr Step)=
\newcommand\DonneeMin{}%
\newcommand\EffectifMax{}%
-\setKVdefault[ClesStat]{Tableau=false,Frequence=false,EffectifTotal=false,Etendue=false,Moyenne=false,SET=false,Mediane=false,Total=false,Concret=false,Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif(s),Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,Graphique=false,Batons=true,Unitex=0.5,Unitey=0.5,Rayon=3cm,AffichageAngle=false,Liste=false,ECC=false,Coupure=10,ColorTab=gray!15}
+\setKVdefault[ClesStat]{ColVide=0,EffVide=false,%
+FreqVide=false,AngVide=false,ECCVide=false,TotalVide=false,Sondage=false,%
+Tableau=false,Stretch=1,Frequence=false,EffectifTotal=false,%
+Etendue=false,Moyenne=false,SET=false,Mediane=false,Total=false,Concret=false,%
+Unite={},Largeur=1cm,Precision=2,Donnee=Valeurs,Effectif=Effectif,Origine=0,Angle=false,SemiAngle=false,Qualitatif=false,TableauVide=false,Graphique=false,Batons=true,Unitex=0.5,Unitey=0.5,Rayon=3cm,AffichageAngle=false,Liste=false,ECC=false,Coupure=10,CouleurTab=gray!15,ListeCouleurs={white},Hachures=false,Inverse=false,AbscisseRotation=false}
% La construction du tableau
\def\addtotok#1#2{#1\expandafter{\the#1#2}}
\newtoks\tabtoksa\newtoks\tabtoksb\newtoks\tabtoksc
-\def\updatetoks#1/#2\nil{\addtotok\tabtoksa{&\num{#1}}\addtotok\tabtoksb{&\num{#2}}}
-\def\buildtab{%
+\def\updatetoks#1/#2\nil{\addtotok\tabtoksa{\ifboolKV[ClesStat]{Qualitatif}{&#1}{&\num{#1}}}\addtotok\tabtoksb{&\num{#2}}}
+\def\buildtab{% %%Tableau sans total
\tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}%
\foreachitem\compteur\in\ListeComplete{\expandafter\updatetoks\compteur\nil}%
\[%
- \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{ColorTab}}}c|*{\number\numexpr\ListeCompletelen}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
+ %\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{\ListeComplete[##1,2]}%
+ \renewcommand{\arraystretch}{\useKV[ClesStat]{Stretch}}%
+ \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{CouleurTab}}}c|*{\number\numexpr\ListeCompletelen}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
\hline%
- \rowcolor{\useKV[ClesStat]{ColorTab}}\the\tabtoksa\\\hline%
- \the\tabtoksb\\\hline%
- \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculFrequence{##1}}}\\\hline}{}%
- \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculAngle{##1}}}\\\hline}{}%
- \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\CalculSemiAngle{##1}}\\\hline}{}%
- \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculECC{##1}}}\\\hline}{}%
- \end{tabular}
+ \rowcolor{\useKV[ClesStat]{CouleurTab}}\the\tabtoksa\\\hline%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}<1%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\the\tabtoksb}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}>\ListeCompletelen%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\the\tabtoksb}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}=1%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}=\ListeCompletelen%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ListeComplete[##1,2]}}&\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ListeComplete[##1,2]}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculSemiAngle{##1}}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}\\\hline}{}%
+ \end{tabular}
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \renewcommand{\arraystretch}{1}%
\]
}
-\def\buildtabt{%
+\def\buildtabt{% %%Tableau avec total
\tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}%
\foreachitem\compteur\in\ListeComplete{\expandafter\updatetoks\compteur\nil}%
- \[%
- \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{ColorTab}}}c|*{\number\numexpr\ListeCompletelen+1}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
+ \[%
+ \renewcommand{\arraystretch}{\useKV[ClesStat]{Stretch}}%
+ \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{CouleurTab}}}c|*{\number\numexpr\ListeCompletelen+1}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
\hline%
- \rowcolor{\useKV[ClesStat]{ColorTab}}\the\tabtoksa&Total\\\hline%
- \the\tabtoksb&\ifboolKV[ClesStat]{TableauVide}{}{\num{\EffectifTotal}}%
- \\\hline%
- \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculFrequence{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{100}\\\hline}{}%
- \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculAngle{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{360}\\\hline}{}%
- \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculSemiAngle{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{180}\\\hline}{}%
- \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculECC{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{\num{\EffectifTotal}}\\\hline}{}%
+ \rowcolor{\useKV[ClesStat]{CouleurTab}}\the\tabtoksa&Total\\\hline%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}<1%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen+1}}\do{&}}{\the\tabtoksb&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}%
\end{tabular}
- \]
-}
-
-\def\updatetoksq#1/#2\nil{\addtotok\tabtoksa{&#1}\addtotok\tabtoksb{&\num{#2}}}
-\def\buildtabq{%
- \tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}%
- \foreachitem\compteur\in\ListeComplete{\expandafter\updatetoksq\compteur\nil}%
- \[%
- \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{ColorTab}}}c|*{\number\numexpr\ListeCompletelen}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
- \hline%
- \rowcolor{\useKV[ClesStat]{ColorTab}}\the\tabtoksa\\\hline%
- \the\tabtoksb\\\hline%
- \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculFrequence{##1}}}\\\hline}{}%
- \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculAngle{##1}}}\\\hline}{}%
- \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculSemiAngle{##1}}}\\\hline}{}%
- \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculECC{##1}}}\\\hline}{}%
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}>\ListeCompletelen%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen+1}}\do{&}}{\the\tabtoksb&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}%
\end{tabular}
- \]
-}
-
-\def\buildtabqt{%
- \tabtoksa{\useKV[ClesStat]{Donnee}}\tabtoksb{\useKV[ClesStat]{Effectif}}%
- \foreachitem\compteur\in\ListeComplete{\expandafter\updatetoksq\compteur\nil}%
- \[%
- \begin{tabular}{|>{\columncolor{\useKV[ClesStat]{ColorTab}}}c|*{\number\numexpr\ListeCompletelen+1}{>{\centering\arraybackslash}p{\useKV[ClesStat]{Largeur}}|}}%
- \hline%
- \rowcolor{\useKV[ClesStat]{ColorTab}}\the\tabtoksa&Total\\\hline%
- \the\tabtoksb&\num{\EffectifTotal}\\\hline%
- \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculFrequence{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{100}\\\hline}{}%
- \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculAngle{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{360}\\\hline}{}%
- \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculSemiAngle{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{180}\\\hline}{}%
- \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\CalculECC{##1}}}&\ifboolKV[ClesStat]{TableauVide}{}{\num{\EffectifTotal}}\\\hline}{}%
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}=1%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen+1}}\do{&}}{\useKV[ClesStat]{Effectif}&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.&\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifnum\number\numexpr\useKV[ClesStat]{ColVide}=\ListeCompletelen%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen+1}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ListeComplete[##1,2]}&&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}%
+ \end{tabular}
+ \else%
+ \ifboolKV[ClesStat]{EffVide}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen+1}}\do{&}}{\useKV[ClesStat]{Effectif}\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ListeComplete[##1,2]}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ListeComplete[##1,2]}&\ifboolKV[ClesStat]{TotalVide}{}{\num{\EffectifTotal}}}\\\hline%
+ \ifboolKV[ClesStat]{Frequence}{Fréquence (\%)\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{\CalculFrequence{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{FreqVide}{}{100}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{Angle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{360}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{SemiAngle}{Angle (\si{\degree})\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{\CalculSemiAngle{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{AngVide}{}{180}}}\\\hline}{}%
+ \ifboolKV[ClesStat]{ECC}{E.C.C.\xintFor* ##1 in {\xintSeq {1}{\number\numexpr\useKV[ClesStat]{ColVide}-1}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\xintFor* ##1 in {\xintSeq {\number\numexpr\useKV[ClesStat]{ColVide}+1}{\ListeCompletelen}}\do{&\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\CalculECC{##1}}}}&\ifboolKV[ClesStat]{TotalVide}{}{\ifboolKV[ClesStat]{TableauVide}{}{\ifboolKV[ClesStat]{ECCVide}{}{\num{\EffectifTotal}}}}\\\hline}{}%
\end{tabular}
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+ \renewcommand{\arraystretch}{1}%
\]
}
% Pour construire le diagramme en bâtons
\def\Updatetoks#1/#2\nil{\addtotok\toklistepoint{(#1,#2),}}
-\def\buildgraph{%
- \newtoks\toklistepoint
+\newcommand\buildgraph[1][]{%
+ \newtoks\toklistepoint
\foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoks\compteur\nil}%
- \[\MPStat{\useKV[ClesStat]{Unitex}}{\useKV[ClesStat]{Unitey}}{\the\toklistepoint}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}\]%
+ \[\MPStat[#1]{\useKV[ClesStat]{Unitex}}{\useKV[ClesStat]{Unitey}}{\the\toklistepoint}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]%
}%
% Pour construire le diagramme en bâtons qualitatif
\def\Updatetoksq#1/#2\nil{\addtotok\toklistepointq{"#1",#2,}}
-\def\buildgraphq{%
+\newcommand\buildgraphq[1][]{%
\newtoks\toklistepointq
- \toklistepointq{}
\foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}
- \[\MPStatQ{2*\useKV[ClesStat]{Unitex}}{0.5*\useKV[ClesStat]{Unitey}}{\the\toklistepointq}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}\]
+ \[\MPStatQ[#1]{2*\useKV[ClesStat]{Unitex}}{0.5*\useKV[ClesStat]{Unitey}}{\the\toklistepointq}{\useKV[ClesStat]{Donnee}}{\useKV[ClesStat]{Effectif}}{\useKV[ClesStat]{Origine}}{\useKV[ClesStat]{AbscisseRotation}}\]
}
+
+\def\UpdateCoul#1\nil{\addtotok\toklistecouleur{#1,}}%
+
% Pour construire le diagramme circulaire qualitatif
\def\buildgraphcq#1{%
\newtoks\toklistepointq%
\toklistepointq{}%
+ \newtoks\toklistecouleur%
+ \toklistecouleur{}%
+ %
\foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}%
+ \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleurs}}%
+ \readlist*\ListeCouleur{\ListeAvantCouleurs}%
+ \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}%
\ifboolKV[ClesStat]{AffichageAngle}{%
- \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}\]%
+ \ifboolKV[ClesStat]{Hachures}{%
+ \ifboolKV[ClesStat]{Inverse}{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{1}{1}\]%
+ }{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{1}{0}\]%
+ }%
+ }{%
+ \ifboolKV[ClesStat]{Inverse}{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{0}{1}\]%
+ }{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{1}{\the\toklistecouleur}{0}{0}\]%
+ }%
+ }%
}{%
- \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}\]%
+ \ifboolKV[ClesStat]{Hachures}{%
+ \ifboolKV[ClesStat]{Inverse}{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{1}{1}\]%
+ }{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{1}{0}\]%
+ }%
+ }{%
+ \ifboolKV[ClesStat]{Inverse}{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{0}{1}\]%
+ }{%
+ \[\MPStatCirculaireQ{\useKV[ClesStat]{Rayon}}{\the\toklistepointq}{#1}{0}{\the\toklistecouleur}{0}{0}\]%
+ }%
+ }%
}%
}%
@@ -5767,92 +6226,103 @@ vardef Positions(expr Step)=
\num{\TotalECC}%
}
-% la construction du graphique
-\def\MPStat#1#2#3#4#5#6{%
+% la construction du graphique en bâtons pour quantitatif
+\newcommand\MPStat[8][]{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
maxx:=0;
maxy:=0;
- unitex:=#1*cm;
- unitey:=#2*cm;
+ unitex:=#2*cm;
+ unitey:=#3*cm;
pair A[],B[],P[];
n:=0;
vardef toto(text t)=
for p_=t:
if pair p_:
n:=n+1;
- P[n]=((xpart(p_)-(#6))*unitex,ypart(p_)*unitey);
+ P[n]=((xpart(p_)-(#7))*unitex,ypart(p_)*unitey);
if xpart(p_)>maxx:
- maxx:=xpart(p_)-(#6);
+ maxx:=xpart(p_)-(#7);
fi;
if ypart(p_)>maxy:
maxy:=ypart(p_);
fi;
- A[n]=unitex*(xpart(p_)-(#6),0);
+ A[n]=unitex*(xpart(p_)-(#7),0);
B[n]=unitey*(0,ypart(p_));
+ if (#8):
+ label.bot(TEX("\num{"&decimal(xpart(p_))&"}") rotated 90,A[n]);
+ else :
label.bot(TEX("\num{"&decimal(xpart(p_))&"}"),A[n]);
+ fi;
label.lft(TEX("\num{"&decimal(ypart(p_))&"}"),B[n]);
fi;
endfor;
enddef;
- toto(#3);
+ toto(#4);
for k=1 upto n:
draw A[k]--P[k] withpen pencircle scaled 2bp;
draw B[k]--P[k] dashed evenly;
endfor;
drawarrow (0,0)--unitex*(maxx+1,0);
drawarrow (0,0)--unitey*(0,maxy+1);
- label.lrt(btex #4 etex,unitex*(maxx+1,0));
- label.urt(btex #5 etex,unitey*(0,maxy+1));
+ label.lrt(btex #5 etex,unitex*(maxx+1,0));
+ label.urt(btex #6 etex,unitey*(0,maxy+1));
\end{mplibcode}
\else
+ \mpxcommands{%
+ \setKV[ClesStat]{#1}%
+ }
\begin{mpost}
maxx:=0;
maxy:=0;
- unitex:=#1*cm;
- unitey:=#2*cm;
+ unitex:=#2*cm;
+ unitey:=#3*cm;
pair A[],B[],P[];
n:=0;
vardef toto(text t)=
for p_=t:
if pair p_:
n:=n+1;
- P[n]=((xpart(p_)-(#6))*unitex,ypart(p_)*unitey);
+ P[n]=((xpart(p_)-(#7))*unitex,ypart(p_)*unitey);
if xpart(p_)>maxx:
- maxx:=xpart(p_)-(#6);
+ maxx:=xpart(p_)-(#7);
fi;
if ypart(p_)>maxy:
maxy:=ypart(p_);
fi;
- A[n]=unitex*(xpart(p_)-(#6),0);
+ A[n]=unitex*(xpart(p_)-(#7),0);
B[n]=unitey*(0,ypart(p_));
+ if (#8):
+ label.bot(LATEX("\num{"&decimal(xpart(p_))&"}") rotated 90,A[n]);
+ else :
label.bot(LATEX("\num{"&decimal(xpart(p_))&"}"),A[n]);
+ fi;
label.lft(LATEX("\num{"&decimal(ypart(p_))&"}"),B[n]);
fi;
endfor;
enddef;
- toto(#3);
+ toto(#4);
for k=1 upto n:
draw A[k]--P[k] withpen pencircle scaled 2bp;
draw B[k]--P[k] dashed evenly;
endfor;
drawarrow (0,0)--unitex*(maxx+1,0);
drawarrow (0,0)--unitey*(0,maxy+1);
- label.lrt(btex #4 etex,unitex*(maxx+1,0));
- label.urt(btex #5 etex,unitey*(0,maxy+1));
+ label.lrt(\btex \useKV[ClesStat]{Donnee} etex,unitex*(maxx+1,0));
+ label.urt(\btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+1));
\end{mpost}
\fi
}
-% la construction du graphique qualitatif
-\def\MPStatQ#1#2#3#4#5#6{%
+% la construction du graphique en bâtons pour qualitatif
+\newcommand\MPStatQ[8][]{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
maxy:=0;
- unitex:=#1*cm;
- unitey:=#2*cm;
+ unitex:=#2*cm;
+ unitey:=#3*cm;
pair A[],B[],P[];
n:=0;
vardef toto(text t)=
@@ -5867,25 +6337,32 @@ vardef Positions(expr Step)=
n:=n+1;
else:
A[n]=unitex*(n+1,0);
+ if (#8):
label.bot(TEX(p_) rotated 90,A[n]);
+ else :
+ label.bot(TEX(p_),A[n]);
+ fi;
fi;
endfor;
enddef;
- toto(#3);
+ toto(#4);
for k=0 upto n-1:
draw A[k]--P[k] withpen pencircle scaled 2bp;
draw B[k]--P[k] dashed evenly;
endfor;
drawarrow (0,0)--unitex*(n+1,0);
drawarrow (0,0)--unitey*(0,maxy+1);
- label.lrt(btex #4 etex,unitex*(n+1,0));
- label.urt(btex #5 etex,unitey*(0,maxy+1));
+ label.lrt(btex #5 etex,unitex*(n+1,0));
+ label.urt(btex #6 etex,unitey*(0,maxy+1));
\end{mplibcode}
\else
+ \mpxcommands{%
+ \setKV[ClesStat]{#1}%
+ }
\begin{mpost}
maxy:=0;
- unitex:=#1*cm;
- unitey:=#2*cm;
+ unitex:=#2*cm;
+ unitey:=#3*cm;
pair A[],B[],P[];
n:=0;
vardef toto(text t)=
@@ -5900,25 +6377,29 @@ vardef Positions(expr Step)=
n:=n+1;
else:
A[n]=unitex*(n+1,0);
+ if (#8):
label.bot(LATEX(p_) rotated 90,A[n]);
+ else :
+ label.bot(LATEX(p_),A[n]);
+ fi;
fi;
endfor;
enddef;
- toto(#3);
+ toto(#4);
for k=0 upto n-1:
draw A[k]--P[k] withpen pencircle scaled 2bp;
draw B[k]--P[k] dashed evenly;
endfor;
drawarrow (0,0)--unitex*(n+1,0);
drawarrow (0,0)--unitey*(0,maxy+1);
- label.lrt(btex #4 etex,unitex*(n+1,0));
- label.urt(btex #5 etex,unitey*(0,maxy+1));
+ label.lrt(\btex \useKV[ClesStat]{Donnee} etex,unitex*(n+1,0));
+ label.urt(\btex \useKV[ClesStat]{Effectif} etex,unitey*(0,maxy+1));
\end{mpost}
\fi
}
% la construction du graphique qualitatif
-\def\MPStatCirculaireQ#1#2#3#4{%
+\def\MPStatCirculaireQ#1#2#3#4#5#6#7{%
\ifluatex
\mplibforcehmode
\begin{mplibcode}
@@ -5930,13 +6411,20 @@ vardef Positions(expr Step)=
ang[0]:=0;
path cc;
cc=(fullcircle scaled (2*#1));
- if #3=360:
- draw cc;
+ % on récupère les couleurs
+ color Col[];
+ n:=0;
+ for p_=#5:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ if #7=0:
+ A[0]=point(0) of cc;
else:
- draw (subpath(0,length cc/2) of cc)--cycle;
+ A[0]=point(180) of cc;
fi;
- A[0]=point(0) of cc;
vardef toto(text t)=
+ n:=0;
for p_=t:
if numeric p_:
n:=n+1;
@@ -5951,28 +6439,65 @@ vardef Positions(expr Step)=
for p_=t:
if numeric p_:
n:=n+1;
+ if #7=0:
A[n]=A[n-1] rotatedabout(O,p_*(#3/total[N]));
- draw A[n-1]--O--A[n];
+ else:
+ A[n]=A[n-1] rotatedabout(O,-p_*(#3/total[N]));
+ fi;
+ %hachure ou pas ?
+ if #6=0:
+ fill (O--if #7=0:arccercle(A[n-1],A[n],O) else:
+ arccercle(A[n],A[n-1],O) fi--cycle) withcolor if unknown Col[n]: white else:Col[n] fi;
+ else:
+ draw
+ hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
+ else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if
+ (n mod 2)=0: +90 else: -90 fi,0.25,if (n mod 2)=0 : 0 else: 1 fi)
+ if #4=1: withcolor 0.5white fi;
+ fi;
+ draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi;
% Affichage des angles associés
if #4=1:
if round(p_*(#3/total[N]))>15:
if (n mod 2)=0:
- marque_a:=0.9*20
+ marque_a:=3.1*20
else:
- marque_a:=1.1*20/0.9
+ marque_a:=3.1*20/0.9
+ fi;
+ if #6=1:
+ if #7=0:
+ undraw
+ Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ else:
+ undraw
+ Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ fi;
+ fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor
+ blanc;
+ fi;
+ if #7=0:
+ draw
+ Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ else:
+ draw
+ Codeangle(A[n],O,A[n-1],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
fi;
- draw Codeangle(A[n-1],O,A[n],0,(((TEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")) scaled 0.5)));
fi;
fi;
%
fi;
endfor;
+ if #3=360:
+ draw cc if #6=1: withpen pencircle scaled2 fi;
+ else:
+ draw (subpath(0,length cc/2) of cc)--cycle if #6=1: withpen pencircle scaled2 fi;;
+ fi;
n:=0;
path cd[];
for p_=t:
if string p_:
n:=n+1;
- C[n]=A[n-1] rotatedabout(O,(ang[n]-ang[n-1])/2);
+ C[n]=A[n-1] rotatedabout(O,if #7=1:-1* fi(ang[n]-ang[n-1])/2);
draw 0.95[O,C[n]]--1.05[O,C[n]];
C[n]:=1.05[O,C[n]];
if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
@@ -6002,7 +6527,7 @@ vardef Positions(expr Step)=
toto(#2);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfC-Geometrie;}]
+ \begin{mpost}%[mpsettings={input PfC-Geometrie;}]
pair A[],O,B[],C[],D[];
O=(0,0);
n:=0;
@@ -6011,13 +6536,20 @@ vardef Positions(expr Step)=
ang[0]:=0;
path cc;
cc=(fullcircle scaled (2*#1));
- if #3=360:
- draw cc;
+ % on récupère les couleurs
+ color Col[];
+ n:=0;
+ for p_=#5:
+ n:=n+1;
+ Col[n]=p_;
+ endfor;
+ if #7=0:
+ A[0]=point(0) of cc;
else:
- draw (subpath(0,length cc/2) of cc)--cycle;
+ A[0]=point(180) of cc;
fi;
- A[0]=point(0) of cc;
vardef toto(text t)=
+ n:=0;
for p_=t:
if numeric p_:
n:=n+1;
@@ -6032,28 +6564,65 @@ vardef Positions(expr Step)=
for p_=t:
if numeric p_:
n:=n+1;
+ if #7=0:
A[n]=A[n-1] rotatedabout(O,p_*(#3/total[N]));
- draw A[n-1]--O--A[n];
+ else:
+ A[n]=A[n-1] rotatedabout(O,-p_*(#3/total[N]));
+ fi;
+ %hachure ou pas ?
+ if #6=0:
+ fill (O--if #7=0:arccercle(A[n-1],A[n],O) else:
+ arccercle(A[n],A[n-1],O) fi--cycle) withcolor if unknown Col[n]: white else:Col[n] fi;
+ else:
+ draw
+ hachurage((O--if #7=0:arccercle(A[n-1],A[n],O)
+ else:arccercle(A[n],A[n-1],O) fi--cycle),p_*(#3/total[N]) if
+ (n mod 2)=0: +90 else: -90 fi,0.25,if (n mod 2)=0 : 0 else: 1 fi)
+ if #4=1: withcolor 0.5white fi;
+ fi;
+ draw A[n-1]--O--A[n] if #6=1: withpen pencircle scaled2 fi;
% Affichage des angles associés
if #4=1:
if round(p_*(#3/total[N]))>15:
if (n mod 2)=0:
- marque_a:=0.9*20
+ marque_a:=3.1*20
else:
- marque_a:=1.1*20/0.9
+ marque_a:=3.1*20/0.9
+ fi;
+ if #6=1:
+ if #7=0:
+ undraw
+ Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ else:
+ undraw
+ Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ fi;
+ fill cercles(w shifted(marque_ang*unitvector(w-O)),3mm) withcolor
+ blanc;
+ fi;
+ if #7=0:
+ draw
+ Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
+ else:
+ draw
+ Codeangle(A[n],O,A[n-1],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")))));
fi;
- draw Codeangle(A[n-1],O,A[n],0,(((LATEX("\ang{"&decimal(round(p_*(#3/total[N])))&"}")) scaled 0.5)));
fi;
fi;
%
fi;
endfor;
+ if #3=360:
+ draw cc if #6=1: withpen pencircle scaled2 fi;
+ else:
+ draw (subpath(0,length cc/2) of cc)--cycle if #6=1: withpen pencircle scaled2 fi;;
+ fi;
n:=0;
path cd[];
for p_=t:
if string p_:
n:=n+1;
- C[n]=A[n-1] rotatedabout(O,(ang[n]-ang[n-1])/2);
+ C[n]=A[n-1] rotatedabout(O,if #7=1:-1* fi(ang[n]-ang[n-1])/2);
draw 0.95[O,C[n]]--1.05[O,C[n]];
C[n]:=1.05[O,C[n]];
if (xpart(C[n])>xpart(O)) and (ypart(C[n])>ypart(O)):
@@ -6089,8 +6658,16 @@ vardef Positions(expr Step)=
\DTLgnewdb{mtdb}%
\dtlexpandnewvalue%
\newcount\nbdonnees%
-
-
+%
+\def\AjoutListEEaa#1\nil{\addtotok\tabtoksEEa{#1,}}%
+\def\AjoutListEEab#1\nil{\addtotok\tabtoksEEa{#1/}}%
+\def\AjoutListEEb#1\nil{\addtotok\tabtoksEEb{#1,}}%
+\def\AjoutListEEx#1\nil{\addtotok\tabtoksEE{#1,}}%
+\def\AjoutListEEy#1\nil{\addtotok\tabtoksEE{#1/}}%
+
+\DTLgnewdb{mtdbEE}%
+\DTLgnewdb{mtdbEEqual}%
+%
\newcommand\Stat[2][]{%
\useKVdefault[ClesStat]%
\setKV[ClesStat]{#1}%
@@ -6104,11 +6681,89 @@ vardef Positions(expr Step)=
}%
\readlist*\ListeComplete{\foo}%
\setKV[ClesStat]{Qualitatif}%
+ }{
+ \ifboolKV[ClesStat]{Sondage}{%
+ \setsepchar{,}\ignoreemptyitems%
+ \readlist*\Liste{#2}%
+ % "liste vide"
+ \newtoks\tabtoksEEa%
+ \tabtoksEEa{}%
+ %
+ % "liste vide"
+ \newtoks\tabtoksEEb%
+ \tabtoksEEb{}%
+ %
+ \readlist*\ListeSansDoublonsEE{999}% %% Pour ne pas avoir une liste vide
+ %
+ \newcount\cmptEE%
+ \newcount\PasNumEE% %% Permettra de savoir si ce sondage est qualitatif ou quantitatif
+ \PasNumEE=0\relax%
+ \DTLcleardb{mtdbEE}%
+ % on range les resultats du sondage par ordre croissant.
+ \foreachitem\x\in\Liste{%
+ \DTLnewrow{mtdbEE}%
+ \DTLnewdbentry{mtdbEE}{Numeric}{\x}%
+ }%
+ \dtlsort{Numeric}{mtdbEE}{\dtlicompare}%
+ \DTLforeach{mtdbEE}{\nba=Numeric}{%
+ \IfDecimal{\nba}{}{\PasNumEE=\numexpr\PasNumEE+1\relax}%
+ \cmptEE=0\relax%
+ \foreachitem\nbb\in\ListeSansDoublonsEE{%
+ \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}%
+ }%
+ \ifthenelse{\equal{\the\cmptEE}{0}}{%
+ \expandafter\AjoutListEEb\nba\nil%
+ \xdef\listEEa{\the\tabtoksEEb}%
+ \ignoreemptyitems%
+ \setsepchar{,}%
+ \readlist*\ListeSansDoublonsEE\listEEa% %%% Enlève tous les élements
+ %%% identiques de Liste
+ }{}%
+ }%
+ \foreachitem\nba\in\ListeSansDoublonsEE{%
+ \cmptEE=0\relax%
+ \DTLforeach{mtdbEE}{\nbb=Numeric}{%
+ \ifthenelse{\equal{\nba}{\nbb}}{\cmptEE=\numexpr\cmptEE+1\relax}{}%
+ }%
+ \expandafter\AjoutListEEab\nba\nil%
+ \expandafter\AjoutListEEaa\the\cmptEE\nil% %%% Compte tous les élements
+ %%% identiques de Liste
+ }%
+ \xdef\listEEb{\the\tabtoksEEa}
+ \ignoreemptyitems%
+ \setsepchar[*]{,*/}
+ \readlist*\ListeComplete\listEEb%
+ %
+ \ifthenelse{\equal{\the\PasNumEE}{0}}{\setKV[ClesStat]{Quantitatif}}{\setKV[ClesStat]{Qualitatif}}%
}{%
+ \ifboolKV[ClesStat]{Qualitatif}{%
% % on lit la liste écrite sous la forme valeur/effectif
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListeComplete{#2}%
- }
+ }{% Dans le qualitatif, on trie d'abord les valeurs.
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListeInitiale{#2}%
+% "liste vide"
+ \newtoks\tabtoksEE%
+ \tabtoksEE{}%
+ \DTLcleardb{mtdbEEqual}%
+ \foreachitem\x\in\ListeInitiale{%
+ \DTLnewrow{mtdbEEqual}%
+ \itemtomacro\ListeInitiale[\xcnt,1]\x%
+ \DTLnewdbentry{mtdbEEqual}{Val}{\x}%
+ \itemtomacro\ListeInitiale[\xcnt,2]\y%
+ \DTLnewdbentry{mtdbEEqual}{Eff}{\y}%
+ }%
+ \dtlsort{Val}{mtdbEEqual}{\dtlicompare}%
+ \DTLforeach{mtdbEEqual}{\Val=Val,\Eff=Eff}{%
+ \expandafter\AjoutListEEy\Val\nil%
+ \expandafter\AjoutListEEx\Eff\nil%
+ }
+ \xdef\listEE{\the\tabtoksEE}
+ \ignoreemptyitems%
+ \setsepchar[*]{,*/}
+ \readlist*\ListeComplete\listEE%
+ }}}
% on crée la base de données des valeurs dans le cas qualitatif
\DTLcleardb{mtdb}%
% on les trie pour la médiane dans le cas qualitatif % Touhami / Texnique.fr
@@ -6134,14 +6789,20 @@ vardef Positions(expr Step)=
% %% celui de la somme des données
\foreachitem\don\in\ListeComplete{\xdef\SommeDonnees{\fpeval{\SommeDonnees+\ListeComplete[\doncnt,2]}}}%
% %% celui de l'effectif total
- \xdef\EffectifTotal{\SommeDonnees}%
\ifboolKV[ClesStat]{EffectifTotal}{%
- L'effectif total est \num{\ListeCompletelen}.\par
- }{}
+ \ifboolKV[ClesStat]{Liste}{L'effectif total de la série est
+ \num{\ListeCompletelen}.\par}{
+ \foreachitem\don\in\ListeComplete{\xdef\EffectifTotal{\fpeval{\EffectifTotal+\ListeComplete[\doncnt,2]}}}%
+ L'effectif total de la série est : \[\ListeComplete[1,2]\xintFor* ##1 in
+ {\xintSeq {2}{\ListeCompletelen}}\do{%
+ +\ListeComplete[##1,2]}=\num{\EffectifTotal}\]}
+ }{}%
+ \xdef\EffectifTotal{\SommeDonnees}%
% %% celui de la moyenne
- \xdef\Moyenne{\fpeval{\SommeDonnees/\ListeCompletelen}}%
+ \xdef\Moyenne{\fpeval{\SommeDonnees/\ListeCompletelen}}%
\ifboolKV[ClesStat]{Moyenne}{%
- La somme des données est :%
+ \ifboolKV[ClesStat]{Liste}{%
+ La somme des données de la série est :%
\xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{%
\[
\num{\ListeComplete[1,2]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{%
@@ -6155,15 +6816,15 @@ vardef Positions(expr Step)=
}=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}%
\]%
}%
- \ifboolKV[ClesStat]{SET}{}{L'effectif total est \num{\ListeCompletelen}.\\}%
- Donc la moyenne est égale à :%
+ \ifboolKV[ClesStat]{SET}{}{Le nombre de données de la série est \num{\ListeCompletelen}.\\}%
+ Donc la moyenne de la série est égale à :%
\[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\ListeCompletelen}}%\IfInteger{\fpeval{round(\fpeval{\SommeDonnees/\ListeCompletelen},\useKV[ClesStat]{Precision})}}{=}{\approx}
\opdiv*{\SommeDonnees}{\ListeCompletelen}{resultatmoy}{restemoy}%
\opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}%
\opcmp{resultatmoy}{resultatmoy1}\ifopeq=\else\approx\fi%
\num{\fpeval{round(\fpeval{\SommeDonnees/\ListeCompletelen},\useKV[ClesStat]{Precision})}}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}.}{.}%
\]%
- }{}%
+ }{Pas de moyenne possible pour une série de données à caractère qualitatif.}}{}%
% % %% celui de l'étendue
\xintFor* ##1 in {\xintSeq {1}{\ListeCompletelen}}\do{%
\xintifboolexpr{\ListeComplete[##1,2]>\DonneeMax}{%
@@ -6175,11 +6836,12 @@ vardef Positions(expr Step)=
}%
\xdef\EffectifMax{\DonneeMax}%
\xdef\Etendue{\fpeval{\DonneeMax-\DonneeMin}}%
- \ifboolKV[ClesStat]{Etendue}{L'étendue est égale à $\num{\DonneeMax}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\DonneeMin}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
- }{}%
+ \ifboolKV[ClesStat]{Etendue}{%
+ \ifboolKV[ClesStat]{Liste}{%
+ L'étendue de la série est égale à $\num{\DonneeMax}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\DonneeMin}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
+ }{Pas d'étendue possible pour une série de données à caractère qualitatif.}}{}%
\ifboolKV[ClesStat]{Mediane}{%
- %%%%%%%%%%%%%%%%%%%%%%%%
-
+ \ifboolKV[ClesStat]{Liste}{%
On range les données par ordre croissant :%
\nbdonnees=0%
\xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{%
@@ -6198,35 +6860,38 @@ vardef Positions(expr Step)=
\newcount\meda%
\ifodd\number\ListeCompletelen%odd impair
\med=\fpeval{(\ListeCompletelen+1)/2}\relax%
- L'effectif total est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\
+ L'effectif total de la série est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$.\\
\else% pair
\med=\fpeval{\ListeCompletelen/2}\relax
\meda=\numexpr\med+1\relax
- L'effectif total est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\
+ L'effectif total de la série est \num{\ListeCompletelen}. Or, $\num{\ListeCompletelen}=\num{\the\med}+\num{\the\med}$.\\
\fi%
\newcount\k%
\k=0%
\DTLforeach{mtdb}{\numeroDonnee=Numeric}{\k=\numexpr\k+1\relax%
\ifnum\k=\med %La médiane vaut \numeroDonnee\fi
\ifodd\number\ListeCompletelen%
- La médiane est la \the\med\ieme{} donnée.\\Donc la médiane est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
+ La médiane de la série est la \the\med\ieme{} donnée.\\Donc la médiane de la série est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
\else%
La \the\med\ieme{} donnée est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\xdef\Mediane{\numeroDonnee} %
\fi
\fi
\ifnum\k=\meda
- La \the\meda\ieme{} donnée est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.} Donc la médiane est \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}
+ La \the\meda\ieme{} donnée est \num{\numeroDonnee}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.} Donc la médiane de la série est \xdef\Mediane{\fpeval{(\Mediane+\numeroDonnee)/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}
\fi
}
%%%%%%%%%%%%%%%%%%%%%%%%
- }{}
- % construction du tableau
- \ifboolKV[ClesStat]{Tableau}{\ifboolKV[ClesStat]{Total}{\buildtabqt}{\buildtabq}}{}
- % Construction du graphique ??
+ }{Pas de médiane possible pour une série de données à caractère qualitatif.}}{}
+ % Construction du tableau
+ \ifboolKV[ClesStat]{Tableau}{%
+ \ifboolKV[ClesStat]{Liste}{Pas de tableau possible avec la clé Liste.\\Utilisez plutôt la clé Sondage si vous voulez un tableau avec cette liste.}{%
+ \ifboolKV[ClesStat]{Total}{\buildtabt}{\buildtab}}}%
+ {}%
+ % Construction du graphique
\ifboolKV[ClesStat]{Graphique}{%
- \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{}}
- \ifboolKV[ClesStat]{Batons}{\buildgraphq}{}
- }{}
+ \ifboolKV[ClesStat]{Liste}{Pas de graphique possible avec la clé Liste.\\Utilisez plutôt la clé Sondage si vous voulez un graphique avec cette liste.}{%
+ \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraphq[#1]}}%
+ }}{}
}{%%%%%%%%%%%%%%%%%%%%%Début quantitatif
% % on effectue les calculs
% %% celui de la somme des données
@@ -6247,12 +6912,12 @@ vardef Positions(expr Step)=
% %% celui de la moyenne
\xdef\Moyenne{\fpeval{\SommeDonnees/\EffectifTotal}}%
\ifboolKV[ClesStat]{EffectifTotal}{%
- L'effectif total est : \[\ListeComplete[1,2]\xintFor* ##1 in
+ L'effectif total de la série est : \[\ListeComplete[1,2]\xintFor* ##1 in
{\xintSeq {2}{\ListeCompletelen}}\do{%
+\ListeComplete[##1,2]}=\num{\EffectifTotal}\]
}{}%
\ifboolKV[ClesStat]{Moyenne}{%
- La somme des données est :%
+ La somme des données de la série est :%
\xintifboolexpr{\ListeCompletelen<\useKV[ClesStat]{Coupure}}{%
\[
\ifnum\ListeComplete[1,2]=1\else\num{\ListeComplete[1,2]}\times\fi\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{%
@@ -6268,7 +6933,7 @@ vardef Positions(expr Step)=
}=\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}
\]
}
- \ifboolKV[ClesStat]{SET}{}{L'effectif total est :%
+ \ifboolKV[ClesStat]{SET}{}{L'effectif total de la série est :%
\ifboolKV[ClesStat]{Liste}{ \num{\EffectifTotal}\\}{%
\[\num{\ListeComplete[1,2]}\xintFor* ##1 in {\xintSeq {2}{\ListeCompletelen}}\do{%
+\num{\ListeComplete[##1,2]}
@@ -6276,7 +6941,7 @@ vardef Positions(expr Step)=
\]%
}%
}
- Donc la moyenne est égale à :%
+ Donc la moyenne de la série est égale à :%
\[\frac{\num{\SommeDonnees}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}}{\num{\EffectifTotal}}%
\opdiv*{\SommeDonnees}{\EffectifTotal}{resultatmoy}{restemoy}%
\opround{resultatmoy}{\useKV[ClesStat]{Precision}}{resultatmoy1}%
@@ -6287,7 +6952,7 @@ vardef Positions(expr Step)=
}{}%
% % Affichage des réponses.
% %% pour l'étendue
- \ifboolKV[ClesStat]{Etendue}{L'étendue est égale à $\num{\ListeComplete[\ListeCompletelen,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}}{}%
+ \ifboolKV[ClesStat]{Etendue}{L'étendue de la série est égale à $\num{\ListeComplete[\ListeCompletelen,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}-\num{\ListeComplete[1,1]}\ifboolKV[ClesStat]{Concret}{~\text{\useKV[ClesStat]{Unite}}}{}=\num{\Etendue}$\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}}{}%
% %% pour la médiane
\ifboolKV[ClesStat]{Mediane}{%
@@ -6295,11 +6960,11 @@ vardef Positions(expr Step)=
\newcount\meda%
\ifodd\number\EffectifTotal%odd impair
\med=\fpeval{(\EffectifTotal+1)/2}\relax%
- L'effectif total est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. %
+ L'effectif total de la série est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med-1}}+1+\num{\fpeval{\med-1}}$. %
\else% pair
\med=\fpeval{\EffectifTotal/2}\relax%
\meda=\numexpr\med+1\relax%
- L'effectif total est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. %
+ L'effectif total de la série est \num{\EffectifTotal}. Or, $\num{\EffectifTotal}=\num{\fpeval{\med}}+\num{\fpeval{\med}}$. %
\fi%
\newcount\k%
\k=0%
@@ -6308,13 +6973,13 @@ vardef Positions(expr Step)=
\k=\numexpr\k+1\relax%
\ifnum\k=\med%
\ifodd\number\EffectifTotal%
- La médiane est la \the\med\ieme{} donnée. Donc la médiane est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
+ La médiane de la série est la \the\med\ieme{} donnée. Donc la médiane de la série est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
\else%
La \the\med\ieme{} donnée est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}. }{. }\xdef\Mediane{\ListeComplete[##1,1]}%
\fi%
\fi%
\ifnum\k=\meda%
- La \the\meda\ieme{} valeur est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la médiane est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
+ La \the\meda\ieme{} valeur est \num{\ListeComplete[##1,1]}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}\\Donc la médiane de la série est \xdef\Mediane{\fpeval{(\Mediane+\ListeComplete[##1,1])/2}}\num{\Mediane}\ifboolKV[ClesStat]{Concret}{~\useKV[ClesStat]{Unite}.}{.}%
\fi%
}%
}%
@@ -6322,13 +6987,15 @@ vardef Positions(expr Step)=
% Construction de tableau
\ifboolKV[ClesStat]{Tableau}{\ifboolKV[ClesStat]{Total}{\buildtabt}{\buildtab}}{}%
% Construction du graphique ??
- \ifboolKV[ClesStat]{Graphique}{\buildgraph}{}%
+ \ifboolKV[ClesStat]{Graphique}{%
+ \ifboolKV[ClesStat]{Angle}{\buildgraphcq{360}}{\ifboolKV[ClesStat]{SemiAngle}{\buildgraphcq{180}}{\buildgraph[#1]}}
+ }{}%
}%
}%
-%%%%%%%%%%%%%
-%%% Radar
-%%%%%%%%%%%%%
+%%%
+% Radar
+%%%
\setKVdefault[ClesRadar]{Rayon=3cm,Reference=20,MoyenneClasse=false,Disciplines=false,Pas=5}
\newtoks\toklisteradara%pour la moyenne de l'élève
@@ -6359,12 +7026,17 @@ vardef Positions(expr Step)=
p:=0;
for p_=#2:
p:=p+1;
- if N[p]>180:
- label(TEX(p_)
- rotated(90+N[p]),1.15[O,pointarc(cc,N[p])]);
- else:
- label(TEX(p_)
- rotated(-90+N[p]),1.15[O,pointarc(cc,N[p])]);
+ if (N[p]<90) or (N[p]=90):
+ label.urt(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if ((N[p]>90) and (N[p]<180)) or (N[p]=180):
+ label.ulft(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if (N[p]>180) and (N[p]<270):
+ label.llft(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if (N[p]>270) or (N[p]=270):
+ label.lrt(TEX(p_),1.025[O,pointarc(cc,N[p])]);
fi;
endfor;
% tracé des pas:
@@ -6376,7 +7048,7 @@ vardef Positions(expr Step)=
trace pointarc(cc,N[1]) for l=2 upto n: --pointarc(cc,N[l]) endfor
--cycle;
% etiquettage des pas
- dotlabel.top(btex \tiny #4 etex rotated -90,pointarc(cc,0));
+ dotlabel.urt(btex \tiny #4 etex,pointarc(cc,0));
dotlabel.urt(btex \tiny #3 etex,(1/pas)[O,pointarc(cc,0)]);
% tracé des résultats élèves
pair El[];
@@ -6414,12 +7086,17 @@ vardef Positions(expr Step)=
p:=0;
for p_=#2:
p:=p+1;
- if N[p]>180:
- label(LATEX(p_)
- rotated(90+N[p]),1.15[O,pointarc(cc,N[p])]);
- else:
- label(LATEX(p_)
- rotated(-90+N[p]),1.15[O,pointarc(cc,N[p])]);
+ if (N[p]<90) or (N[p]=90):
+ label.urt(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if ((N[p]>90) and (N[p]<180)) or (N[p]=180):
+ label.ulft(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if (N[p]>180) and (N[p]<270):
+ label.llft(TEX(p_),1.025[O,pointarc(cc,N[p])]);
+ fi;
+ if (N[p]>270) or (N[p]=270):
+ label.lrt(TEX(p_),1.025[O,pointarc(cc,N[p])]);
fi;
endfor;
% tracé des pas:
@@ -6460,6 +7137,7 @@ vardef Positions(expr Step)=
\useKVdefault[ClesRadar]%
\setKV[ClesRadar]{#1}%
\ignoreemptyitems%
+ \setsepchar[*]{,}%
\readlist*\ListeRadar{#2}%
\toklisteradara{}%
\foreachitem\compteur\in\ListeRadar{\expandafter\UpdateRadara\compteur\nil}%
@@ -6474,9 +7152,9 @@ vardef Positions(expr Step)=
\MPRadar{\useKV[ClesRadar]{Rayon}}{\the\toklisteradarb}{\useKV[ClesRadar]{Pas}}{\useKV[ClesRadar]{Reference}}{\the\toklisteradara}{\the\toklisteradarc}%
}
-%%%%%%%%%%%%
+%%%
% Barres de niveaux
-%%%%%%%%%%%%
+%%%
\setKVdefault[ClesBarre]{Niveau=false,LimiteI=25,LimiteF=50,LimiteS=75,TexteOrigine=0,TexteReference=100,CouleurGraduation=white,CouleurFond=gray!50,CouleurBarre=black,Graduation=false,Nom=Défaut,Pas=10,CouleurI=red,CouleurF=orange,CouleurS=yellow,CouleurM=green}
\newlength{\barrewidth}
@@ -6537,10 +7215,10 @@ vardef Positions(expr Step)=
}
}
-%%%%%%%%%%%%%%%
-%%% Equations
-%%%%%%%%%%%%%%%
-\setKVdefault[ClesEquation]{Ecart=0.5,Fleches=false,FlecheDiv=false,Laurent=false,Decomposition=false,Terme=false,Composition=false,Symbole=false,Entier=false,Lettre=x,Solution=false,Bloc=false,Simplification=false,CouleurTerme=black,CouleurCompo=black,CouleurSous=red,CouleurSymbole=orange,Verification=false,Nombre=0,Egalite=false,Produit=false,Facteurs=false,Carre=false,Pose=false,Equivalence=false}
+%%%
+% Equations
+%%%
+\setKVdefault[ClesEquation]{Ecart=0.5,Fleches=false,FlecheDiv=false,Laurent=false,Decomposition=false,Terme=false,Composition=false,Symbole=false,Entier=false,Lettre=x,Solution=false,LettreSol=true,Bloc=false,Simplification=false,CouleurTerme=black,CouleurCompo=black,CouleurSous=red,CouleurSymbole=orange,Verification=false,Nombre=0,Egalite=false,Produit=false,Facteurs=false,Carre=false,Exact=false,Pose=false,Equivalence=false}
\newcommand\rightcomment[4]%
{\begin{tikzpicture}[remember picture,overlay]
@@ -6552,7 +7230,6 @@ vardef Positions(expr Step)=
\end{tikzpicture}%
}
-
\newcommand\leftcomment[4]%
{\begin{tikzpicture}[remember picture,overlay]
\draw[Cfleches,-stealth]
@@ -6659,9 +7336,9 @@ vardef Positions(expr Step)=
\definecolor{Cfleches}{RGB}{100,100,100}%
-\input{PfC-EquationSoustraction1}%
+\input{PfC-EquationSoustraction2}%
\input{PfC-EquationTerme1}%
-\input{PfC-EquationComposition1}%
+\input{PfC-EquationComposition2}%
\input{PfC-EquationPose1}%
\input{PfC-EquationSymbole1}%
\input{PfC-EquationLaurent1}
@@ -6716,12 +7393,12 @@ vardef Positions(expr Step)=
Comme \num{#2} est positif, alors l'équation $\useKV[ClesEquation]{Lettre}^2=\num{#2}$ a deux solutions :%
\begin{align*}
\useKV[ClesEquation]{Lettre}&=\sqrt{\num{#2}}&&\text{et}&\useKV[ClesEquation]{Lettre}&=-\sqrt{\num{#2}}%\\
- \ifboolKV[ClesEquation]{Entier}{\\%
+ \ifboolKV[ClesEquation]{Exact}{\\%
\useKV[ClesEquation]{Lettre}&=\num{\fpeval{sqrt(#2)}}&&\text{et}&\useKV[ClesEquation]{Lettre}&=-\num{\fpeval{sqrt(#2)}}}{}%
\end{align*}
- }
- }
-}
+ }%
+ }%
+}%
\newcommand\ResolEquationProduit[5][]{%
\setKV[ClesEquation]{#1}%
@@ -6782,9 +7459,8 @@ vardef Positions(expr Step)=
}
\end{align*}
}%
-
- \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#3=0}{\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}}{(\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}})}\xintifboolexpr{#5=0}{\times\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}}{(\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}})}=0$ a deux solutions : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$ et \opdiv*{\Coeffd}{\Coeffc}{solution}{resteequa}\opcmp{resteequa}{0}$\useKV[ClesEquation]{Lettre}=\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffd}{\Coeffc}}{\frac{\num{\Coeffd}}{\num{\Coeffc}}}\fi$.
- }{}
+ \ifboolKV[ClesEquation]{Solution}{L'équation $\xintifboolexpr{#3=0}{\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}}{(\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}})}\xintifboolexpr{#5=0}{\times\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}}{(\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}})}=0$ a deux solutions : \opdiv*{\Coeffb}{\Coeffa}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffb}{\Coeffa}}{\frac{\num{\Coeffb}}{\num{\Coeffa}}}\fi$ et \opdiv*{\Coeffd}{\Coeffc}{solution}{resteequa}\opcmp{resteequa}{0}$\ifboolKV[ClesEquation]{LettreSol}{\useKV[ClesEquation]{Lettre}=}{}\displaystyle\ifopeq\opexport{solution}{\solution}\num{\solution}\else\ifboolKV[ClesEquation]{Entier}{\SSimplifie{\Coeffd}{\Coeffc}}{\frac{\num{\Coeffd}}{\num{\Coeffc}}}\fi$.
+ }{}%
}
\newcommand\Verification[5][]{%
@@ -6802,10 +7478,10 @@ vardef Positions(expr Step)=
}{\xintifboolexpr{\Testa=\Testb}{Comme $\num{\Testa}=\num{\Testb}$, alors $\useKV[ClesEquation]{Lettre}=\num{\useKV[ClesEquation]{Nombre}}$ est bien }{Comme $\num{\Testa}\not=\num{\Testb}$, alors $\useKV[ClesEquation]{Lettre}=\num{\useKV[ClesEquation]{Nombre}}$ n'est pas }une solution de l'équation $\xintifboolexpr{#2=0}{\num{#3}}{\xintifboolexpr{#2=1}{}{\num{#2}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#3=0}{}{\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}}}=\xintifboolexpr{#4=0}{\num{#5}}{\xintifboolexpr{#4=1}{}{\num{#4}}\useKV[ClesEquation]{Lettre}\xintifboolexpr{#5=0}{}{\xintifboolexpr{#5>0}{+\num{#5}}{-\num{\fpeval{0-#5}}}}}$.}
}
-%%%%%%%%%%%%%%%%%%%%
-%%% Proportionnalité
-%%%%%%%%%%%%%%%%%%%%
-\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,ColorTab=gray!15}%Tableau=false :
+%%%
+% Proportionnalité
+%%%
+\setKVdefault[ClesPropor]{GrandeurA=Grandeur A,GrandeurB=Grandeur B,Largeur=1cm,Math=false,Stretch=1,ColorFill=white,CouleurTab=gray!15}%Tableau=false :
%inutile ?
\def\Updatetoksmath#1/#2\nil{\addtotok\tabtoksa{&#1}\addtotok\tabtoksb{&#2}}%
@@ -6819,7 +7495,7 @@ vardef Positions(expr Step)=
}%
\xdef\LongListe{\ListeValeurlen}%
\renewcommand{\arraystretch}{\useKV[ClesPropor]{Stretch}}%
- \begin{tabular}{|>{\columncolor{\useKV[ClesPropor]{ColorTab}}}c|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}}%
+ \begin{tabular}{|>{\columncolor{\useKV[ClesPropor]{CouleurTab}}}c|*{\number\numexpr\ListeValeurlen}{>{\centering\arraybackslash}p{\useKV[ClesPropor]{Largeur}}|}}%
\multicolumn{1}{c}{\TikzPHD\setcounter{NbPropor}{1}}\xintFor* ##1 in {\xintSeq {1}{\ListeValeurlen}}\do{&\multicolumn{1}{c}{\TikzPH}}\\%
\hhline{*{\number\numexpr\ListeValeurlen+1}{-}}%
\the\tabtoksa\\%
@@ -6839,9 +7515,15 @@ vardef Positions(expr Step)=
}%
\newcommand{\TikzPHD}{%
- \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}
- \tikz[remember picture,overlay]{%
- \coordinate[name=ProporHD,xshift=-0.5*\the\wd1,yshift=-\the\dp\strutbox*\arraystretch];}%
+ \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}%
+ \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}%
+ \xintifboolexpr{\wd1>\wd2}{%
+ \tikz[remember picture,overlay]{%
+ \coordinate[name=ProporHD,xshift=-0.5\wd1,yshift=-\the\dp\strutbox*\arraystretch];}%
+ }{%
+ \tikz[remember picture,overlay]{%
+ \coordinate[name=ProporHD,xshift=-0.5\wd2,yshift=-\the\dp\strutbox*\arraystretch];}%
+ }
}%
\newcommand{\TikzPB}{%
@@ -6851,20 +7533,26 @@ vardef Positions(expr Step)=
}%
\newcommand{\TikzPBD}{%
- \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}
- \tikz[remember picture, overlay]{%
- \coordinate[name=ProporBD,xshift=-0.5*\the\wd1,yshift=\the\ht\strutbox*\arraystretch];}%
+ \setbox1=\hbox{\useKV[ClesPropor]{GrandeurA}}%
+ \setbox2=\hbox{\useKV[ClesPropor]{GrandeurB}}%
+ \xintifboolexpr{\wd1>\wd2}{%
+ \tikz[remember picture, overlay]{%
+ \coordinate[name=ProporBD,xshift=-0.5*\the\wd1,yshift=\the\ht\strutbox*\arraystretch];}%
+ }{%
+ \tikz[remember picture, overlay]{%
+ \coordinate[name=ProporBD,xshift=-0.5*\the\wd2,yshift=\the\ht\strutbox*\arraystretch];}%
+ }
\stepcounter{NbPropor}%
}%
\newcommand\FlechesPH[3]{%
\ifnum#1<#2\relax%
\begin{tikzpicture}[remember picture,overlay]%
- \draw[-stealth,out=50,in=130] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.65, sloped]{#3}(ProporH-#2);%
+ \draw[-stealth,out=50,in=130] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporH-#2);%
\end{tikzpicture}%
\else%
\begin{tikzpicture}[remember picture,overlay]%
- \draw[-stealth,out=130,in=50] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.65, sloped]{#3}(ProporH-#2);%
+ \draw[-stealth,out=130,in=50] (ProporH-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporH-#2);%
\end{tikzpicture}%
\fi%
}%
@@ -6872,11 +7560,11 @@ vardef Positions(expr Step)=
\newcommand\FlechesPB[3]{%
\ifnum\number#1<\number#2\relax%
\begin{tikzpicture}[remember picture,overlay]%
- \draw[-stealth,out=-50,in=-130] (ProporB-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.65, sloped]{#3}(ProporB-#2);%
+ \draw[-stealth,out=-50,in=-130] (ProporB-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporB-#2);%
\end{tikzpicture}%
\else%
\begin{tikzpicture}[remember picture,overlay]%
- \draw[-stealth,out=-130,in=-50] (ProporB-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.65, sloped]{#3}(ProporB-#2);%
+ \draw[-stealth,out=-130,in=-50] (ProporB-#1) to node[inner sep=0pt, inner xsep=1pt,fill=\colorfill, pos=0.5, sloped]{#3}(ProporB-#2);%
\end{tikzpicture}%
\fi%
}
@@ -6902,14 +7590,13 @@ vardef Positions(expr Step)=
\end{tikzpicture}%
}%
-\newcommand\FlecheCoefDebut[2][1.25\tabcolsep]{%
+\newcommand\FlecheCoefDebut[2][\tabcolsep+\arrayrulewidth]{%
\begin{tikzpicture}[remember picture, overlay]%
\node[] (Noeud1) at ($(ProporHD)!0.1!(ProporBD)$) {};%
\node[] (Noeud2) at ($(ProporHD)!0.9!(ProporBD)$) {};%
\coordinate[left of=Noeud1,node distance=#1] (noeud1);%
\coordinate[left of=Noeud2,node distance=#1] (noeud2);%
\draw[-stealth,out=160,in=-160] (noeud2) to node[midway,left,inner sep=1pt]{#2}(noeud1);%
- %\draw[red](ProporHD) to (ProporBD);
\end{tikzpicture}%
}%
@@ -6945,26 +7632,26 @@ vardef Positions(expr Step)=
\end{tikzpicture}
}
-%%%%%%%%%%%
-%% Application : pourcentage
-%%%%%%%%%%%
-\setKVdefault[ClesPourcentage]{Appliquer,Calculer=false,Augmenter=false,Reduire=false,Fractionnaire=false,Decimal,Formule=false,Unite=g,Concret=false,GrandeurA=Grandeur A,GrandeurB=Total,MotReduction=diminution,AideTableau=false,ColorFill=white,ColorTab=gray!15}
+%%%
+% Application : pourcentage
+%%%
+\setKVdefault[ClesPourcentage]{Appliquer,Calculer=false,Augmenter=false,Reduire=false,Fractionnaire=false,Decimal,Formule=false,Unite=g,Concret=false,GrandeurA=Grandeur A,GrandeurB=Total,MotReduction=diminution,AideTableau=false,ColorFill=white,CouleurTab=gray!15}
\newcommand\Pourcentage[3][]{%
\useKVdefault[ClesPourcentage]%
\setKV[ClesPourcentage]{#1}%
\ifboolKV[ClesPourcentage]{Reduire}{%
\ifboolKV[ClesPourcentage]{Formule}{%
- Réduire une quantité de \num{#2}~\%, cela revient à multiplier cette quantitié par $1-\dfrac{\num{#2}}{100}$. Par conséquent, si on réduit \num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{} de \num{#2}~\%, cela donne :
+ Réduire une quantité de \num{#2}~\%, cela revient à multiplier cette quantité par $1-\dfrac{\num{#2}}{100}$. Par conséquent, si on réduit \num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{} de \num{#2}~\%, cela donne :
\[\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times\left(1-\frac{\num{#2}}{100}\right)=\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times(1-\num{\fpeval{#2/100}})=\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times\num{\fpeval{(1-#2/100)}}=\num{\fpeval{#3*(1-#2/100)}}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\]
}{%
Calculons ce que représente la \useKV[ClesPourcentage]{MotReduction} de \num{#2}~\%.
\ifboolKV[ClesPourcentage]{AideTableau}{%
\xdef\NomA{\useKV[ClesPourcentage]{GrandeurA}}%
\xdef\NomB{\useKV[ClesPourcentage]{GrandeurB}}%
- \xdef\NomColorTab{\useKV[ClesPourcentage]{ColorTab}}%
+ \xdef\NomCouleurTab{\useKV[ClesPourcentage]{CouleurTab}}%
\begin{center}
- \Propor[GrandeurA=\NomA,GrandeurB=\NomB,ColorTab=\NomColorTab]{/#3,#2/100}
+ \Propor[GrandeurA=\NomA,GrandeurB=\NomB,CouleurTab=\NomCouleurTab]{/#3,#2/100}
\end{center}
\FlecheCoefInv{\tiny$\times\num{\fpeval{#2/100}}$}%
On obtient une \useKV[ClesPourcentage]{MotReduction} de $\num{\fpeval{#2/100}}\times\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}=\num{\fpeval{#3*#2/100}}$\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{}. Donc un total de $\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}-\num{\fpeval{#3*#2/100}}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}=\num{\fpeval{#3*(1-#2/100)}}$\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{}.%
@@ -6975,16 +7662,16 @@ vardef Positions(expr Step)=
}{%
\ifboolKV[ClesPourcentage]{Augmenter}{%
\ifboolKV[ClesPourcentage]{Formule}{%
- Augmenter de \num{#2}~\% une quantité, cela revient à multiplier cette quantitié par $1+\dfrac{\num{#2}}{100}$. Par conséquent, si on augmente \num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{} de \num{#2}~\%, cela donne :
+ Augmenter de \num{#2}~\% une quantité, cela revient à multiplier cette quantité par $1+\dfrac{\num{#2}}{100}$. Par conséquent, si on augmente \num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{} de \num{#2}~\%, cela donne :
\[\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times\left(1+\frac{\num{#2}}{100}\right)=\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times(1+\num{\fpeval{#2/100}})=\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\times\num{\fpeval{(1+#2/100)}}=\num{\fpeval{#3*(1+#2/100)}}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}\]
}{%
Calculons ce que représente l'augmentation de \num{#2}~\%. %
\ifboolKV[ClesPourcentage]{AideTableau}{%
\xdef\NomA{\useKV[ClesPourcentage]{GrandeurA}}%
\xdef\NomB{\useKV[ClesPourcentage]{GrandeurB}}%
- \xdef\NomColorTab{\useKV[ClesPourcentage]{ColorTab}}%
+ \xdef\NomCouleurTab{\useKV[ClesPourcentage]{CouleurTab}}%
\begin{center}%
- \Propor[GrandeurA=\NomA,GrandeurB=\NomB,ColorTab=\NomColorTab]{/#3,#2/100}%
+ \Propor[GrandeurA=\NomA,GrandeurB=\NomB,CouleurTab=\NomCouleurTab]{/#3,#2/100}%
\end{center}%
\FlecheCoefInv{\tiny$\times\num{\fpeval{#2/100}}$}%
On obtient une augmentation de $\num{\fpeval{#2/100}}\times\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}=\num{\fpeval{#3*#2/100}}$\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{}.\\Donc un total de $\num{#3}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}+\num{\fpeval{#3*#2/100}}\ifboolKV[ClesPourcentage]{Concret}{~\text{\useKV[ClesPourcentage]{Unite}}}{}=\num{\fpeval{#3*(1+#2/100)}}$\ifboolKV[ClesPourcentage]{Concret}{~\useKV[ClesPourcentage]{Unite}}{}.%
@@ -6996,8 +7683,8 @@ vardef Positions(expr Step)=
\ifboolKV[ClesPourcentage]{Calculer}{%
\xdef\NomA{\useKV[ClesPourcentage]{GrandeurA}}%
\xdef\NomB{\useKV[ClesPourcentage]{GrandeurB}}%
- \xdef\NomColorTab{\useKV[ClesPourcentage]{ColorTab}}%
- \Propor[GrandeurA=\NomA,GrandeurB=\NomB,ColorTab=\NomColorTab]{#2/#3,/100}%
+ \xdef\NomCouleurTab{\useKV[ClesPourcentage]{CouleurTab}}%
+ \Propor[GrandeurA=\NomA,GrandeurB=\NomB,CouleurTab=\NomCouleurTab]{#2/#3,/100}%
\xdef\colorfill{\useKV[ClesPourcentage]{ColorFill}}%
\FlechesPB{2}{1}{\scriptsize$\times\num{\fpeval{#3/100}}$}%
\FlechesPH{1}{2}{\scriptsize$\div\num{\fpeval{#3/100}}$}%
@@ -7010,10 +7697,10 @@ vardef Positions(expr Step)=
}%
}%
-%%%%%%%%%%%%%
-%Lien : ratio
-%%%%%%%%%%%%%
-\setKVdefault[ClesRatio]{Figure=false,Longueur=5cm,TexteTotal=quantité,TextePart=part,Tableau=false,GrandeurA=Grandeur A,GrandeurB=Part(s),Largeur=1cm,Stretch=1,Nom=false,CouleurUn=gris,CouleurDeux=0.5gris+0.5blanc,CouleurTrois=white,ColorTab=gray!15}
+%%%
+% Lien : ratio
+%%%
+\setKVdefault[ClesRatio]{Figure=false,Longueur=5cm,TexteTotal=quantité,TextePart=part,Tableau=false,GrandeurA=Grandeur A,GrandeurB=Part(s),Largeur=1cm,Stretch=1,Nom=false,CouleurUn=gris,CouleurDeux=0.5gris+0.5blanc,CouleurTrois=white,CouleurTab=gray!15}
\newcommand\MPTest[9][]{%
% #2 : Longueur de la barre unité
@@ -7098,12 +7785,11 @@ vardef Positions(expr Step)=
fi;
\end{mplibcode}
\else
- \usempxpackage{simplekv}
\mpxcommands{%
\setKVdefault[ClesRatio]{TexteTotal=quantité,TextePart=part}
\setKV[ClesRatio]{#1}
}
- \begin{mpost}[mpsettings={input PfC-Geometrie;}]
+ \begin{mpost}
vardef RatioTrois(expr long)(text t)=%longueur de la barre / quantité à partager / textepart :) / t le ratio
pair A,B,C,D;
A=u*(1,1);
@@ -7189,7 +7875,7 @@ vardef Positions(expr Step)=
\foreachitem\compteur\in\ListeRatio{\expandafter\updateratiotoks\compteur\nil}%
\xdef\LongListe{\ListeRatiolen}%
\renewcommand{\arraystretch}{\useKV[ClesRatio]{Stretch}}%
- \begin{tabular}{|>{\columncolor{\useKV[ClesRatio]{ColorTab}}}c|*{\number\numexpr\ListeRatiolen}{>{\centering\arraybackslash}p{\useKV[ClesRatio]{Largeur}}|}l}
+ \begin{tabular}{|>{\columncolor{\useKV[ClesRatio]{CouleurTab}}}c|*{\number\numexpr\ListeRatiolen}{>{\centering\arraybackslash}p{\useKV[ClesRatio]{Largeur}}|}l}
\ifboolKV[ClesRatio]{Nom}{%
\hhline{~*{\number\numexpr\ListeRatiolen}{-}}
\multicolumn{1}{c|}{}\the\tabtoksc\\
@@ -7245,7 +7931,7 @@ vardef Positions(expr Step)=
\foreachitem\compteur\in\ListeRatio{\expandafter\UpdateRatio\compteur\nil}%
\itemtomacro\ListeRatio[1]\NbUn
\itemtomacro\ListeRatio[2]\NbDeux
- \xintifboolexpr{\ListeRatiolen>2}{\itemtomacro\ListeRatio[3]\NbTrois}{\newcommand\NbTrois{}}
+ \xintifboolexpr{\ListeRatiolen>2}{\itemtomacro\ListeRatio[3]\NbTrois}{\xdef\NbTrois{}}
\MPTest[#1]{\useKV[ClesRatio]{Longueur}}{\NbUn}{\NbDeux}{\NbTrois}{\the\toklisteratio}{\useKV[ClesRatio]{CouleurUn}}{\useKV[ClesRatio]{CouleurDeux}}{\useKV[ClesRatio]{CouleurTrois}}%
}{%
\ifboolKV[ClesRatio]{Tableau}{%
@@ -7256,9 +7942,9 @@ vardef Positions(expr Step)=
}%
}%
-%%%%%%%%%%%%%%%
-%% Cartes Mentales
-%%%%%%%%%%%%%%%
+%%%
+% Cartes Mentales
+%%%
\setKVdefault[ClesMentales]{Nom={Bulle}, Largeur=5cm, Ancre={0,0},Pointilles=false,CTrace=black,CFond=white,Epaisseur=1pt,Rayon=1}%
\newenvironment{Mind}{\begin{tikzpicture}}{\end{tikzpicture}}%
@@ -7282,9 +7968,9 @@ vardef Positions(expr Step)=
}
}
-%%%%%%%%%%%%
+%%%
% Pptés des droites (6eme)
-%%%%%%%%%%%
+%%%
\setKVdefault[ClesDroites]{Brouillon=false,CitePropriete=false,Num=1,Figure=false,Remediation=false}
\newcommand\Redaction[4][]{%
@@ -7320,7 +8006,7 @@ vardef Positions(expr Step)=
Comme les droites $(\hbox to2em{\dotfill})$ et $(\hbox to2em{\dotfill})$ sont parallèles, alors la droite $(\hbox to2em{\dotfill})$ qui est perpendiculaire à $(\hbox to2em{\dotfill})$ est également perpendiculaire à la droite $(\hbox to2em{\dotfill})$.
}
}
- }%%%%%%%%%%%%%%%%%%%%%
+ }%
}{%
\xintifboolexpr{\useKV[ClesDroites]{Num}=1}{%
\ifboolKV[ClesDroites]{CitePropriete}{%
@@ -7351,11 +8037,11 @@ vardef Positions(expr Step)=
Donc les droites $(#2)$ et $(#3)$ sont perpendiculaires.
}{%
Comme les droites $(#2)$ et $(#4)$ sont parallèles, alors la droite $(#3)$ qui est perpendiculaire à $(#4)$ est également perpendiculaire à la droite $(#2)$.
- }
- }
- }
- }
-}
+ }%
+ }%
+ }%
+ }%
+}%
\newcommand\Brouillon[4][]{%
\setlength{\abovedisplayskip}{0pt}
@@ -7417,10 +8103,10 @@ vardef Positions(expr Step)=
\end{array}
\right\}(#2)\perp(#3)
\]
- }
- }
- }
-}
+ }%
+ }%
+ }%
+}%
\def\MPFigureDroite#1#2{%
\ifluatex
@@ -7626,11 +8312,10 @@ vardef Positions(expr Step)=
}%
}%
-%%%%%%%%%%%%%%%%%%%%
-%%% Fonction Affine
-%%%%%%%%%%%%%%%%%%%%
-\setKVdefault[ClesAffine]{Nom=f,Variable=x,Ligne=false,Image=false,Antecedent=false,Graphique=false,Retrouve=false,ProgCalcul=false,Unitex=1,Unitey=1,VoirCoef=false,ACoef=0,Redaction=false,Ecriture=false,Definition=false}%ACoefficient=false
- %: inutile ?
+%%%
+% Fonction Affine
+%%%
+\setKVdefault[ClesAffine]{Nom=f,Variable=x,Ligne=false,Image=false,Antecedent=false,Graphique=false,Retrouve=false,ProgCalcul=false,Unitex=1,Unitey=1,VoirCoef=false,ACoef=0,Redaction=false,Ecriture=false,Definition=false}%ACoefficient=false%: inutile ?
\newcommand\FonctionAffine[5][]{%
% #1 nombre ou abscisse premier point
@@ -7641,7 +8326,7 @@ vardef Positions(expr Step)=
\setKV[ClesAffine]{#1}%
\ifboolKV[ClesAffine]{Image}{%
\ifboolKV[ClesAffine]{Ligne}{%
- \ensuremath{\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}=\num{\fpeval{#2*#3}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}\xintifboolexpr{#4=0}{}{=\num{\fpeval{#2*#3+#4}}}}%
+ \ensuremath{\useKV[ClesAffine]{Nom}(\num{#2})=\num{#3}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}=\num{\fpeval{#2*#3}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}\xintifboolexpr{#4=0}{}{=\num{\fpeval{#2*#3+#4}}}}%
}{%
\ifboolKV[ClesAffine]{ProgCalcul}{%
\begin{align*}
@@ -7650,8 +8335,8 @@ vardef Positions(expr Step)=
\end{align*}
}{%
\begin{align*}
- \useKV[ClesAffine]{Nom}(\num{#2})&=\num{#3}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}\\
- \useKV[ClesAffine]{Nom}(\num{#2})&=\num{\fpeval{#3*#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}%\\
+ \useKV[ClesAffine]{Nom}(\num{#2})&=\num{#3}\times\xintifboolexpr{#2<0}{(\num{#2})}{\num{#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}\\
+ \useKV[ClesAffine]{Nom}(\num{#2})&=\num{\fpeval{#3*#2}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}%\\
\xintifboolexpr{#4=0}{}{\\
\useKV[ClesAffine]{Nom}(\num{#2})&=\num{\fpeval{#3*#2+#4}}%\\
}
@@ -7669,17 +8354,20 @@ vardef Positions(expr Step)=
\useKV[ClesAffine]{Nom}&:\frac{\num{\fpeval{#2-#4}}}{\num{#3}}\stackrel{\div\xintifboolexpr{#3<0}{(\num{#3})}{\num{#3}}}{\longleftarrow}\num{\fpeval{#2-#4}}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{\stackrel{-\num{#4}}{\longleftarrow}}{\stackrel{+\num{\fpeval{0-#4}}}{\longleftarrow}}\num{#2}}
\end{align*}
}{%
- On cherche l'antécédent de $\num{#2}$ par la fonction $\useKV[ClesAffine]{Nom}$, c'est-à-dire le nombre $\useKV[ClesAffine]{Variable}$ tel que $\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\num{#2}$. Or, la fonction $\useKV[ClesAffine]{Nom}$ est définie par :
- \begin{align*}
- \useKV[ClesAffine]{Nom}&:\useKV[ClesAffine]{Variable}\stackrel{\times\xintifboolexpr{#3<0}{(\num{#3})}{\num{#3}}}{\longrightarrow}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{\stackrel{+\num{#4}}{\longrightarrow}}{\stackrel{\num{#4}}{\longrightarrow}}\num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}}
- \end{align*}
+ On cherche l'antécédent de $\num{#2}$ par la fonction
+ $\useKV[ClesAffine]{Nom}$, c'est-à-dire le nombre
+ $\useKV[ClesAffine]{Variable}$ tel que
+ $\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\num{#2}$. Or,
+ la fonction $\useKV[ClesAffine]{Nom}$ est définie par : \[%
+ \useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\xintifboolexpr{#3=0}{}{\num{#3}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#3=0}{\num{#4}}{\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}}
+ \]
Par conséquent, on a :
\begin{align*}
- \num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{\num{#4}}}&=\num{#2}\\
- \xintifboolexpr{#4=0}{\useKV[ClesAffine]{Variable}\uppercase{&}=\frac{\num{#2}}{\num{#3}}
- }{\num{#3}\useKV[ClesAffine]{Variable}&=\num{\fpeval{#2-#4}}\\
- \useKV[ClesAffine]{Variable}&=\frac{\num{\fpeval{#2-#4}}}{\num{#3}}
- }
+ \num{#3}\useKV[ClesAffine]{Variable}\xintifboolexpr{#4=0}{}{\xintifboolexpr{#4>0}{+\num{#4}}{-\num{\fpeval{0-#4}}}}&=\num{#2}\\
+ \xintifboolexpr{#4=0}{\useKV[ClesAffine]{Variable}\uppercase{&}=\frac{\num{#2}}{\num{#3}}%\\
+ }{\num{#3}\useKV[ClesAffine]{Variable}&=\num{\fpeval{#2-#4}}\\
+ \useKV[ClesAffine]{Variable}&=\frac{\num{\fpeval{#2-#4}}}{\num{#3}}%\\
+ }
\end{align*}
}%
}{%
@@ -7716,16 +8404,15 @@ vardef Positions(expr Step)=
\ifboolKV[ClesAffine]{Redaction}{%
\xintifboolexpr{#2=0}{Comme la fonction $\useKV[ClesAffine]{Nom}$
est une fonction constante, alors sa représentation graphique est une droite parallèle à l'axe des abscisses passant par le point de coordonnées $(0;\num{#3})$.}%
- {\xintifboolexpr{#3=0}{Comme la fonction
- $\useKV[ClesAffine]{Nom}$ est une fonction linéaire, alors sa représentation graphique est une droite passant par l'origine du repère.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomFonctionA{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonctionA,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonnées $(\num{#4};\num{\fpeval{#2*#4+#3}})$.
+ {\xintifboolexpr{#3=0}{Comme la fonction $\useKV[ClesAffine]{Nom}$ est une fonction linéaire, alors sa représentation graphique est une droite passant par l'origine du repère.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomFonctionA{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonctionA,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonnées $(\num{#4};\num{\fpeval{#2*#4+#3}})$.
}{%
- Comme $\useKV[ClesAffine]{Nom}$ est une fonction affine, alors sa représentation graphique est une droite.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomFonction{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonction,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonnées $(\num{#4};\num{\fpeval{#2*#4+#3}})$.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#5}$. Son image est \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#5}{#2}{#3}{#4}. On place le point de coordonnées $(\num{#5};\num{\fpeval{#2*#5+#3}})$.%
+ Comme $\useKV[ClesAffine]{Nom}$ est une fonction affine, alors sa représentation graphique est une droite.\\Je choisis $\useKV[ClesAffine]{Variable}=\num{#4}$. Son image est \xdef\NomVariable{\useKV[ClesAffine]{Variable}}\xdef\NomFonction{\useKV[ClesAffine]{Nom}}\FonctionAffine[Nom=\NomFonction,Image,Ligne]{#4}{#2}{#3}{#5}. On place le point de coordonnées $(\num{#4};\num{\fpeval{#2*#4+#3}})$.\\Je choisis \setKV[ClesAffine]{Variable=\NomVariable}$\useKV[ClesAffine]{Variable}=\num{#5}$. Son image est \FonctionAffine[Nom=\NomFonction,Image,Ligne]{#5}{#2}{#3}{#4}. On place le point de coordonnées $(\num{#5};\num{\fpeval{#2*#5+#3}})$.%
}%
}%
}%
{}%
- \ifboolKV[ClesAffine]{Ecriture}{\ensuremath{\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\xintifboolexpr{#2=0}{}{\num{#2}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#2=0}{\num{#3}}{\xintifboolexpr{#3=0}{}{\xintifboolexpr{#3>0}{+\num{#3}}{\num{#3}}}}}}{}%
- \ifboolKV[ClesAffine]{Definition}{\ensuremath{\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\xintifboolexpr{#2=0}{}{\num{#2}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#2=0}{\num{#3}}{\xintifboolexpr{#3=0}{}{\xintifboolexpr{#3>0}{+\num{#3}}{\num{#3}}}}}}{}%
+ \ifboolKV[ClesAffine]{Ecriture}{\ensuremath{\useKV[ClesAffine]{Nom}(\useKV[ClesAffine]{Variable})=\xintifboolexpr{#2=0}{}{\num{#2}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#2=0}{\num{#3}}{\xintifboolexpr{#3=0}{}{\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}}}}}{}%
+ \ifboolKV[ClesAffine]{Definition}{\ensuremath{\useKV[ClesAffine]{Nom}:\useKV[ClesAffine]{Variable}\mapsto\xintifboolexpr{#2=0}{}{\num{#2}\useKV[ClesAffine]{Variable}}\xintifboolexpr{#2=0}{\num{#3}}{\xintifboolexpr{#3=0}{}{\xintifboolexpr{#3>0}{+\num{#3}}{-\num{\fpeval{0-#3}}}}}}}{}%
}%
\def\MPFonctionAffine#1#2#3#4#5#6#7{%
@@ -7987,30 +8674,228 @@ vardef Positions(expr Step)=
}
-%%%%%%%%%%%%%%%
+%%%
% Fonction
-%%%%%%%%%%%%%%%
-\setKVdefault[ClesFonction]{Nom=f,Variable=x,Calcul=x,Tableau=false,Largeur=5mm,Ecriture=false,Definition=false}
+%%%
+\setKVdefault[ClesFonction]{Nom=f,Variable=x,Calcul=x,Tableau=false,Largeur=5mm,Ecriture=false,Definition=false,Points=false,Tangentes=false,PasX=1,PasY=1,UniteX=1,UniteY=1,Prolonge=false}
+
+\newtoks\toklistePtsFn%pour la discipline
+
+\def\UpdatePtsFn#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{#1,(#2,#3),#4,}}%
+\def\UpdatePtsFN#1/#2/#3/#4\nil{\addtotok\toklistePtsFn{(#2,#3),}}%
+
+\def\MPCourbePoints#1#2#3#4#5#6{%
+ % #1 la liste des points
+ % #2: pas en x
+ % #3: pas en y
+ % #4: unité en x
+ % #5: unité en y
+ % #6 : prolongement avant et après les premier et dernier points ?
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ x.u:=#2;
+ y.u:=#3;
+ X.u:=#4;
+ Y.u:=#5;
+ numeric dirav[],dirap[];
+ pair Fn[],Gn[];
+ n=0;
+ for p_=#1:
+ Gn[n]=p_;
+ Fn[n]=cm*(X.u*xpart(p_),Y.u*ypart(p_));
+ n:=n+1;
+ endfor;
+ N:=(n-1);
+ MinX=999;
+ MaxX=-999;
+ MinY=999;
+ MaxY=-999;
+ for k=0 upto N:
+ if xpart(Gn[k])<MinX:
+ MinX:=xpart(Gn[k]);
+ fi;
+ if xpart(Gn[k])>MaxX:
+ MaxX:=xpart(Gn[k]);
+ fi;
+ if ypart(Gn[k])<MinY:
+ MinY:=ypart(Gn[k]);
+ fi;
+ if ypart(Gn[k])>MaxY:
+ MaxY:=ypart(Gn[k]);
+ fi;
+ endfor;
+ if #6=0:
+ for k=MinY-1 step y.u until MaxY+1:
+ draw cm*((MinX-1)*X.u,k*Y.u)--cm*((MaxX+1)*X.u,k*Y.u) withcolor 0.75white;
+ endfor;
+ for k=MinX-1 step x.u until MaxX+1:
+ draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+ endfor;
+ else:
+ for k=MinY-1 step y.u until MaxY+1:
+ draw cm*((MinX)*X.u,k*Y.u)--cm*((MaxX)*X.u,k*Y.u) withcolor 0.75white;
+ endfor;
+ for k=MinX step x.u until MaxX:
+ draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+ endfor;
+ fi;
+ if #6=0:
+ for k=0 upto N:
+ fill cercles(Fn[k],0.5mm);
+ endfor;
+ else:
+ for k=1 upto N-1:
+ fill cercles(Fn[k],0.5mm);
+ endfor;
+ fi;
+ if #6=0:
+ drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+ drawarrow ((MinX-1)*X.u*cm,0)--((MaxX+1)*X.u*cm,0);
+ else:
+ drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+ drawarrow ((MinX)*X.u*cm,0)--((MaxX)*X.u*cm,0);
+ fi;
+ label.llft(btex O etex,(0,0));
+ dotlabel.bot(btex 1 etex,cm*X.u*(1,0));
+ dotlabel.lft(btex 1 etex,cm*Y.u*(0,1));
+ draw Fn[0]
+ for k=1 upto N:
+ ..Fn[k]
+ endfor;
+ \end{mplibcode}
+ \fi
+}
+
+\def\MPCourbe#1#2#3#4#5#6{%
+ \ifluatex
+ \mplibforcehmode
+ \begin{mplibcode}
+ x.u:=#2;
+ y.u:=#3;
+ X.u:=#4;
+ Y.u:=#5;
+ numeric dirav[],dirap[];
+ pair Fn[],Gn[];
+ n=0;
+ for p_=#1:
+ if (n mod 3)=0:
+ dirav[n div 3]=p_;
+ fi;
+ if (n mod 3)=1:
+ Gn[n div 3]=p_;
+ Fn[n div 3]=cm*(X.u*xpart(p_),Y.u*ypart(p_));
+ fi;
+ if (n mod 3)=2:
+ dirap[n div 3]=p_;
+ fi;
+ n:=n+1;
+ endfor;
+ N:=(n-1) div 3;
+ MinX=999;
+ MaxX=-999;
+ MinY=999;
+ MaxY=-999;
+ for k=0 upto N:
+ if xpart(Gn[k])<MinX:
+ MinX:=xpart(Gn[k]);
+ fi;
+ if xpart(Gn[k])>MaxX:
+ MaxX:=xpart(Gn[k]);
+ fi;
+ if ypart(Gn[k])<MinY:
+ MinY:=ypart(Gn[k]);
+ fi;
+ if ypart(Gn[k])>MaxY:
+ MaxY:=ypart(Gn[k]);
+ fi;
+ endfor;
+ if #6=0:
+ for k=MinY-1 step y.u until MaxY+1:
+ draw cm*((MinX-1)*X.u,k*Y.u)--cm*((MaxX+1)*X.u,k*Y.u) withcolor 0.75white;
+ endfor;
+ for k=MinX-1 step x.u until MaxX+1:
+ draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+ endfor;
+ else:
+ for k=MinY-1 step y.u until MaxY+1:
+ draw cm*((MinX)*X.u,k*Y.u)--cm*((MaxX)*X.u,k*Y.u) withcolor 0.75white;
+ endfor;
+ for k=MinX step x.u until MaxX:
+ draw cm*(k*X.u,(MinY-1)*Y.u)--cm*(k*X.u,(MaxY+1)*Y.u) withcolor 0.75white;
+ endfor;
+ fi;
+ if #6=0:
+ for k=0 upto N:
+ fill cercles(Fn[k],0.5mm);
+ endfor;
+ else:
+ for k=1 upto N-1:
+ fill cercles(Fn[k],0.5mm);
+ endfor;
+ fi;
+ if #6=0:
+ drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+ drawarrow ((MinX-1)*X.u*cm,0)--((MaxX+1)*X.u*cm,0);
+ else:
+ drawarrow (0,(MinY-1)*Y.u*cm)--(0,(MaxY+1)*Y.u*cm);
+ drawarrow ((MinX)*X.u*cm,0)--((MaxX)*X.u*cm,0);
+ fi;
+ label.llft(btex O etex,(0,0));
+ dotlabel.bot(btex 1 etex,cm*X.u*(1,0));
+ dotlabel.lft(btex 1 etex,cm*Y.u*(0,1));
+ draw Fn[0]{dir dirap[0]}
+ for k=1 upto (N-1):
+ ..{dir dirav[k]}Fn[k]{dir dirap[k]}
+ endfor
+ ..{dir dirav[N]}Fn[N];
+ \end{mplibcode}
+ \fi
+}
\newcommand{\Fonction}[2][]{%
\useKVdefault[ClesFonction]
\setKV[ClesFonction]{#1}
- \ignoreemptyitems%
- \readlist*\ListeFonction{#2}
- \StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{\i}[\temp]%
-
- \StrSubstitute{\useKV[ClesFonction]{Calcul}}{**}{^}[\tempa]%
- \StrSubstitute{\tempa}{*}{}[\tempab]%
- \ifboolKV[ClesFonction]{Ecriture}{%
- \ensuremath{\useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})=\tempab}
- }{}%
- \ifboolKV[ClesFonction]{Definition}{%
- \ensuremath{\useKV[ClesFonction]{Nom}:\useKV[ClesFonction]{Variable}\mapsto\tempab}
- }{}%
- \ifboolKV[ClesFonction]{Tableau}{%
- \buildtabfonction%
- }{}
-}
+ \ifboolKV[ClesFonction]{Points}{%
+ \toklistePtsFn{}%
+ \setsepchar[*]{,*/}%\ignoreemptyitems%
+ \readlist*\ListePoints{#2}%
+ \ifboolKV[ClesFonction]{Tangentes}{%
+ \foreachitem\compteur\in\ListePoints{%
+ \expandafter\UpdatePtsFn\compteur\nil%
+ }%
+ \ifboolKV[ClesFonction]{Prolonge}{%
+ \MPCourbe{\the\toklistePtsFn}{\useKV[ClesFonction]{PasX}}{\useKV[ClesFonction]{PasY}}{\useKV[ClesFonction]{UniteX}}{\useKV[ClesFonction]{UniteY}}{1}%
+ }{%
+ \MPCourbe{\the\toklistePtsFn}{\useKV[ClesFonction]{PasX}}{\useKV[ClesFonction]{PasY}}{\useKV[ClesFonction]{UniteX}}{\useKV[ClesFonction]{UniteY}}{0}%
+ }%
+ }{%
+ \foreachitem\compteur\in\ListePoints{%
+ \expandafter\UpdatePtsFN\compteur\nil%
+ }%
+ \ifboolKV[ClesFonction]{Prolonge}{%
+ \MPCourbePoints{\the\toklistePtsFn}{\useKV[ClesFonction]{PasX}}{\useKV[ClesFonction]{PasY}}{\useKV[ClesFonction]{UniteX}}{\useKV[ClesFonction]{UniteY}}{1}%
+ }{%
+ \MPCourbePoints{\the\toklistePtsFn}{\useKV[ClesFonction]{PasX}}{\useKV[ClesFonction]{PasY}}{\useKV[ClesFonction]{UniteX}}{\useKV[ClesFonction]{UniteY}}{0}%
+ }%
+ }%
+ }{%
+ \ignoreemptyitems%
+ \readlist*\ListeFonction{#2}
+ \StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{\i}[\temp]%
+ \StrSubstitute{\useKV[ClesFonction]{Calcul}}{**}{^}[\tempa]%
+ \StrSubstitute{\tempa}{*}{}[\tempab]%
+ \ifboolKV[ClesFonction]{Ecriture}{%
+ \ensuremath{\useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})=\tempab}
+ }{}%
+ \ifboolKV[ClesFonction]{Definition}{%
+ \ensuremath{\useKV[ClesFonction]{Nom}:\useKV[ClesFonction]{Variable}\mapsto\tempab}
+ }{}%
+ \ifboolKV[ClesFonction]{Tableau}{%
+ \buildtabfonction%
+ }{}%
+ }%
+}%
\def\buildtabfonction{%\\
\[%
@@ -8018,16 +8903,16 @@ vardef Positions(expr Step)=
\hline
\useKV[ClesFonction]{Variable}\xintFor* ##1 in {\xintSeq {1}{\ListeFonctionlen}}\do{&\num{\ListeFonction[##1]}}\\
\hline
- \useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})\xintFor* ##1 in {\xintSeq {1}{\ListeFonctionlen}}\do{& \StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{\ListeFonction[##1]}[\tempab]\num{\fpeval{\tempab}}}
+ \useKV[ClesFonction]{Nom}(\useKV[ClesFonction]{Variable})\xintFor* ##1 in {\xintSeq {1}{\ListeFonctionlen}}\do{& \StrSubstitute{\useKV[ClesFonction]{Calcul}}{\useKV[ClesFonction]{Variable}}{(\ListeFonction[##1])}[\tempab]\num{\fpeval{\tempab}}}
\\\hline
\end{array}
\]
}
-%%%%%%%
-%% Formules
-%%%%%%
-\setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carré,Solide=pavé droit,Figure=false,Angle=0,Ancre={(0,0)},Largeur=5cm}
+%%%
+% Formules
+%%%
+\setKVdefault[ClesFormule]{Perimetre=false,Aire=false,Volume=false,Surface=carré,Solide=pavé,Angle=0,Ancre={(0,0)},Largeur=5cm,Couleur=white}
\def\MPFigureCarre{%
\ifluatex
@@ -8496,7 +9381,6 @@ vardef Positions(expr Step)=
\mplibforcehmode
\begin{mplibcode}
drawoptions( dashed dashpattern(on1cm));
- % Figure(-10u,-10u,10u,10u);
u:=0.5cm;
z0=(-0.5,0)*u;
z1=(2.5,0.5)*u;
@@ -8788,7 +9672,6 @@ vardef Positions(expr Step)=
\mplibforcehmode
\begin{mplibcode}
drawoptions( dashed dashpattern(on1cm));
- % Figure(-5u,-5u,5u,5u);
pair A,B,C,H,I,J;
A=u*(0.5,1);
B-A=u*(1.4,0);
@@ -8866,12 +9749,13 @@ vardef Positions(expr Step)=
}
\newcommand\Formule[1][]{%
- \useKVdefault[ClesFormule]
- \setKV[ClesFormule]{#1}
- \setlength{\RoundedBoxWidth}{\useKV[ClesFormule]{Largeur}}
+ \useKVdefault[ClesFormule]%
+ \setKV[ClesFormule]{#1}%
+ \setlength{\RoundedBoxWidth}{\useKV[ClesFormule]{Largeur}}%
+ \xdef\ColorFill{\useKV[ClesFormule]{Couleur}}%
\ifboolKV[ClesFormule]{Perimetre}{%
\begin{tikzpicture}[remember picture, overlay]
- \node[draw,dashed,rounded corners,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
+ \node[draw,fill=\ColorFill,dashed,rounded corners,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
\IfStrEqCase{\useKV[ClesFormule]{Surface}}{%
{carré}{\begin{center}
\MPFigureCarre\par
@@ -8883,7 +9767,7 @@ vardef Positions(expr Step)=
Périmètre d'un polygone : \par$\text{Somme des côtés}$
\end{center}
}%
- {rectangle}{
+ {rectangle}{%
\begin{center}
\MPFigureRectangle\par
Périmètre d'un rectangle : \par$2\times(L+\ell)$
@@ -8907,7 +9791,7 @@ vardef Positions(expr Step)=
Périmètre d'un cercle : \par$\pi\times\text{diamètre}$
\end{center}
}%
- {parallélogramme}{
+ {parallélogramme}{%
\begin{center}
\MPFigureParallelogramme\par
Périmètre d'un parallélogramme : \par Somme des côtés
@@ -8917,7 +9801,7 @@ vardef Positions(expr Step)=
\end{tikzpicture}
}{\ifboolKV[ClesFormule]{Aire}{%
\begin{tikzpicture}[remember picture, overlay]
- \node[draw,dashed,rounded corners=2,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
+ \node[draw,fill=\ColorFill,dashed,rounded corners=2,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
\IfStrEqCase{\useKV[ClesFormule]{Surface}}{%
{carré}{\begin{center}
\MPFigureCarre\par
@@ -8963,7 +9847,7 @@ vardef Positions(expr Step)=
\end{tikzpicture}
}{%Volume
\begin{tikzpicture}[remember picture, overlay]
- \node[draw,dashed,rounded corners=2,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
+ \node[draw,fill=\ColorFill,dashed,rounded corners=2,rotate={\useKV[ClesFormule]{Angle}}] (test) at \useKV[ClesFormule]{Ancre} {\begin{minipage}{\RoundedBoxWidth}%
\IfStrEqCase{\useKV[ClesFormule]{Solide}}{%
{boule}{\begin{center}
\MPFigureSphere\par
@@ -9012,10 +9896,10 @@ vardef Positions(expr Step)=
}
}
-%%%%%%%%%%
-%%% Proba
-%%%%%%%%%%
-\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=0}
+%%%
+% Proba
+%%%
+\setKVdefault[ClesProba]{Echelle=false,Arbre=false,Branche=2,Angle=60,Rayon=0.25,LongueurEchelle=5,Affichage=0,Grille=1}
\def\Updatetoksproba#1/#2\nil{\addtotok\toklistepointproba{"#1","\footnotesize #2",}}
\def\Updatetoksprobaechelle#1/#2/#3\nil{\addtotok\toklistepointproba{#1,#2,"#3",}}
@@ -9091,7 +9975,7 @@ vardef Positions(expr Step)=
dotlabel.top("",C[k]);
fi;
if (#3>2):
- label.bot(TEX("$\frac{"&decimal(num)&"}{"&decimal(deno)&"}$"),C[k]-u*(0,0.5));%Le \noexpand est nécessaire pour éviter un problème à la compilation, dû à l'expansion du \frac par gmp.
+ label.bot(TEX("$\frac{"&decimal(num)&"}{"&decimal(deno)&"}$"),C[k]-u*(0,0.5));
fi;
k:=k+1;
fi;
@@ -9271,10 +10155,10 @@ vardef Positions(expr Step)=
}
}
-%%%%%%%%%%%%%%
-%%%Reperage
-%%%%%%%%%%%%%%
-\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AffichageNom=false,AffichageCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,EchelleEspace=50,CouleurCoord=black}
+%%%
+% Reperage
+%%%
+\setKVdefault[ClesReperage]{Unitex=1,Pasx=1,Unitey=1,Pasy=1,Unitez=1,Pasz=1,DemiDroite=false,Droite=false,Plan=false,Trace=false,ListeSegment={},Espace=false,Sphere=false,AffichageNom=false,AffichageGrad=false,AffichageAbs=0,AffichageCoord=false,LectureCoord=false,ValeurUnitex=1,ValeurUnitey=1,ValeurOrigine=0,NomOrigine=O,EchelleEspace=50,CouleurCoord=black}
% ValeurOrigine permet de faire des morceaux de demi-droite graduée en passant par droite :)
\def\Updatetoksdroite#1/#2\nil{\addtotok\toklistepointdroite{#1,"#2",}}
@@ -9565,46 +10449,44 @@ vardef Positions(expr Step)=
}%
% Pour construire le repère du plan
-\def\buildrepere{%
+\def\buildreperenew{%
\toklistepointrepere{}%
\foreachitem\compteur\in\ListePointRepere{\expandafter\Updatetoksrepere\compteur\nil}%
\ifboolKV[ClesReperage]{Trace}{%
\[\MPPlanTrace{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{2}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}{\useKV[ClesReperage]{ListeSegment}}\]%
}{%
- \ifboolKV[ClesReperage]{AffichageNom}{%
- \ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPPlan{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{3}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}\]%
- }{%
- \[\MPPlan{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{2}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}\]%
- }
- }{%
- \ifboolKV[ClesReperage]{AffichageCoord}{%
- \[\MPPlan{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{1}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}\]%
- }{%
- \[\MPPlan{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\useKV[ClesReperage]{Unitey}}{\useKV[ClesReperage]{Pasy}}{\the\toklistepointrepere}{0}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurUnitey}}\]%
- }
- }%
+ \xdef\AfficheNom{0}\ifboolKV[ClesReperage]{AffichageNom}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{3}}{\xdef\AfficheNom{2}}}{\ifboolKV[ClesReperage]{LectureCoord}{\xdef\AfficheNom{1}}{}}%
+ \xdef\AfficheGrad{0}\ifboolKV[ClesReperage]{AffichageGrad}{\xdef\AfficheGrad{1}}{}%
+ \xdef\AfficheCoord{\useKV[ClesReperage]{AffichageAbs}}%
+ \MPPlannew{(\useKV[ClesReperage]{Unitex},\useKV[ClesReperage]{Pasx})}{(\useKV[ClesReperage]{Unitey},\useKV[ClesReperage]{Pasy})}{\the\toklistepointrepere}{\AfficheNom}{\AfficheCoord}{\AfficheGrad}{(\useKV[ClesReperage]{ValeurUnitex},\useKV[ClesReperage]{ValeurUnitey})}%
}%
}
-\def\MPPlan#1#2#3#4#5#6#7#8{%
+\def\MPPlannew#1#2#3#4#5#6#7{%
+ %#1 : Unitex, pasx
+ %#2 : unitey, pasy
+ %#3 : liste de points
+ %#4 : Affichage nom + lecture graphique
+ %#5 : Affichage des (abscisses/ordonnées)
+ %#6 : Graduation complète ?
+ %#7 : (unitex,unitey)
\ifluatex
\begin{mplibcode}
maxx:=-4000;
- minx=4000;
- unitex:=#1*cm;
- pasx=#2;
- unitpx:=unitex/pasx;
- maxy:=-4000;
- miny:=4000;
- unitey:=#3*cm;
- pasy:=#4;
- unitpy:=unitey/pasy;
- n:=1;
- vardef toto(text t)=
+ minx=4000;
+ unitex:=(xpart(#1))*cm;
+ pasx=ypart(#1);
+ unitpx:=unitex/pasx;
+ maxy:=-4000;
+ miny:=4000;
+ unitey:=(xpart(#2))*cm;
+ pasy:=ypart(#2);
+ unitpy:=unitey/pasy;
+ n:=1;
+ vardef toto(text t)=
for p_=t:
if (n mod 3)=1:
- if p_>maxx:
+ if p_>maxx:
maxx:=p_;
fi;
if p_<minx:
@@ -9623,22 +10505,22 @@ vardef Positions(expr Step)=
endfor;
maxx:=maxx+1;
minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
+ if maxx<(ypart(#1)+1):
+ maxx:=ypart(#1)+1;
fi;
- if minx>(-#2-1):
- minx:=-#2-1;
+ if minx>(-ypart(#1)-1):
+ minx:=-ypart(#1)-1;
fi;
maxy:=maxy+1;
miny:=miny-1;
- if maxy<(#4+1):
- maxy:=#2+1;
+ if maxy<(ypart(#2)+1):
+ maxy:=ypart(#2)+1;
fi;
- if miny>(-#4-1):
- miny:=-#4-1;
+ if miny>(-ypart(#2)-1):
+ miny:=-ypart(#2)-1;
fi;
enddef;
- toto(#5);
+ toto(#3);
Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
pair A,B,C,D,E;
A=(0,0);
@@ -9654,14 +10536,32 @@ vardef Positions(expr Step)=
endfor;
drawarrow (B+(-0.75*unitpx,0))--(C+(0.75*unitpx,0));
drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
- dotlabel.bot(TEX("\footnotesize\num{"&decimal(#7)&"}"),(unitex,0));
- dotlabel.lft(TEX("\footnotesize\num{"&decimal(#8)&"}"),(0,unitey));
- label.llft(btex 0 etex,A);
+ % graduation complète ou pas ?
+ label.llft(btex \footnotesize 0 etex,A);
+ if #6>0:
+ for k=minx upto maxx:
+ if (xpart((k*unitex,0))>xpart(B+(-0.75*unitpx,0))) and (xpart((k*unitex,0))<xpart(C+(0.75*unitpx,0))):
+ if k<>0:
+ dotlabel.lrt(TEX("\footnotesize\num{"&decimal(k)&"}"),(k*unitex,0));
+ fi;
+ fi;
+ endfor;
+ for k=miny upto maxy:
+ if (ypart((0,k*unitey))>ypart(D+(0,-0.75*unitpy))) and (ypart((0,k*unitey))<ypart(E+(0,0.75*unitpy))):
+ if k<>0:
+ dotlabel.ulft(TEX("\footnotesize\num{"&decimal(k)&"}"),(0,k*unitey));
+ fi;
+ fi;
+ endfor;
+ else:
+ dotlabel.lrt(TEX("\footnotesize\num{"&decimal(xpart(#7))&"}"),(unitex,0));
+ dotlabel.ulft(TEX("\footnotesize\num{"&decimal(ypart(#7))&"}"),(0,unitey));
+ fi;
% apparition du nom des points ou pas
m_c:=m_c*3;
marque_p:="croix";
vardef tata(text t)=%on place les points
- if #6>0:
+ if #4>0:
n:=1;
k:=0;%pour retenir la coordonnée en x
l:=0;%pour retenir la coordonnée en y
@@ -9677,15 +10577,14 @@ vardef Positions(expr Step)=
fi;
fi;
if (n mod 3)=0:
- if #6>1:
- message("p = "&p_);
- % if p_<>"":
+ if #4>1:
+ if p_<>"":
if (k>0) and (l>0):
label.urt(TEX(p_),(k*unitpx,l*unitpy));
fi;
- if (k=0) and (l>0):
- label.urt(TEX(p_),(k*unitpx,l*unitpy));
- fi;
+ if (k=0) and (l>0):
+ label.urt(TEX(p_),(k*unitpx,l*unitpy));
+ fi;
if (k>0) and (l=0):
label.urt(TEX(p_),(k*unitpx,l*unitpy));
fi;
@@ -9705,35 +10604,92 @@ vardef Positions(expr Step)=
label.lrt(TEX(p_),(k*unitpx,l*unitpy));
fi;
pointe((k*unitpx,l*unitpy));
- % fi;
fi;
- if (#6=1) or (#6=3):
+ fi;
+ if (#4=1) or (#4=3):
draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
fi;
fi;
n:=n+1;
endfor;
fi;
+ if #5=2:
+ n:=1;
+ k:=0;%pour retenir la coordonnée en x
+ l:=0;%pour retenir la coordonnée en y
+ for p_=t:
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
+ fi;
+ fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
+ fi;
+ fi;
+ if (n mod 3)=0:
+ if p_<>"":
+ if (k mod pasx)<>0:
+ label.lrt(TEX("\footnotesize$\frac{\num{"&decimal(k)&"}}{\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
+ else:
+ label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ fi;
+ if (l mod pasy)<>0:
+ label.ulft(TEX("\footnotesize$\frac{\num{"&decimal(l)&"}}{\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
+ else:
+ label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ fi;
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
+ n:=n+1;
+ endfor;
+ elseif #5=1:
+ n:=1;
+ k:=0;%pour retenir la coordonnée en x
+ l:=0;%pour retenir la coordonnée en y
+ for p_=t:
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
+ fi;
+ fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
+ fi;
+ fi;
+ if (n mod 3)=0:
+ if p_<>"":
+ label.lrt(TEX("\footnotesize\num{\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ label.ulft(TEX("\footnotesize\num{\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
+ n:=n+1;
+ endfor;
+ fi;
enddef;
- tata(#5);
+ tata(#3);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfC-Geometrie;}]
- maxx:=-4000;
- minx=4000;
- unitex:=#1*cm;
- pasx=#2;
- unitpx:=unitex/pasx;
- maxy:=-4000;
- miny:=4000;
- unitey:=#3*cm;
- pasy:=#4;
- unitpy:=unitey/pasy;
- n:=1;
- vardef toto(text t)=
+ \begin{mpost}
+ maxx:=-4000;
+ minx=4000;
+ unitex:=(xpart(#1))*cm;
+ pasx=ypart(#1);
+ unitpx:=unitex/pasx;
+ maxy:=-4000;
+ miny:=4000;
+ unitey:=(xpart(#2))*cm;
+ pasy:=ypart(#2);
+ unitpy:=unitey/pasy;
+ n:=1;
+ vardef toto(text t)=
for p_=t:
if (n mod 3)=1:
- if p_>maxx:
+ if p_>maxx:
maxx:=p_;
fi;
if p_<minx:
@@ -9752,22 +10708,22 @@ vardef Positions(expr Step)=
endfor;
maxx:=maxx+1;
minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
+ if maxx<(ypart(#1)+1):
+ maxx:=ypart(#1)+1;
fi;
- if minx>(-#2-1):
- minx:=-#2-1;
+ if minx>(-ypart(#1)-1):
+ minx:=-ypart(#1)-1;
fi;
maxy:=maxy+1;
miny:=miny-1;
- if maxy<(#4+1):
- maxy:=#2+1;
+ if maxy<(ypart(#2)+1):
+ maxy:=ypart(#2)+1;
fi;
- if miny>(-#4-1):
- miny:=-#4-1;
+ if miny>(-ypart(#2)-1):
+ miny:=-ypart(#2)-1;
fi;
enddef;
- toto(#5);
+ toto(#3);
Figure((minx-1)*unitpx,(miny-1)*unitpy,(maxx+1)*unitpx,(maxy+1)*unitpy);
pair A,B,C,D,E;
A=(0,0);
@@ -9783,14 +10739,32 @@ vardef Positions(expr Step)=
endfor;
drawarrow (B+(-0.75*unitpx,0))--(C+(0.75*unitpx,0));
drawarrow (D+(0,-0.75*unitpy))--(E+(0,0.75*unitpy));
- dotlabel.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#7)&"}"),(unitex,0));
- dotlabel.lft(LATEX("\noexpand\footnotesize\num{"&decimal(#8)&"}"),(0,unitey));
- label.llft(btex 0 etex,A);
+ % graduation complète ou pas ?
+ label.llft(btex \noexpand\footnotesize 0 etex,A);
+ if #6>0:
+ for k=minx upto maxx:
+ if (xpart((k*unitex,0))>xpart(B+(-0.75*unitpx,0))) and (xpart((k*unitex,0))<xpart(C+(0.75*unitpx,0))):
+ if k<>0:
+ dotlabel.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(k*unitex,0));
+ fi;
+ fi;
+ endfor;
+ for k=miny upto maxy:
+ if (ypart((0,k*unitey))>ypart(D+(0,-0.75*unitpy))) and (ypart((0,k*unitey))<ypart(E+(0,0.75*unitpy))):
+ if k<>0:
+ dotlabel.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(k)&"}"),(0,k*unitey));
+ fi;
+ fi;
+ endfor;
+ else:
+ dotlabel.lrt(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(xpart(#7))&"}"),(unitex,0));
+ dotlabel.ulft(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(ypart(#7))&"}"),(0,unitey));
+ fi;
% apparition du nom des points ou pas
m_c:=m_c*3;
marque_p:="croix";
vardef tata(text t)=%on place les points
- if #6>0:
+ if #4>0:
n:=1;
k:=0;%pour retenir la coordonnée en x
l:=0;%pour retenir la coordonnée en y
@@ -9806,7 +10780,8 @@ vardef Positions(expr Step)=
fi;
fi;
if (n mod 3)=0:
- if #6>1:
+ if #4>1:
+ if p_<>"":
if (k>0) and (l>0):
label.urt(LATEX(p_),(k*unitpx,l*unitpy));
fi;
@@ -9833,15 +10808,73 @@ vardef Positions(expr Step)=
fi;
pointe((k*unitpx,l*unitpy));
fi;
- if (#6=1) or (#6=3):
+ fi;
+ if (#4=1) or (#4=3):
draw (0,l*unitpy)--(k*unitpx,l*unitpy)--(k*unitpx,0) dashed evenly;
fi;
fi;
n:=n+1;
endfor;
fi;
+ if #5=2:
+ n:=1;
+ k:=0;%pour retenir la coordonnée en x
+ l:=0;%pour retenir la coordonnée en y
+ for p_=t:
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
+ fi;
+ fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
+ fi;
+ fi;
+ if (n mod 3)=0:
+ if p_<>"":
+ if (k mod pasx)<>0:
+ label.lrt(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(k)&"}}{\noexpand\num{"&decimal(pasx)&"}}$"),(k*unitpx,0));
+ else:
+ label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ fi;
+ if (l mod pasy)<>0:
+ label.ulft(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{"&decimal(l)&"}}{\noexpand\num{"&decimal(pasy)&"}}$"),(0,l*unitpy));
+ else:
+ label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ fi;
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
+ n:=n+1;
+ endfor;
+ elseif #5=1:
+ n:=1;
+ k:=0;%pour retenir la coordonnée en x
+ l:=0;%pour retenir la coordonnée en y
+ for p_=t:
+ if (n mod 3)=1:
+ if numeric p_:
+ k:=p_;
+ fi;
+ fi;
+ if (n mod 3)=2:
+ if numeric p_:
+ l:=p_;
+ fi;
+ fi;
+ if (n mod 3)=0:
+ if p_<>"":
+ label.lrt(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(k)&"/"&decimal(pasx)&"}}"),(k*unitpx,0));
+ label.ulft(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(l)&"/"&decimal(pasy)&"}}"),(0,l*unitpy));
+ pointe((k*unitpx,0),(0,l*unitpy));
+ fi;
+ fi;
+ n:=n+1;
+ endfor;
+ fi;
enddef;
- tata(#5);
+ tata(#3);
\end{mpost}
\fi
}
@@ -10146,163 +11179,232 @@ vardef Positions(expr Step)=
\fi
}
-% Pour construire la demi-droite graduée
-\def\builddemidroite{%
- \toklistepointdroite{}%
- \foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdroite\compteur\nil}%
- \ifboolKV[ClesReperage]{DemiDroite}{%
- \ifboolKV[ClesReperage]{AffichageNom}{%
- \[\MPDemiGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{1}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}\]%
- }{%
- \[\MPDemiGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{0}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}\]%
- }
- }{%
- \ifboolKV[ClesReperage]{AffichageNom}{%
- \[\MPDroiteGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{1}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}\]%
- }{%
- \[\MPDroiteGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{0}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}\]%
- }%
- }%
-}%
-
-\def\MPDemiGraduee#1#2#3#4#5#6{%
- % #1 : unite
+\def\MPDEMIGraduee#1#2#3#4#5#6#7#8{%
+ % #1 : unite
% #2 : pas
% #3 : liste des points à placer en pas. pour gérer le cas des repérages fractionnaires
% #4 : on affiche le nom des points ou pas
% #5 : quelle est la valeur de la longueur unité ?
% #6 : la valeur de l'unité (ne sert à rien ici, mais en prévision
% de Droite)
+ % #7 : on affiche les abscisses ou pas : 0 non, 1 oui, 2 fraction
+ % #8 : on affiche tous les multiples de la graduation "principale"
\ifluatex
+ \mplibforcehmode
\begin{mplibcode}
maxx:=0;
- unitex:=#1*cm;
- pasx:=#2;
- unitp:=unitex/pasx;%unité de déplacement
- vardef toto(text t)=%On détermine le nombre "d'unités" à placer
- for p_=t:
- if numeric p_:
- if p_>maxx:
- maxx:=p_;
- fi;
- fi;
- endfor;
- maxx:=maxx+1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- enddef;
- toto(#3);
- Figure(-u,-u,(maxx+0.75)*unitp,u);
- pair A,B;
- A=(0,0);
- B=unitp*(maxx,0);
- drawarrow A--(B+(0.75*unitp,0));
- %marquage secondaire
- marque_s:=marque_s/3;
- for k=0 step 2 until (maxx):
- draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
- endfor;
- drawoptions();
- % marquage primaire
- marque_s:=marque_s*3;
- for k=0 step pasx until (maxx-1):
- draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
- endfor;
- % marquage des points
- m_c:=m_c*3;
- marque_p:="croix";
- labeloffset:=labeloffset*2;
- dotlabel.bot(TEX("\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
- label.bot(TEX("\footnotesize\num{"&decimal(#6)&"}"),A);
- vardef tata(text t)=%on place les points
- if #4>0:
- for p_=t:
- if numeric p_:
- label("",unitp*(p_,0));
- k:=p_;
- fi;
- if string p_:
- if p_<>"":
- label.top(TEX(p_),unitp*(k,0));
- pointe(unitp*(k,0));
- fi;
- fi;
- endfor;
- fi;
- enddef;
- tata(#3);
+ unitex:=#1*cm;
+ pasx:=#2;
+ unitp:=unitex/pasx;%unité de déplacement
+ vardef toto(text t)=%On détermine le nombre "d'unités" à placer
+ for p_=t:
+ if numeric p_:
+ if p_>maxx:
+ maxx:=p_;
+ fi;
+ fi;
+ endfor;
+ maxx:=maxx+1;
+ if maxx<(#2+1):
+ maxx:=#2+1;
+ fi;
+ enddef;
+ toto(#3);
+ Figure(-u,-u,(maxx+0.75)*unitp,u);
+ pair A,B;
+ A=(0,0);
+ B=unitp*(maxx,0);
+ drawarrow A--(B+(0.75*unitp,0));
+ % marquage secondaire
+ marque_s:=marque_s/3;
+ for k=0 step 2 until (maxx):
+ draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
+ endfor;
+ drawoptions();
+ % marquage primaire
+ marque_s:=marque_s*3;
+ for k=0 step pasx until (maxx-1):
+ draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
+ endfor;
+ % marquage des points
+ m_c:=m_c*3;
+ marque_p:="croix";
+ labeloffset:=labeloffset*2;
+ dotlabel.bot(TEX("\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
+ label.bot(TEX("\footnotesize\num{"&decimal(#6)&"}"),A);
+ if #8>0:
+ for k=2 upto maxx:
+ dotlabel.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}"),unitex*(k,0));
+ endfor;
+ fi;
+ vardef tata(text t)=%on place les points
+ if #4>0:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ label.top(TEX(p_),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
+ if #7=2:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ if ((#5*k) mod pasx)<>0:
+ label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(k,0));
+ else:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ fi;
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ elseif #7=1:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
+ enddef;
+ tata(#3);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfC-Geometrie;}]
- maxx:=0;
- unitex:=#1*cm;
- pasx:=#2;
- unitp:=unitex/pasx;%unité de déplacement
- vardef toto(text t)=%On détermine le nombre "d'unités" à placer
- for p_=t:
- if numeric p_:
- if p_>maxx:
- maxx:=p_;
- fi;
- fi;
- endfor;
- maxx:=maxx+1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- enddef;
- toto(#3);
- Figure(-u,-u,(maxx+0.75)*unitp,u);
- pair A,B;
- A=(0,0);
- B=unitp*(maxx,0);
- drawarrow A--(B+(0.75*unitp,0));
- %marquage secondaire
- marque_s:=marque_s/3;
- for k=0 step 2 until (maxx):
- draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
- endfor;
- drawoptions();
- % marquage primaire
- marque_s:=marque_s*3;
- for k=0 step pasx until (maxx-1):
- draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
- endfor;
- % marquage des points
- m_c:=m_c*3;
- marque_p:="croix";
- labeloffset:=labeloffset*2;
- dotlabel.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
- label.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#6)&"}"),A);
- vardef tata(text t)=%on place les points
- if #4>0:
- for p_=t:
- if numeric p_:
- label("",unitp*(p_,0));
- k:=p_;
- fi;
- if string p_:
- label.top(LATEX(p_),unitp*(k,0));
- if p_<>"":
- pointe(unitp*(k,0));
- fi;
- fi;
- endfor;
- fi;
- enddef;
- tata(#3);
-\end{mpost}
-\fi
+ \begin{mpost}
+ maxx:=0;
+ unitex:=#1*cm;
+ pasx:=#2;
+ unitp:=unitex/pasx;%unité de déplacement
+ vardef toto(text t)=%On détermine le nombre "d'unités" à placer
+ for p_=t:
+ if numeric p_:
+ if p_>maxx:
+ maxx:=p_;
+ fi;
+ fi;
+ endfor;
+ maxx:=maxx+1;
+ if maxx<(#2+1):
+ maxx:=#2+1;
+ fi;
+ enddef;
+ toto(#3);
+ Figure(-u,-u,(maxx+0.75)*unitp,u);
+ pair A,B;
+ A=(0,0);
+ B=unitp*(maxx,0);
+ drawarrow A--(B+(0.75*unitp,0));
+ % marquage secondaire
+ marque_s:=marque_s/3;
+ for k=0 step 2 until (maxx):
+ draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
+ endfor;
+ drawoptions();
+ % marquage primaire
+ marque_s:=marque_s*3;
+ for k=0 step pasx until (maxx-1):
+ draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
+ endfor;
+ % marquage des points
+ m_c:=m_c*3;
+ marque_p:="croix";
+ labeloffset:=labeloffset*2;
+ dotlabel.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
+ label.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#6)&"}"),A);
+ if #8>0:
+ for k=2 upto maxx:
+ dotlabel.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}"),unitex*(k,0));
+ endfor;
+ fi;
+ vardef tata(text t)=%on place les points
+ if #4>0:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ label.top(LATEX(p_),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
+ if #7=2:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ if ((#5*k) mod pasx)<>0:
+ label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(k,0));
+ else:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ fi;
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ elseif #7=1:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
+ enddef;
+ tata(#3);
+ \end{mpost}
+ \fi
}
-\def\MPDroiteGraduee#1#2#3#4#5#6{%
- % #1 : unite
- % #2 : pas
- % #3 : liste des points à placer en pas. pour gérer le cas des repérages fractionnaires
- % #4 : on affiche le nom des points ou pas
- % #5 : quelle est la valeur de la longueur unité ?
+% Pour construire les droite/demi-droite graduée
+\def\builddemidroitenew{%
+ \toklistepointdroite{}%
+ \foreachitem\compteur\in\ListePointDroite{\expandafter\Updatetoksdroite\compteur\nil}%
+ \xdef\AffichageNom{0}\ifboolKV[ClesReperage]{AffichageNom}{\xdef\AffichageNom{1}}{}
+ \xdef\AffichageCoord{\useKV[ClesReperage]{AffichageAbs}}
+ \xdef\AffichageGrad{0}\ifboolKV[ClesReperage]{AffichageGrad}{\xdef\AffichageGrad{1}}{}
+ \ifboolKV[ClesReperage]{DemiDroite}{%
+ \[\MPDEMIGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{\AffichageNom}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}{\AffichageCoord}{\AffichageGrad}\]%
+ }{%
+ \[\MPDROITEGraduee{\useKV[ClesReperage]{Unitex}}{\useKV[ClesReperage]{Pasx}}{\the\toklistepointdroite}{\AffichageNom}{\useKV[ClesReperage]{ValeurUnitex}}{\useKV[ClesReperage]{ValeurOrigine}}{\AffichageCoord}{\AffichageGrad}\]%
+ }%
+}%
+
+
+\def\MPDROITEGraduee#1#2#3#4#5#6#7#8{%
+ % #1 : unite
+ % #2 : pas
+ % #3 : liste des points à placer en pas. pour gérer le cas des repérages fractionnaires
+ % #4 : on affiche le nom des points ou pas
+ % #5 : quelle est la valeur de la longueur unité ?
+ % #6 : la valeur de l'unité
+ % #7 : on affiche les abscisses ou pas : 0 non, 1 oui, 2 fraction
+ % #8 : on affiche tous les multiples de la graduation "principale"
\ifluatex
+ \mplibforcehmode
\begin{mplibcode}
maxx:=0;
minx:=4000;
@@ -10310,67 +11412,71 @@ vardef Positions(expr Step)=
pasx:=#2;
unitp:=unitex/pasx;%unité de déplacement
vardef toto(text t)=%On détermine le nombre "d'unités" à placer
- for p_=t:
- if numeric p_:
- if p_>maxx:
- maxx:=p_;
- fi;
- if p_<minx:
- minx:=p_;
- fi;
- fi;
- endfor;
- maxx:=maxx+1;
- minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- if minx>(-#2-1):
- minx:=-#2-1;
- fi;
+ for p_=t:
+ if numeric p_:
+ if p_>maxx:
+ maxx:=p_;
+ fi;
+ if p_<minx:
+ minx:=p_;
+ fi;
+ fi;
+ endfor;
+ maxx:=maxx+(pasx div 2);
+ minx:=minx-(pasx div 2);
+ if maxx<(#2+1):
+ maxx:=#2+(pasx-1);
+ fi;
+ if minx>(-#2-1):
+ minx:=-#2-(pasx-1);
+ fi;
enddef;
toto(#3);
- Figure((minx-1)*u,-u,(maxx+1)*unitp,u);
+ Figure((minx-1)*unitp,-u,(maxx+1)*unitp,u);
pair A,B,C;
A=(0,0);
B=unitp*(maxx,0);
C=unitp*(minx,0);
drawarrow (C+unitp*(-0.75,0))--(B+unitp*(0.75,0));
+ % marquage secondaire
marque_s:=marque_s/3;
labeloffset:=labeloffset*2;
if ((maxx-minx) mod 2)=0:
-% show maxx; show minx;
for k=(minx+1) step 2 until (maxx-1):
draw marquedemidroite(C,B);
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
else:
- % show maxx; show minx;
for k=(minx) step 2 until (maxx-1):
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
fi;
- % marquage primaire%%%%%%%%%%%%%%%%%%%%%%%%
- marque_s:=marque_s*3;
- for k=0 step pasx until (maxx-pasx):
- draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
- endfor;
- for k=0 step -pasx until (minx+pasx):
- draw marquesegment((k/maxx)[A,B],((k-pasx)/maxx)[A,B]);
- endfor;
+ % marquage primaire
+ marque_s:=marque_s*3;
+ for k=0 step pasx until (maxx-pasx):
+ draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
+ endfor;
+ for k=0 step -pasx until (minx+pasx):
+ draw marquesegment((k/maxx)[A,B],((k-pasx)/maxx)[A,B]);
+ endfor;
+ % marquage des points
m_c:=m_c*3;
marque_p:="croix";
- dotlabel.bot(TEX("\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
+ labeloffset:=labeloffset*2;
+ label.bot(TEX("\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
label.bot(TEX("\footnotesize\num{"&decimal(#6)&"}"),A);
- if #5=1:
- label.top(TEX("I"),unitex*(1,0));
+ if #8>0:
+ for k=2 upto maxx:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"}}"),unitex*(k,0));%%%
+ endfor;
+ for k=minx upto -1:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"}}"),unitex*(k,0));%%%
+ endfor;
fi;
- label.top(TEX("O"),A);
vardef tata(text t)=%on place les points
if #4>0:
for p_=t:
if numeric p_:
- label("",unitp*(p_,0));
k:=p_;
fi;
if string p_:
@@ -10381,83 +11487,145 @@ vardef Positions(expr Step)=
fi;
endfor;
fi;
+ if #7=2:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ if ((#5*k) mod pasx)<>0:
+ label.bot(TEX("\footnotesize$\frac{\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}}{\num{"&decimal(pasx)&"}}$"),unitp*(k,0));
+ else:
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ fi;
+ pointe(unitp*(k-#6,0));
+ fi;
+ fi;
+ endfor;
+ elseif #7=1:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ label.bot(TEX("\footnotesize\num{\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
enddef;
tata(#3);
\end{mplibcode}
\else
- \begin{mpost}[mpsettings={input PfC-Geometrie;}]
+ \begin{mpost}
maxx:=0;
minx:=4000;
unitex:=#1*cm;
pasx:=#2;
unitp:=unitex/pasx;%unité de déplacement
vardef toto(text t)=%On détermine le nombre "d'unités" à placer
- for p_=t:
- if numeric p_:
- if p_>maxx:
- maxx:=p_;
- fi;
- if p_<minx:
- minx:=p_;
- fi;
- fi;
- endfor;
- maxx:=maxx+1;
- minx:=minx-1;
- if maxx<(#2+1):
- maxx:=#2+1;
- fi;
- if minx>(-#2-1):
- minx:=-#2-1;
- fi;
+ for p_=t:
+ if numeric p_:
+ if p_>maxx:
+ maxx:=p_;
+ fi;
+ if p_<minx:
+ minx:=p_;
+ fi;
+ fi;
+ endfor;
+ maxx:=maxx+(pasx div 2);
+ minx:=minx-(pasx div 2);
+ if maxx<(#2+1):
+ maxx:=#2+(pasx-1);
+ fi;
+ if minx>(-#2-1):
+ minx:=-#2-(pasx-1);
+ fi;
enddef;
toto(#3);
- Figure((minx-1)*u,-u,(maxx+1)*unitp,u);
+ Figure((minx-1)*unitp,-u,(maxx+1)*unitp,u);
pair A,B,C;
A=(0,0);
B=unitp*(maxx,0);
C=unitp*(minx,0);
drawarrow (C+unitp*(-0.75,0))--(B+unitp*(0.75,0));
+ % marquage secondaire
marque_s:=marque_s/3;
labeloffset:=labeloffset*2;
if ((maxx-minx) mod 2)=0:
-% show maxx; show minx;
for k=(minx+1) step 2 until (maxx-1):
draw marquedemidroite(C,B);
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
else:
- % show maxx; show minx;
for k=(minx) step 2 until (maxx-1):
draw marquesegment((k/maxx)[A,B],((k+1)/maxx)[A,B]);
endfor;
fi;
- % marquage primaire%%%%%%%%%%%%%%%%%%%%%%%%
- marque_s:=marque_s*3;
- for k=0 step pasx until (maxx-pasx):
- draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
- endfor;
- for k=0 step -pasx until (minx+pasx):
- draw marquesegment((k/maxx)[A,B],((k-pasx)/maxx)[A,B]);
- endfor;
+ % marquage primaire
+ marque_s:=marque_s*3;
+ for k=0 step pasx until (maxx-pasx):
+ draw marquesegment((k/maxx)[A,B],((k+pasx)/maxx)[A,B]);
+ endfor;
+ for k=0 step -pasx until (minx+pasx):
+ draw marquesegment((k/maxx)[A,B],((k-pasx)/maxx)[A,B]);
+ endfor;
+ % marquage des points
m_c:=m_c*3;
marque_p:="croix";
- dotlabel.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#5)&"}"),unitex*(1,0));
- label.bot(LATEX("\noexpand\footnotesize\num{"&decimal(#6)&"}"),A);
- if #5=1:
- label.top(LATEX("I"),unitex*(1,0));
+ labeloffset:=labeloffset*2;
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(#5)&"}"),unitex*(1,0));
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{"&decimal(#6)&"}"),A);
+ if #8>0:
+ for k=2 upto maxx:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"}}"),unitex*(k,0));%%%
+ endfor;
+ for k=minx upto -1:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"}}"),unitex*(k,0));%%%
+ endfor;
fi;
- label.top(LATEX("O"),A);
vardef tata(text t)=%on place les points
if #4>0:
for p_=t:
if numeric p_:
- label("",unitp*(p_,0));
k:=p_;
fi;
if string p_:
+ if p_<>"":
label.top(LATEX(p_),unitp*(k,0));
+ pointe(unitp*(k,0));
+ fi;
+ fi;
+ endfor;
+ fi;
+ if #7=2:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
+ if p_<>"":
+ if ((#5*k) mod pasx)<>0:
+ label.bot(LATEX("\noexpand\footnotesize$\noexpand\frac{\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"}}}{\noexpand\num{"&decimal(pasx)&"}}$"),unitp*(k,0));
+ else:
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#5)&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
+ fi;
+ pointe(unitp*(k-#6,0));
+ fi;
+ fi;
+ endfor;
+ elseif #7=1:
+ for p_=t:
+ if numeric p_:
+ k:=p_;
+ fi;
+ if string p_:
if p_<>"":
+ label.bot(LATEX("\noexpand\footnotesize\noexpand\num{\noexpand\fpeval{"&decimal(#6)&"+"&decimal(#5-(#6))&"*"&decimal(k)&"/"&decimal(pasx)&"}}"),unitp*(k,0));
pointe(unitp*(k,0));
fi;
fi;
@@ -10468,7 +11636,7 @@ vardef Positions(expr Step)=
\end{mpost}
\fi
}
-
+
\newcommand\Reperage[2][]{%
\useKVdefault[ClesReperage]%
\setKV[ClesReperage]{#1}%
@@ -10481,51 +11649,146 @@ vardef Positions(expr Step)=
}{\ifboolKV[ClesReperage]{Plan}{%
\setsepchar[*]{,*/}\ignoreemptyitems%
\readlist*\ListePointRepere{#2}%
- \buildrepere%
- }{\ifboolKV[ClesReperage]{Droite}{%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListePointDroite{#2}%
- \builddemidroite%
- }{%
- \setsepchar[*]{,*/}\ignoreemptyitems%
- \readlist*\ListePointDroite{#2}%
- \builddemidroite%
- }%
+ \buildreperenew%
+ }{%
+ \setsepchar[*]{,*/}\ignoreemptyitems%
+ \readlist*\ListePointDroite{#2}%
+ \builddemidroitenew%
}%
}%
}%
-
-%%%%%%%%
-%% Puissances
-%%%%%%
+%%%
+% Puissances
+%%%
\newcommand\Puissances[2]{%
- \ensuremath{
+ \ensuremath{%
\xintifboolexpr{#2=0}{1}{\xintifboolexpr{#2>0}{\xdef\total{\fpeval{#2-1}}#1\multido{\i=1+1}{\total}{\times#1}}{\xdef\total{\fpeval{-#2-1}}\frac{1}{#1\multido{\i=1+1}{\total}{\times#1}}}}%
- }
+ }%
}
-%%%%%%%%%
+%%%
% Ecritures d'unités
-%%%%%%%%%%
-\setKVdefault[Unites]{m=false,km=false,hm=false,dam=false,dm=false,cm=true,mm=false,g=true,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,kmh=true,ms=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false}
+%%%
+\setKVdefault[Unites]{m=false,km=false,hm=false,ha=false,dam=false,a=false,dm=false,cm=true,mm=false,um=false,nm=false,g=true,t=false,q=false,kg=false,hg=false,dag=false,dg=false,cg=false,mg=false,ug=false,ng=false,kmh=true,kms=false,ms=false,kgm=false,gcm=true,L=true,kL=false,hL=false,daL=false,dL=false,cL=false,mL=false,l=true,kl=false,hl=false,dal=false,dl=false,cl=false,ml=false,Go=true,Mo=false,ko=false,To=false,o=false,kWh=true,C=true,K=false,F=false}
+
+%D'apres https://tex.stackexchange.com/questions/38905/time-of-the-day-or-time-period-using-the-package-siunitx
+\ExplSyntaxOn
+\NewDocumentCommand \Temps { o > { \SplitArgument { 5 } { ; } } m }
+{
+ \group_begin:
+ \IfNoValueF {#1}
+ { \keys_set:nn { siunitx } {#1} }
+ \siunitx_hms_output:nnn #2
+ \group_end:
+}
+\cs_new_protected:Npn \siunitx_hms_output:nnn #1#2#3#4#5#6
+{
+ \IfNoValueF {#1}
+ {
+ \tl_if_blank:nF {#1}
+ {
+ \SI {#1} { \annee\xintifboolexpr{#1>1}{s}{} }
+ \IfNoValueF {#2} { ~ }
+ }
+ }
+ \IfNoValueF {#2}
+ {
+ \tl_if_blank:nF {#2}
+ {
+ \SI {#2} { \mois }
+ \IfNoValueF {#3} { ~ }
+ }
+ }
+ \IfNoValueF {#3}
+ {
+ \tl_if_blank:nF {#3}
+ {
+ \SI {#3} { \jour }
+ \IfNoValueF {#4} { ~ }
+ }
+ }
+ \IfNoValueF {#4}
+ {
+ \tl_if_blank:nF {#4}
+ {
+ \SI {#4} { \hour }
+ \IfNoValueF {#5} { ~ }
+ }
+ }
+ \IfNoValueF {#5}
+ {
+ \tl_if_blank:nF {#5}
+ {
+ \SI {#5} { \minute }
+ \IfNoValueF {#6} { ~ }
+ }
+ }
+ \IfNoValueF {#6}
+ { \tl_if_blank:nF {#6} { \SI {#6} { \second } } }
+}
+\ExplSyntaxOff
+
+\newcommand\Temp[2][]{%
+ \useKVdefault[Unites]%
+ \setKV[Unites]{#1}%
+ \ifboolKV[Unites]{F}{%
+ \SI{#2}{\fahrenheit}%
+ }{%
+ \ifboolKV[Unites]{K}{%
+ \SI{#2}{\kelvin}%
+ }{%
+ \SI{#2}{\celsius}%
+ }%
+ }%
+}%
+
+\newcommand\Conso[2][]{%
+ \SI{#2}{\kWh}%
+}
+
+\newcommand\Octet[2][]{%
+ \useKVdefault[Unites]%
+ \setKV[Unites]{#1}%
+ \ifboolKV[Unites]{o}{%
+ \SI{#2}{\octet}%
+ }{%
+ \ifboolKV[Unites]{ko}{%
+ \SI{#2}{\kilo\octet}%
+ }{\ifboolKV[Unites]{Mo}{%
+ \SI{#2}{\mega\octet}%
+ }{\ifboolKV[Unites]{To}{%
+ \SI{#2}{\tera\octet}%
+ }{%
+ \SI{#2}{\giga\octet}%
+ }%
+ }%
+ }%
+ }%
+}%
\newcommand\Lg[2][]{%
\useKVdefault[Unites]%
\setKV[Unites]{#1}%
- \ifboolKV[Unites]{km}{%
- \SI{#2}{\km}%
- }{\ifboolKV[Unites]{hm}{%
- \SI{#2}{\hecto\metre}%
- }{\ifboolKV[Unites]{dam}{%
- \SI{#2}{\deca\metre}%
- }{\ifboolKV[Unites]{dm}{%
- \SI{#2}{\dm}%
- }{\ifboolKV[Unites]{m}{%
- \SI{#2}{\m}%
- }{\ifboolKV[Unites]{mm}{%
- \SI{#2}{\mm}%
- }{\SI{#2}{\cm}%
+ \ifboolKV[Unites]{nm}{%
+ \SI{#2}{\nm}%
+ }{\ifboolKV[Unites]{um}{%
+ \SI{#2}{\um}%
+ }{\ifboolKV[Unites]{km}{%
+ \SI{#2}{\km}%
+ }{\ifboolKV[Unites]{hm}{%
+ \SI{#2}{\hecto\metre}%
+ }{\ifboolKV[Unites]{dam}{%
+ \SI{#2}{\deca\metre}%
+ }{\ifboolKV[Unites]{dm}{%
+ \SI{#2}{\dm}%
+ }{\ifboolKV[Unites]{m}{%
+ \SI{#2}{\m}%
+ }{\ifboolKV[Unites]{mm}{%
+ \SI{#2}{\mm}%
+ }{\SI{#2}{\cm}%
+ }%
+ }%
}%
}%
}%
@@ -10537,19 +11800,32 @@ vardef Positions(expr Step)=
\newcommand\Masse[2][]{%
\useKVdefault[Unites]%
\setKV[Unites]{#1}%
- \ifboolKV[Unites]{kg}{%
- \SI{#2}{\kg}%
- }{\ifboolKV[Unites]{hg}{%
- \SI{#2}{\hecto\gram}%
- }{\ifboolKV[Unites]{dag}{%
- \SI{#2}{\deca\gram}%
- }{\ifboolKV[Unites]{dg}{%
- \SI{#2}{\deci\gram}%
- }{\ifboolKV[Unites]{cg}{%
- \SI{#2}{\centi\gram}%
- }{\ifboolKV[Unites]{mg}{%
- \SI{#2}{\milli\gram}%
- }{\SI{#2}{\gram}%
+ \ifboolKV[Unites]{ng}{%
+ \SI{#2}{\ng}%
+ }{\ifboolKV[Unites]{ug}{%
+ \SI{#2}{\ug}%
+ }{\ifboolKV[Unites]{t}{%
+ \SI{#2}{\tonne}%
+ }{\ifboolKV[Unites]{q}{%
+ \SI{#2}{\quintal}%
+ }{%
+ \ifboolKV[Unites]{kg}{%
+ \SI{#2}{\kg}%
+ }{\ifboolKV[Unites]{hg}{%
+ \SI{#2}{\hecto\gram}%
+ }{\ifboolKV[Unites]{dag}{%
+ \SI{#2}{\deca\gram}%
+ }{\ifboolKV[Unites]{dg}{%
+ \SI{#2}{\deci\gram}%
+ }{\ifboolKV[Unites]{cg}{%
+ \SI{#2}{\centi\gram}%
+ }{\ifboolKV[Unites]{mg}{%
+ \SI{#2}{\milli\gram}%
+ }{\SI{#2}{\gram}%
+ }%
+ }%
+ }%
+ }%
}%
}%
}%
@@ -10589,15 +11865,21 @@ vardef Positions(expr Step)=
\SI{#2}{\square\km}%
}{\ifboolKV[Unites]{hm}{%
\SI{#2}{\square\hecto\metre}%
- }{\ifboolKV[Unites]{dam}{%
- \SI{#2}{\square\deca\metre}%
- }{\ifboolKV[Unites]{dm}{%
- \SI{#2}{\square\dm}%
- }{\ifboolKV[Unites]{m}{%
- \SI{#2}{\square\metre}%
- }{\ifboolKV[Unites]{mm}{%
- \SI{#2}{\square\mm}%
- }{\SI{#2}{\square\cm}%
+ }{\ifboolKV[Unites]{ha}{%
+ \SI{#2}{\hectare}%
+ }{\ifboolKV[Unites]{dam}{%
+ \SI{#2}{\square\deca\metre}%
+ }{\ifboolKV[Unites]{a}{%
+ \SI{#2}{\are}%
+ }{\ifboolKV[Unites]{dm}{%
+ \SI{#2}{\square\dm}%
+ }{\ifboolKV[Unites]{m}{%
+ \SI{#2}{\square\metre}%
+ }{\ifboolKV[Unites]{mm}{%
+ \SI{#2}{\square\mm}%
+ }{\SI{#2}{\square\cm}%
+ }%
+ }%
}%
}%
}%
@@ -10636,7 +11918,11 @@ vardef Positions(expr Step)=
\ifboolKV[Unites]{ms}{%
\SI[per-mode=symbol]{#2}{\meter\per\second}%
}{%
- \SI[per-mode=symbol]{#2}{\kilo\meter\per\hour}%
+ \ifboolKV[Unites]{kms}{%
+ \SI[per-mode=symbol]{#2}{\kilo\meter\per\second}%
+ }{%
+ \SI[per-mode=symbol]{#2}{\kilo\meter\per\hour}%
+ }%
}%
}%
@@ -10650,177 +11936,378 @@ vardef Positions(expr Step)=
}%
}%
-%%%%%%%%%
-%% Tableaux d'unités
-%%%%%%%%%
-\setKVdefault[ClesTableaux]{Entiers=false,Decimaux=false,Milliards=false,Millions=false,Milliers=true,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Classes=false,Nombres=false,Metre=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,Colonnes=false,Prefixes=false}
+%%%
+% Tableaux d'unités
+%%%
+\setKVdefault[ClesTableaux]{Virgule=true,Entiers=false,Decimaux=false,Milliards=false,Millions=false,Micro=false,Nano=false,Partie=false,CouleurG=gray!15,CouleurM=gray!15,Couleurm=gray!15,Couleuru=gray!15,Classes=false,Nombres=false,Puissances=false,NbLignes=2,Metre=false,Are=false,Capacite=false,Carre=false,Cube=false,Litre=false,Gramme=false,Fleches=false,FlechesB=false,FlechesH=false,Colonnes=false,Prefixes=false}
\newcommand\Tableau[1][]{%
\useKVdefault[ClesTableaux]%
\setKV[ClesTableaux]{#1}%
+ %
+ %%% Clé Prefixes
+ %
\ifboolKV[ClesTableaux]{Prefixes}{%
- \setlength{\tabcolsep}{0.01\tabcolsep}
- \begin{center}
- \begin{tabular}{|*{12}{>{\centering\arraybackslash}m{3.25em}|}>{\columncolor{gray!15},}{c}|*{12}{>{\centering\arraybackslash}m{3.25em}|}}
+ \setlength{\tabcolsep}{0.01\tabcolsep}%
+ \begin{center}%
+ %
+ %%% Definition du tableau
+ %
+ \begin{tabular}{|*{\ifboolKV[ClesTableaux]{Milliards}{12}{%
+ \ifboolKV[ClesTableaux]{Millions}{9}{6}%
+ }}{>{\centering\arraybackslash}m{3.25em}|}>{\columncolor{gray!15}}{c}|*{%
+ \ifboolKV[ClesTableaux]{Micro}{6}{%
+ \ifboolKV[ClesTableaux]{Nano}{9}{3}%
+ }}%
+ {>{\centering\arraybackslash}m{3.25em}|}}%
+ %
+ %%% Prise en compte de la clé Partie
+ %
\ifboolKV[ClesTableaux]{Partie}{%
- \multicolumn{12}{c}{\bfseries Partie entière}
- &\multicolumn{1}{c}{\cellcolor{gray!15},}%
- &\multicolumn{12}{c}{\bfseries Partie décimale}\\}{}
+ \multicolumn{%
+ \ifboolKV[ClesTableaux]{Milliards}{12}{%
+ \ifboolKV[ClesTableaux]{Millions}{9}{6}%
+ }}{c}{\bfseries Partie entière}
+ &\multicolumn{1}{c}{\cellcolor{gray!15}\ifboolKV[ClesTableaux]{Virgule}{,}{}}%
+ &\multicolumn{%
+ \ifboolKV[ClesTableaux]{Micro}{6}{%
+ \ifboolKV[ClesTableaux]{Nano}{9}{3}%
+ }}%
+ {c}{\bfseries Partie décimale}\\}{}%
+ %
+ %%% Prise en compte de la clé Classes
+ %
\ifboolKV[ClesTableaux]{Classes}{%
- \hline%
- \multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe
- des milliards}%
- &\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe
+ \hline
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \cline{1-12}\multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe des milliards}%
+ &\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}%
+ &}{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \cline{1-9}\multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe
des millions}%
- &\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
+ &}{%
+ \cline{1-6}}}%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \multicolumn{3}{c|}}{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \multicolumn{3}{c|}}{\multicolumn{3}{|c|}}}%
+ {\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
des milliers}%
&\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{Couleuru}}Classe
des unités}%
- &&&&&&&&&&&&&\\}{}
- \hline
- %
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
+ &\multicolumn{%
+ \ifboolKV[ClesTableaux]{Micro}{6}{%
+ \ifboolKV[ClesTableaux]{Nano}{9}{3}%
+ }}%
+ {c|}{}\\}{}%
+ %
+ %%% Valeurs par défaut
+ %
+ \hline%
+ \ifboolKV[ClesTableaux]{Milliards}{%
&%
&\fontsize{8.5}{8.5}\selectfont giga%
&%
&%
&\fontsize{8.5}{8.5}\selectfont méga%
&%
+ }{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ &%
+ &\fontsize{8.5}{8.5}\selectfont méga%
+ &%
+ }{%
+ }}%
&%
&\fontsize{8.5}{8.5}\selectfont kilo%
&\fontsize{8.5}{8.5}\selectfont hecto%
&\fontsize{8.5}{8.5}\selectfont déca%
&\fontsize{8.5}{8.5}\selectfont unités%
- &%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
&\fontsize{8.5}{8.5}\selectfont deci%
&\fontsize{8.5}{8.5}\selectfont centi%
- &\fontsize{8.5}{8.5}\selectfont milli%
+ &\fontsize{8.5}{8.5}\selectfont milli%
+ \ifboolKV[ClesTableaux]{Micro}{&%
&%
+ &\fontsize{8.5}{8.5}\selectfont micro\\}{%
+ \ifboolKV[ClesTableaux]{Nano}{&%
&%
&\fontsize{8.5}{8.5}\selectfont micro%
&%
&%
- &\fontsize{8.5}{8.5}\selectfont nano%
+ &\fontsize{8.5}{8.5}\selectfont nano\\}{\\}%
+ }%
+ %
+ %%% Prise en compte de la clé Nombres
+ %
+ \ifboolKV[ClesTableaux]{Nombres}{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \fontsize{4.5}{4.5}\selectfont\num{100000000000}%
+ &\fontsize{4.5}{4.5}\selectfont\num{10000000000}%
+ &\fontsize{4.5}{4.5}\selectfont\num{1000000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{100000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000000}%
&%
+ }{}
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \fontsize{4.5}{4.5}\selectfont \num{100000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000000}%
&%
- &\\
- \ifboolKV[ClesTableaux]{Nombres}{%
+ }{}
+ \fontsize{4.5}{4.5}\selectfont \num{100000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{100}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1}%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,1} ou $\dfrac{\strut1}{\strut10}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,01} ou $\dfrac{\strut1}{\strut100}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,001} ou $\dfrac{\strut1}{\strut\num{1000}}$%
+ \ifboolKV[ClesTableaux]{Micro}{%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,0001} ou $\dfrac{\strut1}{\strut\num{10000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,00001} ou $\dfrac{\strut1}{\strut\num{100000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,000001} ou $\dfrac{\strut1}{\strut\num{1000000}}$%
+ }{%
+ \ifboolKV[ClesTableaux]{Nano}{%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,0001} ou $\dfrac{\strut1}{\strut\num{10000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,00001} ou $\dfrac{\strut1}{\strut\num{100000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,000001} ou $\dfrac{\strut1}{\strut\num{1000000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,0000001} ou $\dfrac{\strut1}{\strut\num{10000000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,00000001} ou $\dfrac{\strut1}{\strut\num{100000000}}$%
+ &\fontsize{4.5}{4.5}\selectfont \num{0,000000001} ou $\dfrac{\strut1}{\strut\num{1000000000}}$%
+ }{}%
+ }{}\\}{}%
+ %
+ %%% Prise en compte de la clé Puissances
+ %
+ \ifboolKV[ClesTableaux]{Puissances}{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
&%
&\fontsize{4.5}{4.5}\selectfont $\times10^{9}$%
&%
&%
&\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ \ifboolKV[ClesTableaux]{Millions}{%
&%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ }}%
&%
&\fontsize{4.5}{4.5}\selectfont $\times10^3$%
&\fontsize{4.5}{4.5}\selectfont $\times\num{10}^2$%
&\fontsize{4.5}{4.5}\selectfont $\times\num{10}^1$%
&\fontsize{4.5}{4.5}\selectfont $\times\num{1}$%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-1}$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-2}$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-3}$%
+ \ifboolKV[ClesTableaux]{Micro}{&%
&%
- &\fontsize{4.5}{4.5}\selectfont$\times\num{10}^{-1}$%
- &\fontsize{4.5}{4.5}\selectfont$\times\num{10}^{-2}$%
- &\fontsize{4.5}{4.5}\selectfont$\times\num{10}^{-3}$%
- &%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-6}$}{%
+ \ifboolKV[ClesTableaux]{Nano}{&%
&%
&\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-6}$%
&%
&%
- &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-9}$%
- &
- &
- &\\
- }{}
- \hline
- &&&&&&&&&&&&&&&&&&&&&&&&\\
- &&&&&&&&&&&&&&&&&&&&&&&&\\
- \end{tabular}
- \end{center}
- \setlength{\tabcolsep}{100\tabcolsep}
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-9}$}{}%
+ }%
+ \\%
+ }{}%
+ %
+ %%% Lignes vierges
+ %
+ \hline%
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ &&&&&&%
+ }{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ &&&%
+ }{%
+ }}%
+ &&&&&&,&&&%
+ \ifboolKV[ClesTableaux]{Micro}{&&&}{%
+ \ifboolKV[ClesTableaux]{Nano}{&&&&&&}{}%
+ }
+ \\}%
+ \end{tabular}%
+ \end{center}%
+ \setlength{\tabcolsep}{100\tabcolsep}%
}{}%
+ %
+ %%% Clé Entiers
+ %
\ifboolKV[ClesTableaux]{Entiers}{%
- \setlength{\tabcolsep}{0.01\tabcolsep}
- \begin{center}
- \begin{tabular}{|*{12}{>{\centering\arraybackslash}m{4.75em}|}}
- \ifboolKV[ClesTableaux]{Classes}{\hline\multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe
- des milliards}%
- &\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe
- des millions}%
- &\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
+ \setlength{\tabcolsep}{0.01\tabcolsep}%
+ \begin{center}%
+ %
+ %%% Definition du tableau
+ %
+ \begin{tabular}{|*{%
+ \ifboolKV[ClesTableaux]{Milliards}{12}{%
+ \ifboolKV[ClesTableaux]{Millions}{9}{6}%
+ }%
+ }{>{\centering\arraybackslash}m{4.75em}|}}%
+ \ifboolKV[ClesTableaux]{Classes}{%
+ \hline
+ \ifboolKV[ClesTableaux]{Milliards}{\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe des milliards}&\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}&}{}
+ \ifboolKV[ClesTableaux]{Millions}{\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}&}{}
+ \multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
des milliers}%
&\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{Couleuru}}Classe des unités}\\}{}
\hline
+ \ifboolKV[ClesTableaux]{Milliards}{%
\fontsize{4.5}{4.5}\selectfont centaines de milliards%
&\fontsize{4.5}{4.5}\selectfont dizaines de milliards%
&\fontsize{4.5}{4.5}\selectfont unités de milliards%
&\fontsize{4.5}{4.5}\selectfont centaines de millions%
&\fontsize{4.5}{4.5}\selectfont dizaines de millions%
&\fontsize{4.5}{4.5}\selectfont unités de millions%
- &\fontsize{4.5}{4.5}\selectfont centaines de milliers%
+ &
+ }{}
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \fontsize{4.5}{4.5}\selectfont centaines de millions%
+ &\fontsize{4.5}{4.5}\selectfont dizaines de millions%
+ &\fontsize{4.5}{4.5}\selectfont unités de millions%
+ &
+ }{}
+ \fontsize{4.5}{4.5}\selectfont centaines de milliers%
&\fontsize{4.5}{4.5}\selectfont dizaines de milliers%
&\fontsize{4.5}{4.5}\selectfont unités de milliers%
&\fontsize{4.5}{4.5}\selectfont centaines%
&\fontsize{4.5}{4.5}\selectfont dizaines%
&\fontsize{4.5}{4.5}\selectfont unités\\%
\ifboolKV[ClesTableaux]{Nombres}{%
- \fontsize{4.5}{4.5}\selectfont \num{100000000000}%
- &\fontsize{4.5}{4.5}\selectfont \num{10000000000}%
- &\fontsize{4.5}{4.5}\selectfont \num{1000000000}%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \fontsize{4.5}{4.5}\selectfont\num{100000000000}%
+ &\fontsize{4.5}{4.5}\selectfont\num{10000000000}%
+ &\fontsize{4.5}{4.5}\selectfont\num{1000000000}%
&\fontsize{4.5}{4.5}\selectfont \num{100000000}%
&\fontsize{4.5}{4.5}\selectfont \num{10000000}%
&\fontsize{4.5}{4.5}\selectfont \num{1000000}%
- &\fontsize{4.5}{4.5}\selectfont \num{100000}%
+ &%
+ }{}
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \fontsize{4.5}{4.5}\selectfont \num{100000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000000}%
+ &%
+ }{}
+ \fontsize{4.5}{4.5}\selectfont \num{100000}%
&\fontsize{4.5}{4.5}\selectfont \num{10000}%
&\fontsize{4.5}{4.5}\selectfont \num{1000}%
&\fontsize{4.5}{4.5}\selectfont \num{100}%
&\fontsize{4.5}{4.5}\selectfont \num{10}%
&\fontsize{4.5}{4.5}\selectfont \num{1}%
\\
- }{}
- \hline
- &&&&&&&&&&&\\
- &&&&&&&&&&&\\
- \end{tabular}
- \end{center}
- \setlength{\tabcolsep}{100\tabcolsep}
+ }{}
+ %
+ %%% Prise en compte de la clé Puissances
+ %
+ \ifboolKV[ClesTableaux]{Puissances}{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{9}$%
+ &%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ }}%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^3$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^2$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^1$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{1}$%
+ \\%
+ }{}%
+ %
+ %%% Lignes vierges
+ %
+ \hline%
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ &&&&&&}{}%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ &&&}{}
+ &&&&&\\}%
+ \end{tabular}%
+ \end{center}%
+ \setlength{\tabcolsep}{100\tabcolsep}%
}{}%
+ %
+ %%% Clé Decimaux
+ %
\ifboolKV[ClesTableaux]{Decimaux}{%
- \setlength{\tabcolsep}{0.01\tabcolsep}
- \ifboolKV[ClesTableaux]{Milliards}{%
- \newcolumntype{X}{|*{12}{>{\centering\arraybackslash}m{4.75em}|}>{\columncolor{gray!15},}{c}|*{3}{>{\centering\arraybackslash}m{4.75em}|}}%
- }{\ifboolKV[ClesTableaux]{Millions}{%
- \newcolumntype{X}{|*{9}{>{\centering\arraybackslash}m{4.75em}|}>{\columncolor{gray!15},}{c}|*{3}{>{\centering\arraybackslash}m{4.75em}|}}%
- }{\newcolumntype{X}{|*{6}{>{\centering\arraybackslash}m{4.75em}|}>{\columncolor{gray!15},}{c}|*{3}{>{\centering\arraybackslash}m{4.75em}|}}%
- }
- }
- \begin{center}
- \begin{tabular}{X}
+ \setlength{\tabcolsep}{0.01\tabcolsep}%
+ \begin{center}%
+ %
+ %%% Definition du tableau
+ %
+ \begin{tabular}{|*{\ifboolKV[ClesTableaux]{Milliards}{12}{%
+ \ifboolKV[ClesTableaux]{Millions}{9}{6}%
+ }}{>{\centering\arraybackslash}m{4.75em}|}>{\columncolor{gray!15}}{c}|*{3}%
+ {>{\centering\arraybackslash}m{4.75em}|}}%
+ %
+ %%% Prise en compte de la clé Partie
+ %
\ifboolKV[ClesTableaux]{Partie}{%
- \ifboolKV[ClesTableaux]{Milliards}{\multicolumn{12}{c}{\bfseries Partie entière}}{\ifboolKV[ClesTableaux]{Millions}{\multicolumn{9}{c}{\bfseries Partie entière}}{\multicolumn{6}{c}{\bfseries Partie entière}}}
- &\multicolumn{1}{c}{\cellcolor{gray!15},}%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \multicolumn{12}{c}{\bfseries Partie entière}}{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \multicolumn{9}{c}{\bfseries Partie entière}}{%
+ \multicolumn{6}{c}{\bfseries Partie entière}}}%
+ &\multicolumn{1}{c}{\cellcolor{gray!15}\ifboolKV[ClesTableaux]{Virgule}{,}{}}%
&\multicolumn{3}{c}{\bfseries Partie décimale}\\}{}
+ %
+ %%% Prise en compte de la clé Classes
+ %
\ifboolKV[ClesTableaux]{Classes}{%
\hline%
- \ifboolKV[ClesTableaux]{Milliards}{\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe des milliards}\uppercase{&}\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}\uppercase{&}}{}
- \ifboolKV[ClesTableaux]{Millions}{\multicolumn{3}{|c}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}\uppercase{&}}{}
- \multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurG}}Classe des milliards}&\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}&}{}%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \multicolumn{3}{|c|}{\cellcolor{\useKV[ClesTableaux]{CouleurM}}Classe des millions}&}{}%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ \multicolumn{3}{c|}}{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ \multicolumn{3}{c|}}{\multicolumn{3}{|c|}}}%
+ {\cellcolor{\useKV[ClesTableaux]{Couleurm}}Classe
des milliers}%
&\multicolumn{3}{c|}{\cellcolor{\useKV[ClesTableaux]{Couleuru}}Classe
des unités}%
- &&&&\\}{}
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}&\multicolumn{3}{c|}{}\\}{}
+ %
+ %%% Valeurs ci-dessous par défaut
+ %
\hline
\ifboolKV[ClesTableaux]{Milliards}{%
\fontsize{4.5}{4.5}\selectfont centaines de milliards%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont dizaines de milliards%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont unités de milliards%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont centaines de millions%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont dizaines de millions%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont unités de millions%
- \uppercase{&}
+ &\fontsize{4.5}{4.5}\selectfont dizaines de milliards%
+ &\fontsize{4.5}{4.5}\selectfont unités de milliards%
+ &\fontsize{4.5}{4.5}\selectfont centaines de millions%
+ &\fontsize{4.5}{4.5}\selectfont dizaines de millions%
+ &\fontsize{4.5}{4.5}\selectfont unités de millions%
+ &
}{}
\ifboolKV[ClesTableaux]{Millions}{%
\fontsize{4.5}{4.5}\selectfont centaines de millions%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont dizaines de millions%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont unités de millions%
- \uppercase{&}
+ &\fontsize{4.5}{4.5}\selectfont dizaines de millions%
+ &\fontsize{4.5}{4.5}\selectfont unités de millions%
+ &
}{}
\fontsize{4.5}{4.5}\selectfont centaines de milliers%
&\fontsize{4.5}{4.5}\selectfont dizaines de milliers%
@@ -10828,53 +12315,84 @@ vardef Positions(expr Step)=
&\fontsize{4.5}{4.5}\selectfont centaines%
&\fontsize{4.5}{4.5}\selectfont dizaines%
&\fontsize{4.5}{4.5}\selectfont unités%
- &%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
&\fontsize{4.5}{4.5}\selectfont dixièmes%
&\fontsize{4.5}{4.5}\selectfont centièmes%
&\fontsize{4.5}{4.5}\selectfont millièmes\\
\ifboolKV[ClesTableaux]{Nombres}{%
\ifboolKV[ClesTableaux]{Milliards}{%
\fontsize{4.5}{4.5}\selectfont\num{100000000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont\num{10000000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont\num{1000000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont \num{100000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont \num{10000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont \num{1000000}%
- \uppercase{&}%
+ &\fontsize{4.5}{4.5}\selectfont\num{10000000000}%
+ &\fontsize{4.5}{4.5}\selectfont\num{1000000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{100000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{10000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000000}%
+ &%
}{}
\ifboolKV[ClesTableaux]{Millions}{%
\fontsize{4.5}{4.5}\selectfont \num{100000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont \num{10000000}%
- \uppercase{&}\fontsize{4.5}{4.5}\selectfont \num{1000000}%
- \uppercase{&}%
- }{}
+ &\fontsize{4.5}{4.5}\selectfont \num{10000000}%
+ &\fontsize{4.5}{4.5}\selectfont \num{1000000}%
+ &%
+ }{}
\fontsize{4.5}{4.5}\selectfont \num{100000}%
&\fontsize{4.5}{4.5}\selectfont \num{10000}%
&\fontsize{4.5}{4.5}\selectfont \num{1000}%
&\fontsize{4.5}{4.5}\selectfont \num{100}%
&\fontsize{4.5}{4.5}\selectfont \num{10}%
&\fontsize{4.5}{4.5}\selectfont \num{1}%
- &%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
&\fontsize{4.5}{4.5}\selectfont \num{0,1} ou $\dfrac{\strut1}{\strut10}$%
&\fontsize{4.5}{4.5}\selectfont \num{0,01} ou $\dfrac{\strut1}{\strut100}$%
&\fontsize{4.5}{4.5}\selectfont \num{0,001} ou $\dfrac{\strut1}{\strut\num{1000}}$%
\\
+ }{}%
+ %
+ %%% Prise en compte de la clé Puissances
+ %
+ \ifboolKV[ClesTableaux]{Puissances}{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{9}$%
+ &%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ \ifboolKV[ClesTableaux]{Millions}{%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^{6}$%
+ &
+ }{%
+ }}%
+ &%
+ &\fontsize{4.5}{4.5}\selectfont $\times10^3$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^2$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^1$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{1}$%
+ &\ifboolKV[ClesTableaux]{Virgule}{,}{}%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-1}$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-2}$%
+ &\fontsize{4.5}{4.5}\selectfont $\times\num{10}^{-3}$%
+ \\%
}{}
- \hline
- \ifboolKV[ClesTableaux]{Milliards}{%
- \uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}}{} %
- \ifboolKV[ClesTableaux]{Millions}{%
- \uppercase{&}\uppercase{&}\uppercase{&}}{}
- &&&&&&&&&\\
- \ifboolKV[ClesTableaux]{Milliards}{%
- \uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}\uppercase{&}}{} %
+ \hline%
+ %
+ %%% Lignes vierges
+ %
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ \ifboolKV[ClesTableaux]{Milliards}{%
+ &&&&&&}{}%
\ifboolKV[ClesTableaux]{Millions}{%
- \uppercase{&}\uppercase{&}\uppercase{&}}{}
- &&&&&&&&&\\
+ &&&}{}
+ &&&&&&,&&&\\}
\end{tabular}
- \end{center}
- \setlength{\tabcolsep}{100\tabcolsep}
- }{}
+ \end{center}%
+ \setlength{\tabcolsep}{100\tabcolsep}%
+ }{}%
+ %
+ %%% Prise en compte de la clé Metre
+ %
\ifboolKV[ClesTableaux]{Metre}{%
\[\renewcommand{\arraystretch}{1.15}%
\begin{tabular}{|*{7}{p{7.5mm}|}}%
@@ -10888,7 +12406,8 @@ vardef Positions(expr Step)=
\hline
\multicolumn{1}{|c|}{km}&\multicolumn{1}{c|}{hm}&\multicolumn{1}{c|}{dam}&\multicolumn{1}{c|}{m}&\multicolumn{1}{c|}{dm}&\multicolumn{1}{c|}{cm}&\multicolumn{1}{c|}{mm}\\
\hline
- &&&&&&\\
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ &&&&&&\\}
\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (G1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (F1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (E1);}}%
@@ -10896,33 +12415,25 @@ vardef Positions(expr Step)=
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (C1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (B1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (A1);}}\\%
- \end{tabular}
- \]
- \ifboolKV[ClesTableaux]{Fleches}{%
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (A) to node[above, midway]{\small$\times\mbox{10}$}(B);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to node[above, midway]{\small$\times\mbox{10}$}(C);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to node[above, midway]{\small$\times\mbox{10}$}(D);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to node[above, midway]{\small$\times\mbox{10}$}(E);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to node[above, midway]{\small$\times\mbox{10}$}(F);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to node[above, midway]{\small$\times\mbox{10}$}(G);}
- % bas
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to node[below, midway]{\small$\div\mbox{10}$}(B1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to node[below, midway]{\small$\div\mbox{10}$}(C1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to node[below, midway]{\small$\div\mbox{10}$}(D1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to node[below, midway]{\small$\div\mbox{10}$}(E1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to node[below, midway]{\small$\div\mbox{10}$}(F1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to node[below, midway]{\small$\div\mbox{10}$}(G1);}
- }{}
- }
- {}
+ \end{tabular}%
+ \]%
+ \Conversion{10}%
+ }%
+ {}%
+ %
+ %%% Prise en compte de la clé Carre
+ %
\ifboolKV[ClesTableaux]{Carre}{%
\[\renewcommand{\arraystretch}{1.15}%
\ifboolKV[ClesTableaux]{Colonnes}{%
- \newcolumntype{X}{|*{7}{p{2.5mm}!{\color{gray!50}\vrule}p{2.5mm}|}}%
+ \newcolumntype{X}{|*{7}{>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}|}}%
}{%
- \newcolumntype{X}{|*{7}{p{2.5mm}p{2.5mm}|}}
- }
- \begin{tabular}{X}
+ \ifboolKV[ClesTableaux]{Are}{%
+ \newcolumntype{X}{|*{7}{>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}|}}%
+ }{
+ \newcolumntype{X}{|*{7}{p{3.5mm}p{3.5mm}|}}%
+ }}%
+ \begin{tabular}{X}%
\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate (A);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate (B);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate (C);}}%
@@ -10931,9 +12442,14 @@ vardef Positions(expr Step)=
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate (F);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate (G);}}\\%
\hline
- \multicolumn{2}{|c|}{km$^2$}&\multicolumn{2}{c|}{hm$^2$}&\multicolumn{2}{c|}{dam$^2$}&\multicolumn{2}{c|}{m$^2$}&\multicolumn{2}{c|}{dm$^2$}&\multicolumn{2}{c|}{cm$^2$}&\multicolumn{2}{c|}{mm$^2$}\\
- \hline
- &&&&&&&&&&&&&\\
+ \multicolumn{2}{|c|}{km$^2$}&\multicolumn{2}{c|}{hm$^2$}&\multicolumn{2}{c|}{dam$^2$}&\multicolumn{2}{c|}{m$^2$}&\multicolumn{2}{c|}{dm$^2$}&\multicolumn{2}{c|}{cm$^2$}&\multicolumn{2}{c|}{mm$^2$}\\%
+ \ifboolKV[ClesTableaux]{Are}{%
+ \cline{3-6}
+ \multicolumn{2}{|c|}{}&&{\scriptsize ha}&&{\scriptsize a}&\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{}&\multicolumn{2}{c|}{}\\
+ }{}
+ \hline
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
+ &&&&&&&&&&&&&\\}
\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=0.6em] (G1);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=0.6em] (F1);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=0.6em] (E1);}}%
@@ -10942,32 +12458,23 @@ vardef Positions(expr Step)=
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=0.6em] (B1);}}%
&\multicolumn{2}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=0.6em] (A1);}}\\%
\end{tabular}
- \]
- \ifboolKV[ClesTableaux]{Fleches}{%
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (A) to node[above, midway]{\small$\times\mbox{100}$}(B);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to node[above, midway]{\small$\times\mbox{100}$}(C);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to node[above, midway]{\small$\times\mbox{100}$}(D);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to node[above, midway]{\small$\times\mbox{100}$}(E);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to node[above, midway]{\small$\times\mbox{100}$}(F);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to node[above, midway]{\small$\times\mbox{100}$}(G);}
- % bas
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to node[below, midway]{\small$\div\mbox{100}$}(B1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to node[below, midway]{\small$\div\mbox{100}$}(C1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to node[below, midway]{\small$\div\mbox{100}$}(D1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to node[below, midway]{\small$\div\mbox{100}$}(E1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to node[below, midway]{\small$\div\mbox{100}$}(F1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to node[below, midway]{\small$\div\mbox{100}$}(G1);}
- }{}%
- }%
- {}%
+ \]%
+ \Conversion{100}%
+ }{}%
+ %
+ %%% Prise en compte de la clé Cube
+ %
\ifboolKV[ClesTableaux]{Cube}{%
\setlength{\tabcolsep}{0.625\tabcolsep}%
- \ifboolKV[ClesTableaux]{Colonnes}{%
- \newcolumntype{X}{|*{7}{p{2.5mm}!{\color{gray!50}\vrule}p{2.5mm}!{\color{gray!50}\vrule}p{2.5mm}|}}%
+ \ifboolKV[ClesTableaux]{Colonnes}{%
+ \newcolumntype{X}{|*{7}{>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}|}}%
}{%
- \newcolumntype{X}{|*{7}{p{2.5mm}p{2.5mm}p{2.5mm}|}}%
- }
- \[\renewcommand{\arraystretch}{1.15}
+ \ifboolKV[ClesTableaux]{Capacite}{%
+ \newcolumntype{X}{|*{7}{>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}!{\color{gray!50}\vrule}>{\centering\arraybackslash}p{3.5mm}|}}%
+ }{%
+ \newcolumntype{X}{|*{7}{p{3.5mm}p{3.5mm}p{3.5mm}|}}%
+ }}%
+ \[\renewcommand{\arraystretch}{1.15}%
\begin{tabular}{X}
\multicolumn{3}{c}{\tikz[remember picture,overlay]{\coordinate (A);}}%
&\multicolumn{3}{c}{\tikz[remember picture,overlay]{\coordinate (B);}}%
@@ -10978,8 +12485,14 @@ vardef Positions(expr Step)=
&\multicolumn{3}{c}{\tikz[remember picture,overlay]{\coordinate (G);}}\\%
\hline
\multicolumn{3}{|c|}{km$^3$}&\multicolumn{3}{c|}{hm$^3$}&\multicolumn{3}{c|}{dam$^3$}&\multicolumn{3}{c|}{m$^3$}&\multicolumn{3}{c|}{dm$^3$}&\multicolumn{3}{c|}{cm$^3$}&\multicolumn{3}{c|}{mm$^3$}\\
+ \ifboolKV[ClesTableaux]{Capacite}{%
+ \cline{10-15}
+ \multicolumn{3}{|c|}{}&\multicolumn{3}{c|}{}&\multicolumn{3}{c|}{}&{\scriptsize hL}&{\scriptsize daL}&{\scriptsize L}&{\scriptsize dL}&{\scriptsize cL}&{\scriptsize mL}&\multicolumn{3}{c|}{}&\multicolumn{3}{c|}{}\\
+ }{}%
\hline
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}}}\do{%
&&&&&&&&&&&&&&&&&&&&\\
+ }%
\multicolumn{3}{c}{\tikz[remember picture,overlay,yshift=\ht\strutbox]{\coordinate (G1);}}%
&\multicolumn{3}{c}{\tikz[remember picture,overlay,yshift=\ht\strutbox]{\coordinate (F1);}}%
&\multicolumn{3}{c}{\tikz[remember picture,overlay,yshift=\ht\strutbox]{\coordinate (E1);}}%
@@ -10988,75 +12501,41 @@ vardef Positions(expr Step)=
&\multicolumn{3}{c}{\tikz[remember picture,overlay,yshift=\ht\strutbox]{\coordinate (B1);}}%
&\multicolumn{3}{c}{\tikz[remember picture,overlay,yshift=\ht\strutbox]{\coordinate (A1);}}\\%
\end{tabular}
- \]
- \setlength{\tabcolsep}{1.6\tabcolsep}
- \ifboolKV[ClesTableaux]{Fleches}{%
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150]
- (A) to node[above, midway]{$\times\mbox{\num{1000}}$}(B);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to
- node[above, midway]{$\times\mbox{\num{1000}}$}(C);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to
- node[above, midway]{$\times\mbox{\num{1000}}$}(D);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to
- node[above, midway]{$\times\mbox{\num{1000}}$}(E);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to
- node[above, midway]{$\times\mbox{\num{1000}}$}(F);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to
- node[above, midway]{$\times\mbox{\num{1000}}$}(G);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(B1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(C1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(D1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(E1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(F1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to
- node[below, midway]{$\div\mbox{\num{1000}}$}(G1);}
- }{}
- }
- {}
+ \]%
+ \setlength{\tabcolsep}{1.6\tabcolsep}%
+ \Conversion{1000}%
+ }{}%
+ %
+ %%% Prise en compte de la clé Litre
+ %
\ifboolKV[ClesTableaux]{Litre}{%
\[\renewcommand{\arraystretch}{1.15}%
- \begin{tabular}{|*{7}{p{7.5mm}|}}
+ \begin{tabular}{|*{6}{p{7.5mm}|}}
\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (A);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (B);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (C);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (D);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (E);}}%
- &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (F);}}%
- &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (G);}}\\%
+ &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (F);}}\\%
\hline
- \multicolumn{1}{|c|}{kL}&\multicolumn{1}{c|}{hL}&\multicolumn{1}{c|}{daL}&\multicolumn{1}{c|}{L}&\multicolumn{1}{c|}{dL}&\multicolumn{1}{c|}{cL}&\multicolumn{1}{c|}{mL}\\
- \hline
- &&&&&&\\
- \multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (G1);}}%
- &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (F1);}}
+ \multicolumn{1}{|c|}{hL}&\multicolumn{1}{c|}{daL}&\multicolumn{1}{c|}{L}&\multicolumn{1}{c|}{dL}&\multicolumn{1}{c|}{cL}&\multicolumn{1}{c|}{mL}\\
+ \hline
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}-1}}\do{%
+ &&&&&\\}%
+ &&&&&\\%
+ \multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (F1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (E1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (D1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (C1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (B1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (A1);}}\\%
\end{tabular}
- \]
- \ifboolKV[ClesTableaux]{Fleches}{%
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (A) to node[above, midway]{\small$\times\mbox{10}$}(B);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to node[above, midway]{\small$\times\mbox{10}$}(C);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to node[above, midway]{\small$\times\mbox{10}$}(D);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to node[above, midway]{\small$\times\mbox{10}$}(E);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to node[above, midway]{\small$\times\mbox{10}$}(F);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to node[above, midway]{\small$\times\mbox{10}$}(G);}
- % bas
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to node[below, midway]{\small$\div\mbox{10}$}(B1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to node[below, midway]{\small$\div\mbox{10}$}(C1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to node[below, midway]{\small$\div\mbox{10}$}(D1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to node[below, midway]{\small$\div\mbox{10}$}(E1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to node[below, midway]{\small$\div\mbox{10}$}(F1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to node[below, midway]{\small$\div\mbox{10}$}(G1);}
- }{}%
+ \]%
+ \Conversion{10}%
}{}%
+ %
+ %%% Prise en compte de la clé Gramme
+ %
\ifboolKV[ClesTableaux]{Gramme}{%
\[\renewcommand{\arraystretch}{1.15}%
\begin{tabular}{|*{7}{p{7.5mm}|}}
@@ -11066,11 +12545,12 @@ vardef Positions(expr Step)=
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (D);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (E);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (F);}}%
- &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (G);}}
- \\%
+ &\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate (G);}}\\%
\hline
\multicolumn{1}{|c|}{kg}&\multicolumn{1}{c|}{hg}&\multicolumn{1}{c|}{dag}&\multicolumn{1}{c|}{g}&\multicolumn{1}{c|}{dg}&\multicolumn{1}{c|}{cg}&\multicolumn{1}{c|}{mg}\\
\hline
+ \xintFor* ##1 in {\xintSeq{1}{\useKV[ClesTableaux]{NbLignes}-1}}\do{%
+ &&&&&&\\}%
&&&&&&\\
\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (G1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (F1);}}%
@@ -11080,21 +12560,483 @@ vardef Positions(expr Step)=
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (B1);}}%
&\multicolumn{1}{c}{\tikz[remember picture,overlay]{\coordinate[yshift=1em] (A1);}}\\%
\end{tabular}
- \]
- \ifboolKV[ClesTableaux]{Fleches}{%
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (A) to node[above, midway]{\small$\times\mbox{10}$}(B);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to node[above, midway]{\small$\times\mbox{10}$}(C);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to node[above, midway]{\small$\times\mbox{10}$}(D);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to node[above, midway]{\small$\times\mbox{10}$}(E);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to node[above, midway]{\small$\times\mbox{10}$}(F);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to node[above, midway]{\small$\times\mbox{10}$}(G);}
-% % bas
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to node[below, midway]{\small$\div\mbox{10}$}(B1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to node[below, midway]{\small$\div\mbox{10}$}(C1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to node[below, midway]{\small$\div\mbox{10}$}(D1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to node[below, midway]{\small$\div\mbox{10}$}(E1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to node[below, midway]{\small$\div\mbox{10}$}(F1);}
- \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to node[below, midway]{\small$\div\mbox{10}$}(G1);}
- }{}%
+ \]%
+ \Conversion{10}%
+ }{}%
+}%
+
+\newcommand\Conversion[1]{%
+ \ifboolKV[ClesTableaux]{Fleches}{\setKV[ClesTableaux]{FlechesH,FlechesB}}{}%
+ \ifboolKV[ClesTableaux]{FlechesH}{%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (A) to node[above, midway]{\small$\times\num{#1}$}(B);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (B) to node[above, midway]{\small$\times\num{#1}$}(C);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (C) to node[above, midway]{\small$\times\num{#1}$}(D);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (D) to node[above, midway]{\small$\times\num{#1}$}(E);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (E) to node[above, midway]{\small$\times\num{#1}$}(F);}%
+ \ifboolKV[ClesTableaux]{Litre}{}{\tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=30,in=150] (F) to node[above, midway]{\small$\times\num{#1}$}(G);}%
+ }%
}{}%
+ \ifboolKV[ClesTableaux]{FlechesB}{%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (A1) to node[below, midway]{\small$\div\num{#1}$}(B1);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (B1) to node[below, midway]{\small$\div\num{#1}$}(C1);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (C1) to node[below, midway]{\small$\div\num{#1}$}(D1);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (D1) to node[below, midway]{\small$\div\num{#1}$}(E1);}%
+ \tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (E1) to node[below, midway]{\small$\div\num{#1}$}(F1);}%
+ \ifboolKV[ClesTableaux]{Litre}{}{\tikz[remember picture, overlay]{\draw[gray,->,>=latex,out=-150,in=-30] (F1) to node[below, midway]{\small$\div\num{#1}$}(G1);}}%
+ }{}%
+}%
+
+%%%
+% Cards
+%%%
+\newtcolorbox{Mybox}[3]{%
+ enhanced,
+ nobeforeafter,
+ left=0pt,right=0pt,top=0pt,
+ text fill,
+ width=\largeurcarte,
+ height=\hauteurcarte,
+ arc=5pt,
+ overlay unbroken and first={%
+ \coordinate[yshift=-0.5\hauteurtitre] (A1) at (frame.north west);
+ \coordinate[yshift=-0.5\hauteurtitre] (B1) at (frame.north east);
+ \coordinate[yshift=-\hauteurtitre] (A) at (frame.north west);
+ \coordinate[yshift=-\hauteurtitre] (B) at (frame.north east);
+ \coordinate[xshift=1.5pt,yshift=8mm] (S1) at (frame.south west);
+ \coordinate[xshift=-1.5pt,yshift=8mm] (S2) at (frame.south east);
+ \coordinate[xshift=3mm+(\largeurtitre/2)] (A2) at (A1);
+ \coordinate[xshift=-3mm-(\largeurtitre/2)] (B2) at (B1);
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T1) at (A2){};
+ \node[TexteCouleur] (T1a) at (T1){\Large #1};
+ \node[yshift=-0.65cm] (T1b) at (T1){\tiny réponse précédente};
+ \node[inner sep=0pt,rounded corners, rectangle, draw=black,minimum height=1cm,text width=\largeurtitre,fill=TrameCouleur] (T2) at (B2){};
+ \node[inner sep=0pt,TexteCouleur] (T2a) at (T2){
+ \begin{minipage}{\largeurtitre}
+ \begin{center}
+ #2
+ \end{center}
+ \end{minipage}
+ };
+ \node[yshift=-0.65cm] (T2b) at (T2){};
+ \ifboolKV[Cards]{Titre}{\node[] at (T2b) {\tiny\useKV[Cards]{NomTitre}};}{},
+ \node[rectangle,xshift=5mm,yshift=4.25mm,minimum width=2em,rounded corners,fill=TrameCouleur,draw=black] (R) at (frame.south west) {\color{black}\Large\bfseries #3};
+ \draw[dashed] (S1) -- (S2);
+ },
+ colback=white,
+ colbacktitle=TrameCouleur,
+}
+
+\usetikzlibrary{backgrounds}
+
+\makeatletter
+%https://tex.stackexchange.com/questions/347434/clip-background-image-inside-tcolorbox
+\newtcolorbox{MyboxSimpleAv}[1]{%
+ enhanced,
+ nobeforeafter,
+ left=0pt,right=0pt,top=\hauteurtitre,bottom=0pt,
+ text fill,
+ width=\largeurcarte,
+ height=\hauteurcarte,
+ arc=5pt,
+ colback=white,
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAv}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb@height,
+ width=\tcb@width,
+ ]{\useKV[Cards]{ImageAv}}};
+ \end{tcbclipinterior},
+ }{}
+ },
+ overlay unbroken and first={%
+ \coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T1) at
+ (A){\begin{minipage}{\largeurcarte-6mm}
+ \begin{center}
+ #1
+ \end{center}
+ \end{minipage}};
+ \node[yshift=-0.5em-0.5\hauteurtitre] (B) at (A){};
+ \ifboolKV[Cards]{Titre}{\node[fill=white] at (B) {\useKV[Cards]{NomTitre}};}{},
+ }
+}
+
+\newtcolorbox{MyboxSimpleAr}[1]{%
+ enhanced,
+ nobeforeafter,
+ left=0pt,right=0pt,top=\hauteurtitre,bottom=0pt,
+ text fill,
+ width=\largeurcarte,
+ height=\hauteurcarte,
+ arc=5pt,
+ colback=white,
+ underlay={%
+ \ifboolKV[Cards]{BackgroundAr}{%
+ \begin{tcbclipinterior}
+ \node[anchor=center,opacity=1]
+ at (interior.center) {%
+ \includegraphics[%
+ height=\tcb@height,
+ width=\tcb@width,
+ ]{\useKV[Cards]{ImageAr}}};
+ \end{tcbclipinterior},
+ }{}
+ },
+ overlay unbroken and first={%
+ \coordinate[yshift=-0.5\hauteurtitre] (A) at (frame.north);
+ \node[rounded corners, draw=black, rectangle,minimum height=1cm,text width=\largeurcarte-6mm,fill=TrameCouleur] (T1) at
+ (A){\begin{minipage}{\largeurcarte-6mm}
+ \begin{center}
+ #1
+ \end{center}
+ \end{minipage}};
+ %\node[yshift=-1em] (B) at (A){};
+ %\ifboolKV[Cards]{Titre}{\node[fill=white] at (B) {\useKV[Cards]{NomTitre}};}{},
+ }
+}
+\makeatother
+
+\newlength{\largeurcards}
+\newlength{\hauteurcards}
+\newlength{\largeurcarte}
+\newlength{\hauteurcarte}
+\newlength{\hauteurtitre}
+\newlength{\largeurtitre}
+
+\newlength{\margeh}
+\newlength{\margev}
+
+\NewEnviron{Trame}{%
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A) at (current page.north west);
+ \coordinate[yshift=-\margev] (B) at (current page.north east);
+ \coordinate[yshift=-\hauteurcards] (A1) at (A);
+ \coordinate[yshift=-\hauteurcards] (B1) at (B);
+ \coordinate[yshift=-\hauteurcards] (A2) at (A1);
+ \coordinate[yshift=-\hauteurcards] (B2) at (B1);
+ \coordinate[yshift=-\hauteurcards] (A3) at (A2);
+ \coordinate[yshift=-\hauteurcards] (B3) at (B2);
+ \coordinate[yshift=-\hauteurcards] (A4) at (A3);
+ \coordinate[yshift=-\hauteurcards] (B4) at (B3);
+ \coordinate[xshift=\margeh] (C) at (current page.north west);
+ \coordinate[xshift=\margeh] (D) at (current page.south west);
+ \coordinate[xshift=\largeurcards] (C1) at (C);
+ \coordinate[xshift=\largeurcards] (D1) at (D);
+ \coordinate[xshift=\largeurcards] (C2) at (C1);
+ \coordinate[xshift=\largeurcards] (D2) at (D1);
+ \coordinate[xshift=\largeurcards] (C3) at (C2);
+ \coordinate[xshift=\largeurcards] (D3) at (D2);
+ \draw (A) -- (B);
+ \draw (A1) -- (B1);
+ \draw (A2) -- (B2);
+ \draw (A3) -- (B3);
+ \draw (A4) -- (B4);
+ \draw (C)--(D);
+ \draw (C1)--(D1);
+ \draw (C2)--(D2);
+ \draw (C3)--(D3);
+ % point pour placer les cartes
+ \coordinate[xshift=\margeh+0.5\largeurcards,yshift=-0.5\hauteurcards] (Carte1) at (A);
+ \coordinate[xshift=\largeurcards,yshift=0mm] (Carte2) at (Carte1);
+ \coordinate[xshift=2\largeurcards,yshift=0mm] (Carte3) at (Carte1);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte4) at (Carte1);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte5) at (Carte2);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte6) at (Carte3);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte7) at (Carte4);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte8) at (Carte5);
+ \coordinate[xshift=0mm,yshift=-\hauteurcards] (Carte9) at (Carte6);
+ \BODY
+ \end{tikzpicture}
+}
+
+\setKVdefault[Cards]{Largeur=59,Hauteur=89,HauteurTheme=15,Marge=4,Landscape=false,Couleur=Cornsilk,Theme=Théorème\\de
+ Pythagore,ThemeSol=Solution,Trame=false,Titre=false,NomTitre=Jeu 1,Loop,BackgroundAv=false,BackgroundAr=false,ImageAv=4813762.jpg,ImageAr=4813762.jpg}
+
+\newcommand\Cartes[2][]{%
+ \useKVdefault[Cards]%
+ \setKV[Cards]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeCards{#2}%
+ \ifboolKV[Cards]{Landscape}{%
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{95mm}%
+ \setlength{\hauteurcards}{65mm}%
+ \setlength{\margeh}{(297mm-3\largeurcards)/2}%
+ \setlength{\margev}{(210mm-3\hauteurcards)/2}%
+ }{
+ \setlength{\hauteurcarte}{\fpeval{\useKV[Cards]{Hauteur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcarte}{\fpeval{\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}}mm}%
+ \setlength{\largeurcards}{65mm}
+ \setlength{\hauteurcards}{95mm}
+ \setlength{\margeh}{(210mm-3\largeurcards)/2}
+ \setlength{\margev}{(297mm-3\hauteurcards)/2}
+ }
+ \setlength{\hauteurtitre}{\fpeval{\useKV[Cards]{HauteurTheme}}mm}%
+ \setlength{\largeurtitre}{\fpeval{(\useKV[Cards]{Largeur}-\useKV[Cards]{Marge}-9)/2}mm}%
+ \colorlet{TexteCouleur}{black}
+ \colorlet{TrameCouleur}{\useKV[Cards]{Couleur}}
+ \ifboolKV[Cards]{Loop}{%
+ \ifboolKV[Cards]{Trame}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{Trame}
+ \multido{\i=1+1}{9}{%
+ \node at (Carte\i) {%
+ \begin{Mybox}{\ListeCards[\i,1]}{\useKV[Cards]{Theme}}{\ListeCards[\i,2]}%
+ \ListeCards[\i,3]%
+ \end{Mybox}%
+ };%
+ }%
+ \end{Trame}%
+ \clearpage%
+ }{%
+ \begin{Mybox}{\ListeCards[1,1]}{\useKV[Cards]{Theme}}{\ListeCards[1,2]}%
+ \ListeCards[1,3]%
+ \end{Mybox}%
+ }%
+ }{%
+ \ifboolKV[Cards]{Trame}{%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{Trame}
+ \multido{\i=1+1}{9}{%
+ \node[] at (Carte\i) {%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[\i,1]%
+ \end{MyboxSimpleAv}%
+ };%
+ }%
+ \end{Trame}%
+ \clearpage%
+ \thispagestyle{empty}%
+ \begin{Trame}
+ \multido{\i=1+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{4-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=4+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{10-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \multido{\i=7+1}{3}{%
+ \node at (Carte\i) {%
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[\fpeval{16-\i},2]%
+ \end{MyboxSimpleAr}%
+ };%
+ }%
+ \end{Trame}%
+ \clearpage%
+ }{%
+ \begin{MyboxSimpleAv}{\useKV[Cards]{Theme}}%
+ \ListeCards[1,1]%
+ \end{MyboxSimpleAv}
+ \begin{MyboxSimpleAr}{\useKV[Cards]{ThemeSol}}%
+ \ListeCards[1,2]%
+ \end{MyboxSimpleAr}
+ }%
+ }%
+}
+
+\newcommand\SolutionCarte[2]{%
+ \begin{center}
+ \bfseries#1
+ \end{center}
+
+ #2
+}
+
+%%%
+% Tableur
+%%%
+\setKVdefault[Tableur]{Colonnes=4,Largeur=3,Formule={},Cellule=A1,Ligne=0,Colonne=0,PasL=1,PasC=1}
+
+%Basé sur un code de Christian Télléchéa.
+\makeatletter
+\newcount\cntlin
+\newcount\cntcol
+
+\newtoks\t@b
+\long\def\ifremain@lines#1\\#2\@nil{%
+ \csname @\ifx\@empty#2\@empty second\else first\fi oftwo\endcsname}
+\long\def\subst@eol#1\\#2\@nil{\addtot@b{#1\\\hline}%
+ \ifremain@lines#2\\\@nil{\addtot@b&\subst@eol#2\@nil}{\addtot@b{#2\CodeAfter\xintifboolexpr{\useKV[Tableur]{Ligne}=0 || \useKV[Tableur]{Colonne}=0}{}{\tikz\draw[line width=2pt](row-\fpeval{\useKV[Tableur]{Ligne}+1}-|col-\fpeval{\useKV[Tableur]{Colonne}+1}) rectangle (row-\fpeval{\useKV[Tableur]{Ligne}+1+\useKV[Tableur]{PasL}}-|col-\fpeval{\useKV[Tableur]{Colonne}+1+\useKV[Tableur]{PasC}});}\end{NiceTabular}}}}
+\long\def\collectcp@body#1\end{\subst@eol#1\@nil\end}
+
+\newcommand\addtot@b[1]{\t@b\expandafter{\the\t@b#1}}
+\newcommand\edftot@b[1]{\edef\temp@{#1}\expandafter\addtot@b\expandafter{\temp@}}
+
+\newlength\LongInter
+\newlength\TotalInter
+
+\newenvironment{Tableur}[1][]{%
+ \useKVdefault[Tableur]%
+ \setKV[Tableur]{#1}%
+ \ttfamily%
+ \setlength{\LongInter}{\fpeval{(\useKV[Tableur]{Colonnes}-1)*\useKV[Tableur]{Largeur}-4}em+\fpeval{\useKV[Tableur]{Colonnes}*2-6}\tabcolsep+\fpeval{\useKV[Tableur]{Colonnes}-3}\arrayrulewidth}
+ \newcolumntype X{>{\centering\arraybackslash}p{\useKV[Tableur]{Largeur}em}}%
+ \begin{tabular}{|p{\useKV[Tableur]{Largeur}em}|p{1em}|p{5em}|p{\LongInter}|}
+ \cline{1-2}\cline{4-4}%
+ \useKV[Tableur]{Cellule}&\centering\arraybackslash\scriptsize$\blacktriangledown$&$f_x$\hfill$\sum$~\scriptsize$\blacktriangledown$\hfill$=$&\useKV[Tableur]{Formule}\hfill\scriptsize$\blacktriangledown$\\
+ \cline{1-2}\cline{4-4}%
+ \end{tabular}
+
+ \cntlin\z@
+ \t@b{%
+ \begin{NiceTabular}{%
+ |>{%
+ \columncolor{gray!15}
+ \global\cntcol\z@\global\advance\cntlin\@ne
+ \centering\arraybackslash
+ \ifnum\cntlin>\@ne\number\numexpr\cntlin-1\relax\fi}
+ p{2em}|*{\useKV[Tableur]{Colonnes}}{X|}}%
+ \hline
+ \rowcolor{gray!15}}%
+ \loop
+ \ifnum\cntcol<\useKV[Tableur]{Colonnes}
+ \advance\cntcol\@ne
+ \addtot@b{&}%
+ \edftot@b{{\noexpand\@Alph\the\cntcol}}%
+ \repeat
+ \addtot@b{\\\hline&}%
+ \collectcp@body}{\the\t@b}
+\makeatother
+
+%%%
+% Domino
+%%%
+\newtcolorbox{MyDominoMini}[1][]{%
+ enhanced,
+ nobeforeafter,
+ left skip=0pt,
+ right skip=0pt,
+ left=0pt,right=0pt,top=0pt,bottom=0pt,
+ width=\textwidth/\ColonneDomino,
+ height=\textheight/\LigneDomino,
+ segmentation style={solid, line width=1.5pt},
+ colback=\CouleurDomino,
+ center upper,
+ valign upper=center,
+ center lower,
+ valign lower=center,
+ arc=2pt,
+ #1
+}
+
+\newtcolorbox{MyDominoLogo}[1][]{%
+ enhanced,
+ nobeforeafter,
+ left skip=0pt,
+ right skip=0pt,
+ left=0pt,right=0pt,top=0pt,bottom=0pt,
+ width=\textwidth/\ColonneDomino,
+ height=\textheight/\LigneDomino,
+ valign=center,
+ halign=center,
+ arc=2pt,
+ colback=white,
+ #1
+}
+
+\NewEnviron{TrameDomino}{%
+ \setlength{\margev}{1cm}
+ \setlength{\margeh}{1cm}
+ \begin{tikzpicture}[remember picture,overlay]
+ % quadrillages horizontal et vertical
+ \coordinate[yshift=-\margev] (A0) at (current page.north west);
+ \coordinate[yshift=-\margev] (B0) at (current page.north east);
+ \foreach \i in {1,...,\useKV[Domino]{Lignes}}{%
+ \coordinate[yshift=-\i*\textheight/\LigneDomino] (A\i) at (A0);
+ \coordinate[yshift=-\i*\textheight/\LigneDomino] (B\i) at (B0);
+ }
+ \coordinate[xshift=\margeh] (C0) at (current page.north west);
+ \coordinate[xshift=\margeh] (D0) at (current page.south west);
+ \foreach \i in {1,...,\useKV[Domino]{Colonnes}}{
+ \coordinate[xshift=\i*\textwidth/\ColonneDomino] (C\i) at (C0);
+ \coordinate[xshift=\i*\textwidth/\ColonneDomino] (D\i) at (D0);
+ }
+ \foreach \i in {0,...,\LigneDomino}{%
+ \draw (A\i) -- (B\i);
+ }
+ \foreach \i in {0,...,\ColonneDomino}{%
+ \draw (C\i) -- (D\i);
+ }
+ \draw[blue, line width=3pt] (A0)--(B0);
+ \draw[blue, line width=3pt] (A\LigneDomino)--(B\LigneDomino);
+ \draw[blue, line width=3pt] (C0)--(D0);
+ \draw[blue, line width=3pt] (C\ColonneDomino)--(D\ColonneDomino);
+ % point pour placer les cartes
+ \foreach \i in {0,...,\fpeval{\ColonneDomino-1}}{%
+ \foreach \j in {0,...,\fpeval{\LigneDomino-1}}{%
+ \coordinate[xshift=\margeh+(0.5\textwidth/\ColonneDomino)+\i*\textwidth/\ColonneDomino,yshift=-0.5\textheight/\LigneDomino-\j*\textheight/\LigneDomino]
+ (Domino\fpeval{\i+\ColonneDomino*\j+1}) at (A0);
+ }
+ }
+ \BODY
+ \end{tikzpicture}
+}
+
+\setKVdefault[Domino]{Couleur=white,Trame,Ratio=0.5,Lignes=7,Colonnes=5,Superieur=false,Logo=false,Image=tiger.pdf}
+
+\newcommand\Dominos[2][]{%
+ \useKVdefault[Domino]%
+ \setKV[Domino]{#1}%
+ \setsepchar[*]{§*/}%
+ \readlist*\ListeDominos{#2}%
+ \xdef\CouleurDomino{\useKV[Domino]{Couleur}}%
+ \xdef\ratiodomino{\useKV[Domino]{Ratio}}%
+ \xdef\LigneDomino{\useKV[Domino]{Lignes}}%
+ \xdef\ColonneDomino{\useKV[Domino]{Colonnes}}%
+ \ifboolKV[Domino]{Trame}{%
+ \clearpage
+ \begin{TrameDomino}
+ \foreach\i in {1,...,\fpeval{\LigneDomino*\ColonneDomino}}{%
+ \node[] at (Domino\i){%
+ \ifboolKV[Domino]{Superieur}{%
+ \begin{MyDominoMini}[space=\ratiodomino]%
+ \ListeDominos[\i,1]\tcblower\ListeDominos[\i,2]%
+ \end{MyDominoMini}%
+ }{%
+ \begin{MyDominoMini}[sidebyside,sidebyside gap=4mm,righthand ratio=\ratiodomino]%
+ \ListeDominos[\i,1]\tcblower\ListeDominos[\i,2]%
+ \end{MyDominoMini}%
+ }%
+ };
+ }%
+ \end{TrameDomino}%
+ \ifboolKV[Domino]{Logo}{%
+ \clearpage
+ \begin{TrameDomino}
+ \foreach\i in {1,...,\fpeval{\LigneDomino*\ColonneDomino}}{%
+ \node at (Domino\i){%
+ \begin{MyDominoLogo}%
+ \includegraphics[height=\tcbtextheight]{\useKV[Domino]{Image}}
+ \end{MyDominoLogo}%
+ };
+ }%
+ \end{TrameDomino}%
+ }{}%
+ }{%
+ \ifboolKV[Domino]{Superieur}{%
+ \begin{MyDominoMini}[space=\ratiodomino]%
+ \ListeDominos[1,1]\tcblower\ListeDominos[1,2]%
+ \end{MyDominoMini}%
+ }{%
+ \begin{MyDominoMini}[sidebyside,sidebyside gap=4mm,righthand ratio=\ratiodomino]%
+ \ListeDominos[1,1]\tcblower%
+ \ListeDominos[1,2]%
+ \end{MyDominoMini}%
+ }%
+ }%
}% \ No newline at end of file
diff --git a/macros/latex/contrib/profcollege/metapost/PfC-Afficheur.mp b/macros/latex/contrib/profcollege/metapost/PfC-Afficheur.mp
new file mode 100644
index 0000000000..166cd22979
--- /dev/null
+++ b/macros/latex/contrib/profcollege/metapost/PfC-Afficheur.mp
@@ -0,0 +1,182 @@
+u:=1cm;
+
+vardef Afficheur(expr nb,creux)=
+ pair Aa[];
+ Aa1=u*(-0.5,-1);
+ Aa2-Aa1=u*(1,0);
+ Aa4-Aa2=u*(0,2);
+ Aa3=1/2[Aa2,Aa4];
+ Aa5-Aa4=Aa1-Aa2;
+ Aa6-Aa3=Aa1-Aa2;
+ pair Bb[];
+ Bb1=Aa1 xscaled0.7 yscaled 0.85;
+ Bb2=Aa2 xscaled0.7 yscaled 0.85;
+ Bb4=Aa4 xscaled0.7 yscaled 0.85;
+ Bb5=Aa5 xscaled0.7 yscaled 0.85;
+ Bb3=1/2[Bb2,Bb4];
+ Bb6=1/2[Bb1,Bb5];
+ Bb7=1/2[Bb6,Bb3]+(0,4);
+ Bb8=1/2[Bb6,Bb3]-(0,6);
+ pair Cc[];
+ Cc1=u*(0.4,-0.85)+(0,-1);
+ ecarth:=1.5;
+ ecartv:=0.05;
+ path ASegment[];
+ ASegment[1]=1/10[Bb1,Bb2]--9/10[Bb1,Bb2];
+ ASegment[2]=1/10[Bb2,Bb3]--9/10[Bb2,Bb3];
+ ASegment[3]=1/10[Bb3,Bb4]--9/10[Bb3,Bb4];
+ ASegment[4]=1/10[Bb4,Bb5]--9/10[Bb4,Bb5];
+ ASegment[5]=1/10[Bb5,Bb6]--9/10[Bb5,Bb6];
+ ASegment[6]=1/10[Bb6,Bb1]--9/10[Bb6,Bb1];
+ ASegment[7]=1/10[Bb6,Bb3]--9/10[Bb6,Bb3];
+ color fondsegment;
+ fondsegment=0.2[LightSteelBlue,white];
+ save $;
+ picture $;
+ $=image(
+ fill Aa1--Aa2--Aa4--Aa5--cycle withcolor LightSteelBlue;
+ draw Aa1--Aa2--Aa4--Aa5--cycle withcolor LightSteelBlue;
+ if creux=0:
+ fill (unitsquare scaled 2) shifted Cc1 withcolor fondsegment;
+ else:
+ fill (unitsquare scaled 2) shifted Cc1 withcolor Crimson;
+ fi;
+ if nb=1:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[2];
+ draw ASegment[3];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[1];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions();
+ fi;
+ if nb=2:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[2];
+ draw ASegment[5];
+ drawoptions();
+ fi;
+ if nb=3:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[5];
+ draw ASegment[6];
+ drawoptions();
+ fi;
+ if nb=4:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[5];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[1];
+ draw ASegment[4];
+ draw ASegment[6];
+ drawoptions();
+ fi;
+ if nb=5:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[3];
+ draw ASegment[6];
+ drawoptions();
+ fi;
+ if nb=6:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[3];
+ drawoptions();
+ fi;
+ if nb=7:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[1];
+ draw ASegment[5];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions();
+ fi;
+ if nb=8:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions();
+ fi;
+ if nb=9:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[7];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[6];
+ drawoptions();
+ fi;
+ if nb=0:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[6];
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[7];
+ drawoptions();
+ fi;
+ if nb=10:
+ drawoptions(withpen pensquare scaled2 withcolor Crimson);
+ fill (unitsquare scaled 2) shifted Bb7 withcolor Crimson;
+ fill (unitsquare scaled 2) shifted Bb8 withcolor Crimson;
+ drawoptions(withpen pensquare scaled2 withcolor fondsegment);
+ draw ASegment[1];
+ draw ASegment[2];
+ draw ASegment[3];
+ draw ASegment[4];
+ draw ASegment[5];
+ draw ASegment[6];
+ draw ASegment[7];
+ drawoptions();
+ fi;
+ );
+ $
+enddef;
+
+endinput;
+
diff --git a/macros/latex/contrib/profcollege/metapost/PfC-Calculatrice.mp b/macros/latex/contrib/profcollege/metapost/PfC-Calculatrice.mp
index a6326e1925..92d4d3057d 100644
--- a/macros/latex/contrib/profcollege/metapost/PfC-Calculatrice.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfC-Calculatrice.mp
@@ -1,6 +1,3 @@
-%Author : Christophe Poulain
-%Licence : Released under the LaTeX Project Public License v1.3c
-% or later, see http://www.latex-project.org/lppl.txtf
prologues:=3;
path carre[];
@@ -174,7 +171,7 @@ vardef Test(expr cptk,cptnt)=
fi;
enddef;
-vardef LCD(text nt)(text rep)=
+vardef LCD(text nt)(text rep)(expr NB)=
decahoriz:=0;
nblignes:=nblignes+1;
path Ecran;
@@ -185,6 +182,12 @@ vardef LCD(text nt)(text rep)=
BlocAffichage;
Test(k,nt);
endfor;
+ for k=1 upto NB:
+ nblignes:=nblignes+1;
+ Ecran:=(u*(0,-1)--u*(120,-1)--u*(120,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
+ fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
+ draw Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
+ endfor;
nblignes:=nblignes+1;
Ecran:=(u*(0,-1)--u*(120,-1)--u*(120,7)--u*(0,7)--cycle) shifted(u*(0,-8*(nblignes-1)));
fill Ecran withcolor if print=true:0.8white else:CouleurEcran fi;
diff --git a/macros/latex/contrib/profcollege/metapost/PfC-Constantes.mp b/macros/latex/contrib/profcollege/metapost/PfC-Constantes.mp
index b97bd8a4c0..02895dcf8c 100644
--- a/macros/latex/contrib/profcollege/metapost/PfC-Constantes.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfC-Constantes.mp
@@ -1,6 +1,3 @@
-%Author : Christophe Poulain
-%Licence : Released under the LaTeX Project Public License v1.3c
-% or later, see http://www.latex-project.org/lppl.txtf
%Constantes
u:=1cm;
v:=(sqrt3)/2;
diff --git a/macros/latex/contrib/profcollege/metapost/PfC-LaTeX.mp b/macros/latex/contrib/profcollege/metapost/PfC-LaTeX.mp
index daa206a603..33d9848b63 100644
--- a/macros/latex/contrib/profcollege/metapost/PfC-LaTeX.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfC-LaTeX.mp
@@ -1,16 +1,11 @@
-%Author : Christophe Poulain
-%Licence : Released under the LaTeX Project Public License v1.3c
-% or later, see http://www.latex-project.org/lppl.txtf
vardef LATEX primary s =
write "verbatimtex" to "mptextmp.mp";
write "%&latex" to "mptextmp.mp";
write "\documentclass[]{article}" to "mptextmp.mp";
+ write "\usepackage{ProfCollege}" to "mptextmp.mp";
write "\usepackage[utf8]{inputenc}" to "mptextmp.mp";
write "\usepackage[T1]{fontenc}" to "mptextmp.mp";
write "\usepackage{fourier}" to "mptextmp.mp";
- write "\usepackage{mathtools,amssymb}" to "mptextmp.mp";
- write "\usepackage{siunitx}" to "mptextmp.mp";
- write "\sisetup{locale=FR,detect-all,output-decimal-marker={,},group-four-digits}" to "mptextmp.mp";
write "\usepackage[french]{babel}" to "mptextmp.mp";
write "\begin{document}" to "mptextmp.mp";
write "etex" to "mptextmp.mp";
diff --git a/macros/latex/contrib/profcollege/metapost/PfC-Svgnames.mp b/macros/latex/contrib/profcollege/metapost/PfC-Svgnames.mp
index 3af1336dc3..3aa2cf2386 100644
--- a/macros/latex/contrib/profcollege/metapost/PfC-Svgnames.mp
+++ b/macros/latex/contrib/profcollege/metapost/PfC-Svgnames.mp
@@ -1,6 +1,3 @@
-%Author : Christophe Poulain
-%Licence : Released under the LaTeX Project Public License v1.3c
-% or later, see http://www.latex-project.org/lppl.txtf
%D'après /usr/local/texlive/2020/texmf-dist/tex/latex/xcolor/svgnam.def
color AliceBlue; AliceBlue = (.94,.972,1);
color AntiqueWhite; AntiqueWhite = (.98,.92,.844);
diff --git a/macros/luatex/latex/unitipa/README.txt b/macros/luatex/latex/unitipa/README.txt
index b68d0b4fdb..2d9bc5ba02 100644
--- a/macros/luatex/latex/unitipa/README.txt
+++ b/macros/luatex/latex/unitipa/README.txt
@@ -1,10 +1,9 @@
--------------------------------------------------------------------------
Package: unitipa
Author: Niranjan
-Version: 0.1 (21 September, 2020)
+Version: 0.2 (13 March, 2021)
Description: TIPA typefaces with Unicode characters.
Repository: https://gitlab.com/niranjanvikastambe/unitipa
Bug tracker: https://gitlab.com/niranjanvikastambe/unitipa/-/issues
License: The LaTeX Project Public License v1.3c or later.
--------------------------------------------------------------------------
-
diff --git a/macros/luatex/latex/unitipa/unitipa.dtx b/macros/luatex/latex/unitipa/unitipa.dtx
index 4437f73253..e834a96c02 100644
--- a/macros/luatex/latex/unitipa/unitipa.dtx
+++ b/macros/luatex/latex/unitipa/unitipa.dtx
@@ -2,8 +2,9 @@
%
% File: unitipa.dtx
% ---------------------------------------------------------------------------
-% Package: unitipa
-% Author: Niranjan
+% Package: unitipa
+% Author: Niranjan
+% Version: 0.2 (13 March, 2021)
% Description: TIPA typefaces with Unicode characters.
% Repository: https://gitlab.com/niranjanvikastambe/unitipa
% Bug tracker: https://gitlab.com/niranjanvikastambe/unitipa/-/issues
@@ -33,7 +34,7 @@
--------------------------------------------------------------------------
Package: unitipa
Author: Niranjan
-Version: 0.1 (21 September, 2020)
+Version: 0.2 (13 March, 2021)
Description: TIPA typefaces with Unicode characters.
Repository: https://gitlab.com/niranjanvikastambe/unitipa
Bug tracker: https://gitlab.com/niranjanvikastambe/unitipa/-/issues
@@ -44,10 +45,10 @@ License: The LaTeX Project Public License v1.3c or later.
\fi
%</internal>
%<*driver|package>
-\def\unitipaPackageName{unitipa}
-\def\unitipaPackageVersion{0.1}
-\def\unitipaPackageDate{2020/21/09}
-\def\unitipaPackageDescription{TIPA typefaces with Unicode characters.}
+\def\unitipaname{unitipa}
+\def\unitipaversion{0.2}
+\def\unitipadate{2021/03/13}
+\def\unitipadescription{TIPA typefaces with Unicode characters.}
%</driver|package>
%<*driver>
\documentclass{l3doc}
@@ -56,32 +57,41 @@ License: The LaTeX Project Public License v1.3c or later.
\usepackage{unitipa}
\usepackage{hyperref}
\usepackage{xcolor}
-\hypersetup{
-colorlinks,
-linkcolor=red!60!black,
-citecolor=green!60!black,
-urlcolor=blue!60!black
-}
+\hypersetup{%
+colorlinks,%
+linkcolor=red!60!black,%
+citecolor=green!60!black,%
+urlcolor=blue!60!black%
+}%
\usepackage{fontawesome5}
\begin{document}
- \DocInput{\unitipaPackageName.dtx}
+ \DocInput{\unitipaname.dtx}
\end{document}
%</driver>
% \fi
-% \title{The \pkg{\unitipaPackageName} package}
+% \title{The \pkg{\unitipaname} package}
% \author{Niranjan}
% \date^^A
% {^^A
-% Version \unitipaPackageVersion\ --- \unitipaPackageDate\\[1ex]^^A
+% Version \unitipaversion\ --- \unitipadate\\[1ex]^^A
% {\small\faIcon{link}\quad\url{https://ctan.org/pkg/unitipa}}\\^^A
% {\small\faIcon{gitlab}\quad\url{https://gitlab.com/niranjanvikastambe/unitipa}}^^A
% }
% \maketitle
-
-% This package converts Unicode characters into TIPA commands, which gives us \pkg{tipa} typefaces, without actually learning the \pkg{tipa} commands in much details. This package needs Lua\LaTeX\ as the compiler for correctly typesetting the IPA diacritics. TIPA was designed to match with the Computer Modern design, no other IPA font matches with traditional \LaTeX\ font. This package is helpful for getting the beautiful \pkg{tipa} shapes with Unicode characters. This package assumes that the user knows how to type IPA Unicode. Following is the list of symbols that \textit{cannot} be used with the traditional \LaTeX\ font. Every other symbol in the IPA chart is present in the current \LaTeX\ font.
+%
+% This package converts Unicode characters into TIPA commands, which gives us
+% \pkg{tipa} typefaces, without actually learning the \pkg{tipa} commands in
+% much details. This package needs Lua\LaTeX\ as the compiler for correctly
+% typesetting the IPA diacritics. TIPA was designed to match with the Computer
+% Modern design, no other IPA font matches with traditional \LaTeX\ font. This
+% package is helpful for getting the beautiful \pkg{tipa} shapes with Unicode
+% characters. This package assumes that the user knows how to type IPA
+% Unicode. Following is the list of symbols that \textit{cannot} be used with
+% the traditional \LaTeX\ font. Every other symbol in the IPA chart is present
+% in the current \LaTeX\ font.
% \begin{description}
% \item[Plosives] ʈ ɖ ɟ ɢ ʔ
-% \item[Nasals] ɱ ɳ ɴ
+% \item[Nasals] ɱ ɳ ɲ\footnote{Added in v0.2} ɴ
% \item[Trills] ʙ ʀ
% \item[Taps or flaps] ⱱ ɾ ɽ
% \item[Fricatives] ɸ β θ ʃ ʒ ʂ ʐ ɣ χ ʁ ʕ ɦ
@@ -94,6 +104,13 @@ urlcolor=blue!60!black
% \item[Close-mid vowels] ɵ ɤ
% \item[Open-mid vowels] ɛ ɜ ɞ ʌ ɔ
% \item[Near-open vowels] ɐ ɶ ɒ
+% \item[Open vowels] ɑ\footnote{Reported \textit{\&} added by Heller, Thomas in
+% v0.2.
+%
+% Bug report - \url{https://gitlab.com/niranjanvikastambe/unitipa/-/issues/1}
+%
+% MR - \url{https://gitlab.com/niranjanvikastambe/unitipa/-/merge_requests/1}
+% }
% \item[Clicks] ʘ ǀ ǃ ǂ ǁ
% \item[Voiced Implosives] ɓ ɗ ʄ ɠ ʛ
% \item[Ejective] ʼ
@@ -107,10 +124,19 @@ urlcolor=blue!60!black
% \begin{documentation}
% \section{Package options}
% \begin{function}{nodiacritics}
-% If you are very sure that you don't need any IPA diacritics in your document, you can load the package with this option. If this option is loaded, package can be compiled with other compilers too, but no IPA diacritic will be printed.
+% If you are very sure that you don't need any IPA diacritics in your document,
+% you can load the package with this option. If this option is loaded, package
+% can be compiled with other compilers too, but no IPA diacritic will be
+% printed.
% \end{function}
% \begin{function}{ipafont}
-% IPA character [ⱱ] is not available in \pkg{tipa}, but for the convenience of users, this character is coded with Doulos SIL as it seemed to me the closest match to \pkg{tipa} typeface. If you don't have this font, please install package \pkg{\href{https://ctan.org/pkg/doulossil}{doulossil}} or download the font from \href{https://software.sil.org/doulos/}{here}. If users want to change the font used for this character, they can simply add the font name as the value to this option.
+% IPA character [ⱱ] is not available in \pkg{tipa}, but for the convenience of
+% users, this character is coded with Doulos SIL as it seemed to me the closest
+% match to \pkg{tipa} typeface. If you don't have this font, please install
+% package \pkg{\href{https://ctan.org/pkg/doulossil}{doulossil}} or download the
+% font from \href{https://software.sil.org/doulos/}{here}. If users want to
+% change the font used for this character, they can simply add the font name as
+% the value to this option.
% \begin{syntax}
% ipafont=\meta{font name}
% \end{syntax}
@@ -123,7 +149,7 @@ urlcolor=blue!60!black
%<*package>
% \end{macrocode}
% \begin{macrocode}
-\ProvidesPackage{unitipa}[2020/21/09 v0.1
+\ProvidesPackage{unitipa}[2021/03/13 v0.2
TIPA typefaces with unicode characters]
\RequirePackage{tipa}
% \end{macrocode}
@@ -131,16 +157,17 @@ TIPA typefaces with unicode characters]
% \begin{macrocode}
\RequirePackage{graphicx}
% \end{macrocode}
-% Package \pkg{graphicx} is needed for printing [ɞ] correctly. See line no.\ 295.
+% Package \pkg{graphicx} is needed for printing [ɞ] correctly. See line no.\
+% 295.
% \begin{macrocode}
\RequirePackage{newunicodechar}
\RequirePackage{fontspec}
\RequirePackage{pgfkeys}
-\pgfkeys{
- unitipa/.is family, unitipa/.cd,
- ipafont/.code={\setfontfamily{\ipa}{#1}},
- ipafont=DoulosSIL,
-}
+\pgfkeys{%
+ unitipa/.is family, unitipa/.cd,%
+ ipafont/.code={\setfontfamily{\ipa}{#1}},%
+ ipafont=DoulosSIL%
+}%
\DeclareTextFontCommand{\ipatext}{\ipa}
\def\unitipa@ipafont#1{\pgfkeys{unitipa/.cd,#1}}
\DeclareOption*{\expandafter\unitipa@ipafont\expandafter{\CurrentOption}}
@@ -179,189 +206,194 @@ TIPA typefaces with unicode characters]
s = unicode.utf8.gsub ( s , '(%a)̹', '\\textsubrhalfring{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
morerounded, "morerounded")}
-\begin{luacode}
+ \begin{luacode}
function lessrounded ( s )
s = unicode.utf8.gsub ( s , '(%a)̜', '\\textsublhalfring{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
lessrounded, "lessrounded")}
-\begin{luacode}
+ \begin{luacode}
function advanced ( s )
s = unicode.utf8.gsub ( s , '(%a)̟', '\\textsubplus{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
advanced, "advanced")}
-\begin{luacode}
+ \begin{luacode}
function retracted ( s )
s = unicode.utf8.gsub ( s , '(%a)̠', '\\textsubbar{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
retracted, "retracted")}
-\begin{luacode}
+ \begin{luacode}
function midcentralized ( s )
s = unicode.utf8.gsub ( s , '(%a)̽', '\\textovercross{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
midcentralized, "midcentralized")}
-\begin{luacode}
+ \begin{luacode}
function syllabic ( s )
s = unicode.utf8.gsub ( s , '(%a)̩', '\\textsyllabic{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
syllabic, "syllabic")}
-\begin{luacode}
+ \begin{luacode}
function nonsyllabic ( s )
s = unicode.utf8.gsub ( s , '(%a)̯', '\\textsubarch{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
nonsyllabic, "nonsyllabic")}
-\begin{luacode}
+ \begin{luacode}
function breathyvoiced ( s )
s = unicode.utf8.gsub ( s , '(%a)̤', '\\textsubumlaut{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
breathyvoiced, "breathyvoiced")}
-\begin{luacode}
+ \begin{luacode}
function linguolabial ( s )
s = unicode.utf8.gsub ( s , '(%a)̼', '\\textseagull{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
linguolabial, "linguolabial")}
-\begin{luacode}
+ \begin{luacode}
function velarized ( s )
s = unicode.utf8.gsub ( s , '(%a)̴', '\\textsuperimposetilde{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
velarized, "velarized")}
-\begin{luacode}
+ \begin{luacode}
function raised ( s )
s = unicode.utf8.gsub ( s , '(%a)̝', '\\textraising{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
raised, "raised")}
-\begin{luacode}
+ \begin{luacode}
function lowered ( s )
s = unicode.utf8.gsub ( s , '(%a)̞', '\\textlowering{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
lowered, "lowered")}
-\begin{luacode}
+ \begin{luacode}
function advancedtr ( s )
s = unicode.utf8.gsub ( s , '(%a)̘', '\\textadvancing{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
advancedtr, "advancedtr")}
-\begin{luacode}
+ \begin{luacode}
function retractedtr ( s )
s = unicode.utf8.gsub ( s , '(%a)̙', '\\textretracting{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
retractedtr, "retractedtr")}
-\begin{luacode}
+ \begin{luacode}
function dental ( s )
s = unicode.utf8.gsub ( s , '(%a)̪', '\\textsubbridge{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
dental, "dental")}
-\begin{luacode}
+ \begin{luacode}
function apical ( s )
s = unicode.utf8.gsub ( s , '(%a)̺', '\\textinvsubbridge{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
apical, "apical")}
-\begin{luacode}
+ \begin{luacode}
function laminal ( s )
s = unicode.utf8.gsub ( s , '(%a)̻', '\\textsubsquare{%1}' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
laminal, "laminal")}
-\begin{luacode}
+ \begin{luacode}
function unaudible ( s )
s = unicode.utf8.gsub ( s , '(%a)̚', '%1\\textcorner' )
return s
end
-\end{luacode}
-\directlua{luatexbase.add_to_callback("process_input_buffer",
+ \end{luacode}
+ \directlua{luatexbase.add_to_callback("process_input_buffer",
unaudible, "unaudible")}
%% Tie bars
\begin{luacode}
- function tiebarup ( s )
- s = unicode.utf8.gsub ( s , '(%a)͡(%a)', '\\texttoptiebar{%1%2}' )
- return s
- end
+ function tiebarup ( s )
+ s = unicode.utf8.gsub ( s , '(%a)͡(%a)', '\\texttoptiebar{%1%2}' )
+ return s
+ end
\end{luacode}
\directlua{luatexbase.add_to_callback("process_input_buffer",
- tiebarup, "tiebarup")}
+ tiebarup, "tiebarup")}
\begin{luacode}
- function tiebardown ( s )
- s = unicode.utf8.gsub ( s , '(%a)͜(%a)', '\\textbottomtiebar{%1%2}' )
- return s
- end
+ function tiebardown ( s )
+ s = unicode.utf8.gsub ( s , '(%a)͜(%a)', '\\textbottomtiebar{%1%2}' )
+ return s
+ end
\end{luacode}
\directlua{luatexbase.add_to_callback("process_input_buffer",
- tiebardown, "tiebardown")}
+ tiebardown, "tiebardown")}
\begin{luacode}
- function risefall ( s )
- s = unicode.utf8.gsub ( s , '(%a)᷈', '\\textrisefall{%1}' )
- return s
- end
+ function risefall ( s )
+ s = unicode.utf8.gsub ( s , '(%a)᷈', '\\textrisefall{%1}' )
+ return s
+ end
\end{luacode}
\directlua{luatexbase.add_to_callback("process_input_buffer",
- risefall, "risefall")}
+ risefall, "risefall")}
\begin{luacode}
- function rising ( s )
- s = unicode.utf8.gsub ( s , '(%a)᷄', '\\texthighrise{%1}' )
- return s
- end
+ function rising ( s )
+ s = unicode.utf8.gsub ( s , '(%a)᷄', '\\texthighrise{%1}' )
+ return s
+ end
\end{luacode}
\directlua{luatexbase.add_to_callback("process_input_buffer",
- rising, "rising")}
+ rising, "rising")}
\begin{luacode}
- function falling ( s )
- s = unicode.utf8.gsub ( s , '(%a)᷅', '\\textlowrise{%1}' )
- return s
- end
+ function falling ( s )
+ s = unicode.utf8.gsub ( s , '(%a)᷅', '\\textlowrise{%1}' )
+ return s
+ end
\end{luacode}
\directlua{luatexbase.add_to_callback("process_input_buffer",
- falling, "falling")}
+ falling, "falling")}
\fi
% \end{macrocode}
-% Option \verb|nodiacritics| provided for using the package without Lua\LaTeX. Enabling this option won't print any diacritics. Help from Samcarter and Mico Loretan on different platforms\footnote{Samcarter's \href{https://topanswers.xyz/tex?q=1332\#a1577}{answer} on TopAnswer \& Mico Loretan's \href{https://tex.stackexchange.com/a/563447/174620}{answer} on TeX.SE.} gave a right direction to this code.
+% Option \verb|nodiacritics| provided for using the package without
+% Lua\LaTeX. Enabling this option won't print any diacritics. Help from
+% Samcarter and Mico Loretan on different platforms\footnote{Samcarter's
+% \href{https://topanswers.xyz/tex?q=1332\#a1577}{answer} on TopAnswer \& Mico
+% Loretan's \href{https://tex.stackexchange.com/a/563447/174620}{answer} on
+% TeX.SE.} gave a right direction to this code.
% \begin{macrocode}
%% Pulmonic Consonants
%% Plosives
@@ -373,6 +405,7 @@ TIPA typefaces with unicode characters]
%% Nasals
\newunicodechar{ɱ}{\textltailm}
\newunicodechar{ɳ}{\textrtailn}
+\newunicodechar{ɲ}{\textltailn} %% Added in v0.2
\newunicodechar{ɴ}{\textscn}
%% Trills
\newunicodechar{ʙ}{\textscb}
@@ -434,6 +467,11 @@ TIPA typefaces with unicode characters]
\newunicodechar{ɐ}{\textturna}
\newunicodechar{ɶ}{\textscoelig}
\newunicodechar{ɒ}{\textturnscripta}
+%% Open
+%% Reported and added by Heller, Thomas on 2021/03/13
+%% Bug report - https://gitlab.com/niranjanvikastambe/unitipa/-/issues/1
+%% MR - https://gitlab.com/niranjanvikastambe/unitipa/-/merge_requests/1
+\newunicodechar{ɑ}{\textscripta}
%% Non-Pulmonic
\newunicodechar{ʘ}{\textbullseye}
\newunicodechar{ǀ}{\textpipe}
@@ -478,4 +516,8 @@ TIPA typefaces with unicode characters]
%</package>
% \end{macrocode}
% \end{implementation}
+% \RecordChanges
+% \changes{v0.1}{2020/09/21}{Initial version}
+% \changes{v0.2}{2021/03/13}{Added characters `ɑ' and `ɲ'}
+% \PrintChanges
% \Finale \ No newline at end of file
diff --git a/macros/luatex/latex/unitipa/unitipa.pdf b/macros/luatex/latex/unitipa/unitipa.pdf
index d74cb5403a..c6b795dae1 100644
--- a/macros/luatex/latex/unitipa/unitipa.pdf
+++ b/macros/luatex/latex/unitipa/unitipa.pdf
Binary files differ