summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-07-01 03:03:30 +0000
committerNorbert Preining <norbert@preining.info>2020-07-01 03:03:30 +0000
commitd79a721c345c9a2ced6c0640e88c10cc3378c1f0 (patch)
tree400d84326bfe896b980146734c9650006b72e550 /macros
parent70c32b2936f7dac3a0898faafe7c554c3bedeae9 (diff)
CTAN sync 202007010303
Diffstat (limited to 'macros')
-rw-r--r--macros/context/contrib/context-filter/VERSION2
-rw-r--r--macros/context/contrib/context-filter/doc/context/third/filter/filter.txt84
-rw-r--r--macros/context/contrib/context-filter/tex/context/third/filter/t-filter.mkiv19
-rw-r--r--macros/context/contrib/context-vim/VERSION2
-rw-r--r--macros/context/contrib/context-vim/doc/context/third/vim/vim.txt99
-rw-r--r--macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkii (renamed from macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.tex)4
-rw-r--r--macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkiv126
-rw-r--r--macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-highlight.mkiv63
-rw-r--r--macros/context/contrib/context-vim/tex/context/third/vim/t-vim.tex78
-rw-r--r--macros/context/contrib/context-vim/tex/context/third/vim/vimtyping-default.css415
-rw-r--r--macros/generic/tracklang/CHANGES8
-rw-r--r--macros/generic/tracklang/README27
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals-babel.pdfbin14843 -> 14855 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals-de-poly.pdfbin3821 -> 3820 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals-de.pdfbin13613 -> 13625 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals-poly.pdfbin3556 -> 3556 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals-sr-poly.pdfbin0 -> 7547 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals.pdfbin12644 -> 12656 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2-de.pdfbin13613 -> 13625 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2-de2.pdfbin13613 -> 13625 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2-de3.pdfbin13595 -> 13607 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2-de4.pdfbin3817 -> 3820 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2-poly.pdfbin3556 -> 3560 bytes
-rw-r--r--macros/generic/tracklang/samples/animals/sample-animals2.pdfbin12644 -> 12656 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions.pdfbin13148 -> 13161 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2-manx.pdfbin19773 -> 21945 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2-map.pdfbin25988 -> 26000 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2-map2.pdfbin25840 -> 25852 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2-map3.pdfbin24912 -> 24924 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2-nomap.pdfbin25456 -> 25468 bytes
-rw-r--r--macros/generic/tracklang/samples/regions/sample-regions2.pdfbin14704 -> 14716 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang.pdfbin19540 -> 19552 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang2.pdfbin19790 -> 19802 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang3.pdfbin19802 -> 19814 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang4.pdfbin6198 -> 6202 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang5.pdfbin16902 -> 16914 bytes
-rw-r--r--macros/generic/tracklang/samples/sample-tracklang6.pdfbin19885 -> 19897 bytes
-rw-r--r--macros/generic/tracklang/tracklang.dtx69
-rw-r--r--macros/generic/tracklang/tracklang.ins4
-rw-r--r--macros/generic/tracklang/tracklang.pdfbin738081 -> 742279 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb-doc.pdfbin153525 -> 153907 bytes
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb-doc.tex9
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.dtx136
-rw-r--r--macros/latex/contrib/babel-contrib/french/frenchb.pdfbin308091 -> 325661 bytes
-rw-r--r--macros/latex/contrib/l3backend/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/l3backend/README.md2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-basics.dtx12
-rw-r--r--macros/latex/contrib/l3backend/l3backend-box.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-color.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-draw.dtx6
-rw-r--r--macros/latex/contrib/l3backend/l3backend-graphics.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-header.dtx2
-rw-r--r--macros/latex/contrib/l3backend/l3backend-pdf.dtx2
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.pdfbin356758 -> 359504 bytes
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix-french.tex65
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.dtx352
-rw-r--r--macros/latex/contrib/nicematrix/nicematrix.pdfbin882583 -> 896061 bytes
-rw-r--r--macros/latex/contrib/pm-isomath/README.txt42
-rw-r--r--macros/latex/contrib/pm-isomath/pm-isomath.dtx25
-rw-r--r--macros/latex/contrib/pm-isomath/pm-isomath.pdfbin593775 -> 594246 bytes
-rw-r--r--macros/latex/contrib/shtthesis/CHANGELOG.md8
-rw-r--r--macros/latex/contrib/shtthesis/README.md21
-rw-r--r--macros/latex/contrib/shtthesis/shtthesis-user-guide.pdfbin2168060 -> 2172646 bytes
-rw-r--r--macros/latex/contrib/shtthesis/shtthesis-user-guide.tex71
-rw-r--r--macros/latex/contrib/shtthesis/shtthesis.cls297
-rw-r--r--macros/luatex/generic/cloze/README.md (renamed from macros/luatex/latex/cloze/README.md)10
-rw-r--r--macros/luatex/generic/cloze/cloze.dtx907
-rw-r--r--macros/luatex/generic/cloze/cloze.ins (renamed from macros/luatex/latex/cloze/cloze.ins)3
-rw-r--r--macros/luatex/generic/cloze/cloze.lua (renamed from macros/luatex/latex/cloze/cloze.lua)679
-rw-r--r--macros/luatex/generic/cloze/cloze.pdfbin0 -> 600199 bytes
-rw-r--r--macros/luatex/latex/cloze/cloze.dtx1929
-rw-r--r--macros/luatex/latex/cloze/cloze.pdfbin318609 -> 0 bytes
72 files changed, 2874 insertions, 2718 deletions
diff --git a/macros/context/contrib/context-filter/VERSION b/macros/context/contrib/context-filter/VERSION
index 9e6f07d186..ee81786fef 100644
--- a/macros/context/contrib/context-filter/VERSION
+++ b/macros/context/contrib/context-filter/VERSION
@@ -1 +1 @@
-2020.04.25
+2020.06.29
diff --git a/macros/context/contrib/context-filter/doc/context/third/filter/filter.txt b/macros/context/contrib/context-filter/doc/context/third/filter/filter.txt
index a4e24f39ce..17cfb9f172 100644
--- a/macros/context/contrib/context-filter/doc/context/third/filter/filter.txt
+++ b/macros/context/contrib/context-filter/doc/context/third/filter/filter.txt
@@ -4,9 +4,6 @@
The filter module
=================
-History
--------
-
This module started with a simple idea. I wanted an environment
\startmarkdown
@@ -31,6 +28,38 @@ program would be a waste of effort. Each new program requires only a few changes
in the R-module; what I needed was a R-module _template_ so that I could fill in
the blanks with the appropriate values. And so, the filter module was born.
+Table of Contents
+=================
+
+* [Compatibility](#compatibility)
+* [Installation](#installation)
+* [Basic Usage](#basic-usage)
+* [Inheriting setup from other commands](#inheriting-setup-from-other-commands)
+* [Dealing with slow filters](#dealing-with-slow-filters)
+* [Reading the input](#reading-the-input)
+* [Space around the environment](#space-around-the-environment)
+* [Stripping leading whitespace (MkIV only)](#stripping-leading-whitespace-mkiv-only)
+* [Names of temporary files](#names-of-temporary-files)
+* [Output Directory](#output-directory)
+* [Disabling filters](#disabling-filters)
+* [Deleting temporary files](#deleting-temporary-files)
+* [Standard options](#standard-options)
+* [Options to a specific environment](#options-to-a-specific-environment)
+* [A setup to control them all](#a-setup-to-control-them-all)
+* [Passing options to filters](#passing-options-to-filters)
+* [Macro variant](#macro-variant)
+* [Processing existing Files](#processing-existing-files)
+* [Processing remote files](#processing-remote-files)
+* [Processing existing buffers](#processing-existing-buffers)
+* [Prepend and append text](#prepend-and-append-text)
+* [XML export](#xml-export)
+* [Special use case: \write18 with caching](#special-use-case--write18-with-caching)
+* [Dealing with expansion](#dealing-with-expansion)
+* [Limitations](#limitations)
+* [Messages and Tracing](#messages-and-tracing)
+* [Version History](#version-history)
+
+
Compatibility
------------
@@ -47,7 +76,7 @@ standalone, you can install the module using
Depending on your TeX distribution, you may already have the module.
To verify, check if
- kpsewhich t-filter.mkii
+ luatools t-filter.mkiv
returns a meaningful path. If not, you have to manually install the module.
@@ -55,22 +84,22 @@ Download the latest version of the module from
[http://modules.contextgarden.net/filter](http://modules.contextgarden.net/filter)
and unzip it either `$TEXMFHOME` or `$TEXMFLOCAL`. Run
- mktexlsr
+ mtxrun --generate
and
- mtxrun --generate
+ mktexlsr
-to refresh the TeX file database (for MkII and MkIV, respectively). If
+to refresh the TeX file database (for MkIV and MkII, respectively). If
everything went well
- kpsewhich t-filter.mkii
+ luatools t-filter.mkiv
will return the path where you stored the file.
Unfortunately, that is not enough. For the module to work, TeX must be able to
call an external program. This feature is a potential security risk and is
-disabled by default on most TeX distributions. To enable this feature, set
+disabled by default on most TeX distributions. To enable this feature in MkII, set
shell_escape=t
@@ -726,6 +755,43 @@ Then you can use
to get a chess board.
+XML export
+----------
+
+The filter module provides a basic support for XML export. If the
+user-document contains
+
+ \setupbackend[export=yes]
+
+or other valid options to `export` such as `export=xml`, then the filter
+environment is exported as well. For example, both
+
+ \startmarkdown
+ ...
+ \stopmarkdown
+
+and
+ \processmarkdownfile{...}
+
+are exported (in `\jobname-export/\jobname.xml`) as
+
+ <externalfilter detail="markdown">
+ ...
+ </externalfilter>
+
+Moreover,
+
+ \inlinemarkdown{...}
+
+is exported as
+
+ <inlineexternalfilter detail="markdown">....</inlineexternalfilter>
+
+
+Note that it is the responsibility of the filter to generate properly tagged
+content. For example, `pandoc` used in the `markdown` examples in this
+document converts `**bold**` to `{\bf bold}`, which is not exported.
+
Special use case: `\write18` with caching
------------------------------------------
diff --git a/macros/context/contrib/context-filter/tex/context/third/filter/t-filter.mkiv b/macros/context/contrib/context-filter/tex/context/third/filter/t-filter.mkiv
index 5db429a3d2..757f4752b0 100644
--- a/macros/context/contrib/context-filter/tex/context/third/filter/t-filter.mkiv
+++ b/macros/context/contrib/context-filter/tex/context/third/filter/t-filter.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-filter,
-%D version=2020.04.25,
+%D version=2020.06.29,
%D title=\CONTEXT\ User Module,
%D subtitle=Filter,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Filter (ver: 2020.04.25)}
+\writestatus{loading}{Filter (ver: 2020.06.29)}
\startmodule [filter]
\usemodule [module-catcodes]
@@ -35,6 +35,7 @@
\setinterfaceconstant {write} {write}
\setinterfaceconstant {readcommand} {readcommand}
\setinterfaceconstant {taglabel} {taglabel}
+ \setinterfaceconstant {tagdetail} {tagdetail}
\stopinterface
@@ -66,6 +67,10 @@
\setuevalue{process\currentexternalfilter file}{\externalfilter@process_file[\currentexternalfilter]}%
\setuevalue{process\currentexternalfilter buffer}{\externalfilter@process_buffer[\currentexternalfilter]}%
\setuevalue{inline\currentexternalfilter}{\externalfilter@inline[\currentexternalfilter]}%
+ \setelementbackendtag[\externalfilterparameter\c!taglabel]
+ \setelementnature [\externalfilterparameter\c!taglabel][display]
+ \setelementbackendtag[inline\externalfilterparameter\c!taglabel]
+ \setelementnature [inline\externalfilterparameter\c!taglabel][inline]
\to \everydefineexternalfilter
% For backward compatibility
@@ -479,16 +484,17 @@
\doifelse{\externalfilterparameter\c!location}\v!paragraph
{\blank[\externalfilterparameter\c!spacebefore]
\usealignparameter\externalfilterparameter
- \externalfilterparameter\c!before}
- {\externalfilterparameter\c!left}
+ \externalfilterparameter\c!before
+ \dostarttagged{\externalfilterparameter\c!taglabel}{\externalfilterparameter\c!tagdetail}}
+ {\externalfilterparameter\c!left
+ \dostarttagged{inline\externalfilterparameter\c!taglabel}{\externalfilterparameter\c!tagdetail}}
\begingroup
- \dostarttagged{\externalfilterparameter\c!taglabel}\currentexternalfilter
\useexternalfilterstyleandcolor\c!style\c!color
\processcommacommand[\externalfilterparameter\c!setups]\directsetup
\externalfilterparameter\c!readcommand\externalfilter@output_file
- \dostoptagged
\endgroup
+ \dostoptagged
\doifelse{\externalfilterparameter\c!location}\v!paragraph
{\externalfilterparameter\c!after
@@ -526,6 +532,7 @@
\c!buffer\c!before=,
\c!buffer\c!after=,
\c!taglabel=\externalfilter@id,
+ \c!tagdetail=\currentexternalfilter,
]
\def\externalfilterbasefile {\externalfilter@base_file}
diff --git a/macros/context/contrib/context-vim/VERSION b/macros/context/contrib/context-vim/VERSION
index 245e15befa..ee81786fef 100644
--- a/macros/context/contrib/context-vim/VERSION
+++ b/macros/context/contrib/context-vim/VERSION
@@ -1 +1 @@
-2020.06.25
+2020.06.29
diff --git a/macros/context/contrib/context-vim/doc/context/third/vim/vim.txt b/macros/context/contrib/context-vim/doc/context/third/vim/vim.txt
index 88bc2b9dc6..12c5d10a07 100644
--- a/macros/context/contrib/context-vim/doc/context/third/vim/vim.txt
+++ b/macros/context/contrib/context-vim/doc/context/third/vim/vim.txt
@@ -37,6 +37,7 @@ Table of Contents
* [Name (and location) of the VIM executable](#name-and-location-of-the-vim-executable)
* [Defining a new colorscheme](#defining-a-new-colorscheme)
* [Modifying an existing color scheme](#modifying-an-existing-color-scheme)
+* [XML export](#xml-export)
* [A bit of a history](#a-bit-of-a-history)
@@ -69,30 +70,30 @@ standalone, you can install the module using
Depending on your TeX distribution, you may already have the module.
To verify, check if
- kpsewhich t-vim.tex
+ luatools t-vim.tex
returns a meaningful path. If not, you have to manually install the module.
Download the latest version of the `filter` and `vim` modules from
[http://github.com/adityam/filter/downloads](http://github.com/adityam/filter/downloads)
and unzip them either `$TEXMFHOME` or `$TEXMFLOCAL`. Run
- mktexlsr
+ mtxrun --generate
and
- mtxrun --generate
+ mktexlsr
-to refresh the TeX file database (for MkII and MkIV, respectively). If
+to refresh the TeX file database (for MkIV and MkII, respectively). If
everything went well
- kpsewhich t-vim
+ luatools t-vim
will return the path where you stored the file.
Unfortunately, that is not enough. For the module to work, TeX must be able to
call an external program. This feature is a potential security risk and is
-disabled by default on most TeX distributions. To enable this feature, you must
-set
+disabled by default on most TeX distributions. To enable this feature in MkII,
+you must set
shell_escape=t
@@ -297,9 +298,12 @@ If you want every fifth line to be numbered, use
Standard options for line numbering
-----------------------------------
-**Note**: These options can only be set using `\definevimtyping[...][...]` or
-`\setupvimtyping[...][...]`. They do not work when used with
-`\start<vimtyping>`.
+**Note**: Linenumbering options can only be set using `\definevimtyping[...][...]`
+or `\setupvimtyping[...][...]`. They do not work when used with
+`\start<vimtyping>`. All the line numbers on a given page have the same
+properties. So, if you change these properties in the middle of the page, it
+will effect all the listings on that page, _even those defined earlier!_
+
- To change the color or style of the numbers, use the `numbercolor=...` and
`numberstyle=...` options. By default `numbercolor` is not set, while
@@ -971,6 +975,81 @@ typeset in bold red, we can use:
[color=red, style=bold]
\stopcolorscheme
```
+XML Export
+----------
+
+The vim module provides a basic support for XML export. If the user-document
+contains
+
+ \setupbackend[export=yes]
+
+or other valid options to `export` such as `export=xml`, then the vim typing
+environments are exported as well. For example,
+
+ \definevimtyping[PYTHON][syntax=python]
+ \startPYTHON
+ # Python program listing
+ def foobar
+ print("Hello World")
+ \stopPYTHON
+
+
+is exported as
+
+ <vimtyping detail="pscolor">
+ <verbatimline><syntaxgroup detail="vimComment"># Python program listing</syntaxgroup></verbatimline>
+ <verbatimline><syntaxgroup detail="vimStatement">def</syntaxgroup> <syntaxgroup detail="vimFunction">foobar</syntaxgroup></verbatimline>
+ <verbatimline> <syntaxgroup detail="vimFunction">print</syntaxgroup>(<syntaxgroup detail="vimString">"</syntaxgroup><syntaxgroup detail="vimString">Hello World</syntaxgroup><syntaxgroup detail="vimString">"</syntaxgroup>)</verbatimline>
+ </vimtyping>
+
+The name of the exported envionment is `vimtyping`.
+
+Inline environments such as
+
+ \definevimtyping[PYTHON][syntax=python]
+ \inlinePYTHON{print("Hello World")}
+
+is exported as
+
+ <inlinevimtyping detail="pscolor"><verbatimline><syntaxgroup detail="vimFunction">print</syntaxgroup>(<syntaxgroup detail="vimString">"</syntaxgroup><syntaxgroup detail="vimString">Hello World</syntaxgroup><syntaxgroup detail="vimString">"</syntaxgroup>)</verbatimline></inlinevimtyping>
+
+The name of the exported envionment is `inlinevimtyping`.
+
+In both the display and inline environments, the name of the programming
+language (value of the `syntax` key) is
+not exported since it is not needed to display the parse output.
+Instead the name of the colorscheme (value of the `alternative` key) is
+exported as the parameter `detail` of `vimtyping`. Each line is exported as a
+`verbatimline`. Each syntaxgroup is exported as `<syntaxgroup detail="...">`.
+The value of `defail` equals to the name of the syntax highlighting group
+_prepended with `vim`_. The name is prepended with `vim` to avoid name clashes
+with other elements in the exported XML. Strictly speaking this is not
+necessary, but it does make it easier to write CSS selectors.
+
+The module comes with a CSS file with default mappings for the two
+colorschemes that are provided with the module (`pscolor` and
+`blackandwhite`). This is meant as a simple solution which gives approximately
+the same output as the PDF file. To use this CSS file, add
+
+ \setupexport[cssfile=\vimtypingcssfile]
+
+If you already have other values for `cssfile`, then use:
+
+ \setupexport[cssfile={...,...,\vimtypingcssfile}]
+
+Note that the macro `\vimtypingcssfile` is defined in the vim module, so the
+above line has to come after the `vim` module has been loaded.
+
+If you make changes to the default colorschemes, define colorschemes of your
+own, or want to tweak the visual appearance of the output, you need to tweak
+the default CSS file to suit your needs. It is suggested that you copy the
+default css file and tweak it. You can find the location of the default CSS
+file using
+
+ luatools vimtyping-default.css
+
+Copy it under a different name and tweak it as desired.
+
A bit of a history
------------------
diff --git a/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.tex b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkii
index 23fb1b7593..b13a902af1 100644
--- a/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.tex
+++ b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkii
@@ -32,8 +32,6 @@
\installparameterhandler \syntaxgroup@namespace \syntaxgroup@id
\installsetuphandler \syntaxgroup@namespace \syntaxgroup@id
-\doifmode{\s!mkiv}
- {\installstyleandcolorhandler \syntaxgroup@namespace \syntaxgroup@id}
\def\m!syntaxgroup{t-syntax-group}
@@ -99,14 +97,12 @@
\iftracesyntaxgroups
\syntaxgroup@show_values
\fi
- \doifmode{\s!mkiv}{\dostarttagged\t!syntaxgroup{#1}}
\syntaxgroupparameter\c!command
{
\externalfilter@attributes_start\syntaxgroup@id\c!style\c!color
#2
\externalfilter@attributes_stop
}
- \doifmode{\s!mkiv}{\dostoptagged}
\syntaxgroupparameter\c!after
\endgroup
\stoptexdefinition
diff --git a/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkiv b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkiv
new file mode 100644
index 0000000000..564490ee26
--- /dev/null
+++ b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-groups.mkiv
@@ -0,0 +1,126 @@
+%D \module
+%D [ file=t-syntax-groups,
+%D version=2020.06.29,
+%D title=\CONTEXT\ User Module,
+%D subtitle=Syntax highlighting support,
+%D author=Aditya Mahajan,
+%D date=\currentdate,
+%D copyright=Aditya Mahajan,
+%D email=adityam <at> ieee <dot> org,
+%D license=Simplified BSD License]
+
+\writestatus{loading}{Syntax highlighting groups (ver: 2020.06.29)}
+
+\startmodule [syntax-group]
+\usemodule [module-catcodes]
+
+\unprotectmodulecatcodes
+
+\def\colorscheme@name {}
+
+\def\syntaxgroup@id {syntaxgroup}
+\def\syntaxgroup@namespace {@@@@\syntaxgroup@id}
+\def\syntaxgroup@name {}
+
+\edef\t!vimsyntaxgroup {\syntaxgroup@id}
+\setelementbackendtag[\t!vimsyntaxgroup]
+\setelementnature [\t!vimsyntaxgroup][inline]
+
+
+\installparameterhandler \syntaxgroup@namespace \syntaxgroup@id
+\installsetuphandler \syntaxgroup@namespace \syntaxgroup@id
+\installstyleandcolorhandler \syntaxgroup@namespace \syntaxgroup@id
+
+\def\m!syntaxgroup{t-syntax-group}
+
+\def\definesyntaxgroup
+ {\dodoubleargument\syntaxgroup@define}
+
+\starttexdefinition syntaxgroup@define [#1][#2]
+ % #1 list name
+ % #2 options
+ \doifassignmentelse{#2}
+ {
+ \def\syntaxgroup@get_parameters##1%
+ {
+ \edef\syntaxgroup@name {\colorscheme@name##1}
+ \setupsyntaxgroup[\syntaxgroup@name]
+ [\s!parent=\syntaxgroup@namespace,\c!color=,\c!style=,\c!command=,#2]
+ \doifsomething{\syntaxgroupparameter\c!color}
+ {
+ \expanded{\definecolor[\syntaxgroup@namespace-##1-color]
+ [\syntaxgroupparameter\c!color]}
+ \setupsyntaxgroup[\syntaxgroup@name][\s!parent=\syntaxgroup@namespace,\c!color=\syntaxgroup@namespace-##1-color]
+ }
+ }
+ }{
+ \def\syntaxgroup@get_parameters##1%
+ {
+ \edef\syntaxgroup@name {\colorscheme@name##1}
+ \expanded{\setupsyntaxgroup[\syntaxgroup@name]
+ [\c!color=\namedsyntaxgroupparameter{\colorscheme@name#2}\c!color,
+ \c!style=\namedsyntaxgroupparameter{\colorscheme@name#2}\c!style,
+ \c!command=\namedsyntaxgroupparameter{\colorscheme@name#2}\c!command,
+ ]}
+
+ % In MkII, \expanded messes up the definition of \currentsyntaxgroup
+ \def\currentsyntaxgroup {\syntaxgroup@name}
+ }
+ }
+
+ \processcommalist[#1]\syntaxgroup@get_parameters
+\stoptexdefinition
+
+\def\startcolorscheme%
+ {\dosingleargument\colorscheme@start}
+
+\starttexdefinition colorscheme@start [#1]
+ \pushmacro\colorscheme@name
+ \setcolorscheme{#1}
+ %\setupsyntaxgroup[\c!color=,\c!style=,\c!command=]
+\stoptexdefinition
+
+\def\stopcolorscheme
+ {\popmacro\colorscheme@name}
+
+\def\setcolorscheme#1%
+ {\edef\colorscheme@name{#1}}
+
+\starttexdefinition syntaxgroup [#1]#2
+ % #1 = style
+ % #2 = content
+ \begingroup
+ \edef\syntaxgroup@name{\colorscheme@name#1}%
+ \syntaxgroupparameter\c!before
+ \iftracesyntaxgroups
+ \syntaxgroup@show_values
+ \fi
+ \dostarttagged\t!vimsyntaxgroup{vim#1}
+ \syntaxgroupparameter\c!command
+ {
+ \externalfilter@attributes_start\syntaxgroup@id\c!style\c!color
+ #2
+ \externalfilter@attributes_stop
+ }
+ \dostoptagged
+ \syntaxgroupparameter\c!after
+ \endgroup
+\stoptexdefinition
+
+%D Tracing macros
+
+\newif\iftracesyntaxgroups
+\let\tracesyntaxgroups\tracesyntaxgroupstrue
+
+\def\currentsyntaxgroup {\syntaxgroup@name}
+
+\starttexdefinition syntaxgroup@show_values
+ \writestatus\m!syntaxgroup{color scheme : \colorscheme@name}
+ \writestatus\m!syntaxgroup{current group: \syntaxgroup@name}
+ \writestatus\m!syntaxgroup{command : \syntaxgroupparameter\c!command}
+ \writestatus\m!syntaxgroup{style : \syntaxgroupparameter\c!style}
+ \writestatus\m!syntaxgroup{color : \syntaxgroupparameter\c!color}
+\stoptexdefinition
+
+\protectmodulecatcodes
+\stopmodule
diff --git a/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-highlight.mkiv b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-highlight.mkiv
index a056730174..13786bba29 100644
--- a/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-highlight.mkiv
+++ b/macros/context/contrib/context-vim/tex/context/third/vim/t-syntax-highlight.mkiv
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-syntax-highlight,
-%D version=2018.08.10,
+%D version=2020.06.29,
%D title=\CONTEXT\ User Module,
%D subtitle=Code syntax highlighting,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Code syntax highlighting (ver: 2018.08.10)}
+\writestatus{loading}{Code syntax highlighting (ver: 2020.06.29)}
\startmodule [syntax-highlight]
\usemodule [syntax-groups]
@@ -36,32 +36,37 @@
\appendtoks
\defineexternalfilter[\currentsyntaxhighlighting]
- [\s!parent=\????syntaxhighlighting\currentexternalfilter,\c!taglabel=\vimtyping@id]%
+ [\s!parent=\????syntaxhighlighting\currentexternalfilter,
+ \c!taglabel=\vimtyping@id,
+ \c!tagdetail={\externalfilterparameter\c!alternative},
+ ]%
\normalexpanded{\definelinenumbering [\currentsyntaxhighlighting]}%
\setevalue{type\currentsyntaxhighlighting file}{\getvalue{process\currentsyntaxhighlighting file}}%
\to\everydefinesyntaxhighlighting
+\define[1]\syntaxhighlighting@set_linenumbers
+ {\def\syntaxhighlighting@linenumbering{\getvalue{current#1}}%
+ \def\syntaxhighlighting@parameter{\getvalue{#1parameter}}%
+ \normalexpanded{\setuplinenumbering[\syntaxhighlighting@linenumbering]
+ [
+ \c!method=\syntaxhighlighting@parameter{\c!number\c!method},
+ \c!conversion=\syntaxhighlighting@parameter\c!numberconversion,
+ \c!location=\syntaxhighlighting@parameter{\c!number\c!location},
+ \c!style=\syntaxhighlighting@parameter\c!numberstyle,
+ \c!color=\syntaxhighlighting@parameter\c!numbercolor,
+ \c!width=\syntaxhighlighting@parameter{\c!number\c!width},
+ \c!left=\syntaxhighlighting@parameter{\c!number\c!left},
+ \c!right=\syntaxhighlighting@parameter{\c!number\c!right},
+ \c!command=\syntaxhighlighting@parameter\c!numbercommand,
+ \c!distance=\syntaxhighlighting@parameter{\c!number\c!distance},
+ \c!align=\syntaxhighlighting@parameter{\c!number\c!align},
+ ]}}
+
\appendtoks
- % \externalfitlterparameter does not work, so it is better to use
- % \syntaxhighlighting parameter.
- \normalexpanded{\setuplinenumbering[\currentsyntaxhighlighting]
- [
- \c!method=\syntaxhighlightingparameter{\c!number\c!method},
- \c!conversion=\syntaxhighlightingparameter\c!numberconversion,
- \c!location=\syntaxhighlightingparameter{\c!number\c!location},
- \c!style=\syntaxhighlightingparameter\c!numberstyle,
- \c!color=\syntaxhighlightingparameter\c!numbercolor,
- \c!width=\syntaxhighlightingparameter{\c!number\c!width},
- \c!left=\syntaxhighlightingparameter{\c!number\c!left},
- \c!right=\syntaxhighlightingparameter{\c!number\c!right},
- \c!command=\syntaxhighlightingparameter\c!numbercommand,
- \c!distance=\syntaxhighlightingparameter{\c!number\c!distance},
- \c!align=\syntaxhighlightingparameter{\c!number\c!align},
- ]}%
+ \syntaxhighlighting@set_linenumbers\syntaxhighlighting@id
\to\everysetupsyntaxhighlighting
\def\syntaxhighlighting@id {syntaxhighlighting}
-\edef\t!syntaxhighlighting {\syntaxhighlighting@id}
%D Helper macro
@@ -111,7 +116,7 @@
\stoptexdefinition
\starttexdefinition syntaxhighlighting@linenumbering_start
- \doifinset{\externalfilterparameter\c!numbering}\syntaxhighlighting@yes
+ \doifinsetelse{\externalfilterparameter\c!numbering}\syntaxhighlighting@yes
{\let\SYNBOL=\syntaxhighlighting_begin_number_lines
\let\SYNEOL=\syntaxhighlighting_end_number_lines
\startlinenumbering
@@ -122,24 +127,34 @@
\c!step=\externalfilterparameter{\c!number\c!step},
\c!continue=\externalfilterparameter{\c!number\c!continue},
]}
- \dostarttagged\t!syntaxhighlighting\colorscheme@name
+ {\let\SYNBOL=\syntaxhighlighting_begin_lines
+ \let\SYNEOL=\syntaxhighlighting_end_lines}
\stoptexdefinition
\starttexdefinition syntaxhighlighting@linenumbering_stop
- \dostoptagged
\doifinset{\externalfilterparameter\c!numbering}\syntaxhighlighting@yes
{\stoplinenumbering}
\stoptexdefinition
\newcount\nofsyntaxhighlightinglines
+\starttexdefinition syntaxhighlighting_begin_lines
+ \dostarttaggednodetail\t!verbatimline
+\stoptexdefinition
+
+\starttexdefinition syntaxhighlighting_end_lines
+ \dostoptagged
+\stoptexdefinition
+
\starttexdefinition syntaxhighlighting_begin_number_lines
\global\advance\nofsyntaxhighlightinglines\plusone
+ \dostarttaggednodetail\t!verbatimline
\attribute\verbatimlineattribute\nofsyntaxhighlightinglines
\stoptexdefinition
\starttexdefinition syntaxhighlighting_end_number_lines
- \attribute\verbatimlineattribute\attributeunsetvalue
+ \attribute\verbatimlineattribute\attributeunsetvalue
+ \dostoptagged
\stoptexdefinition
diff --git a/macros/context/contrib/context-vim/tex/context/third/vim/t-vim.tex b/macros/context/contrib/context-vim/tex/context/third/vim/t-vim.tex
index 2ea93198c4..3cb8e31089 100644
--- a/macros/context/contrib/context-vim/tex/context/third/vim/t-vim.tex
+++ b/macros/context/contrib/context-vim/tex/context/third/vim/t-vim.tex
@@ -1,6 +1,6 @@
%D \module
%D [ file=t-vim,
-%D version=2020.05.17,
+%D version=2020.06.29,
%D title=\CONTEXT\ User Module,
%D subtitle=Vim syntax highlighting,
%D author=Aditya Mahajan,
@@ -9,7 +9,7 @@
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
-\writestatus{loading}{Vim syntax highlighting (ver: 2020.05.17)}
+\writestatus{loading}{Vim syntax highlighting (ver: 2020.06.29)}
\startmodule [vim]
\usemodule [filter] % loads module catcodes
@@ -31,6 +31,13 @@
\installparameterhandler \vimtyping@namespace \vimtyping@id
\installsetuphandler \vimtyping@namespace \vimtyping@id
+\appendtoks
+ % \setupvimtyping[...][...] does not call
+ % \setupsyntaxhighlighting[...][...],
+ % So, the line numbering options are not reset. Reset them explicitly here
+ \syntaxhighlighting@set_linenumbers\vimtyping@id
+\to\everysetupvimtyping
+
\def\definevimtyping
{\dodoubleargument\vimtyping@define}
@@ -43,11 +50,16 @@
% Mode to testing the dev version of 2context script.
\doifmodeelse{vim-dev,dev-vim}
- {\def\vimtyping@script_name{2context.vim}}
+ {\def\vimtyping@script_name{2context.vim}%
+ \doifmode\s!mkiv{\def\vimtyping@css_name{vimtyping-default.css}}}
{\doifmodeelse\s!mkiv
- {\ctxlua{context.setvalue("vimtyping@script_name",resolvers.resolve("full:2context.vim"))}}
+ {\ctxlua{context.setvalue("vimtyping@script_name",resolvers.resolve("full:2context.vim"))}%
+ \ctxlua{context.setvalue("vimtyping@css_name",
+ resolvers.resolve("full:vimtyping-default.css"))}}
{\def\vimtyping@script_name{kpse:2context.vim}}}
+\def\vimtypingcssfile{\vimtyping@css_name}
+
\def\vimtyping@filter_command
{\externalfilterparameter\c!vimcommand\space
-u \vimrc_filename\space % read global config file
@@ -258,7 +270,6 @@
[\c!color={h=800000},
\c!command=\vimtodoframed]
-
\definesyntaxgroup
[Error]
[\c!color={h=c03000}]
@@ -268,11 +279,6 @@
[\c!color={h=6a5acd},
\c!command=\underbar]
- \definesyntaxgroup
- [Todo]
- [\c!color={h=800000},
- \c!command=\vimtodoframed]
-
\setups{vim-minor-groups}
\definesyntaxgroup
@@ -324,58 +330,6 @@
\setups{vim-minor-groups}
\stopcolorscheme
-
-\startcolorscheme[kate]
- % Temporary definition... will change
- % . kw dsKeyword
- % . dt dsDataType
- % . dv dsDecVal
- % . bn dsBaseN
- % . fl dsFloat
- % . ch dsChar
- % . st dsString
- % . co dsComment
- % . ot dsOthers
- % . al dsAlert
- % . fu dsFunction
- % . re dsRegionMarker
- % . er dsError
- \definesyntaxgroup
- [kw]
- [\c!color={h=007020}, \c!style=bold]
-
- \definesyntaxgroup
- [dt]
- [\c!color={h=902000}]
-
- \definesyntaxgroup
- [dv, bn, fl]
- [\c!color={h=40a070}]
-
- \definesyntaxgroup
- [ch, st]
- [\c!color={h=4070a0}]
-
- \definesyntaxgroup
- [co]
- [\c!color={h=60a0b0}, \c!style=italic]
-
- \definesyntaxgroup
- [ot]
- [\c!color={h=007020}]
-
- \definesyntaxgroup
- [al, er]
- [\c!color=red, \c!style=bold]
-
- \definesyntaxgroup
- [fu]
- [\c!color={h=06287e}]
-
- \definesyntaxgroup
- [re]
-
-\stopcolorscheme
\protectmodulecatcodes
\stopmodule
diff --git a/macros/context/contrib/context-vim/tex/context/third/vim/vimtyping-default.css b/macros/context/contrib/context-vim/tex/context/third/vim/vimtyping-default.css
new file mode 100644
index 0000000000..e1eeb7d89d
--- /dev/null
+++ b/macros/context/contrib/context-vim/tex/context/third/vim/vimtyping-default.css
@@ -0,0 +1,415 @@
+/*
+ author : Aditya Mahajan and Christoph Hintermüller,
+ license : Simplfied BSD License,
+ version : 2020.06.29
+*/
+
+/* TODO:
+ * Inline environments
+ * Export of TODO has an extra space
+ * Line numbering in the margin
+ */
+
+vimtyping,
+.vimtyping
+{
+ font-family:monospace;
+ display:block;
+ white-space:pre-wrap;
+}
+
+inlinevimtyping,
+.inlinevimtyping
+{
+ font-family:monospace;
+ display:inline;
+ white-space:pre-wrap;
+}
+
+
+vimtyping verbatimline,
+inlinevimtyping verbatimline,
+.vimtyping .verbatimline,
+.inlinevimtyping .verbatimline
+{
+ display:inline;
+ white-space:pre-wrap;
+}
+
+vimtyping syntaxgroup,
+inlinevimtyping syntaxgroup,
+.vimtyping .syntaxgroup,
+.inlinevimtyping .syntaxgroup
+{
+ display:inline;
+}
+
+/* `pscolor` color scheme */
+vimtyping[detail=pscolor] syntaxgroup[defail=vimConstant],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimConstant],
+.vimtyping.pscolor .syntaxgroup.vimConstant,
+.inlinevimtyping.pscolor .syntaxgroup.vimConstant,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimString],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimString],
+.vimtyping.pscolor .syntaxgroup.vimString,
+.inlinevimtyping.pscolor .syntaxgroup.vimString,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimCharacter],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimCharacter],
+.vimtyping.pscolor .syntaxgroup.vimCharacter,
+.inlinevimtyping.pscolor .syntaxgroup.vimCharacter,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimBoolean],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimBoolean],
+.vimtyping.pscolor .syntaxgroup.vimBoolean,
+.inlinevimtyping.pscolor .syntaxgroup.vimBoolean,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimFloat],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimFloat],
+.vimtyping.pscolor .syntaxgroup.vimFloat,
+.inlinevimtyping.pscolor .syntaxgroup.vimFloat
+{
+ color:#007068;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimNumber],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimNumber],
+.vimtyping.pscolor .syntaxgroup.vimNumber,
+.inlinevimtyping.pscolor .syntaxgroup.vimNumber
+{
+ color:#907000;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimIdentifier],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimIdentifier],
+.vimtyping.pscolor .syntaxgroup.vimIdentifier,
+.inlinevimtyping.pscolor .syntaxgroup.vimIdentifier,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimFunction],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimFunction],
+.vimtyping.pscolor .syntaxgroup.vimFunction,
+.inlinevimtyping.pscolor .syntaxgroup.vimFunction
+{
+ color:#a030a0;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimStatement],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimStatement],
+.vimtyping.pscolor .syntaxgroup.vimStatement,
+.inlinevimtyping.pscolor .syntaxgroup.vimStatement,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimCondition],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimCondition],
+.vimtyping.pscolor .syntaxgroup.vimCondition,
+.inlinevimtyping.pscolor .syntaxgroup.vimCondition,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimRepeat],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimRepeat],
+.vimtyping.pscolor .syntaxgroup.vimRepeat,
+.inlinevimtyping.pscolor .syntaxgroup.vimRepeat,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimLabel],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimLabel],
+.vimtyping.pscolor .syntaxgroup.vimLabel,
+.inlinevimtyping.pscolor .syntaxgroup.vimLabel,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimOperator],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimOperator],
+.vimtyping.pscolor .syntaxgroup.vimOperator,
+.inlinevimtyping.pscolor .syntaxgroup.vimOperator,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimKeyword],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimKeyword],
+.vimtyping.pscolor .syntaxgroup.vimKeyword,
+.inlinevimtyping.pscolor .syntaxgroup.vimKeyword,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimException],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimException],
+.vimtyping.pscolor .syntaxgroup.vimException,
+.inlinevimtyping.pscolor .syntaxgroup.vimException
+{
+ color:#2060a8;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimPreProc],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimPreProc],
+.vimtyping.pscolor .syntaxgroup.vimPreProc,
+.inlinevimtyping.pscolor .syntaxgroup.vimPreProc,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimInclude],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimInclude],
+.vimtyping.pscolor .syntaxgroup.vimInclude,
+.inlinevimtyping.pscolor .syntaxgroup.vimInclude,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimDefine],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimDefine],
+.vimtyping.pscolor .syntaxgroup.vimDefine,
+.inlinevimtyping.pscolor .syntaxgroup.vimDefine,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimMacro],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimMacro],
+.vimtyping.pscolor .syntaxgroup.vimMacro,
+.inlinevimtyping.pscolor .syntaxgroup.vimMacro,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimPreCondit],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimPreCondit],
+.vimtyping.pscolor .syntaxgroup.vimPreCondit,
+.inlinevimtyping.pscolor .syntaxgroup.vimPreCondit
+{
+ color:#009030;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimType],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimType],
+.vimtyping.pscolor .syntaxgroup.vimType,
+.inlinevimtyping.pscolor .syntaxgroup.vimType,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimStorageClass],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimStorageClass],
+.vimtyping.pscolor .syntaxgroup.vimStorageClass,
+.inlinevimtyping.pscolor .syntaxgroup.vimStorageClass,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimStructure],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimStructure],
+.vimtyping.pscolor .syntaxgroup.vimStructure,
+.inlinevimtyping.pscolor .syntaxgroup.vimStructure,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimTypedef],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimTypedef],
+.vimtyping.pscolor .syntaxgroup.vimTypedef,
+.inlinevimtyping.pscolor .syntaxgroup.vimTypedef
+{
+ color:#0850a0;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimSpecial],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimSpecial],
+.vimtyping.pscolor .syntaxgroup.vimSpecial,
+.inlinevimtyping.pscolor .syntaxgroup.vimSpecial,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimSpecialChar],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimSpecialChar],
+.vimtyping.pscolor .syntaxgroup.vimSpecialChar,
+.inlinevimtyping.pscolor .syntaxgroup.vimSpecialChar,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimDelimiter],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimDelimiter],
+.vimtyping.pscolor .syntaxgroup.vimDelimiter,
+.inlinevimtyping.pscolor .syntaxgroup.vimDelimiter,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimDebug],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimDebug],
+.vimtyping.pscolor .syntaxgroup.vimDebug,
+.inlinevimtyping.pscolor .syntaxgroup.vimDebug
+{
+ color:#907000;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimComment],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimComment],
+.vimtyping.pscolor .syntaxgroup.vimComment,
+.inlinevimtyping.pscolor .syntaxgroup.vimComment,
+vimtyping[detail=pscolor] syntaxgroup[defail=vimSpecialComment],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimSpecialComment],
+.vimtyping.pscolor .syntaxgroup.vimSpecialComment,
+.inlinevimtyping.pscolor .syntaxgroup.vimSpecialComment
+{
+ color:#606000;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimIgnore],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimIgnore],
+.vimtyping.pscolor .syntaxgroup.vimIgnore,
+.inlinevimtyping.pscolor .syntaxgroup.vimIgnore
+{
+ color:unset;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimTodo],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimTodo],
+.vimtyping.pscolor .syntaxgroup.vimTodo,
+.inlinevimtyping.pscolor .syntaxgroup.vimTodo
+{
+ color:#800000;
+ background-color:#e0e090;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimError],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimError],
+.vimtyping.pscolor .syntaxgroup.vimError,
+.inlinevimtyping.pscolor .syntaxgroup.vimError
+{
+ color:#c03000;
+}
+
+vimtyping[detail=pscolor] syntaxgroup[defail=vimUnderlined],
+inlinevimtyping[detail=pscolor] syntaxgroup[defail=vimUnderlined],
+.vimtyping.pscolor .syntaxgroup.vimUnderlined,
+.inlinevimtyping.pscolor .syntaxgroup.vimUnderlined
+{
+ color:#6a5acd;
+ text-decoration:underline;
+}
+
+/* `blackandwhite` color scheme */
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimConstant],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimConstant],
+.vimtyping.blackandwhite .syntaxgroup.vimConstant,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimConstant,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimString],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimString],
+.vimtyping.blackandwhite .syntaxgroup.vimString,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimString,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimCharacter],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimCharacter],
+.vimtyping.blackandwhite .syntaxgroup.vimCharacter,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimCharacter,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimBoolean],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimBoolean],
+.vimtyping.blackandwhite .syntaxgroup.vimBoolean,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimBoolean,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimFloat],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimFloat],
+.vimtyping.blackandwhite .syntaxgroup.vimFloat,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimFloat
+{
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimNumber],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimNumber],
+.vimtyping.blackandwhite .syntaxgroup.vimNumber,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimNumber
+{
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimIdentifier],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimIdentifier],
+.vimtyping.blackandwhite .syntaxgroup.vimIdentifier,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimIdentifier,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimFunction],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimFunction],
+.vimtyping.blackandwhite .syntaxgroup.vimFunction,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimFunction
+{
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimStatement],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimStatement],
+.vimtyping.blackandwhite .syntaxgroup.vimStatement,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimStatement,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimCondition],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimCondition],
+.vimtyping.blackandwhite .syntaxgroup.vimCondition,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimCondition,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimRepeat],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimRepeat],
+.vimtyping.blackandwhite .syntaxgroup.vimRepeat,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimRepeat,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimLabel],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimLabel],
+.vimtyping.blackandwhite .syntaxgroup.vimLabel,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimLabel,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimOperator],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimOperator],
+.vimtyping.blackandwhite .syntaxgroup.vimOperator,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimOperator,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimKeyword],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimKeyword],
+.vimtyping.blackandwhite .syntaxgroup.vimKeyword,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimKeyword,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimException],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimException],
+.vimtyping.blackandwhite .syntaxgroup.vimException,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimException
+{
+ font-weight:bold;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimPreProc],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimPreProc],
+.vimtyping.blackandwhite .syntaxgroup.vimPreProc,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimPreProc,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimInclude],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimInclude],
+.vimtyping.blackandwhite .syntaxgroup.vimInclude,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimInclude,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimDefine],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimDefine],
+.vimtyping.blackandwhite .syntaxgroup.vimDefine,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimDefine,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimMacro],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimMacro],
+.vimtyping.blackandwhite .syntaxgroup.vimMacro,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimMacro,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimPreCondit],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimPreCondit],
+.vimtyping.blackandwhite .syntaxgroup.vimPreCondit,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimPreCondit
+{
+ font-weight:bold;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimType],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimType],
+.vimtyping.blackandwhite .syntaxgroup.vimType,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimType,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimStorageClass],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimStorageClass],
+.vimtyping.blackandwhite .syntaxgroup.vimStorageClass,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimStorageClass,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimStructure],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimStructure],
+.vimtyping.blackandwhite .syntaxgroup.vimStructure,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimStructure,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimTypedef],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimTypedef],
+.vimtyping.blackandwhite .syntaxgroup.vimTypedef,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimTypedef
+{
+ font-weight:bold;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecial],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecial],
+.vimtyping.blackandwhite .syntaxgroup.vimSpecial,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimSpecial,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecialChar],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecialChar],
+.vimtyping.blackandwhite .syntaxgroup.vimSpecialChar,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimSpecialChar,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimDelimiter],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimDelimiter],
+.vimtyping.blackandwhite .syntaxgroup.vimDelimiter,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimDelimiter,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimDebug],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimDebug],
+.vimtyping.blackandwhite .syntaxgroup.vimDebug,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimDebug
+{
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimComment],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimComment],
+.vimtyping.blackandwhite .syntaxgroup.vimComment,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimComment,
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecialComment],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimSpecialComment],
+.vimtyping.blackandwhite .syntaxgroup.vimSpecialComment,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimSpecialComment
+{
+ font-style:italic;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimIgnore],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimIgnore],
+.vimtyping.blackandwhite .syntaxgroup.vimIgnore,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimIgnore
+{
+
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimTodo],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimTodo],
+.vimtyping.blackandwhite .syntaxgroup.vimTodo,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimTodo
+{
+ border:0.6px solid;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimError],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimError],
+.vimtyping.blackandwhite .syntaxgroup.vimError,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimError
+{
+ text-decoration:line-through;
+}
+
+vimtyping[detail=blackandwhite] syntaxgroup[defail=vimUnderlined],
+inlinevimtyping[detail=blackandwhite] syntaxgroup[defail=vimUnderlined],
+.vimtyping.blackandwhite .syntaxgroup.vimUnderlined,
+.inlinevimtyping.blackandwhite .syntaxgroup.vimUnderlined
+{
+ text-decoration:underline;
+}
+
diff --git a/macros/generic/tracklang/CHANGES b/macros/generic/tracklang/CHANGES
index 452a7d0727..8725ee915d 100644
--- a/macros/generic/tracklang/CHANGES
+++ b/macros/generic/tracklang/CHANGES
@@ -1,3 +1,11 @@
+v1.5 (2020-06-30):
+
+ * Removed redundant code and added debug message to
+ \TrackLangAddToHook and \TrackLangRedefHook
+
+ * Bug fix: removed spurious {\fi} from \@tracklang@test@if@file@exists@for@langII
+ https://www.dickimaw-books.com/bugtracker.php?action=view&key=165
+
v1.4 (2019-11-30):
* tracklang.tex:
diff --git a/macros/generic/tracklang/README b/macros/generic/tracklang/README
index b3e7de27b1..caac438bc4 100644
--- a/macros/generic/tracklang/README
+++ b/macros/generic/tracklang/README
@@ -1,14 +1,17 @@
-Generic TeX Bundle : tracklang v1.4
+Generic TeX Bundle : tracklang v1.5
-Last Modified : 2019-11-30
+Last Modified : 2020-06-30
-Author : Nicola Talbot
+Author : Nicola Talbot (dickimaw-books.com/contact)
-LaTeX usage: \usepackage{tracklang}
+Licence:
-TeX usage: \input tracklang
+This material is subject to the LaTeX Project Public License.
+See http://www.ctan.org/license/lppl1.3 for the details of that license.
-LaTeX code is in tracklang.sty. Generic TeX code is in tracklang.tex.
+Copyright 2014-2020 Nicola Talbot
+
+Description:
The tracklang package is provided for package developers who want a
simple interface to find out which languages the user has requested
@@ -16,12 +19,12 @@ through packages such as babel and polyglossia. *This package
doesn't provide any translations.* Its purpose is simply to track
which languages have been requested by the user.
-Related article: "Localisation of TeX documents: tracklang."
-TUGBoat, Volume 37 (2016), No. 3.
-http://www.tug.org/TUGboat/tb37-3/tb117talbot.pdf
+LaTeX usage: \usepackage{tracklang}
-This material is subject to the LaTeX Project Public License.
-See http://www.ctan.org/license/lppl1.3 for the details of that license.
+TeX usage: \input tracklang
-http://www.dickimaw-books.com/
+LaTeX code is in tracklang.sty. Generic TeX code is in tracklang.tex.
+Related article: "Localisation of TeX documents: tracklang."
+TUGBoat, Volume 37 (2016), No. 3.
+http://www.tug.org/TUGboat/tb37-3/tb117talbot.pdf
diff --git a/macros/generic/tracklang/samples/animals/sample-animals-babel.pdf b/macros/generic/tracklang/samples/animals/sample-animals-babel.pdf
index 2485ee53c7..35cb126385 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals-babel.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals-babel.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals-de-poly.pdf b/macros/generic/tracklang/samples/animals/sample-animals-de-poly.pdf
index 88669915f9..73ce65645d 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals-de-poly.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals-de-poly.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals-de.pdf b/macros/generic/tracklang/samples/animals/sample-animals-de.pdf
index 07962fd91a..6ee9ea4efa 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals-de.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals-de.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals-poly.pdf b/macros/generic/tracklang/samples/animals/sample-animals-poly.pdf
index 476f2f418d..19144645ce 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals-poly.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals-poly.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals-sr-poly.pdf b/macros/generic/tracklang/samples/animals/sample-animals-sr-poly.pdf
new file mode 100644
index 0000000000..7e746cba6a
--- /dev/null
+++ b/macros/generic/tracklang/samples/animals/sample-animals-sr-poly.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals.pdf b/macros/generic/tracklang/samples/animals/sample-animals.pdf
index 3ec9a8145c..89632f165a 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2-de.pdf b/macros/generic/tracklang/samples/animals/sample-animals2-de.pdf
index a509e00866..5f22dca624 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2-de.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2-de.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2-de2.pdf b/macros/generic/tracklang/samples/animals/sample-animals2-de2.pdf
index c6a6e94de9..b2277b8b98 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2-de2.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2-de2.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2-de3.pdf b/macros/generic/tracklang/samples/animals/sample-animals2-de3.pdf
index 09f9b2eb4d..069a48e10c 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2-de3.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2-de3.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2-de4.pdf b/macros/generic/tracklang/samples/animals/sample-animals2-de4.pdf
index 271acfcba4..ce6a514e5c 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2-de4.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2-de4.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2-poly.pdf b/macros/generic/tracklang/samples/animals/sample-animals2-poly.pdf
index 5f1807767c..8809c66b85 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2-poly.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2-poly.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/animals/sample-animals2.pdf b/macros/generic/tracklang/samples/animals/sample-animals2.pdf
index 8ef941783a..fbd7a234d6 100644
--- a/macros/generic/tracklang/samples/animals/sample-animals2.pdf
+++ b/macros/generic/tracklang/samples/animals/sample-animals2.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions.pdf b/macros/generic/tracklang/samples/regions/sample-regions.pdf
index 78c1c87385..fab8f6977b 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2-manx.pdf b/macros/generic/tracklang/samples/regions/sample-regions2-manx.pdf
index 83340a0ce7..93f3428fb3 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2-manx.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2-manx.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2-map.pdf b/macros/generic/tracklang/samples/regions/sample-regions2-map.pdf
index 635f2c1f79..db87696734 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2-map.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2-map.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2-map2.pdf b/macros/generic/tracklang/samples/regions/sample-regions2-map2.pdf
index e664c00877..4784228ed8 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2-map2.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2-map2.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2-map3.pdf b/macros/generic/tracklang/samples/regions/sample-regions2-map3.pdf
index aac08c391d..90546af2b0 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2-map3.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2-map3.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2-nomap.pdf b/macros/generic/tracklang/samples/regions/sample-regions2-nomap.pdf
index df2d0bc468..167a38fcf7 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2-nomap.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2-nomap.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/regions/sample-regions2.pdf b/macros/generic/tracklang/samples/regions/sample-regions2.pdf
index 0b26023e24..d7393715ff 100644
--- a/macros/generic/tracklang/samples/regions/sample-regions2.pdf
+++ b/macros/generic/tracklang/samples/regions/sample-regions2.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang.pdf b/macros/generic/tracklang/samples/sample-tracklang.pdf
index aca2dd6c84..6d5a7dbf53 100644
--- a/macros/generic/tracklang/samples/sample-tracklang.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang2.pdf b/macros/generic/tracklang/samples/sample-tracklang2.pdf
index ef391b9912..d2f16a3e3e 100644
--- a/macros/generic/tracklang/samples/sample-tracklang2.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang2.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang3.pdf b/macros/generic/tracklang/samples/sample-tracklang3.pdf
index fa54737ec5..8966ec23fa 100644
--- a/macros/generic/tracklang/samples/sample-tracklang3.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang3.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang4.pdf b/macros/generic/tracklang/samples/sample-tracklang4.pdf
index ec3ffb3d4d..b65563f2fd 100644
--- a/macros/generic/tracklang/samples/sample-tracklang4.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang4.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang5.pdf b/macros/generic/tracklang/samples/sample-tracklang5.pdf
index 48c0ad786b..3446d96ec5 100644
--- a/macros/generic/tracklang/samples/sample-tracklang5.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang5.pdf
Binary files differ
diff --git a/macros/generic/tracklang/samples/sample-tracklang6.pdf b/macros/generic/tracklang/samples/sample-tracklang6.pdf
index 037e2dade1..1f3cce82ec 100644
--- a/macros/generic/tracklang/samples/sample-tracklang6.pdf
+++ b/macros/generic/tracklang/samples/sample-tracklang6.pdf
Binary files differ
diff --git a/macros/generic/tracklang/tracklang.dtx b/macros/generic/tracklang/tracklang.dtx
index e071563fe3..22dd36860e 100644
--- a/macros/generic/tracklang/tracklang.dtx
+++ b/macros/generic/tracklang/tracklang.dtx
@@ -1,16 +1,16 @@
%\iffalse
% tracklang.dtx generated using makedtx version 1.2 (c) Nicola Talbot
% Command line args:
-% -doc "tracklang-manual.tex"
-% -author "Nicola Talbot"
% -src "tracklang.sty\Z=>tracklang.sty"
% -src "tracklang.tex\Z=>tracklang.tex"
% -src "tracklang-region-codes.tex\Z=>tracklang-region-codes.tex"
% -src "tracklang-scripts.sty\Z=>tracklang-scripts.sty"
% -src "tracklang-scripts.tex\Z=>tracklang-scripts.tex"
+% -author "Nicola Talbot"
+% -doc "tracklang-manual.tex"
% -section "chapter"
% tracklang
-% Created on 2019/12/1 17:41
+% Created on 2020/6/30 11:55
%\fi
%\iffalse
%<*package>
@@ -33,7 +33,7 @@
%\fi
% \iffalse
% Doc-Source file to use with LaTeX2e
-% Copyright (C) 2019 Nicola Talbot, all rights reserved.
+% Copyright (C) 2020 Nicola Talbot, all rights reserved.
% \fi
% \iffalse
%<*driver>
@@ -59,7 +59,7 @@
pdfauthor={Nicola L.C. Talbot},
pdftitle={tracklang: tracking language options}]{hyperref}
-\CheckSum{6156}
+\CheckSum{6210}
\appto\MacroFont{\scriptsize}
\renewcommand*{\usage}[1]{\textit{\hyperpage{#1}}}
@@ -278,11 +278,11 @@ and~\ref{tab:nonisoopts}}
%
%\MakeShortVerb{"}
%
-%\title{tracklang v1.4:
+%\title{tracklang v1.5:
%tracking language options}
%\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}}
%
-%\date{2019-11-30}
+%\date{2020-06-30}
%\maketitle
%
%\begin{abstract}
@@ -3583,7 +3583,7 @@ and~\ref{tab:nonisoopts}}
% packages such as \styfmt{etoolbox}.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang}[2019/11/30 v1.4 (NLCT) Track Languages]
+\ProvidesPackage{tracklang}[2020/06/30 v1.5 (NLCT) Track Languages]
% \end{macrocode}
%\begin{macro}{\@tracklang@declareoption}
% Set up package options.
@@ -3879,7 +3879,7 @@ and~\ref{tab:nonisoopts}}
% Version info.
% \begin{macrocode}
\expandafter\def\csname ver@tracklang.tex\endcsname{%
- 2019/11/30 v1.4 (NLCT) Track Languages Generic Code}
+ 2020/06/30 v1.5 (NLCT) Track Languages Generic Code}
% \end{macrocode}
% Define a long command for determining the existence of a control
% sequence by its name. (\cs{relax} is considered undefined.)
@@ -11374,9 +11374,9 @@ and~\ref{tab:nonisoopts}}
}%
\fi
}%
- {%
- \fi
- }%
+% \end{macrocode}
+%\changes{1.5}{2020-06-30}{removed spurious code block}
+% \begin{macrocode}
}%
{%
\let\@tracklang@test@if@file@exists@next\@tracklang@test@if@file@exists@for@langIII
@@ -11597,16 +11597,19 @@ and~\ref{tab:nonisoopts}}
%
%\begin{macro}{\IfTrackedLanguageFileExists@orig}
%\changes{1.4}{2019-11-30}{new}
+%\changes{1.5}{2020-06-30}{added verbose messages}
%The new definition of \cs{IfTrackedLanguageFileExists} has a
%different order of priority. If the original behaviour is
%specifically required, this has the pre version 1.4 definition.
% \begin{macrocode}
\long\def\IfTrackedLanguageFileExists@orig#1#2#3#4#5{%
+ \@tracklang@verbose{Finding file for dialect `#1' (pre-v1.4)}%
\def\CurrentTrackedTag{}%
\SetCurrentTrackedDialect{#1}%
\IfTrackedDialect{#1}%
{%
\edef\CurrentTrackedTag{#1}%
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
@@ -11618,6 +11621,7 @@ and~\ref{tab:nonisoopts}}
{639-1}{\CurrentTrackedLanguage}}%
\ifx\CurrentTrackedRegion\empty
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}
{%
@@ -11628,21 +11632,25 @@ and~\ref{tab:nonisoopts}}
\TrackedIsoCodeFromLanguage
{639-2}{\CurrentTrackedLanguage}}%
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
}%
\else
\edef\CurrentTrackedTag{%
\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}
{%
@@ -11655,25 +11663,30 @@ and~\ref{tab:nonisoopts}}
{639-2}{\CurrentTrackedLanguage}}%
\edef\CurrentTrackedTag{%
\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\org@currenttrackedisocode
\let\org@currenttrackedisocode\CurrentTrackedIsoCode
\let\CurrentTrackedIsoCode\CurrentTrackedTag
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}
{%
\let\CurrentTrackedIsoCode\org@currenttrackedisocode
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedRegion
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
}%
@@ -11682,14 +11695,17 @@ and~\ref{tab:nonisoopts}}
}%
{%
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedRegion
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
}%
@@ -11720,40 +11736,49 @@ and~\ref{tab:nonisoopts}}
\ifx\CurrentTrackedIsoCode\empty
\ifx\CurrentTrackedRegion\empty
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
\else
\let\CurrentTrackedTag\CurrentTrackedRegion
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
\fi
\else
\ifx\CurrentTrackedRegion\empty
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
\else
\edef\CurrentTrackedTag{%
\CurrentTrackedIsoCode-\CurrentTrackedRegion}%
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedIsoCode
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedRegion
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}%
{#4}%
{%
\let\CurrentTrackedTag\CurrentTrackedLanguage
+ \@tracklang@verbose{Testing tag `\CurrentTrackedTag'}%
\@tracklang@IfFileExists{#2\CurrentTrackedTag#3}{#4}{#5}%
}%
}%
@@ -11890,9 +11915,11 @@ and~\ref{tab:nonisoopts}}
\@tracklang@ifundef{#2\CurrentTrackedLanguage}%
{%
% \end{macrocode}
-% No captions hook. Do the code now.
+% No captions hook. Do nothing (it's possible no language package
+% has been loaded).
+%\changes{1.5}{2020-06-30}{removed redundant code and added verbose message}
% \begin{macrocode}
- #1%
+ \@tracklang@verbose{no hook found for \CurrentTrackedDialect}%
}%
{%
\@tracklang@addtohook{#2}{\CurrentTrackedLanguage}{#1}%
@@ -11911,6 +11938,7 @@ and~\ref{tab:nonisoopts}}
% \end{macrocode}
% No captions hook.
% \begin{macrocode}
+ \@tracklang@verbose{no hook found for \CurrentTrackedDialect}%
}%
{%
\@tracklang@addtohook{#2}{\CurrentTrackedLanguage}{#1}%
@@ -12001,9 +12029,11 @@ and~\ref{tab:nonisoopts}}
\@tracklang@ifundef{#2\CurrentTrackedLanguage}%
{%
% \end{macrocode}
-% No captions hook. Do the code now.
+% No captions hook. Do nothing (it's possible no language package
+% has been loaded).
+%\changes{1.5}{2020-06-30}{removed redundant code and added verbose message}
% \begin{macrocode}
- #1%
+ \@tracklang@verbose{no hook found for \CurrentTrackedDialect}%
}%
{%
\@tracklang@redefhook{#2}{\CurrentTrackedLanguage}{#1}%
@@ -12022,6 +12052,7 @@ and~\ref{tab:nonisoopts}}
% \end{macrocode}
% No captions hook.
% \begin{macrocode}
+ \@tracklang@verbose{no hook found for \CurrentTrackedDialect}%
}%
{%
\@tracklang@redefhook{#2}{\CurrentTrackedLanguage}{#1}%
@@ -12406,7 +12437,7 @@ and~\ref{tab:nonisoopts}}
% Version info.
% \begin{macrocode}
\expandafter\def\csname ver@tracklang-region-codes.tex\endcsname{%
- 2019/11/30 v1.4 (NLCT) Track Languages Regions}%
+ 2020/06/30 v1.5 (NLCT) Track Languages Regions}%
% \end{macrocode}
%
%\begin{macro}{\TrackLangRegionMap}
@@ -12799,7 +12830,7 @@ and~\ref{tab:nonisoopts}}
%\changes{1.3}{2016-10-07}{added tracklang-scripts.sty}
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{tracklang-scripts}[2019/11/30 v1.4 (NLCT) Track
+\ProvidesPackage{tracklang-scripts}[2020/06/30 v1.5 (NLCT) Track
Language Scripts (LaTeX)]
\RequirePackage{tracklang}
\input{tracklang-scripts}
@@ -12841,7 +12872,7 @@ Language Scripts (LaTeX)]
% Version info.
% \begin{macrocode}
\expandafter\def\csname ver@tracklang-scripts.tex\endcsname{%
- 2019/11/30 v1.4 (NLCT) Track Languages Scripts (Generic)}%
+ 2020/06/30 v1.5 (NLCT) Track Languages Scripts (Generic)}%
% \end{macrocode}
%
%\begin{macro}{\TrackLangScriptsMap}
diff --git a/macros/generic/tracklang/tracklang.ins b/macros/generic/tracklang/tracklang.ins
index 019b391cd1..4b7bca1dde 100644
--- a/macros/generic/tracklang/tracklang.ins
+++ b/macros/generic/tracklang/tracklang.ins
@@ -1,10 +1,10 @@
-% tracklang.ins generated using makedtx version 1.2 2019/12/1 17:41
+% tracklang.ins generated using makedtx version 1.2 2020/6/30 11:55
\input docstrip
\preamble
tracklang.dtx
- Copyright 2019 Nicola Talbot
+ Copyright 2020 Nicola Talbot
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/generic/tracklang/tracklang.pdf b/macros/generic/tracklang/tracklang.pdf
index 8f0aeee5fc..a498800ab0 100644
--- a/macros/generic/tracklang/tracklang.pdf
+++ b/macros/generic/tracklang/tracklang.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf
index bf2992cf94..e17f576a21 100644
--- a/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf
+++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex
index 8fd5aa56d5..d8c59aeb65 100644
--- a/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex
+++ b/macros/latex/contrib/babel-contrib/french/frenchb-doc.tex
@@ -410,8 +410,8 @@ document (ou maquette) est modifiée de la façon suivante%
fichier \file{.log}.
Certaines classes ou extensions modifient la présentation des légendes;
- parmi elles, les classes (\cls{memoir}, koma-script et AMS et les
- extensions(\ext{caption} et \ext{floatrow} sont compatibles avec
+ parmi elles, les classes (\cls{memoir}, \cls{beamer}, koma-script et AMS
+ et les extensions(\ext{caption} et \ext{floatrow} sont compatibles avec
\ext{babel-french}.
Un avertissement est inséré dans le fichier \file{.log} lorsqu’il y a risque
@@ -1531,6 +1531,11 @@ La version 3.5g corrige une bogue ancienne affectant l’usage des polices
type~1 avec Lua\-(La)TeX : tout crénage était supprimé pour ces polices depuis
la version~3.1f (2015) ; les polices OpenType elles, n’ont jamais été affectées.
+La version 3.5i corrige aussi une bogue ancienne affectant les classes
+koma-script, \cls{memoir} et \cls{beamer} : les redéfinitions du séparateur
+des légendes de figures et tables (commandes |\captionformat|, |\captiondelim|,
+etc.) sont maintenant prises en compte correctement.
+
\subsection{Changements entre les versions 3.4d et 3.3d}
\label{ssec:changes-3.4}
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.dtx b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
index 4941b1cea7..d253c3b90b 100644
--- a/macros/latex/contrib/babel-contrib/french/frenchb.dtx
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.dtx
@@ -1,4 +1,4 @@
-%\CheckSum{3802}
+%\CheckSum{3835}
%
%\iffalse
% Tell the LaTeX system who we are and write an entry on the
@@ -13,7 +13,7 @@
%<frenchb>\ProvidesLanguage{frenchb}
%<lua>--[[
%<lua> File `frenchb.lua’ generated from frenchb.dtx
- [2020/04/18 v3.5h French support from the babel system]
+ [2020/06/30 v3.5i French support from the babel system]
%<*internal>
\iffalse
%</internal>
@@ -47,21 +47,16 @@
\usepackage[dvipsnames]{xcolor}
\usepackage[no-math]{fontspec}
\usepackage{realscripts}
-\setmainfont{FiraSans}[
- Extension = .otf ,
- UprightFont = *-Book,
- ItalicFont = *-BookItalic,
- BoldFont = *-Medium,
- BoldItalicFont = *-MediumItalic,
- SmallCapsFont = FiraSans-Book,
- SmallCapsFeatures = {Letters=SmallCaps},
+\setmainfont{Vera.ttf}[
+ ItalicFont = VeraIt.ttf,
+ BoldFont = VeraBd.ttf,
+ BoldItalicFont = VeraBI.ttf,
+ Scale = 0.92
]
-\setmonofont{FiraMono}[
- Extension = .otf ,
- UprightFont = *-Regular,
- ItalicFont = *-Oblique,
- BoldFont = *-Medium,
- BoldItalicFont = *-MediumOblique,
+\setmonofont{VeraMono.ttf}[
+ ItalicFont = VeraMoIt.ttf,
+ BoldFont = VeraMoBd.ttf,
+ BoldItalicFont = VeraMoBI.ttf,
Scale = MatchLowercase,
]
%
@@ -659,10 +654,10 @@
% a proper space before it and warns if it fails to do so.
%
% \item [OldFigTabCaptions=true (false)] is to be used \emph{only}
-% when
-% figures’ and tables’ captions must be typeset as with pre~3.0
-% versions of \frenchb{} (with |\CaptionSeparator| in French and
-% colon otherwise). Intended for standard LaTeX classes only.
+% when figures’ and tables’ captions must be typeset as with
+% pre~3.0 versions of \frenchb{} (with |\CaptionSeparator| in
+% French and colon otherwise).
+% Intended for standard LaTeX classes only.
%
% \item [FrenchSuperscripts=false (true)]; then
% |\up=\textsuperscript|. % (option added in version 2.1).
@@ -718,7 +713,7 @@
% which defaults to ` -- ’ and can be redefined in the preamble with
% |\renewcommand*{\CaptionSeparator}{...}|.
% This works for the standard LaTeX2e classes, for the \cls{memoir}
-% and koma-script classes.
+% koma-script and beamer classes.
% In case this procedure fails a warning is issued.
%
% When French is not the main language, the colon is preserved for
@@ -727,9 +722,11 @@
%
% Three options are provided to customise figure and table captions:
% \begin{itemize}
-% \item if \fbo{CustomiseFigTabCaptions} is set to \fbo{false} the
-% colon will be used as separator in all languages, with a proper
-% space before the colon in French (if possible);
+% \item \fbo{CustomiseFigTabCaptions} is set to \fbo{true} when
+% French is the main language (hence separator = ` -- ’) and to
+% \fbo{false} otherwise (hence separator = `: ’ with a proper
+% space before the colon in French if possible); toogle this option
+% if needed;
% \item the second option, \fbo{OldFigTabCaptions}, can be set to
% \fbo{true} to print figures’ and tables’ captions as they were
% with versions pre~3.0 of \frenchb{} (using |\CaptionSeparator|
@@ -1447,7 +1444,7 @@
\else \FB@dialect=1 \relax
\fi
% \end{macrocode}
-% When first entering French, we have to set the LuaTeX
+% When first entering French, we must set the LuaTeX
% tables for French (|\FB@dialect=0|) \emph{before} any dialect
% redefines any |\FB...space| command. Doing this `AtBeginDocument’
% would be too late: if French or a French dialect is the main
@@ -1687,7 +1684,7 @@ local FB_punct_thick =
% Managing spacing after `«’ (U+00AB) and before `»’ (U+00BB) can be
% done by the way; we define two flags, |FB_punct_left| for
% characters requiring some space before them and |FB_punct_right|
-% for `\guillemotleft’ which must be followed by some space.
+% for `«’ which must be followed by some space.
% In case LuaTeX is used to output T1-encoded fonts instead of
% OpenType fonts, codes \texttt{0x13} and \texttt{0x14} have to be
% added for `«’ and `»’.
@@ -3110,9 +3107,10 @@ return french_punctuation
% dialects defines \emph{both} |\datefrench| and |\dateacadian|;
% this is required as \file{french.ldf} is read only once even if
% both language options \opt{french} and \opt{acadian} are supplied
-% to \babel. Note that coding |\StartBabelCommands*{french,acadian}|
-% would \emph{only} define |\csname date\CurrentOption\endcsname|,
+% to \babel. Coding |\StartBabelCommands*{french,acadian}|
+% would \emph{only} define |\date\CurrentOption|,
% leaving the second language undefined in \babel’s sens.
+%
% \begin{macrocode}
\def\BabelLanguages{french,acadian}
\StartBabelCommands*{\BabelLanguages}{date}
@@ -4969,38 +4967,52 @@ return french_punctuation
% figure and table captions are now consistent with babel-french’s
% documentation. Pointed out by Denis Bitouzé.}
%
-% Unless \fbo{CustomiseFigTabCaptions} has been set to \fbo{false},
-% use |\CaptionSeparator| for koma-script, \cls{memoir} and
-% \cls{beamer} classes.
-% \begin{macrocode}
- \ifFBCustomiseFigTabCaptions
- \ifFB@koma
- \renewcommand*{\captionformat}{\CaptionSeparator}%
- \fi
- \@ifclassloaded{memoir}%
- {\captiondelim{\CaptionSeparator}}{}%
- \@ifclassloaded{beamer}%
- {\defbeamertemplate{caption label separator}{FBcustom}{%
- \CaptionSeparator}%
- \setbeamertemplate{caption label separator}[FBcustom]}{}%
- \else
-% \end{macrocode}
-% When \fbo{CustomiseFigTabCaptions} is \fbo{false}, have the colon
-% behave properly in French: locally force |\autospace@beforeFDP| in
-% case of \fbo{AutoSpacePunctuation=false}.
-% \begin{macrocode}
- \ifFB@koma
- \renewcommand*{\captionformat}{{\autospace@beforeFDP : }}%
- \fi
- \@ifclassloaded{memoir}%
- {\captiondelim{{\autospace@beforeFDP : }}%
- }{}%
- \@ifclassloaded{beamer}%
- {\defbeamertemplate{caption label separator}{FBcolon}{%
- {\autospace@beforeFDP : }}%
- \setbeamertemplate{caption label separator}[FBcolon]%
- }{}%
+% \changes{v3.5i}{2020/06/29}{For memoir, koma-script and beamer
+% classes, leave caption delimiter unchanged if it has been user
+% customised.}
+%
+% This is for koma-script, \cls{memoir} and \cls{beamer} classes.
+% If the caption delimiter has been user customised, leave it
+% unchanged. Otherwise, force the colon to behave properly in French
+% (add locally |\autospace@beforeFDP| in case of
+% \fbo{AutoSpacePunctuation=false}) and change the caption delimiter
+% to |\CaptionSeparator| if \fbo{CustomiseFigTabCaptions} has been
+% set to \fbo{true}.
+% \begin{macrocode}
+ \ifFB@koma
+ \edef\FB@capsep{\captionformat}\edef\FB@std@capsep{:\ }%
+ \ifx\FB@capsep\FB@std@capsep
+ \ifFBCustomiseFigTabCaptions
+ \renewcommand*{\captionformat}{\CaptionSeparator}%
+ \else
+ \renewcommand*{\captionformat}{{\autospace@beforeFDP :\ }}%
+ \fi
+ \fi
\fi
+ \@ifclassloaded{memoir}%
+ {\edef\FB@capsep{\@contdelim}\edef\FB@std@capsep{: }%
+ \ifx\FB@capsep\FB@std@capsep
+ \ifFBCustomiseFigTabCaptions
+ \captiondelim{\CaptionSeparator}%
+ \else
+ \captiondelim{{\autospace@beforeFDP : }}%
+ \fi
+ \fi}{}%
+ \@ifclassloaded{beamer}%
+ {\edef\FB@std@capsep{:\ }%
+ \edef\FB@capsep{%
+ \csname beamer@@tmpl@caption label separator\endcsname}%
+ \ifx\FB@capsep\FB@std@capsep
+ \ifFBCustomiseFigTabCaptions
+ \defbeamertemplate{caption label separator}{FBcustom}{%
+ \CaptionSeparator}%
+ \setbeamertemplate{caption label separator}[FBcustom]%
+ \else
+ \defbeamertemplate{caption label separator}{FBcolon}{%
+ {\autospace@beforeFDP : }}%
+ \setbeamertemplate{caption label separator}[FBcolon]%
+ \fi
+ \fi}{}%
% \end{macrocode}
% \fbo{ShowOptions}: if \fbo{true}, print the list of all options
% to the \file{.log} file.
@@ -5829,9 +5841,9 @@ return french_punctuation
\localleftbox{\FBeveryline@quote}}%
\else
% \end{macrocode}
-% Special add-on for the \cls{memoir} class: |\maketitle| redefines
-% |\@makefntext| as |\makethanksmark| which is customised as follows
-% to match the other notes’ vertical alignment.
+% Special add-on for the \cls{memoir} class: |\@makefntext| is
+% redefined as |\makethanksmark| by |\maketitle|, hence these
+% settings to match the other notes’ vertical alignment.
% \begin{macrocode}
\@ifclassloaded{memoir}%
{\ifFBFrenchFootnotes
diff --git a/macros/latex/contrib/babel-contrib/french/frenchb.pdf b/macros/latex/contrib/babel-contrib/french/frenchb.pdf
index f6b1da437c..e2fdf7b604 100644
--- a/macros/latex/contrib/babel-contrib/french/frenchb.pdf
+++ b/macros/latex/contrib/babel-contrib/french/frenchb.pdf
Binary files differ
diff --git a/macros/latex/contrib/l3backend/CHANGELOG.md b/macros/latex/contrib/l3backend/CHANGELOG.md
index 27a96c4fb1..bc09045c8f 100644
--- a/macros/latex/contrib/l3backend/CHANGELOG.md
+++ b/macros/latex/contrib/l3backend/CHANGELOG.md
@@ -6,6 +6,11 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+## [2020-06-29]
+
+### Fixed
+- Loading with `dvisvgm`
+
## [2020-06-23]
### Changed
@@ -91,7 +96,8 @@ this project uses date-based 'snapshot' version identifiers.
- Include `l3backend` in file names
- Moved backend code to internal for each 'parent' module
-[Unreleased]: https://github.com/latex3/latex3/compare/2020-06-23...HEAD
+[Unreleased]: https://github.com/latex3/latex3/compare/2020-06-29...HEAD
+[2020-06-29]: https://github.com/latex3/latex3/compare/2020-06-23...2020-06-29
[2020-06-23]: https://github.com/latex3/latex3/compare/2020-06-18...2020-06-23
[2020-06-18]: https://github.com/latex3/latex3/compare/2020-06-03...2020-06-18
[2020-06-03]: https://github.com/latex3/latex3/compare/2020-05-05...2020-06-03
diff --git a/macros/latex/contrib/l3backend/README.md b/macros/latex/contrib/l3backend/README.md
index edf3db7883..1d298fabdf 100644
--- a/macros/latex/contrib/l3backend/README.md
+++ b/macros/latex/contrib/l3backend/README.md
@@ -1,7 +1,7 @@
LaTeX3 Backend Drivers
======================
-Release 2020-06-23
+Release 2020-06-29
This package forms parts of `expl3`, and contains the code used to interface
with backends (drivers) across the `expl3` codebase. The functions here are
diff --git a/macros/latex/contrib/l3backend/l3backend-basics.dtx b/macros/latex/contrib/l3backend/l3backend-basics.dtx
index a28db733ab..00367dea5f 100644
--- a/macros/latex/contrib/l3backend/l3backend-basics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-basics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
@@ -71,23 +71,23 @@
%<*package>
\ProvidesExplFile
%<*dvipdfmx>
- {l3backend-dvipdfmx.def}{2020-06-23}{}
+ {l3backend-dvipdfmx.def}{2020-06-29}{}
{L3 backend support: dvipdfmx}
%</dvipdfmx>
%<*dvips>
- {l3backend-dvips.def}{2020-06-23}{}
+ {l3backend-dvips.def}{2020-06-29}{}
{L3 backend support: dvips}
%</dvips>
%<*dvisvgm>
- {l3backend-dvisvgm.def}{2020-06-23}{}
+ {l3backend-dvisvgm.def}{2020-06-29}{}
{L3 backend support: dvisvgm}
%</dvisvgm>
%<*pdfmode>
- {l3backend-pdfmode.def}{2020-06-23}{}
+ {l3backend-pdfmode.def}{2020-06-29}{}
{L3 backend support: PDF mode}
%</pdfmode>
%<*xdvipdfmx>
- {l3backend-xdvipdfmx.def}{2020-06-23}{}
+ {l3backend-xdvipdfmx.def}{2020-06-29}{}
{L3 backend support: xdvipdfmx}
%</xdvipdfmx>
%</package>
diff --git a/macros/latex/contrib/l3backend/l3backend-box.dtx b/macros/latex/contrib/l3backend/l3backend-box.dtx
index d07a08a4b4..8a63b8db15 100644
--- a/macros/latex/contrib/l3backend/l3backend-box.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-box.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-color.dtx b/macros/latex/contrib/l3backend/l3backend-color.dtx
index 4aef1ed938..6875ce7579 100644
--- a/macros/latex/contrib/l3backend/l3backend-color.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-color.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index 3b886359ab..1b7d444ae6 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
@@ -1212,9 +1212,9 @@
}
\cs_new_protected:Npn \@@_backend_color_gray_aux:nn #1#2
{ \@@_backend_color:nnn {#1} {#2} {#2} {#2} }
-\cs_new_protected:Npn \@@_backend_color_rgb_cmyk:n #1
+\cs_new_protected:Npn \@@_backend_color_fill_rgb:n #1
{ \@@_backend_color_rgb:nw { fill } #1 \s_@@_stop }
-\cs_new_protected:Npn \@@_backend_color_rgb_cmyk:n #1
+\cs_new_protected:Npn \@@_backend_color_stroke_rgb:n #1
{ \@@_backend_color_rgb:nw { stroke } #1 \s_@@_stop }
\cs_new_protected:Npn \@@_backend_color_rgb:nw
#1#2 ~ #3 ~ #4\s_@@_stop
diff --git a/macros/latex/contrib/l3backend/l3backend-graphics.dtx b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
index ae3eb47111..d9ed9f8495 100644
--- a/macros/latex/contrib/l3backend/l3backend-graphics.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-graphics.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-header.dtx b/macros/latex/contrib/l3backend/l3backend-header.dtx
index e2336f5f34..77303f1733 100644
--- a/macros/latex/contrib/l3backend/l3backend-header.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-header.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
diff --git a/macros/latex/contrib/l3backend/l3backend-pdf.dtx b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
index 13926e0779..7fbc94a550 100644
--- a/macros/latex/contrib/l3backend/l3backend-pdf.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-pdf.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2020-06-23}
+% \date{Released 2020-06-29}
%
% \maketitle
%
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.pdf b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
index 24432563ff..fa9a6f9a40 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.pdf
Binary files differ
diff --git a/macros/latex/contrib/nicematrix/nicematrix-french.tex b/macros/latex/contrib/nicematrix/nicematrix-french.tex
index a8c0fdd435..fe29f84779 100644
--- a/macros/latex/contrib/nicematrix/nicematrix-french.tex
+++ b/macros/latex/contrib/nicematrix/nicematrix-french.tex
@@ -639,8 +639,9 @@ a & b & c & d \\
\label{hvlines}
La clé |hvlines| demande le tracé de tous les filets horizontaux et verticaux \emph{sauf dans les
- blocs}.\footnote{En fait, quand la clé |hvlines| est utilisée, les filets ne sont pas non plus tracés dans les blocs virtuels
- délimités par des cases reliées par des lignes pointillées (cf. p. \pageref{dotted-and-hvlines}).}
+ blocs}.\footnote{En fait, quand la clé |hvlines| (ou la clé |hvlines-except-corners| décrite juste après) est
+ utilisée, les filets ne sont pas non plus tracés dans les blocs virtuels délimités par des cases reliées par des
+ lignes pointillées (cf. p. \pageref{dotted-and-hvlines}).}
\medskip
\begin{Verbatim}
@@ -662,6 +663,66 @@ arum & iris & jacinthe & muguet
\end{center}
+\subsection{La clé hvlines-except-corners}
+
+La clé |hvlines-except-corners| demande le tracé de tous les filets horizontaux et verticaux \emph{sauf dans les
+ blocs} et sauf dans les coins vides.
+
+\medskip
+\begin{Verbatim}
+\begin{NiceTabular}{*{6}{C}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+ & & & & A \\
+ & & A & A & A \\
+ & & & A \\
+ & & A & A & A & A \\
+A & A & A & A & A & A \\
+A & A & A & A & A & A \\
+ & \Block{2-2}{B} & & A \\
+ & & & A \\
+ & A & A & A \\
+\end{NiceTabular}
+\end{Verbatim}
+%
+\begin{center}
+\begin{NiceTabular}{*{6}{C}}[hvlines-except-corners,cell-space-top-limit=3pt]
+ & & & & A \\
+ & & A & A & A \\
+ & & & A \\
+ & & A & A & A & A \\
+A & A & A & A & A & A \\
+A & A & A & A & A & A \\
+ & \Block{2-2}{B} & & A \\
+ & & & A \\
+ & A & A & A \\
+\end{NiceTabular}
+\end{center}
+
+Comme on le voit, un «coin vide» est constitué de la réunion de tous les rectangles vides partant de la case située
+exactement dans le coin.
+
+\bigskip
+\begin{BVerbatim}[boxwidth=11cm,baseline=c]
+\begin{NiceTabular}{*{6}{C}}%
+ [~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+1\\
+1&1\\
+1&2&1\\
+1&3&3&1\\
+1&4&6&4&1\\
+1&5&10&10&5&1
+\end{NiceTabular}
+\end{BVerbatim}
+\begin{NiceTabular}{*{6}{C}}%
+ [c,hvlines-except-corners,cell-space-top-limit=3pt]
+1\\
+1&1\\
+1&2&1\\
+1&3&3&1\\
+1&4&6&4&1\\
+1&5&10&10&5&1
+\end{NiceTabular}
+
+
\subsection{La commande \textbackslash diagbox}
diff --git a/macros/latex/contrib/nicematrix/nicematrix.dtx b/macros/latex/contrib/nicematrix/nicematrix.dtx
index a3e658e757..f4228206e9 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.dtx
+++ b/macros/latex/contrib/nicematrix/nicematrix.dtx
@@ -15,8 +15,8 @@
%
% \fi
% \iffalse
-\def\myfileversion{4.3}
-\def\myfiledate{2020/06/12}
+\def\myfileversion{4.4}
+\def\myfiledate{2020/06/30}
%
%
%<*batchfile>
@@ -703,7 +703,8 @@ version 2005/12/01 or later.
% \label{hvlines}
%
% The key |hvlines| draws all the vertical and horizontal rules \emph{excepted
-% in the blocks}.\footnote{In fact, when the key |hvlines| is in force, the
+% in the blocks}.\footnote{In fact, when the key |hvlines| (or the key
+% |hvlines-except-corners| described just after) is in force, the
% rules are also not drawn in the virtual blocks delimited by cells relied par
% dotted lines (cf. p. \pageref{dotted-and-hvlines}).}
%
@@ -729,8 +730,66 @@ version 2005/12/01 or later.
% \end{center}
%
%
+% \subsection{The key hvlines-except-corners}
+%
+% The key |hvlines-except-corners| draws all the horizontal and vertical rules,
+% \emph{excepted in the blocks} and excepted in the empty corners.
+%
+% \medskip
+% \begin{Verbatim}
+% \begin{NiceTabular}{*{6}{C}}[~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+% & & & & A \\
+% & & A & A & A \\
+% & & & A \\
+% & & A & A & A & A \\
+% A & A & A & A & A & A \\
+% A & A & A & A & A & A \\
+% & \Block{2-2}{B} & & A \\
+% & & & A \\
+% & A & A & A \\
+% \end{NiceTabular}
+% \end{Verbatim}
+% %
+% \begin{center}
+% \begin{NiceTabular}{*{6}{C}}[hvlines-except-corners,cell-space-top-limit=3pt]
+% & & & & A \\
+% & & A & A & A \\
+% & & & A \\
+% & & A & A & A & A \\
+% A & A & A & A & A & A \\
+% A & A & A & A & A & A \\
+% & \Block{2-2}{B} & & A \\
+% & & & A \\
+% & A & A & A \\
+% \end{NiceTabular}
+% \end{center}
+%
+% As we can see, an ``empty corner'' is composed by the reunion of all the empty
+% rectangles starting from the cell actually in the corner of the array.
+%
+% \bigskip
+% \begin{BVerbatim}[boxwidth=11cm,baseline=c]
+% \begin{NiceTabular}{*{6}{C}}%
+% [~emphase#hvlines-except-corners@,cell-space-top-limit=3pt]
+% 1\\
+% 1&1\\
+% 1&2&1\\
+% 1&3&3&1\\
+% 1&4&6&4&1\\
+% 1&5&10&10&5&1
+% \end{NiceTabular}
+% \end{BVerbatim}
+% \begin{NiceTabular}{*{6}{C}}[c,hvlines-except-corners,cell-space-top-limit=3pt]
+% 1\\
+% 1&1\\
+% 1&2&1\\
+% 1&3&3&1\\
+% 1&4&6&4&1\\
+% 1&5&10&10&5&1
+% \end{NiceTabular}
+%
%
-% \subsection{La commande \textbackslash diagbox}
+% \subsection{The command \textbackslash diagbox}
%
% The command |\diagbox| (inspired by the package \pkg{diagbox}), allows, when
% it is used in a cell, to slash that cell diagonally downwards.\footnote{The
@@ -1005,7 +1064,7 @@ version 2005/12/01 or later.
%
%
% \bigskip
-% One should remark that these commands are compatible with the commands de
+% One should remark that these commands are compatible with the commands of
% \pkg{booktabs} (|\toprule|, |\midrule|, |\bottomrule|, etc).
%
% \medskip
@@ -3412,7 +3471,7 @@ version 2005/12/01 or later.
%
%
%
-% \section{Implementation}
+%\section{Implementation}
%
% By default, the package \pkg{nicematrix} doesn't patch any existing code.
%
@@ -3668,7 +3727,7 @@ version 2005/12/01 or later.
\cs_set:Npn \@@_cline
% \end{macrocode}
% We have to act in a fully expandable way since there may be |\noalign| (in the
-% |\multispan|) to detect. That's why we use |\@@_cline_i:en|.
+% |\multispan|) to detect. That's why we use |\@@_cline_i:en|.
% \begin{macrocode}
{ \@@_cline_i:en \l_@@_first_col_int }
% \end{macrocode}
@@ -4089,8 +4148,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\seq_new:N \g_@@_pos_of_blocks_seq
% \end{macrocode}
-% The sequence |\g_@@_pos_of_blocks_seq| when we will draw the rules required by
-% the key |hvlines| (these rules won't be drawn within the blocks).
+% The sequence |\g_@@_pos_of_blocks_seq| will be used when we will draw the
+% rules required by the keys |hvlines| or |hvlines-except-corners|.
%
% \bigskip
% We will also manage a sequence for the positions of the dotted lines. These
@@ -4370,6 +4429,12 @@ version 2005/12/01 or later.
\bool_new:N \l_@@_vlines_bool
\bool_new:N \l_@@_hvlines_bool
% \end{macrocode}
+%
+% \bigskip
+% The flag |\l_@@_hlines_except_corners_bool| corresponds to the key |hlines-except-corners|.
+% \begin{macrocode}
+\bool_new:N \l_@@_hvlines_except_corners_bool
+% \end{macrocode}
%
% \bigskip
% The flag |\l_@@_nullify_dots_bool| corresponds to the option |nullify-dots|.
@@ -4573,6 +4638,8 @@ version 2005/12/01 or later.
% \begin{macrocode}
\keys_define:nn { NiceMatrix / Env }
{
+ hvlines-except-corners .bool_set:N = \l_@@_hvlines_except_corners_bool ,
+ hvlines-except-corners .default:n = true ,
code-before .code:n =
{
\tl_if_empty:nF { #1 }
@@ -7049,6 +7116,8 @@ version 2005/12/01 or later.
{
\bool_if:NT \l_@@_hlines_bool \@@_draw_hlines:
\bool_if:NT \l_@@_vlines_bool \@@_draw_vlines:
+ \bool_if:NT \l_@@_hvlines_except_corners_bool
+ \@@_draw_hvlines_except_corners:
}
% \end{macrocode}
%
@@ -9064,6 +9133,7 @@ version 2005/12/01 or later.
%
% \subsection*{The key hvlines}
%
+% \subsubsection*{The key hvlines}
%
% \begin{macrocode}
\cs_new_protected:Npn \@@_draw_hlines:
@@ -9125,35 +9195,13 @@ version 2005/12/01 or later.
\group_begin:
\CT@arc@
% \end{macrocode}
-%
-% First, the exterior rectangle of the array (only in |{NiceArray}| and
-% |{NiceTabular}|).
-% \begin{macrocode}
- \bool_if:NT \l_@@_NiceArray_bool
- {
- \pgfpicture
- \pgfrememberpicturepositiononpagetrue
- \pgf@relevantforpicturesizefalse
- \pgfsetlinewidth \arrayrulewidth
- \pgfsetrectcap
- \@@_qpoint:n { col - 1 }
- \dim_set_eq:NN \l_tmpa_dim \pgf@x
- \@@_qpoint:n { row -1 }
- \dim_set_eq:NN \l_tmpb_dim \pgf@y
- \@@_qpoint:n { col - \@@_succ:n \c@jCol }
- \dim_set_eq:NN \l_tmpc_dim \pgf@x
- \@@_qpoint:n { row - \@@_succ:n \c@iRow }
- \pgfpathrectanglecorners
- { \pgfpoint \l_tmpa_dim \l_tmpb_dim }
- { \pgfpoint \l_tmpc_dim \pgf@y }
- \pgfusepathqstroke
- \endpgfpicture
- }
-% \end{macrocode}
%
-% Now, the horizontal rules in the interior of the array.
+% The horizontal rules.
% \begin{macrocode}
- \int_step_variable:nnNn 2 \c@iRow \l_tmpa_tl
+ \int_step_variable:nnNn
+ { \bool_if:NTF \l_@@_NiceArray_bool 1 2 }
+ { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:n \c@iRow } \c@iRow }
+ \l_tmpa_tl
{
\int_step_variable:nNn \c@jCol \l_tmpb_tl
{
@@ -9169,6 +9217,35 @@ version 2005/12/01 or later.
{ \@@_test_if_hline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_xdots_seq
{ \@@_test_if_hline_in_block:nnnn ##1 }
+% \end{macrocode}
+% \begin{macrocode}
+ \bool_if:NT \l_@@_hvlines_except_corners_bool
+ {
+ \int_compare:nNnTF \l_tmpa_tl = { \c@iRow + 1 }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \@@_pred:n \l_tmpa_tl - \l_tmpb_tl }
+ { \bool_set_false:N \g_tmpa_bool }
+ }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \l_tmpa_tl - \l_tmpb_tl }
+ {
+ \int_compare:nNnTF \l_tmpa_tl = 1
+ { \bool_set_false:N \g_tmpa_bool }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \@@_pred:n \l_tmpa_tl - \l_tmpb_tl }
+ { \bool_set_false:N \g_tmpa_bool }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+% \begin{macrocode}
\bool_if:NT \g_tmpa_bool
{
\pgfpicture
@@ -9190,17 +9267,20 @@ version 2005/12/01 or later.
}
}
% \end{macrocode}
-% Now, the vertical rules in the interior of the array.
+% Now, the vertical rules.
% \begin{macrocode}
\int_step_variable:nNn \c@iRow \l_tmpa_tl
{
- \int_step_variable:nnNn 2 \c@jCol \l_tmpb_tl
+ \int_step_variable:nnNn
+ { \bool_if:NTF \l_@@_NiceArray_bool 1 2 }
+ { \bool_if:NTF \l_@@_NiceArray_bool { \@@_succ:n \c@jCol } \c@jCol }
+ \l_tmpb_tl
{
% \end{macrocode}
-% The boolean |\g_tmpa_bool| indicates whether the small vertial rule will be
+% The boolean |\g_tmpa_bool| indicates whether the small vertical rule will be
% drawn. If we find that it is in a block (a real block, created by |\Block| or
% a virtual block corresponding to a dotted line, created by |\Cdots|, |\Vdots|,
-% etc.), we will set |\g_tmpa_bool| to |false| and the small vertial rule won't
+% etc.), we will set |\g_tmpa_bool| to |false| and the small vertical rule won't
% be drawn.
% \begin{macrocode}
\bool_gset_true:N \g_tmpa_bool
@@ -9208,6 +9288,37 @@ version 2005/12/01 or later.
{ \@@_test_if_vline_in_block:nnnn ##1 }
\seq_map_inline:Nn \g_@@_pos_of_xdots_seq
{ \@@_test_if_vline_in_block:nnnn ##1 }
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \bool_if:NT \l_@@_hvlines_except_corners_bool
+ {
+ \int_compare:nNnTF \l_tmpb_tl = { \@@_succ:n \c@jCol }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \l_tmpa_tl - \@@_pred:n \l_tmpb_tl }
+ { \bool_set_false:N \g_tmpa_bool }
+ }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \l_tmpa_tl - \l_tmpb_tl }
+ {
+ \int_compare:nNnTF \l_tmpb_tl = 1
+ { \bool_set_false:N \g_tmpa_bool }
+ {
+ \seq_if_in:NxT
+ \l_@@_empty_corner_cells_seq
+ { \l_tmpa_tl - \@@_pred:n \l_tmpb_tl }
+ { \bool_set_false:N \g_tmpa_bool }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
\bool_if:NT \g_tmpa_bool
{
\pgfpicture
@@ -9242,7 +9353,7 @@ version 2005/12/01 or later.
% |#1|, |#2|, |#3| and |#4|. If this rule would be in the block (it must not be
% drawn), the boolean |\l_tmpa_bool| is set to |false|.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_test_if_hline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_if_hline_in_block:nnnn #1 #2 #3 #4
{
\int_compare:nNnT \l_tmpa_tl > { #1 }
{
@@ -9260,7 +9371,7 @@ version 2005/12/01 or later.
%
% The same for vertical rules.
% \begin{macrocode}
-\cs_set_protected:Npn \@@_test_if_vline_in_block:nnnn #1 #2 #3 #4
+\cs_new_protected:Npn \@@_test_if_vline_in_block:nnnn #1 #2 #3 #4
{
\int_compare:nNnT \l_tmpa_tl > { #1 - 1 }
{
@@ -9277,8 +9388,158 @@ version 2005/12/01 or later.
% \end{macrocode}
%
%
+% \bigskip
+% \subsubsection*{The key hvlines-except-corners}
%
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_draw_hvlines_except_corners:
+ {
+% \end{macrocode}
+% The sequence |\l_@@_empty_corner_cells_seq| will be the sequence of all the
+% cells empty (and not in a block) considered in the corners of the array.
+% \begin{macrocode}
+ \seq_clear_new:N \l_@@_empty_corner_cells_seq
+ \@@_compute_a_corner:nnnnnn 1 1 1 1 \c@iRow \c@jCol
+ \@@_compute_a_corner:nnnnnn 1 \c@jCol 1 { -1 } \c@iRow 1
+ \@@_compute_a_corner:nnnnnn \c@iRow 1 { -1 } 1 1 \c@jCol
+ \@@_compute_a_corner:nnnnnn \c@iRow \c@jCol { -1 } { -1 } 1 1
+ \@@_draw_hvlines_ii:
+ }
+% \end{macrocode}
+%
+% \bigskip
+% ``Computing a corner'' is determining all the empty cells (which are not in a
+% block) that belong to that corner. These cells will be added to the sequence
+% |\l_@@_empty_corner_cells_seq|.
+%
+% \medskip
+% The six arguments of |\@@_compute_a_corner:nnnnnn| are as follow:
+% \begin{itemize}
+% \item |#1| and |#2| are the number of row and column of the cell which is
+% actually in the corner ;
+% \item |#3| and |#4| are the step in rows and the step in columns when moving
+% from the corner ;
+% \item |#5| is the number of the final row when scanning the rows from the
+% corner ;
+% \item |#6| is the number of the final column when scanning the columns from
+% the corner.
+% \end{itemize}
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_compute_a_corner:nnnnnn #1 #2 #3 #4 #5 #6
+ {
+% \end{macrocode}
+% For the explanations and the name of the variables, we consider that we are
+% computing the left-upper corner.
+%
+% First, we try to determine which is the last empty cell (and not in a block:
+% we won't add that precision any longer) in the column of number~$1$. The flag
+% |\l_tmpa_bool| will be raised when a non-empty cell is found.
+% \begin{macrocode}
+ \bool_set_false:N \l_tmpa_bool
+ \int_zero_new:N \l_@@_last_empty_row_int
+ \int_step_inline:nnnn { #1 } { #3 } { #5 }
+ {
+ \@@_test_if_cell_in_a_block:nx { ##1 } { \int_eval:n { #2 } }
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:c
+ { pgf @ sh @ ns @ \@@_env: - ##1 - \int_eval:n { #2 } }
+ ||
+ \l_tmpb_bool
+ }
+ { \bool_set_true:N \l_tmpa_bool }
+ {
+ \bool_if:NF \l_tmpa_bool
+ { \int_set:Nn \l_@@_last_empty_row_int { ##1 } }
+ }
+ }
+% \end{macrocode}
+% Now, you determine the last empty cell in the row of number~$1$.
+% \begin{macrocode}
+ \bool_set_false:N \l_tmpa_bool
+ \int_zero_new:N \l_@@_last_empty_column_int
+ \int_step_inline:nnnn { #2 } { #4 } { #6 }
+ {
+ \@@_test_if_cell_in_a_block:xn { \int_eval:n { #1 } } { ##1 }
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:c
+ { pgf @ sh @ ns @ \@@_env: - \int_eval:n { #1 } - ##1 }
+ || \l_tmpb_bool
+ }
+ { \bool_set_true:N \l_tmpa_bool }
+ {
+ \bool_if:NF \l_tmpa_bool
+ { \int_set:Nn \l_@@_last_empty_column_int { ##1 } }
+ }
+ }
+% \end{macrocode}
+% Now, we loop over the rows.
+% \begin{macrocode}
+ \int_step_inline:nnnn { #1 } { #3 } \l_@@_last_empty_row_int
+ {
+% \end{macrocode}
+% We treat the row number |##1| with another loop.
+% \begin{macrocode}
+ \bool_set_false:N \l_tmpa_bool
+ \int_step_inline:nnnn { #2 } { #4 } \l_@@_last_empty_column_int
+ {
+ \@@_test_if_cell_in_a_block:nn { ##1 } { ####1 }
+ \bool_if:nTF
+ {
+ \cs_if_exist_p:c
+ { pgf @ sh @ ns @ \@@_env: - ##1 - ####1 }
+ || \l_tmpb_bool
+ }
+ { \bool_set_true:N \l_tmpa_bool }
+ {
+ \bool_if:NF \l_tmpa_bool
+ {
+ \int_set:Nn \l_@@_last_empty_column_int { ####1 }
+ \seq_put_right:Nn
+ \l_@@_empty_corner_cells_seq
+ { ##1 - ####1 }
+ }
+ }
+ }
+ }
+ }
+% \end{macrocode}
+%
+% \bigskip
+% The following macro tests whether if a cell is in (at least) one of the blocks
+% of the array.
+%
+% The flag |\l_tmpb_bool| will be raised if the cell |#1|-|#2| is in a block.
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_test_if_cell_in_a_block:nn #1 #2
+ {
+ \bool_set_false:N \l_tmpb_bool
+ \seq_map_inline:Nn \g_@@_pos_of_blocks_seq
+ { \@@_test_if_cell_in_block:nnnnnnn { #1 } { #2 } ##1 }
+ }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_generate_variant:Nn \@@_test_if_cell_in_a_block:nn { nx , xn }
+% \end{macrocode}
+%
+% \begin{macrocode}
+\cs_new_protected:Npn \@@_test_if_cell_in_block:nnnnnnn #1 #2 #3 #4 #5 #6
+ {
+ \bool_if:nT
+ {
+ \int_compare_p:n { #3 <= #1 }
+ && \int_compare_p:n { #1 <= #5 }
+ && \int_compare_p:n { #4 <= #2 }
+ && \int_compare_p:n { #2 <= #6 }
+ }
+ { \bool_set_true:N \l_tmpb_bool }
+ }
+% \end{macrocode}
%
+%
% \bigskip
% \subsection*{The commands to draw dotted lines to separate columns and rows}
%
@@ -10008,7 +10269,7 @@ version 2005/12/01 or later.
\cs_new_protected:Npn \@@_Block_iii:nnnnnn #1 #2 #3 #4 #5 #6
{
% \end{macrocode}
-% The group is for the keys (even if, as for new, there is only one key, called
+% The group is for the keys (even if, as for now, there is only one key, called
% |tikz| and not documented).
% \begin{macrocode}
\group_begin:
@@ -10785,6 +11046,7 @@ version 2005/12/01 or later.
first-row,~
hlines,~
hvlines,~
+ hvlines-except-corners,~
last-col,~
last-row,~
left-margin,~
@@ -11309,6 +11571,10 @@ version 2005/12/01 or later.
%
% It's now possible to use the command |\Block| in the ``last row''.
%
+% \subsection*{Changes between versions 4.3 and 4.4}
+%
+% New key |hvlines-except-corners|.
+%
%
% \PrintIndex
%
diff --git a/macros/latex/contrib/nicematrix/nicematrix.pdf b/macros/latex/contrib/nicematrix/nicematrix.pdf
index 31fb149271..2c72de6ae1 100644
--- a/macros/latex/contrib/nicematrix/nicematrix.pdf
+++ b/macros/latex/contrib/nicematrix/nicematrix.pdf
Binary files differ
diff --git a/macros/latex/contrib/pm-isomath/README.txt b/macros/latex/contrib/pm-isomath/README.txt
index 2b1f69bd14..0d1a39f96e 100644
--- a/macros/latex/contrib/pm-isomath/README.txt
+++ b/macros/latex/contrib/pm-isomath/README.txt
@@ -1,31 +1,15 @@
-%%
-%% This is file `README.txt',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% pm-isomath.dtx (with options: `txt')
-%% ______________________________________________________
-%% The PM-ISOmath bundle
-%% Copyright (C) 2017-2020 Claudio Beccari
-%% All rights reserved
-%%
-%% License information appended
-%%
\ProvidesFile{README.txt}[%
+ 2020/04/18 v.1.0.06
+ README file for pm-isomath.sty]
-
-%%
-%%
-%% Distributable under the LaTeX Project Public License,
-%% version 1.3c or higher (your choice). The latest version of
-%% this license is at: http://www.latex-project.org/lppl.txt
-%%
-%% This work is "maintained"
-%%
-%% This work consists of this file pm-isomath.dtx, a README.txt file
-%% and the derived files:
-%% pm-isomath.sty, pm-isomath.pdf.
-%%
-%%
-%% End of file `README.txt'.
+
+ Distributable under the LaTeX Project Public License,
+ version 1.3c or higher (your choice). The latest version of
+ this license is at: http://www.latex-project.org/lppl.txt
+
+ This work is "maintained"
+
+ This work consists of this file pm-isomath.dtx, a README.txt file
+ and the derived files:
+ pm-isomath.sty, pm-isomath.pdf.
+
diff --git a/macros/latex/contrib/pm-isomath/pm-isomath.dtx b/macros/latex/contrib/pm-isomath/pm-isomath.dtx
index e72d09d24b..9e456241ff 100644
--- a/macros/latex/contrib/pm-isomath/pm-isomath.dtx
+++ b/macros/latex/contrib/pm-isomath/pm-isomath.dtx
@@ -32,7 +32,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file
\askforoverwritefalse
\generate{\file{pm-isomath.sty}{\from{pm-isomath.dtx}{style}}
- \file{README.txt}{\from{pm-isomath.dtx}{txt}}
+% \file{README.txt}{\from{pm-isomath.dtx}{txt}}
}
\def\tmpa{plain}
@@ -56,11 +56,11 @@ This work consists of this file pm-isomath.dtx, a README.txt file
%</driver>
%<style>\ProvidesPackage{pm-isomath}[%
%<txt>\ProvidesFile{README.txt}[%
-%<*driver,style>
-2020/04/18 v.1.0.05
-%<txt>Readme file for pm-isomath.sty]
+%<*driver,style,txt>
+ 2020/06/30 v.1.0.06
+%<txt> README file for pm-isomath.sty]
%<style>Poor man package for typesetting ISO compliant math when using pdfLaTeX]
-%</driver,style>
+%</driver,style,txt>
%<*driver>
]
%</driver>
@@ -479,6 +479,11 @@ This work consists of this file pm-isomath.dtx, a README.txt file
% optional, including the first one in spite of being surrounded
% by curly braces. In both cases the default values for each
% argument are respectively |lmr|, |m|, and |n| (normal, upright).
+% Notice the codes: |lmr|, |m|, and|n| are the codes that appear in
+% the |.fd| file to declare the possible family, series, and shape
+% combinations available for a given family. Se bellow further
+% information in table~\ref{tab:lmr-series-shapes} on
+% page~\pageref{tab:lmr-series-shapes}, and how to discover these codes.
%
% Such default values, after loading |pm-isomath|, may be globally
% redefined by using in the preamble:
@@ -586,7 +591,7 @@ This work consists of this file pm-isomath.dtx, a README.txt file
% The resistivity of copper is $1.68\,\micro\ohm\,\mathrm{cm}$ (in text mode: 1.68\unit{\micro\ohm\,cm})
% is typeset with the following code
%\begin{verbatim}
-%$i.68\,\micro\ohm\,\mathrm{cm}$ (in text mode: 1.68\unit{\micro\ohm\,cm})
+%$1.68\,\micro\ohm\,\mathrm{cm}$ (in text mode: 1.68\unit{\micro\ohm\,cm})
%\end{verbatim}
%\subparagraph{A tensor}
%\[ \vectorsymbol{D} =\epsilon_0\tensorsymbol{\epsilon}\ped{r}\vectorsymbol{E}\]
@@ -788,10 +793,10 @@ This work consists of this file pm-isomath.dtx, a README.txt file
% the default family is the Latin Modern regular (or roman);
% the series is medium and the shape is normal (or upright).
% The codes used are the same used in the font description
-% files with extension |.fd|. Their name is obtained by merging
-% the encoding name with the family name; Therefore the default
-% font description file for Latin characters is |t1lmr.fd|,
-% while the one for Greek characters is |lgrlmr.fd|; these
+% files with extension |.fd|. The name of these |.fd| files
+% is obtained by merging the encoding name with the family name;
+% therefore the default font description file for Latin characters
+% is |t1lmr.fd| while the one for Greek characters is |lgrlmr.fd|; these
% files define the series they contain and that are identified
% with codes such as |m| (medium); |bx| (bold extended);
% |b| (bold). Other fonts, with different series may have
diff --git a/macros/latex/contrib/pm-isomath/pm-isomath.pdf b/macros/latex/contrib/pm-isomath/pm-isomath.pdf
index 64c03f00b7..c5c3a867ef 100644
--- a/macros/latex/contrib/pm-isomath/pm-isomath.pdf
+++ b/macros/latex/contrib/pm-isomath/pm-isomath.pdf
Binary files differ
diff --git a/macros/latex/contrib/shtthesis/CHANGELOG.md b/macros/latex/contrib/shtthesis/CHANGELOG.md
index 135a61987a..9dd9f07ef4 100644
--- a/macros/latex/contrib/shtthesis/CHANGELOG.md
+++ b/macros/latex/contrib/shtthesis/CHANGELOG.md
@@ -2,6 +2,14 @@
`sht-thesis` 项目派生于 `ucasthesis`,一个在 GPLv3 License 下分发的项目。根据该许可证条款,`sht-thesis` 项目列出基于 `ucasthesis` (commit `faad94b` 之后) 的所有修改条目:
+## 2020-06-30
+> Release: v0.3.1
+
+1. 改进 Linux/UNIX 环境下 XeLaTeX 和 LuaLaTeX 引擎的中文字体回退机制;
+2. unicode-math 仅对 `\mathbf` 强制使用 `\symbf` 覆盖,其他命令保持原有语义;
+3. 确保 hyperref 宏包在导言区最后被导入;
+4. 从该版本开始,所有 release 同步发布至 Overleaf (真香)。
+
## 2020-06-23
> Release: v0.3.0
diff --git a/macros/latex/contrib/shtthesis/README.md b/macros/latex/contrib/shtthesis/README.md
index 582318cdbf..794511d3f2 100644
--- a/macros/latex/contrib/shtthesis/README.md
+++ b/macros/latex/contrib/shtthesis/README.md
@@ -1,8 +1,8 @@
# ShangHaiTech university THESIS (shtthesis)
-[![Action status](https://github.com/lirundong/sht-thesis/workflows/Build/badge.svg)](https://github.com/lirundong/shtthesis/actions)
-[![CTAN version](https://img.shields.io/ctan/v/shtthesis)](https://ctan.org/pkg/shtthesis)
-[![GitHub release](https://img.shields.io/github/v/release/lirundong/shtthesis)](https://github.com/lirundong/shtthesis/releases/latest)
-[![GitHub downloads](https://img.shields.io/github/downloads/lirundong/shtthesis/total)](https://github.com/lirundong/shtthesis/releases)
+[![Action status](https://github.com/lirundong/sht-thesis/workflows/build/badge.svg)](https://github.com/lirundong/shtthesis/actions)
+[![GitHub release](https://img.shields.io/github/v/release/lirundong/shtthesis?style=flat&logo=GitHub)](https://github.com/lirundong/shtthesis/releases/latest)
+[![CTAN version](https://img.shields.io/ctan/v/shtthesis?style=flat&logo=LaTeX)](https://ctan.org/pkg/shtthesis)
+[![Overleaf](https://img.shields.io/badge/overleaf-shtthesis-green?style=flat&logo=Overleaf&color=1C890F)](https://www.overleaf.com/latex/templates/shanghaitech-university-thesis-template/mskbxkmfxqpt)
`shtthesis` project, forked from [`ucasthesis`](https://github.com/mohuangrui/ucasthesis), is an **unofficial** LaTeX thesis template for ShanghaiTech University and satisfies all format requirements of graduate/undergraduate thesis. The user just need to set `\documentclass{shtthesis}` and to setup mandatory information via `\shtsetup`, then his or her thesis document will be typeset properly:
```latex
@@ -21,17 +21,22 @@
```
## Get the Template
-- Stable version:
+- Stable version: Install or download with any of following methods
- CTAN (**strongly recommended**): [`shtthesis`](https://ctan.org/pkg/shtthesis) package on CTAN can be installed via `tlmgr` for TeX Live and MacTeX users:
```bash
tlmgr install shtthesis
```
+ If your distribution has already installed `shtthesis`, please update it to the latest version:
+ ```bash
+ tlmgr update shtthesis
+ ```
**Note**: `shtthesis` package on CTAN does not include the university logo file. Please download [`shanghaitech-logo.pdf`](https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf) from this repository and put it in the root of your project directory.
- - GitHub Release: please refer to [release](https://github.com/lirundong/sht-thesis/releases) page, and download required files based on release information
-- Develop version: directly clone the GitHub repo
+ - [Overleaf](https://www.overleaf.com/latex/templates/shanghaitech-university-thesis-template/mskbxkmfxqpt): Please compile with XeLaTeX. Since compilation time for Overleaf free-plan is limited to *1 minute*, you might encounter with timeout issue if compiling with LuaLaTeX
+ - GitHub Release: Please refer to the [release](https://github.com/lirundong/sht-thesis/releases) page and download required files based on release information
+- Develop version: Directly clone the GitHub repo
```bash
- git clone https://github.com/lirundong/sht-thesis.git
+ git clone https://github.com/lirundong/shtthesis.git
```
Please, read through [the user's guide](shtthesis-user-guide.pdf) before continuing.
diff --git a/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf b/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf
index 7ad2b160ca..3badd9ad13 100644
--- a/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf
+++ b/macros/latex/contrib/shtthesis/shtthesis-user-guide.pdf
Binary files differ
diff --git a/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex b/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex
index bacc45a16f..16e951a3ff 100644
--- a/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex
+++ b/macros/latex/contrib/shtthesis/shtthesis-user-guide.tex
@@ -206,6 +206,13 @@
url = {http://oaa.shanghaitech.edu.cn/2019/0321/c4666a41070/page.htm},
urldate = {2020-06-17}
}
+@online{clerkma2013unicode,
+ author = {Clerk Ma},
+ title = {如何在{XeTeX}中单独设置数学字体,为什么{STIX}的数学字体很牛?},
+ year = 2013,
+ url = {https://www.zhihu.com/question/20592491/answer/15577847},
+ urldate = {2020-06-30}
+}
\end{filecontents}
\begin{document}
@@ -230,14 +237,14 @@
\ifgraduate
\begin{nomenclatures}
\header[单位]{符号}{说明}
- \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$R$}{the gas constant}
- \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_v$}{specific heat capacity at constant volume}
- \item[${m^{2} \cdot s^{-2} \cdot K^{-1}}$]{$C_p$}{specific heat capacity at constant pressure}
- \item[${m^{2} \cdot s^{-2}}$]{$E$}{specific total energy}
- \item[${kg \cdot m \cdot s^{-3} \cdot K^{-1}}$]{$k$}{thermal conductivity}
- \item[${kg \cdot m^{-1} \cdot s^{-2}}$]{$S_{ij}$}{deviatoric stress tensor}
- \item[${kg \cdot m^{-1} \cdot s^{-2}}$]{$\tau_{ij}$}{viscous stress tensor}
- \item[${1}$]{$\delta_{ij}$}{Kronecker tensor}
+ \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$R$}{the gas constant}
+ \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$C_v$}{specific heat capacity at constant volume}
+ \item[$\symup{{m^{2} \cdot s^{-2} \cdot K^{-1}}}$]{$C_p$}{specific heat capacity at constant pressure}
+ \item[$\symup{{m^{2} \cdot s^{-2}}}$]{$E$}{specific total energy}
+ \item[$\symup{{kg \cdot m \cdot s^{-3} \cdot K^{-1}}}$]{$k$}{thermal conductivity}
+ \item[$\symup{{kg \cdot m^{-1} \cdot s^{-2}}}$]{$S_{ij}$}{deviatoric stress tensor}
+ \item[$\symup{{kg \cdot m^{-1} \cdot s^{-2}}}$]{$\tau_{ij}$}{viscous stress tensor}
+ \item[$\symup{{1}}$]{$\delta_{ij}$}{Kronecker tensor}
\end{nomenclatures}
\begin{nomenclatures}[缩写]
@@ -597,6 +604,16 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian}
\end{align}
同时重载了 \verb|\eqref|,使得公式编号格式修改后,其引用格式仍与 \textsf{amsmath} 无异:贝叶斯定理~\eqref{eq::bayesian}。排版本科生论文时不修改公式编号格式。
+\shtthesis{} 使用 \textsf{unicode-math} 宏包进行公式排版,因此在数学环境内既可以用标准 \LaTeX{} 宏,也可以直接输入 Unicode 符号。例如 $\oiint$ 符号可以通过 \verb|\oiint| 宏录入,也可以通过 Unicode 符号 $∯$ (对应 \verb|U+0222F| 码点) 录入。以下测试公式来自 \citet{clerkma2013unicode},其中所有字符均直接使用对应 Unicode 符号录入。
+\begin{align}
+& ⊢ ∀x[(Fx ∨ Gx) → \mathord{∼}Hx] \\
+& ⊨ ¬∃y∀x[x∈y ↔ x∉x] \\
+& ⊭ x ∩ (y ∪ z) ≠ (x ∩ y) ∪ (x ∩ z) \\
+& ⊢ ⟦α⟧ = ℵ₀ → α ≇ ℘(α) \\
+& ⌜ψ[(℩x)φx]⌝ ≝ ⌜(∃x)[φx ∧ (∀z)(φz ⊃ x=z) ∧ ψx]⌝ \\
+& ⊢ (P ⥽ Q) ⥽ (□P ⥽ ◇Q)
+\end{align}
+
\subsection{数学环境}
\shtthesis 通过 \textsf{amsthm} 宏包定义了常用的数学环境和证明环境,如表~\ref{tab::math_envs} 所列。其中,英文表示 tex 文档内调用的环境名称,中文表示排版后论文中显示的环境名称。
@@ -779,8 +796,8 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian}
本章中的测试材料,数学公式部分来自 \textsf{ucasthesis} 附录 B\footnote{\url{https://github.com/mohuangrui/ucasthesis/blob/master/Tex/Appendix.tex}},生僻字部分来自《生僻字大全(按部首分类)》\footnote{\url{http://xh.5156edu.com/page/z4745m2559j18770.html}}。
\section{排版数学公式}
-\providecommand{\Vector}[1]{\ensuremath{\mathbf{ #1 }}}
-\providecommand{\Tensor}[1]{\ensuremath{\mathbf{\mathsf{ #1 }}}}
+\providecommand{\Vector}[1]{\ensuremath{\symbf{ #1 }}}
+\providecommand{\Tensor}[1]{\ensuremath{\symbfsf{ #1 }}}
\begin{equation}
\begin{cases}
\frac{\partial \rho}{\partial t} + \nabla\cdot(\rho\Vector{V}) = 0 \\
@@ -789,26 +806,28 @@ P(A|B) &= \frac{P(A)P(B|A)}{P(B)} \label{eq::bayesian}
\end{cases}
\end{equation}
\begin{equation}
- \frac{\partial }{\partial t}\int\limits_{\Omega} u \, \mathrm{d}\Omega + \int\limits_{S} \Vector{n}\cdot(u\Vector{V}) \, \mathrm{d}S = \dot{\phi}
+ \frac{\partial }{\partial t}\int\limits_{\Omega} u \, \symup{d}\Omega + \int\limits_{S} \Vector{n}\cdot(u\Vector{V}) \, \symup{d}S = \dot{\phi}
\end{equation}
-\[
+\begin{equation*}
\begin{split}
- \mathcal{L} \{f\}(s) &= \int _{0^{-}}^{\infty} f(t) e^{-st} \, \mathrm{d}t, \
- \mathscr{L} \{f\}(s) = \int _{0^{-}}^{\infty} f(t) e^{-st} \, \mathrm{d}t\\
- \mathcal{F} {\bigl (} f(x+x_{0}) {\bigr )} &= \mathcal{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}, \
- \mathscr{F} {\bigl (} f(x+x_{0}) {\bigr )} = \mathscr{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}
+ \symcal{L} \{f\}(s) &= \int _{0^{-}}^{\infty} f(t) e^{-st} \, \symup{d}t, \
+ \symscr{L} \{f\}(s) = \int _{0^{-}}^{\infty} f(t) e^{-st} \, \symup{d}t\\
+ \symcal{F} {\bigl (} f(x+x_{0}) {\bigr )} &= \symcal{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}, \
+ \symscr{F} {\bigl (} f(x+x_{0}) {\bigr )} = \symscr{F} {\bigl (} f(x) {\bigr )} e^{2\pi i\xi x_{0}}
\end{split}
-\]
-
-Ordinary math: $A,F,L,2,3,5,\sigma$. \verb|\mathrm|: $\mathrm{A,F,L,2,3,5,\sigma}$.
-
-\verb|\mathbf|: $\mathbf{A,F,L,2,3,5,\sigma}$. \verb|\mathit|: $\mathit{A,F,L,2,3,5,\sigma}$.
-
-\verb|\mathsf|: $\mathsf{A,F,L,2,3,5,\sigma}$. \verb|\mathtt|: $\mathtt{A,F,L,2,3,5,\sigma}$.
+\end{equation*}
-\verb|\mathfrak|: $\mathfrak{A,F,L,2,3,5,\sigma}$. \verb|\mathbb|: $\mathbb{A,F,L,2,3,5,\sigma}$.
-
-\verb|\mathcal|: $\mathcal{A,F,L,2,3,5,\sigma}$. \verb|\mathscr|: $\mathscr{A,F,L,2,3,5,\sigma}$.
+\begin{center}
+\begin{tabular}{*{4}{l}}
+ \toprule
+ Ordinary math& $A,F,L,2,3,5,\sigma$& \verb|\symup|& $\symup{A,F,L,2,3,5,\sigma}$ \\
+ \verb|\symbf|& $\symbf{A,F,L,2,3,5,\sigma}$& \verb|\symit|& $\symit{A,F,L,2,3,5,\sigma}$ \\
+ \verb|\symsf|& $\symsf{A,F,L,2,3,5,\sigma}$& \verb|\symtt|& $\symtt{A,F,L,2,3,5,\sigma}$ \\
+ \verb|\symfrak|& $\symfrak{A,F,L,2,3,5,\sigma}$& \verb|\symbb|& $\symbb{A,F,L,2,3,5,\sigma}$ \\
+ \verb|\symcal|& $\symcal{A,F,L,2,3,5,\sigma}$& \verb|\symscr|& $\symscr{A,F,L,2,3,5,\sigma}$ \\
+ \bottomrule
+\end{tabular}
+\end{center}
\section{排版生僻字} \label{sec::chs_rare}
{\songti 叧叨叭叱叴叵叺叻叼叽叾卟叿吀吁吂吅吆吇吋吒吔吖吘吙吚吜吡吢吣吤吥吧吩吪吭吮吰吱吲呐吷吺吽呁呃呄呅呇呉呋呋呌呍呎呏呐呒呓呔呕呗呙呚呛呜呝呞呟呠呡呢呣呤呥呦呧周呩呪呫呬呭呮呯呰呱呲呴呶呵呷呸呹呺呻呾呿咀咁咂咃咄咅咇咈咉咊咋咍咎咐咑咓咔咕咖咗咘咙咚咛咜咝咞咟咠咡咢咣咤咥咦咧咨咩咪咫咬咭咮咯咰咲咳咴咵咶啕咹咺咻呙咽咾咿哂哃哅哆哇哈哊哋哌哎哏哐哑哒哓哔哕哖哗哘哙哚哛哜哝哞哟哠咔哣哤哦哧哩哪哫哬哯哰唝哵哶哷哸哹哻哼哽哾哿唀唁唂唃呗唅唆唈唉唊唋唌唍唎唏唑唒唓唔唣唖唗唘唙吣唛唜唝唞唟唠唡唢唣唤唥唦唧唨唩唪唫唬唭唯唰唲唳唴唵唶唷念唹唺唻唼唽唾唿啀啁啃啄啅啇啈啉啋啌啍啎问啐啑啒启啔啕啖啖啘啙啚啛啜啝哑启啠啡唡衔啥啦啧啨啩啪啫啬啭啮啯啰啱啲啳啴啵啶啷啹啺啻啼啽啾啿喀喁喂喃善喅喆喇喈喉喊喋喌喍喎喏喐喑喒喓喔喕喖喗喙喛喞喟喠喡喢喣喤喥喦喨喩喯喭喯喰喱哟喳喴喵営喷喸喹喺喼喽喾喿嗀嗁嗂嗃嗄嗅呛啬嗈嗉唝嗋嗌嗍吗嗏嗐嗑嗒嗓嗕嗖嗗嗘嗙呜嗛嗜嗝嗞嗟嗠嗡嗢嗧嗨唢嗪嗫嗬嗭嗮嗰嗱嗲嗳嗴嗵哔嗷嗸嗹嗺嗻嗼嗽嗾嗿嘀嘁嘂嘃嘄嘅嘅嘇嘈嘉嘊嘋嘌喽嘎嘏嘐嘑嘒嘓呕嘕啧嘘嘙嘚嘛唛嘝嘞嘞嘟嘠嘡嘢嘣嘤嘥嘦嘧嘨哗嘪嘫嘬嘭唠啸囍嘴哓嘶嘷呒嘹嘺嘻嘼啴嘾嘿噀噂噃噄咴噆噇噈噉噊噋噌噍噎噏噐噑噒嘘噔噕噖噗噘噙噚噛噜咝噞噟哒噡噢噣噤哝哕噧噩噪噫噬噭噮嗳噰噱哙噳喷噵噶噷吨噺噻噼噽噾噿咛嚁嚂嚃嚄嚅嚆吓嚈嚉嚊嚋哜嚍嚎嚏尝嚑嚒嚓嚔噜嚖嚗嚘啮嚚嚛嚜嚝嚞嚟嚠嚡嚢嚣嚤呖嚧咙嚩咙嚧嚪嚫嚬嚭嚯嚰嚱亸喾嚵嘤嚷嚸嚹嚺嚻嚼嚽嚾嚿啭嗫嚣囃囄冁囆囇呓囊囋囍囎囏囐嘱囒啮囔囕囖}
diff --git a/macros/latex/contrib/shtthesis/shtthesis.cls b/macros/latex/contrib/shtthesis/shtthesis.cls
index da48bb990b..1d616c240c 100644
--- a/macros/latex/contrib/shtthesis/shtthesis.cls
+++ b/macros/latex/contrib/shtthesis/shtthesis.cls
@@ -17,8 +17,8 @@
% Identification
% ==============================================================================
\NeedsTeXFormat{LaTeX2e}
-\newcommand\version{0.3.0}
-\newcommand\versiondate{2020/06/23}
+\newcommand\version{0.3.1}
+\newcommand\versiondate{2020/06/30}
\ProvidesClass{shtthesis}[%
\versiondate\space%
v\version\space%
@@ -295,6 +295,7 @@
}{ctexbook}
\PassOptionsToPackage{
natbib = true,
+ hyperref = manual,
backend = biber,
gbpub = false,
gbcitelocal = chinese,
@@ -320,15 +321,12 @@
\RequirePackage[shortlabels, inline]{enumitem}
\RequirePackage{mathtools}
\RequirePackage{amsthm}
-\RequirePackage[
- mathrm = sym,
- mathit = sym,
- mathbf = sym,
- mathtt = sym,
-]{unicode-math}
-\RequirePackage{hyperref}
+\RequirePackage[mathbf=sym]{unicode-math}
\RequirePackage{biblatex}
\AtEndPreamble{
+ \RequirePackage{hyperref}
+ \addbibresource{\sht@bib@resource}
+ \BiblatexManualHyperrefOn
\hypersetup{
pdfencoding = auto,
psdextra = true,
@@ -346,14 +344,6 @@
\definecolor{fdu@link}{HTML}{990000}
\definecolor{fdu@url}{HTML}{0000B2}
\definecolor{fdu@cite}{HTML}{007F00}
- % `classic' color scheme from `fduthesis'
- \definecolor{classic@link}{HTML}{FF0000}
- \definecolor{classic@url}{HTML}{0000FF}
- \definecolor{classic@cite}{HTML}{00FF00}
- % `science' color scheme from `fduthesis'
- \definecolor{science@link}{HTML}{CA0619}
- \definecolor{science@url}{HTML}{389F9D}
- \definecolor{science@cite}{HTML}{FF8920}
\hypersetup{
colorlinks = true,
linkcolor = fdu@link,
@@ -362,7 +352,6 @@
}
\fi
\urlstyle{tt}
- \addbibresource{\sht@bib@resource}
}
% ==============================================================================
% Format Specifications
@@ -382,7 +371,10 @@
\def\tablename{表}
\def\figurename{图}
\definecolor{ShtRed}{RGB}{146,46,23}
-\def\school@logo@missing{校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/shanghaitech-logo.pdf}{项目主页}下载!}
+\def\school@logo@missing{%
+ 校徽文件缺失,请至\href{https://github.com/lirundong/shtthesis/raw/master/%
+ shanghaitech-logo.pdf}{项目主页}下载!%
+}
% ------------------------------------------------------------------------------
% Geometry and layouts
% ------------------------------------------------------------------------------
@@ -550,61 +542,61 @@
% ------------------------------------------------------------------------------
\ifthenelse{\equal{\sht@fontset}{windows}}{
\def\fake@bold@factor{2.5}
- \setCJKmainfont[
- AutoFakeBold = \fake@bold@factor,
- ItalicFont = KaiTi,
- ]{SimSun}
- \setCJKsansfont[
- AutoFakeBold = \fake@bold@factor,
- ]{SimHei}
- \setCJKfamilyfont{zhsong}[
- AutoFakeBold = \fake@bold@factor,
- ]{SimSun}
- \setCJKfamilyfont{zhhei}[
- AutoFakeBold = \fake@bold@factor,
- ]{SimHei}
- \setCJKfamilyfont{zhkai}[
- AutoFakeBold = \fake@bold@factor,
- ]{KaiTi}
+ \setCJKmainfont{SimSun}[
+ AutoFakeBold = \fake@bold@factor,
+ ItalicFont = KaiTi,
+ ]
+ \setCJKsansfont{SimHei}[
+ AutoFakeBold = \fake@bold@factor,
+ ]
+ \setCJKfamilyfont{zhsong}{SimSun}[
+ AutoFakeBold = \fake@bold@factor,
+ ]
+ \setCJKfamilyfont{zhhei}{SimHei}[
+ AutoFakeBold = \fake@bold@factor,
+ ]
+ \setCJKfamilyfont{zhkai}{KaiTi}[
+ AutoFakeBold = \fake@bold@factor,
+ ]
}{
\ifthenelse{\equal{\sht@fontset}{mac}}{
- \setCJKmainfont[
- UprightFont = * Regular,
- BoldFont = * Bold,
- ItalicFont = Kaiti SC Regular,
- BoldItalicFont = Kaiti SC Bold,
- ]{Songti SC}
- \setCJKsansfont[
- UprightFont = * Light,
- BoldFont = * Medium,
- ]{Heiti SC}
- \setCJKfamilyfont{zhsong}[
- UprightFont = * Regular,
- BoldFont = * Bold,
- ]{Songti SC}
- \setCJKfamilyfont{zhhei}[
- UprightFont = * Light,
- BoldFont = * Medium,
- ]{Heiti SC}
- \setCJKfamilyfont{zhkai}[
- UprightFont = * Regular,
- BoldFont = * Bold,
- ]{Kaiti SC}
+ \setCJKmainfont{Songti SC}[
+ UprightFont = * Regular,
+ BoldFont = * Bold,
+ ItalicFont = Kaiti SC Regular,
+ BoldItalicFont = Kaiti SC Bold,
+ ]
+ \setCJKsansfont{Heiti SC}[
+ UprightFont = * Light,
+ BoldFont = * Medium,
+ ]
+ \setCJKfamilyfont{zhsong}{Songti SC}[
+ UprightFont = * Regular,
+ BoldFont = * Bold,
+ ]
+ \setCJKfamilyfont{zhhei}{Heiti SC}[
+ UprightFont = * Light,
+ BoldFont = * Medium,
+ ]
+ \setCJKfamilyfont{zhkai}{Kaiti SC}[
+ UprightFont = * Regular,
+ BoldFont = * Bold,
+ ]
}{
- \IfFontExistsTF{Source Han Serif SC}{
- \def\unix@songti{Source Han Serif SC}
+ \IfFontExistsTF{Noto Serif CJK SC}{
+ \def\unix@songti{Noto Serif CJK SC}
}{
- \IfFontExistsTF{Noto Serif CJK SC}{
- \def\unix@songti{Noto Serif CJK SC}
+ \IfFontExistsTF{Source Han Serif SC}{
+ \def\unix@songti{Source Han Serif SC}
}{
\def\unix@songti{FandolSong}
}
}
- \IfFontExistsTF{Source Han Sans SC}{
- \def\unix@heiti{Source Han Sans SC}
+ \IfFontExistsTF{Noto Sans CJK SC}{
+ \def\unix@heiti{Noto Sans CJK SC}
}{
- \IfFontExistsTF{Noto Sans CJK SC}{
- \def\unix@heiti{Noto Sans CJK SC}
+ \IfFontExistsTF{Source Han Sans SC}{
+ \def\unix@heiti{Source Han Sans SC}
}{
\def\unix@heiti{FandolHei}
}
@@ -626,13 +618,75 @@
}{
\def\unix@fangsong{FandolFang}
}
- \setCJKmainfont[ItalicFont=\unix@kaiti]{\unix@songti}
- \setCJKsansfont[BoldFont=\unix@heiti@bold]{\unix@heiti}
- \setCJKmonofont{\unix@fangsong}
- \setCJKfamilyfont{zhsong}{\unix@songti}
- \setCJKfamilyfont{zhhei}{\unix@heiti}
- \setCJKfamilyfont{zhkai}{\unix@kaiti}
- \setCJKfamilyfont{zhfs}{\unix@fangsong}
+ \ifluatex
+ \setCJKmainfont{\unix@songti}[ItalicFont=\unix@kaiti]
+ \setCJKsansfont{\unix@heiti}[BoldFont=\unix@heiti@bold]
+ \setCJKmonofont{\unix@fangsong}
+ \setCJKfamilyfont{zhsong}{\unix@songti}
+ \setCJKfamilyfont{zhhei}{\unix@heiti}[BoldFont=\unix@heiti@bold]
+ \setCJKfamilyfont{zhkai}{\unix@kaiti}
+ \setCJKfamilyfont{zhfs}{\unix@fangsong}
+ \else
+ \ifthenelse{\equal{\unix@songti}{FandolSong}}{
+ \setCJKmainfont{FandolSong}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ItalicFont = FandolKai-Regular,
+ ]
+ \setCJKfamilyfont{zhsong}{FandolSong}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]
+ }{
+ \ifthenelse{\equal{\unix@kaiti}{FandolKai}}{
+ \setCJKmainfont{\unix@songti}[
+ ItalicFont = FandolKai-Regular,
+ ItalicFeatures = {Extension = .otf},
+ ]
+ }{
+ \setCJKmainfont{\unix@songti}[ItalicFont=\unix@kaiti]
+ }
+ \setCJKfamilyfont{zhsong}{\unix@songti}
+ }
+ \ifthenelse{\equal{\unix@heiti}{FandolHei}}{
+ \setCJKsansfont{FandolHei}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]
+ \setCJKfamilyfont{zhhei}{FandolHei}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ BoldFont = *-Bold,
+ ]
+ }{
+ \setCJKsansfont{\unix@heiti}[BoldFont=\unix@heiti@bold]
+ \setCJKfamilyfont{zhhei}{\unix@heiti}[BoldFont=\unix@heiti@bold]
+ }
+ \ifthenelse{\equal{\unix@kaiti}{FandolKai}}{
+ \setCJKfamilyfont{zhkai}{FandolKai}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]
+ }{
+ \setCJKfamilyfont{zhkai}{\unix@kaiti}
+ }
+ \ifthenelse{\equal{\unix@fangsong}{FandolFang}}{
+ \setCJKfamilyfont{zhfs}{FandolFang}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]
+ \setCJKmonofont{FandolFang}[
+ Extension = .otf,
+ UprightFont = *-Regular,
+ ]
+ }{
+ \setCJKmonofont{\unix@fangsong}
+ \setCJKfamilyfont{zhfs}{\unix@fangsong}
+ }
+ \fi
\providecommand{\songti}{\CJKfamily{zhsong}}
\providecommand{\heiti}{\CJKfamily{zhhei}}
\providecommand{\kaishu}{\CJKfamily{zhkai}}
@@ -683,37 +737,22 @@
% Math fonts
% ------------------------------------------------------------------------------
\IfFontExistsTF{XITSMath-Regular.otf}{
- \setmathfont{XITSMath-Regular} [
- Extension = .otf,
- BoldFont = XITSMath-Bold,
- StylisticSet = 8,
- ]
- \setmathfont{XITSMath-Regular.otf} [
- range = {cal, bfcal},
- StylisticSet = 1,
- ]
- \setmathfont{XITSMath-Regular.otf} [
- range = {scr, bfscr},
- StylisticSet = 2,
- ]
+ \def\sht@math@font{XITSMath-Regular.otf}
}{
- \setmathfont{xits-math} [
- Extension = .otf,
- BoldFont = *bold,
- StylisticSet = 8,
- ]
- \setmathfont{xits-math.otf} [
- range = {cal, bfcal},
- StylisticSet = 1,
- ]
- \setmathfont{xits-math.otf} [
- range = {scr, bfscr},
- StylisticSet = 2,
- ]
+ \def\sht@math@font{xits-math.otf}
}
-\IfFontExistsTF{FiraMath-Regular.otf}{
- \setmathfontface\mathsf{FiraMath-Regular.otf}
-}{}
+\setmathfont{\sht@math@font}[
+ StylisticSet = 8, % upright integral variants, please refer to stix2-otf doc
+]
+% please refer to "Caligraphic vs. Script variants" section of unicode-math doc
+\setmathfont{\sht@math@font}[
+ range = {cal, bfcal},
+ StylisticSet = 1,
+]
+\setmathfont{\sht@math@font}[
+ range = {scr, bfscr},
+ StylisticSet = 2,
+]
% ------------------------------------------------------------------------------
% Math environmrnts
% ------------------------------------------------------------------------------
@@ -732,7 +771,8 @@
\theoremstyle{remark}
\newtheorem{remark}{注}[chapter]
\renewcommand*{\proofname}{证明}
-\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}{\@addpunct{\emph{:}}}{}{}
+\expandafter\patchcmd\csname\string\proof\endcsname{\@addpunct{.}}%
+ {\@addpunct{\emph{:}}}{}{}
% ------------------------------------------------------------------------------
% Utility functions for ToC and bookmarks
% ------------------------------------------------------------------------------
@@ -1158,14 +1198,17 @@
\fi%
}}} \\
\ifdefempty{\sht@supervisor@institution}{}{ &
- \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@supervisor@institution}}} \\
+ \multicolumn{2}{c}{\shifted@uline{%
+ \shifted@box{\sht@supervisor@institution}}} \\
}
学位类别:&
\multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@degree@name}}} \\
一级学科:&
- \multicolumn{2}{c}{\shifted@uline{\shifted@box{\sht@discipline@level@i}}} \\
+ \multicolumn{2}{c}{\shifted@uline{%
+ \shifted@box{\sht@discipline@level@i}}} \\
\multicolumn{2}{l}{学校/学院名称:} &
- \shifted@uline{\shifted@box[\cover@tab@last@entry@width]{\sht@institution}} \\
+ \shifted@uline{\shifted@box[\cover@tab@last@entry@width]{%
+ \sht@institution}} \\
\end{tabular}
}
@@ -1263,22 +1306,28 @@
[\cover@tab@entry@width@undergraduate]{\sht@title} \\
学生姓名:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@author}} \\
学\hspace{2\ccwd}号:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@author@id}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@author@id}} \\
入学年份:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@entrance@year}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@entrance@year}} \\
所在学院:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@institution}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@institution}} \\
攻读专业:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@discipline}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@discipline}} \\
指导教师:&
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate]{\sht@supervisor}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]{%
+ \sht@supervisor}} \\
\end{tabular}
}
@@ -1316,25 +1365,32 @@
\begin{tabular}{lc}
Subject: &
\sht@lines@to@tab[\cover@tab@uline@thick@undergraduate]%
- [\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@title@en} \\
+ [\cover@tab@entry@width@undergraduate][\content@left@shift@en]{%
+ \sht@title@en} \\
Student Name: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@en}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@author@en}} \\
Student ID: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@author@id}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@author@id}} \\
Year of Entrance: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@entrance@year}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@entrance@year}} \\
School: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@institution@en}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@institution@en}} \\
Major: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@discipline@en}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@discipline@en}} \\
Advisor: &
\shifted@uline[\cover@tab@uline@thick@undergraduate]%
- {\shifted@box[\cover@tab@entry@width@undergraduate][\content@left@shift@en]{\sht@supervisor@en}} \\
+ {\shifted@box[\cover@tab@entry@width@undergraduate]%
+ [\content@left@shift@en]{\sht@supervisor@en}} \\
\end{tabular}
}
@@ -1395,7 +1451,8 @@
{\hfill{}作者签名:\hspace*{10em}导师签名:\hspace*{9em}}
- {\hfill{}日\hspace*{2\ccwd}期:\hspace*{10em}日\hspace*{2\ccwd}期:\hspace*{9em}}
+ \hfill{}日\hspace*{2\ccwd}期:%
+ \hspace*{10em}日\hspace*{2\ccwd}期:\hspace*{9em}%
\vspace{3ex}
}
@@ -1593,7 +1650,9 @@
\providecommand{\makebiblio}{%
\renewcommand{\bibfont}{\zihao{5}}%
\intotoc*{\cleardoublepage}{\bibname}%
+ \urlstyle{same}%
\printbibliography%
+ \urlstyle{tt}%
}
% ------------------------------------------------------------------------------
% Appendix
diff --git a/macros/luatex/latex/cloze/README.md b/macros/luatex/generic/cloze/README.md
index 04dc316ef3..d6919d4c8d 100644
--- a/macros/luatex/latex/cloze/README.md
+++ b/macros/luatex/generic/cloze/README.md
@@ -69,14 +69,18 @@ Update the version number in the file `cloze.dtx` on this locations:
[2020/05/20 v1.4 Package to typeset cloze worksheets or cloze tests]
%<*package>
-### In the markup for the package documentation (approximately at the line number 1250)
-
-Add a changes entry:
+Add a changes entry (approximately at the line 90):
```latex
\changes{v1.4}{2020/05/20}{...}
```
+### In the package documentation `documentation.tex` (approximately at the line number 125)
+
+```latex
+\date{v1.6~from 2020/06/30}
+```
+
### In the markup for the file `cloze.lua` (approximately at the line number 1900)
```lua
diff --git a/macros/luatex/generic/cloze/cloze.dtx b/macros/luatex/generic/cloze/cloze.dtx
new file mode 100644
index 0000000000..1c18af683b
--- /dev/null
+++ b/macros/luatex/generic/cloze/cloze.dtx
@@ -0,0 +1,907 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2015-2020 by Josef Friedrich <josef@friedrich.rocks>
+% ----------------------------------------------------------------------
+% 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 Josef Friedrich.
+%
+% This work consists of the files cloze.dtx and cloze.ins
+% and the derived filebase cloze.sty and cloze.lua.
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{cloze.dtx}
+%</driver>
+%<latex>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<latex>\ProvidesPackage{cloze}
+%<*latex>
+ [2020/06/60 v1.6 Package to typeset cloze worksheets or cloze tests]
+%</latex>
+% \fi
+%
+% \CheckSum{0}
+%
+% \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 \~}
+%
+%
+% \changes{v0.1}{2015/06/16}{Converted to DTX file}
+%
+% \changes{v1.0}{2015/07/08}{Inital release}
+%
+% \changes{v1.1}{2016/06/13}{Make cloze compatible to LuaTeX version
+% 0.95}
+%
+% \changes{v1.2}{2016/06/23}{The cloze makros are now working in
+% tabular, tabbing and picture environments}
+%
+% \changes{v1.3}{2017/03/13}{Add the new macros \cmd{\clozenol} and
+% \cmd{\clozeextend} and the environments \texttt{clozebox} and
+% \texttt{clozespace} (This version was not published on CTAN.)}
+%
+% \changes{v1.4}{2020/05/20}{Add the new macro \cmd{\clozestrike} and
+% improve the documentation}
+%
+% \changes{v1.5}{2020/05/27}{
+% * The Lua part of the package (cloze.lua) is now being developed in a
+% separate file.
+% * The readme file is now a standalone mardown file and not embedded in
+% the dtx file any more.
+% * \href{https://github.com/stevedonovan/LDoc}{LDoc} is being used
+% to generate
+% \href{https://josef-friedrich.github.io/cloze}{source code documentation}.
+% * This version fixes two bugs (cloze in display math, line color and
+% hide).
+% }
+%
+% \changes{v1.6}{2020/06/30}{
+% * Implement basic plain \TeX{} respectively plain Lua\TeX{} interface.
+% * Fix issue: Duplicate line generation on the second line in cloze.
+% * Fix issue: width of first line wrong in itemize, mdframed.
+% * Fix issue \#4: \texttt{\string\clozenol} not transparent.
+% * Fix issue: \texttt{clozebox} not transparent.
+% }
+%
+% \DoNotIndex{\newcommand,\newenvironment,\def,\directlua}
+%
+% \StopEventually{}
+% \pagebreak
+% \section{Implementation}
+%
+% \iffalse
+%<*plaintex>
+% \fi
+% \MacroTopsep = 10pt plus 2pt minus 2pt
+% \MacrocodeTopsep = 10pt plus 1.2pt minus 1pt
+%
+% \makeatletter
+% \c@CodelineNo 25 \relax
+% \makeatother
+%
+% \subsection{The file \tt{cloze.tex}}
+%
+% The cloze package uses following naming conventions: Internal / private
+% macros / commands / envirnoments are written in PascalCase, public
+% ones are written in lowercase. Earlier versions of this package used
+% @ characters for private macros. The lower level / private macros
+% are now defined in the plain Lua\TeX{} version of the package and
+% used to set cloze text in plain Lua\TeX{}.
+%
+% \begin{macrocode}
+\directlua{
+ cloze = require('cloze')
+}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newif\ifclozeshow\clozeshowtrue
+% \end{macrocode}
+%
+% \subsubsection{Internal macros}
+%
+% \begin{macro}{\ClozeSetToGlobal}
+% Set the Lua variable |registry.is_global| to |true|. All options
+% are then stored in the variable |registry.global_options|.
+% \begin{macrocode}
+\def\ClozeSetToGlobal{%
+ \directlua{cloze.set_is_global(true)}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeSetToLocal}
+% First unset the variable |registry.local_options|. Now set the Lua
+% variable |registry.is_global| to |false|. All options are then stored
+% in the variable |registry.local_options|.
+% \begin{macrocode}
+\def\ClozeSetToLocal{%
+ \directlua{
+ cloze.unset_local_options()
+ cloze.set_is_global(false)
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeGetOption}
+% This macro is used in the documentation to show the default values
+% of some options.
+% \begin{macrocode}
+\def\ClozeGetOption#1{%
+ \directlua{
+ tex.print(cloze.get_value('#1'))
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeColor}
+% Convert a color definiton name to a PDF colorstack string, for example
+% convert the color name |blue| to the colorstack string
+% |0 0 1 rg 0 0 1 RG|. The macro definition |\ClozeColor{blue}|
+% builds itself the macro |\color@blue|, which expands to the PDF
+% colorstack string. The colorstack string is necessary to generate a
+% PDF colorstack whatsit.
+% \begin{macrocode}
+\def\ClozeColor#1{\csname\string\color@#1\endcsname}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeStartMarker}
+% At the begining |\ClozeStartMarker| registers the required Lua
+% callbacks. Then it inserts a whatsit marker which marks the begin of a
+% gap.
+% \begin{macrocode}
+\def\ClozeStartMarker#1{%
+ \strut\directlua{
+ cloze.register('#1')
+ cloze.marker('#1', 'start')
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeStopMarker}
+% \cmd{\ClozeStopMarker} inserts a whatsit marker that marks the end
+% of gap.
+% \begin{macrocode}
+\def\ClozeStopMarker#1{%
+ \strut\directlua{
+ cloze.marker('#1', 'stop')
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeMargin}
+% \cmd{\ClozeMargin} surrounds a text in a gap with two |kerns|.
+% \begin{macrocode}
+\def\ClozeMargin#1{%
+ \directlua{cloze.margin()}%
+ #1%
+ \directlua{cloze.margin()}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Public plain \TeX{} macros}
+%
+% \begin{macro}{\clozesetoption}
+% \cmd{\clozesetoption} is a wrapper for the Lua function
+% |registry.set_option|. \cmd{\clozesetoption}\marg{key}\marg{value}
+% sets a key \meta{key} to the value \meta{value}.
+% \begin{macrocode}
+\def\clozesetoption#1#2{%
+ \ClozeSetToGlobal%
+ \directlua{cloze.set_option('#1', '#2')}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozereset}
+% The usage of the command \cmd{\clozereset} is described in detail in
+% section \TmpSecRef{sec:command-clozereset}.
+% \begin{macrocode}
+\def\clozereset{%
+ \ClozeSetToGlobal%
+ \directlua{cloze.reset()}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozeshow}
+% The usage of the command \cmd{\clozeshow} is described in detail in
+% section \TmpSecRef{sec:command-clozeshow}.
+% \begin{macrocode}
+\def\clozeshow{%
+ \clozeshowtrue%
+ \ClozeSetToGlobal%
+ \clozesetoption{show}{true}%
+ \clozesetoption{hide}{false}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozehide}
+% The usage of the command \cmd{\clozehide} is described in detail in
+% section \TmpSecRef{sec:command-clozehide}.
+% \begin{macrocode}
+\def\clozehide{%
+ \clozeshowfalse%
+ \ClozeSetToGlobal%
+ \clozesetoption{hide}{true}%
+ \clozesetoption{show}{false}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\clozefont}
+% The usage of the command \cmd{\clozefont} is described in detail in
+% section \TmpSecRef{sec:command-clozefont}.
+% \begin{macrocode}
+\def\clozefont{\it}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozesetfont}
+% The usage of the command \cmd{\clozesetfont} is described in detail in
+% section \TmpSecRef{sec:command-clozesetfont}.
+% \begin{macrocode}
+\def\clozesetfont#1{%
+ \def\clozefont{%
+ #1%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cloze}
+% This is the plain Lua\TeX-Version of the macro \cmd{\cloze}.
+% \begin{macrocode}
+\def\cloze#1{%
+ \ClozeStartMarker{basic}%
+ {%
+ \clozefont\relax%
+ \ClozeMargin{#1}%
+ }%
+ \ClozeStopMarker{basic}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozefix}
+% This is the plain Lua\TeX-Version of \cmd{\clozefix}. The usage of the
+% command \cmd{\clozefix} is described in detail in
+% section \TmpSecRef{sec:command-clozefix}.
+% \begin{macrocode}
+\def\clozefix#1{%
+ \ClozeStartMarker{fix}%
+ {%
+ \clozefont\relax%
+ \ClozeMargin{#1}%
+ }%
+ \ClozeStopMarker{fix}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozenol}
+% This is the plain Lua\TeX-Version of the macro \cmd{\clozenol}. The
+% usage of the command \cmd{\clozenol} is described in detail in
+% section \TmpSecRef{sec:command-clozenol}.
+% \begin{macrocode}
+\def\clozenol#1{%
+ \clozesetoption{thickness}{0pt}%
+ \ClozeStartMarker{basic}%
+ {%
+ \clozefont\relax%
+ \ClozeMargin{#1}%
+ }%
+ \ClozeStopMarker{basic}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozeline}
+% This is the plain Lua\TeX-Version of the macro \cmd{\clozeline}. The
+% usage of the command \cmd{\clozeline} is described in detail in
+% section \TmpSecRef{sec:command-clozeline}.
+% \begin{macrocode}
+\def\clozeline{%
+ \directlua{cloze.line()}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozelinefil}
+% This is the plain Lua\TeX-Version of the macro \cmd{\clozelinefil}.
+% The usage of the command \cmd{\clozelinefil} is described in detail in
+% section \TmpSecRef{sec:command-clozelinefil}.
+% \begin{macrocode}
+\def\clozelinefil{%
+ \strut%
+ \directlua{cloze.linefil()}%
+ \strut%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozefil}
+% This is the plain Lua\TeX-Version of the macro \cmd{\clozefil}.
+% The usage of the command \cmd{\clozefil} is described in detail in
+% section \TmpSecRef{sec:command-clozefil}.
+% \begin{macrocode}
+\def\clozefil#1{%
+ \cloze{#1}\clozelinefil%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozeparcmd}
+% The usage of the macro \cmd{\clozeparcmd} is described in detail in
+% section \TmpSecRef{sec:command-clozeparcmd}.
+% \begin{macrocode}
+\def\clozeparcmd#1\par {%
+ \par%
+ \ClozeStartMarker{par}%
+ \clozefont\relax%
+ #1%
+ \ClozeStopMarker{par}%
+ \par%
+ \directlua{cloze.unregister('par')}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</plaintex>
+% \fi
+%
+% \iffalse
+%<*latex>
+% \fi
+% \MacroTopsep = 10pt plus 2pt minus 2pt
+% \MacrocodeTopsep = 10pt plus 1.2pt minus 1pt
+%
+% \makeatletter
+% \c@CodelineNo 25 \relax
+% \makeatother
+%
+% \subsection{The file \tt{cloze.sty}}
+%
+% \begin{macrocode}
+\input{cloze.tex}
+% \end{macrocode}
+%
+% This packages are used to build \emph{cloze}:
+%
+% \subsubsection{Dependencies}
+%
+% The package \href{https://www.ctan.org/pkg/fontspec}{fontspec} is not
+% necessarily required. When using Lua\LaTeX{} it is good form to load
+% it. Apart from this the package supplies helpful messages, when you
+% compile a Lua\LaTeX{} document with pdf\LaTeX{}.
+% \begin{macrocode}
+\RequirePackage{fontspec}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/luatexbase}{luatexbase}
+% allows to register multiple Lua callbacks.
+% \begin{macrocode}
+\RequirePackage{luatexbase-mcb}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/kvoptions}{kvoptions}
+% takes the handling of the options.
+% \begin{macrocode}
+\RequirePackage{kvoptions}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/setspace}{setspace} is used
+% by the environment |clozespace|.
+% \begin{macrocode}
+\RequirePackage{setspace}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/xcolor}{xcolor} is required
+% to colorize the text and the line of a gap.
+% \begin{macrocode}
+\RequirePackage{xcolor}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/xcolor}{xparse} is used by
+% the environment |clozebox|.
+% \begin{macrocode}
+\RequirePackage{xparse}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/stackengine}{stackengine}
+% is required by the command |\clozestrike{}{}|.
+% \begin{macrocode}
+\RequirePackage{stackengine}
+% \end{macrocode}
+% The package \href{https://www.ctan.org/pkg/ulem}{ulem} is required by
+% the command |\clozestrike{}{}|.
+% \begin{macrocode}
+\RequirePackage{ulem}
+\normalem
+% \end{macrocode}
+%
+% \begin{macrocode}
+\RequirePackage{transparent}
+% \end{macrocode}
+%
+% Load the cloze lua module and put all return values in the variable
+% |cloze|.
+%
+% \begin{macro}{\clozesetoption}
+% \cmd{\clozesetoption} is a wrapper for the Lua function
+% |registry.set_option|. \cmd{\clozesetoption}\marg{key}\marg{value}
+% sets a key \meta{key} to the value \meta{value}. The plain Lua\TeX{}
+% version always sets to the global options. The Lua\LaTeX-version
+% can set values both to the local and the global options store.
+% \begin{macrocode}
+\let\clozesetoption=\undefined
+\newcommand{\clozesetoption}[2]{%
+ \directlua{cloze.set_option('#1', '#2')}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeSetLocalOptions}
+% This macro is used in all cloze commands to handle the optional
+% arguments. First it sets the option storage to local and then it
+% commits the options to the package \emph{kvoptions} via the macro
+% |\kvsetkeys{CLZ}{}|.
+% \begin{macrocode}
+\def\ClozeSetLocalOptions#1{%
+ \ClozeSetToLocal%
+ \kvsetkeys{CLZ}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{Options}
+%
+% \emph{cloze} offers key-value pairs to use as options. For processing
+% the key-value pairs we use the package
+% \href{https://www.ctan.org/pkg/kvoptions}{kvoptions}.
+% To make all key-value pairs accessibly to Lua code, we use the
+% declaration
+% \cmd{\define@key}\marg{CLZ}\marg{option}\oarg[]\marg{\dots}. This
+% declaration comes from the package
+% \href{https://www.ctan.org/pkg/keyval}{keyval}.
+%
+% At start all values are declared as global options. At the Lua side
+% all values are now stored in the |registry.global_options| table.
+%
+% \begin{macrocode}
+\ClozeSetToGlobal
+% \end{macrocode}
+%
+% We use the abbreviation |CLZ| for \emph{cloze} as family name and
+% prefix.
+%
+% \begin{macrocode}
+\SetupKeyvalOptions{
+ family=CLZ,
+ prefix=CLZ@
+}
+% \end{macrocode}
+%
+% \paragraph{\tt{align}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-align} how to use
+% the option |align|. |align| affects only the command \cmd{\clozefix}
+% \TmpSecRef{sec:command-clozefix}.
+%
+% \begin{macrocode}
+\DeclareStringOption{align}
+\define@key{CLZ}{align}[]{\clozesetoption{align}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{boxheight}}
+%
+% \noindent Please read the section \TmpSecRef{sec:command-clozebox}
+% how to use the option |boxheight|. |boxheight| affects only the
+% environment |clozebox|.
+% \TmpSecRef{sec:command-clozefix}.
+%
+% \begin{macrocode}
+\DeclareStringOption{boxheight}
+\define@key{CLZ}{boxheight}[]{\clozesetoption{boxheight}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{boxwidth}}
+%
+% \noindent Please read the section \TmpSecRef{sec:command-clozebox}
+% how to use the option |boxwidth|. |boxwidth| affects only the
+% environment |clozebox|.
+% \TmpSecRef{sec:command-clozefix}.
+%
+% \begin{macrocode}
+\DeclareStringOption{boxwidth}
+\define@key{CLZ}{boxwidth}[]{\clozesetoption{boxwidth}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{distance}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-distance} how to
+% use the option |distance|.
+%
+% \begin{macrocode}
+\DeclareStringOption{distance}
+\define@key{CLZ}{distance}[]{\clozesetoption{distance}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{hide}}
+%
+% \noindent If the option |hide| appears in the commands, |hide| will be
+% set to \emph{true} and |show| to \emph{false} on the Lua side. Please
+% read the section \TmpSecRef{sec:option-hide} how to use the option
+% |hide|.
+%
+% \begin{macrocode}
+\DeclareVoidOption{hide}{%
+ \clozeshowfalse%
+ \clozesetoption{hide}{true}%
+ \clozesetoption{show}{false}%
+}
+% \end{macrocode}
+%
+% \paragraph{\tt{linecolor}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-linecolor} how to
+% use the option |linecolor|.
+%
+% \begin{macrocode}
+\DeclareStringOption{linecolor}
+\define@key{CLZ}{linecolor}[]{%
+ \clozesetoption{linecolor}{\ClozeColor{#1}}%
+ \clozesetoption{linecolor_name}{#1}%
+}
+% \end{macrocode}
+%
+% \paragraph{\tt{margin}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-margin} how to
+% use the option |margin|.
+%
+% \begin{macrocode}
+\DeclareStringOption{margin}
+\define@key{CLZ}{margin}[]{\clozesetoption{margin}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{show}}
+%
+% \noindent If the option |show| appears in the commands, |show| will be
+% set to \emph{true} and |true| to \emph{false} on the Lua side. Please
+% read the section \TmpSecRef{sec:option-show} how to use the option
+% |show|.
+%
+% \begin{macrocode}
+\DeclareVoidOption{show}{%
+ \clozeshowtrue%
+ \clozesetoption{show}{true}%
+ \clozesetoption{hide}{false}%
+}
+% \end{macrocode}
+%
+% \paragraph{\tt{spacing}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-spacing} how to
+% use the option |spacing|.
+%
+% \begin{macrocode}
+\DeclareStringOption{spacing}
+\define@key{CLZ}{spacing}[]{\clozesetoption{spacing}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{textcolor}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-textcolor} how to
+% use the option |textcolor|.
+%
+% \begin{macrocode}
+\DeclareStringOption{textcolor}
+\define@key{CLZ}{textcolor}[]{%
+ \clozesetoption{textcolor}{\ClozeColor{#1}}%
+ \clozesetoption{textcolor_name}{#1}%
+}
+% \end{macrocode}
+%
+% \paragraph{\tt{thickness}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-thickness} how to
+% use the option |thickness|.
+%
+% \begin{macrocode}
+\DeclareStringOption{thickness}
+\define@key{CLZ}{thickness}[]{\clozesetoption{thickness}{#1}}
+% \end{macrocode}
+%
+% \paragraph{\tt{width}}
+%
+% \noindent Please read the section \TmpSecRef{sec:option-width} how to use
+% the option |width|. |width| affects only the command \cmd{\clozefix}
+% \TmpSecRef{sec:command-clozefix}.
+%
+% \begin{macrocode}
+\DeclareStringOption{width}
+\define@key{CLZ}{width}[]{\clozesetoption{width}{#1}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\ProcessKeyvalOptions{CLZ}
+% \end{macrocode}
+%
+% \subsubsection{Public macros}
+%
+% All public macros are prefixed with |\cloze|.
+%
+% \begin{macro}{\clozeset}
+% The usage of the command \cmd{\clozeset} is described in detail in
+% section \TmpSecRef{sec:command-clozeset}.
+% \begin{macrocode}
+\newcommand{\clozeset}[1]{%
+ \ClozeSetToGlobal%
+ \kvsetkeys{CLZ}{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozeshow}
+% The usage of the command \cmd{\clozeshow} is described in detail in
+% section \TmpSecRef{sec:command-clozeshow}.
+% \begin{macrocode}
+\let\clozeshow=\undefined
+\newcommand{\clozeshow}{%
+ \clozeset{show}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozehide}
+% The usage of the command \cmd{\clozehide} is described in detail in
+% section \TmpSecRef{sec:command-clozehide}.
+% \begin{macrocode}
+\let\clozehide=\undefined
+\newcommand{\clozehide}{%
+ \clozeset{hide}
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cloze}
+% The usage of the command \cmd{\cloze} is described in detail in
+% section \TmpSecRef{sec:command-cloze}.
+% \begin{macrocode}
+\let\clozeplain=\cloze
+\let\cloze=\undefined
+\newcommand{\cloze}[2][]{%
+ \ClozeSetLocalOptions{#1}%
+ \clozeplain{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozefix}
+% The usage of the command \cmd{\clozefix} is described in detail in
+% section \TmpSecRef{sec:command-clozefix}.
+% \begin{macrocode}
+\let\clozefixplain=\clozefix
+\let\clozefix=\undefined
+\newcommand{\clozefix}[2][]{%
+ \ClozeSetLocalOptions{#1}%
+ \clozefixplain{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozenol}
+% The usage of the command \cmd{\clozenol} is described in detail in
+% section \TmpSecRef{sec:command-clozenol}.
+% \begin{macrocode}
+\let\clozenolplain=\clozenol
+\let\clozenol=\undefined
+\newcommand{\clozenol}[2][]{%
+ \ClozeSetLocalOptions{#1}%
+ \clozenolplain{#2}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{environment}{clozepar}
+% The usage of the environment |clozepar| is described in detail in
+% section \TmpSecRef{sec:command-clozepar}.
+% \begin{macrocode}
+\newenvironment{clozepar}[1][]%
+{%
+ \par%
+ \ClozeSetLocalOptions{#1}%
+ \ClozeStartMarker{par}%
+ \clozefont\relax%
+}%
+{%
+ \ClozeStopMarker{par}%
+ \par%
+ \directlua{cloze.unregister('par')}%
+}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{clozebox}
+% The usage of the environment |clozebox| is described in detail in
+% section \TmpSecRef{sec:command-clozebox}.
+% TODO: Realize this macro with lua code, without ugly |\color{white}|
+% command.
+% \begin{macrocode}
+\newsavebox{\ClozeBox}%
+\NewDocumentEnvironment{clozebox}{ s O{} +b}{%
+ \ClozeSetLocalOptions{#2}%
+ \noindent%
+ \begin{lrbox}{\ClozeBox}%
+ \directlua{
+ local boxheight = cloze.get_value('boxheight')
+ local boxwidth = cloze.get_value('boxwidth')
+ if boxheight then
+ tex.print('\\begin{minipage}[t][' .. boxheight .. '][t]{' .. boxwidth .. '}')
+ else
+ tex.print('\\begin{minipage}[t]{' .. boxwidth .. '}')
+ end
+ }%
+ \setlength{\parindent}{0pt}%
+ \clozenol[margin=0pt]{#3}%
+ \end{minipage}%
+ \end{lrbox}%
+ \IfBooleanTF{#1}%
+ {\usebox{\ClozeBox}}%
+ {\fbox{\usebox{\ClozeBox}}}%
+}{}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{clozespace}
+% The usage of the environment |clozespace| is described in detail in
+% section \TmpSecRef{sec:command-clozespace}.
+% TODO: Realization without setspace package.
+% \begin{macrocode}
+\newenvironment{clozespace}[1][]%
+{%
+ \ClozeSetLocalOptions{#1}%
+ \begin{spacing}{\directlua{tex.print(cloze.get_value('spacing'))}}%
+}{\end{spacing}}
+% \end{macrocode}
+% \end{environment}
+%
+% \begin{macro}{\clozeline}
+% The usage of the command \cmd{\clozeline} is described in detail in
+% section \TmpSecRef{sec:command-clozeline}.
+% \begin{macrocode}
+\let\clozelineplain=\clozeline
+\let\clozeline=\undefined
+\newcommand{\clozeline}[1][]{%
+ \ClozeSetLocalOptions{#1}%
+ \clozelineplain%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozelinefil}
+% The usage of the command \cmd{\clozelinefil} is described in detail in
+% section \TmpSecRef{sec:command-clozelinefil}.
+% \begin{macrocode}
+\let\clozelinefilplain=\clozelinefil
+\let\clozelinefil=\undefined
+\newcommand{\clozelinefil}[1][]{%
+ \ClozeSetLocalOptions{#1}%
+ \clozelinefilplain%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozefil}
+% The usage of the command \cmd{\clozefil} is described in detail in
+% section \TmpSecRef{sec:command-clozefil}.
+% \begin{macrocode}
+\let\clozefil=\undefined
+\newcommand{\clozefil}[2][]{%
+ \cloze[#1]{#2}\clozelinefil[#1]%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozeextend}
+% TODO: Use node library to create kern nodes.
+% \begin{macrocode}
+\newcommand{\clozeextend}[1][1]{%
+ \directlua{
+ local loop = #1
+ for variable = 1, loop do
+ tex.print(' \string\\hspace{1em} \string\\strut')
+ end
+ }
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeTextColor}
+% \begin{macrocode}
+\newcommand{\ClozeTextColor}[1]{%
+ \textcolor%
+ {\directlua{tex.print(cloze.get_value('textcolor_name'))}}%
+ {#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ClozeStrikeLine}
+% \begin{macrocode}
+\newcommand\ClozeStrikeLine{%
+ \bgroup%
+ \markoverwith{%
+ \ClozeTextColor{%
+ \rule[0.5ex]{2pt}{1pt}%
+ }%
+ }%
+ \ULon%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\clozestrike}
+% \begin{macrocode}
+\newcommand{\clozestrike}[3][]{%
+ \ClozeSetLocalOptions{#1}%
+ \ifclozeshow%
+ \stackengine%
+ {\Sstackgap}% \Sstackgap or \Lstackgap or \stackgap or stacklength
+ {\ClozeStrikeLine{#2}}% anchor
+ {\ClozeTextColor{\clozefont{}#3}}% item
+ {O}% O or U
+ {c}% \stackalignment or l or c or r
+ {\quietstack}% \quietstack or T or F
+ {T}% \useanchorwidth or T or F
+ {\stacktype}% \stacktype or S or L
+ \else%
+ \stackengine%
+ {\Sstackgap}% \Sstackgap or \Lstackgap or \stackgap or stacklength
+ {#2}% anchor
+ {\texttransparent{0}{\clozefont{}#3}}% item
+ {O}% O or U
+ {c}% \stackalignment or l or c or r
+ {\quietstack}% \quietstack or T or F
+ {T}% \useanchorwidth or T or F
+ {\stacktype}% \stacktype or S or L
+ \fi%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \iffalse
+%</latex>
+% \fi
+%
+% \Finale
+\endinput
diff --git a/macros/luatex/latex/cloze/cloze.ins b/macros/luatex/generic/cloze/cloze.ins
index 75f4839276..9ed14f6199 100644
--- a/macros/luatex/latex/cloze/cloze.ins
+++ b/macros/luatex/generic/cloze/cloze.ins
@@ -36,7 +36,8 @@ version 2008/05/05 or later.
\endpreamble
-\generate{\file{cloze.sty}{\from{cloze.dtx}{package}}}
+\generate{\file{cloze.tex}{\from{cloze.dtx}{plaintex}}}
+\generate{\file{cloze.sty}{\from{cloze.dtx}{latex}}}
\obeyspaces
\Msg{*************************************************************}
diff --git a/macros/luatex/latex/cloze/cloze.lua b/macros/luatex/generic/cloze/cloze.lua
index b9490354a5..1563155a1b 100644
--- a/macros/luatex/latex/cloze/cloze.lua
+++ b/macros/luatex/generic/cloze/cloze.lua
@@ -7,18 +7,20 @@
-- * _Variable_ names for _nodes_ are suffixed with `_node`, for example
-- `head_node`.
-- * _Variable_ names for _lengths_ (dimensions) are suffixed with
--- `_length`, for example `width_length`.
+-- `_length`, for example `width`.
--
-- @module cloze
--- __cloze.lua}__
+-- luacheck: globals node tex modules luatexbase callback
+
+-- __cloze.lua__
-- __Initialisation of the function tables__
-- It is good form to provide some background informations about this Lua
-- module.
if not modules then modules = { } end modules ['cloze'] = {
- version = '1.5',
+ version = '1.6',
comment = 'cloze',
author = 'Josef Friedrich, R.-M. Huber',
copyright = 'Josef Friedrich, R.-M. Huber',
@@ -58,13 +60,6 @@ registry.defaults = {
registry.global_options = {}
registry.local_options = {}
--- All those functions are stored in the table `cloze` that are
--- registered as callbacks to the pre and post linebreak filters.
-local cloze = {}
--- In the status table are stored state information, which are necessary
--- for the recursive cloze generation.
-cloze.status = {}
-
-- The `base` table contains some basic functions. `base` is the only
-- table of this Lua module that will be exported.
local base = {}
@@ -135,7 +130,7 @@ function nodex.insert_list(position, current, list, head_node)
if not head_node then
head_node = current
end
- for i, insert in ipairs(list) do
+ for _, insert in ipairs(list) do
if position == 'after' then
head_node, current = node.insert_after(head_node, current, insert)
elseif position == 'before' then
@@ -154,7 +149,7 @@ end
-- <table>
-- <thead>
-- <tr>
--- <th>`n.color_line`</th>
+-- <th>`color_line_node`</th>
-- <th>`whatsit`</th>
-- <th>`pdf_colorstack`</th>
-- <th>Line color</th>
@@ -162,13 +157,13 @@ end
-- </thead>
-- <tbody>
-- <tr>
--- <td>`n.line`</td>
+-- <td>`line_node`</td>
-- <td>`rule`</td>
-- <td></td>
-- <td>`width`</td>
-- </tr>
-- <tr>
--- <td>`n.color_reset`</td>
+-- <td>`color_reset_node`</td>
-- <td>`whatsit`</td>
-- <td>`pdf_colorstack`</td>
-- <td>Reset color</td>
@@ -267,13 +262,13 @@ end
--
-- @treturn node hlist_node
-- @treturn node strut_node
--- @treturn node head_node
+-- @treturn node prev_head_node
local function insert_strut_into_hlist(hlist_node)
- local head_node = hlist_node.head
+ local prev_head_node = hlist_node.head
local kern_node = create_kern_node(0)
- local strut_node = node.insert_before(hlist_node.head, head_node, kern_node)
- hlist_node.head = head_node.prev
- return hlist_node, strut_node, head_node
+ local strut_node = node.insert_before(hlist_node.head, prev_head_node, kern_node)
+ hlist_node.head = prev_head_node.prev
+ return hlist_node, strut_node, prev_head_node
end
--- Write kern nodes to the current node list. This kern nodes can be used
@@ -283,14 +278,14 @@ function nodex.write_margin()
node.write(kern)
end
---- Search for a `hlist` (subtype `line`).
---
--- Insert a strut node into the list if a hlist is found.
+--- Search for a `hlist` (subtype `line`) and nsert a strut node into
+-- the list if a hlist is found.
--
-- @tparam node head_node The head of a node list.
--
--- @treturn node|false Return false, if no `hlist` can
--- be found.
+-- @treturn node hlist_node
+-- @treturn node strut_node
+-- @treturn node prev_head_node
local function search_hlist(head_node)
while head_node do
if head_node.id == node.id('hlist') and head_node.subtype == 1 then
@@ -298,7 +293,6 @@ local function search_hlist(head_node)
end
head_node = head_node.next
end
- return false
end
--- Option handling.
@@ -330,7 +324,7 @@ function registry.create_marker(index)
return marker
end
---- Write a marker node to \TeX's current node list.
+--- Write a marker node to TeX's current node list.
--
-- The argument `mode` accepts the string values `basic`, `fix` and
-- `par`. The argument `position`. The argument `position` is either set
@@ -410,8 +404,13 @@ end
--- This function removes a given whatsit marker.
--
-- It only deletes a node, if a marker is given.
+--
+-- @treturn node head
+-- @treturn node current
function registry.remove_marker(marker)
- if registry.is_marker(marker) then node.remove(marker, marker) end
+ if registry.is_marker(marker) then
+ return node.remove(marker, marker)
+ end
end
-- __Storage functions (storage)__
@@ -536,280 +535,296 @@ end
--- Assembly to cloze texts.
-- @section cloze_functions
---- The function `cloze.basic_make()` makes one gap. The argument `start`
--- is the node, where the gap begins. The argument `stop` is the node,
--- where the gap ends.
-function cloze.basic_make(start_node, end_node)
- local node_head = start_node
- if not start_node or not end_node then
- return
- end
- local line_width = node.dimensions(
- cloze.status.hlist.glue_set,
- cloze.status.hlist.glue_sign,
- cloze.status.hlist.glue_order,
- start_node,
- end_node
- )
- local line_node = nodex.insert_line(start_node, line_width)
- local color_text_node = nodex.insert_list('after', line_node, {nodex.create_color('text')})
- if registry.get_value_show() then
- nodex.insert_list('after', color_text_node, {create_kern_node(-line_width)})
- nodex.insert_list('before', end_node, {nodex.create_color('reset')}, node_head)
- else
- line_node.next = end_node.next
- end_node.prev = line_node -- not line_node.prev -> line color leaks out
- end
- -- In some edge cases the lua callbacks get fired up twice. After the
- -- cloze has been created, the start and stop whatsit markers can be
- -- deleted.
- registry.remove_marker(start_node)
- registry.remove_marker(end_node)
-end
-
---- Search for a stop marker.
---
--- @tparam node head_node The head of a node list.
+--- Assemble a possibly muliline cloze.
--
--- @treturn node The end node.
-function cloze.basic_search_stop(head_node)
- local end_node
- while head_node do
- cloze.status.continue = true
- end_node = head_node
- if registry.check_marker(end_node, 'basic', 'stop') then
- cloze.status.continue = false
- break
- end
- head_node = head_node.next
- end
- return end_node
-end
-
---- Search for a start marker or begin a new cloze if the value
--- `cloze.status.continue` is true.
+-- The corresponding LaTeX command to this Lua function is `\cloze`.
+-- This function is used by other cloze TeX macros too: `\clozenol`,
+-- `\clozefil`
--
--- We have to find a hlist node and use its on the field `head`
--- attached node list to search for a start marker.
+-- @tparam node head_node_input The head of a node list.
--
--- @tparam node head_node The head of a node list.
-function cloze.basic_search_start(head_node)
- local start_node, end_node, hlist_node
- if cloze.status.continue then
- hlist_node = search_hlist(head_node)
- if hlist_node then
- cloze.status.hlist = hlist_node
- start_node = hlist_node.head
+-- @treturn node The head of the node list.
+local function make_basic(head_node_input)
+ -- This local variables are overloaded by function who
+ -- call each other.
+ local continue_cloze, search_stop
+
+ --- The function `make_single()` makes one gap. The argument
+ -- `start_node` is the node where the gap begins. The argument
+ -- `stop_node` is the node where the gap ends.
+ --
+ -- @tparam node start_node The node to start / begin a new cloze.
+ -- @tparam node stop_node The node to stop / end a new cloze.
+ -- @tparam node parent_node The parent node (hlist) of the start and
+ -- the stop node.
+ --
+ -- @treturn node stop_node The stop node.
+ -- @treturn parent_node The parent node (hlist) of the stop node.
+ local function make_single(start_node, stop_node, parent_node)
+ local node_head = start_node
+ local line_width = node.dimensions(
+ parent_node.glue_set,
+ parent_node.glue_sign,
+ parent_node.glue_order,
+ start_node,
+ stop_node
+ )
+ local line_node = nodex.insert_line(start_node, line_width)
+ local color_text_node = nodex.insert_list('after', line_node, {nodex.create_color('text')})
+ if registry.get_value_show() then
+ nodex.insert_list('after', color_text_node, {create_kern_node(-line_width)})
+ nodex.insert_list('before', stop_node, {nodex.create_color('reset')}, node_head)
+ else
+ line_node.next = stop_node.next
+ stop_node.prev = line_node -- not line_node.prev -> line color leaks out
end
- elseif registry.check_marker(head_node, 'basic', 'start') then
- start_node = head_node
- end
- if start_node then
- end_node = cloze.basic_search_stop(start_node)
- cloze.basic_make(start_node, end_node)
+ -- In some edge cases the lua callbacks get fired up twice. After the
+ -- cloze has been created, the start and stop whatsit markers can be
+ -- deleted.
+ registry.remove_marker(start_node)
+ return registry.remove_marker(stop_node), parent_node
end
-end
---- Parse the node tree recursivley.
---
--- Start and end markers could be nested deeply in the node tree.
---
--- @tparam node head_node The head of a node list.
-function cloze.basic_recursion(head_node)
- while head_node do
- if head_node.head then
- cloze.status.hlist = head_node
- cloze.basic_recursion(head_node.head)
+ --- Search for a stop marker or make a cloze up to the end of the node
+ -- list.
+ --
+ -- @tparam node start_node The node to start a new cloze.
+ -- @tparam node parent_node The parent node (hlist) of the start node.
+ --
+ -- @treturn head_node The fast forwarded new head of the node list.
+ -- @treturn parent_node The parent node (hlist) of the head node.
+ function search_stop(start_node, parent_node)
+ local head_node = start_node
+ local last_node
+ while head_node do
+ if registry.check_marker(head_node, 'basic', 'stop') then
+ return make_single(start_node, head_node, parent_node)
+ end
+ last_node = head_node
+ head_node = head_node.next
+ end
+ -- Make a cloze until the end of the node list.
+ head_node = make_single(start_node, last_node, parent_node)
+ if parent_node.next then
+ return continue_cloze(parent_node.next)
else
- cloze.basic_search_start(head_node)
+ return head_node, parent_node
end
- head_node = head_node.next
end
-end
---- The corresponding LaTeX command to this lua function is `\cloze`.
---
--- @tparam node head_node The head of a node list.
---
--- @treturn node The head of the node list.
-function cloze.basic(head_node)
- cloze.status.continue = false
- cloze.basic_recursion(head_node)
- return head_node
-end
+ --- Continue a multiline cloze.
+ --
+ -- @tparam node parent_node A parent node to search for a hlist node.
+ --
+ -- @treturn head_node The fast forwarded new head of the node list.
+ -- @treturn parent_node The parent node (hlist) of the head node.
+ function continue_cloze(parent_node)
+ local hlist_node = search_hlist(parent_node)
+ if hlist_node then
+ local start_node = hlist_node.head
+ return search_stop(start_node, hlist_node)
+ end
+ end
---- Calculate the length of the whitespace before (`l.kern_start`) and
--- after (`l.kern_stop`) the text.
-function cloze.fix_length(start, stop)
- local l = {}
- l.width = tex.sp(registry.get_value('width'))
- l.text_width = node.dimensions(start, stop)
- l.align = registry.get_value('align')
- if l.align == 'right' then
- l.kern_start = - l.text_width
- l.kern_stop = 0
- elseif l.align == 'center' then
- l.half = (l.width - l.text_width) / 2
- l.kern_start = - l.half - l.text_width
- l.kern_stop = l.half
- else
- l.kern_start = - l.width
- l.kern_stop = l.width - l.text_width
+ --- Search for a start marker.
+ --
+ -- @tparam node head_node The head of a node list.
+ -- @tparam node parent_node The parent node (hlist) of the head node.
+ local function search_start(head_node, parent_node)
+ while head_node do
+ if head_node.head then
+ search_start(head_node.head, head_node)
+ elseif registry.check_marker(head_node, 'basic', 'start') and
+ parent_node and
+ parent_node.id == node.id('hlist') then
+ -- Adds also a strut at the first position. It prepars the
+ -- hlist and makes it ready to build a cloze.
+ search_hlist(parent_node)
+ head_node, parent_node = search_stop(head_node, parent_node)
+ end
+ if head_node then
+ head_node = head_node.next
+ else
+ break
+ end
+ end
end
- return l.width, l.kern_start, l.kern_stop
+
+ search_start(head_node_input)
+ return head_node_input
end
---- The function `cloze.fix_make` generates a gap of fixed width.
---
--- __Node lists__
---
--- __Show text:__
---
--- <table>
--- <tbody>
--- <tr>
--- <td>`n.start`</td>
--- <td>`whatsit`</td>
--- <td>`user_definded`</td>
--- <td>`index`</td>
--- </tr>
--- <tr>
--- <td>`n.line`</td>
--- <td>`rule`</td>
--- <td></td>
--- <td>`l.width`</td>
--- </tr>
--- <tr>
--- <td>`n.kern_start`</td>
--- <td>`kern`</td>
--- <td>&amp; Depends on `align`</td>
--- <td></td>
--- </tr>
--- <tr>
--- <td>`n.color_text`</td>
--- <td>`whatsit`</td>
--- <td>`pdf_colorstack`</td>
--- <td>Text color</td>
--- </tr>
--- <tr>
--- <td></td>
--- <td>`glyphs`</td>
--- <td>&amp; Text to show</td>
--- <td></td>
--- </tr>
--- <tr>
--- <td>`n.color_reset`</td>
--- <td>`whatsit`</td>
--- <td>`pdf_colorstack`</td>
--- <td>Reset color</td>
--- </tr>
--- <tr>
--- <td>`n.kern_stop`</td>
--- <td>`kern`</td>
--- <td>&amp; Depends on `align`</td>
--- <td></td>
--- </tr>
--- <tr>
--- <td>`n.stop`</td>
--- <td>`whatsit`</td>
--- <td>`user_definded`</td>
--- <td>`index`</td>
--- </tr>
--- </tbody>
--- </table>
---
--- __Hide text:__
---
--- <table>
--- <thead>
--- <tr>
--- <th>`n.start`</th>
--- <th>`whatsit`</th>
--- <th>`user_definded`</th>
--- <th>`index`</th>
--- </tr>
--- </thead>
--- <tbody>
--- <tr>
--- <td>`n.line`</td>
--- <td>`rule`</td>
--- <td></td>
--- <td>`l.width`</td>
--- </tr>
--- <tr>
--- <td>`n.stop`</td>
--- <td>`whatsit`</td>
--- <td>`user_definded`</td>
--- <td>`index`</td>
--- </tr>
--- </tbody>
--- </table>
+--- The corresponding LaTeX command to this Lua function is `\clozefix`.
--
--- Make fixed size cloze.
---
--- @param start The node, where the gap begins
--- @param stop The node, where the gap ends
-function cloze.fix_make(start, stop)
- local l = {} -- length
- local n = {} -- node
- l.width, l.kern_start, l.kern_stop = cloze.fix_length(start, stop)
- n.line = nodex.insert_line(start, l.width)
- if registry.get_value_show() then
- nodex.insert_list(
- 'after',
- n.line,
- {
- create_kern_node(l.kern_start),
- nodex.create_color('text')
- }
- )
- nodex.insert_list(
- 'before',
- stop,
- {
- nodex.create_color('reset'),
- create_kern_node(l.kern_stop)
- },
- start
- )
- else
- n.line.next = stop.next
+-- @tparam node head_node_input The head of a node list.
+local function make_fix(head_node_input)
+
+ --- Calculate the length of the whitespace before (`kern_start_length`) and
+ -- after (`kern_stop_length`) the text.
+ local function calculate_length(start, stop)
+ local width, kern_start_length, kern_stop_length, text_width, half_length, align
+ width = tex.sp(registry.get_value('width'))
+ text_width = node.dimensions(start, stop)
+ align = registry.get_value('align')
+ if align == 'right' then
+ kern_start_length = - text_width
+ kern_stop_length = 0
+ elseif align == 'center' then
+ half_length = (width - text_width) / 2
+ kern_start_length = - half_length - text_width
+ kern_stop_length = half_length
+ else
+ kern_start_length = - width
+ kern_stop_length = width - text_width
+ end
+ return width, kern_start_length, kern_stop_length
end
- registry.remove_marker(start)
- registry.remove_marker(stop)
-end
---- Function to recurse the node list and search after marker.
---
--- @tparam node head_node The head of a node list.
-function cloze.fix_recursion(head_node)
- local n = {} -- node
- n.start, n.stop = false
- while head_node do
- if head_node.head then
- cloze.fix_recursion(head_node.head)
+ --- The function `make_single` generates a gap of fixed width.
+ --
+ -- __Node lists__
+ --
+ -- __Show text:__
+ --
+ -- <table>
+ -- <tbody>
+ -- <tr>
+ -- <td>`start_node`</td>
+ -- <td>`whatsit`</td>
+ -- <td>`user_definded`</td>
+ -- <td>`index`</td>
+ -- </tr>
+ -- <tr>
+ -- <td>`line_node`</td>
+ -- <td>`rule`</td>
+ -- <td></td>
+ -- <td>`width`</td>
+ -- </tr>
+ -- <tr>
+ -- <td>`kern_start_node`</td>
+ -- <td>`kern`</td>
+ -- <td>&amp; Depends on `align`</td>
+ -- <td></td>
+ -- </tr>
+ -- <tr>
+ -- <td>`color_text_node`</td>
+ -- <td>`whatsit`</td>
+ -- <td>`pdf_colorstack`</td>
+ -- <td>Text color</td>
+ -- </tr>
+ -- <tr>
+ -- <td></td>
+ -- <td>`glyphs`</td>
+ -- <td>&amp; Text to show</td>
+ -- <td></td>
+ -- </tr>
+ -- <tr>
+ -- <td>`color_reset_node`</td>
+ -- <td>`whatsit`</td>
+ -- <td>`pdf_colorstack`</td>
+ -- <td>Reset color</td>
+ -- </tr>
+ -- <tr>
+ -- <td>`kern_stop_node`</td>
+ -- <td>`kern`</td>
+ -- <td>&amp; Depends on `align`</td>
+ -- <td></td>
+ -- </tr>
+ -- <tr>
+ -- <td>`stop_node`</td>
+ -- <td>`whatsit`</td>
+ -- <td>`user_definded`</td>
+ -- <td>`index`</td>
+ -- </tr>
+ -- </tbody>
+ -- </table>
+ --
+ -- __Hide text:__
+ --
+ -- <table>
+ -- <thead>
+ -- <tr>
+ -- <th>`start_node`</th>
+ -- <th>`whatsit`</th>
+ -- <th>`user_definded`</th>
+ -- <th>`index`</th>
+ -- </tr>
+ -- </thead>
+ -- <tbody>
+ -- <tr>
+ -- <td>`line_node`</td>
+ -- <td>`rule`</td>
+ -- <td></td>
+ -- <td>`width`</td>
+ -- </tr>
+ -- <tr>
+ -- <td>`stop_node`</td>
+ -- <td>`whatsit`</td>
+ -- <td>`user_definded`</td>
+ -- <td>`index`</td>
+ -- </tr>
+ -- </tbody>
+ -- </table>
+ --
+ -- Make fixed size cloze.
+ --
+ -- @param start The node, where the gap begins
+ -- @param stop The node, where the gap ends
+ local function make_single(start, stop)
+ local width, kern_start_length, kern_stop_length, line_node
+ width, kern_start_length, kern_stop_length = calculate_length(start, stop)
+ line_node = nodex.insert_line(start, width)
+ if registry.get_value_show() then
+ nodex.insert_list(
+ 'after',
+ line_node,
+ {
+ create_kern_node(kern_start_length),
+ nodex.create_color('text')
+ }
+ )
+ nodex.insert_list(
+ 'before',
+ stop,
+ {
+ nodex.create_color('reset'),
+ create_kern_node(kern_stop_length)
+ },
+ start
+ )
else
- if not n.start then
- n.start = registry.get_marker(head_node, 'fix', 'start')
- end
- if not n.stop then
- n.stop = registry.get_marker(head_node, 'fix', 'stop')
- end
- if n.start and n.stop then
- cloze.fix_make(n.start, n.stop)
- n.start, n.stop = false
+ line_node.next = stop.next
+ end
+ registry.remove_marker(start)
+ registry.remove_marker(stop)
+ end
+
+ --- Function to recurse the node list and search after marker.
+ --
+ -- @tparam node head_node The head of a node list.
+ local function make_fix_recursion(head_node)
+ local start_node, stop_node = false, false
+ while head_node do
+ if head_node.head then
+ make_fix_recursion(head_node.head)
+ else
+ if not start_node then
+ start_node = registry.get_marker(head_node, 'fix', 'start')
+ end
+ if not stop_node then
+ stop_node = registry.get_marker(head_node, 'fix', 'stop')
+ end
+ if start_node and stop_node then
+ make_single(start_node, stop_node)
+ start_node, stop_node = false, false
+ end
end
+ head_node = head_node.next
end
- head_node = head_node.next
end
-end
---- The corresponding LaTeX command to this Lua function is `\clozefix`.
---
--- @tparam node head_node The head of a node list.
-function cloze.fix(head_node)
- cloze.fix_recursion(head_node)
- return head_node
+ make_fix_recursion(head_node_input)
+ return head_node_input
end
--- The corresponding LaTeX environment to this lua function is
@@ -822,7 +837,7 @@ end
-- <table>
-- <thead>
-- <tr>
--- <th>`n.strut`</th>
+-- <th>`strut_node`</th>
-- <th>`kern`</th>
-- <th></th>
-- <th>width = 0</th>
@@ -830,19 +845,19 @@ end
-- </thead>
-- <tbody>
-- <tr>
--- <td>`n.line`</td>
+-- <td>`line_node`</td>
-- <td>`rule`</td>
-- <td></td>
--- <td>`l.width` (Width from hlist)</td>
+-- <td>`width` (Width from hlist)</td>
-- </tr>
-- <tr>
--- <td>`n.kern`</td>
+-- <td>`kern_node`</td>
-- <td>`kern`</td>
-- <td></td>
--- <td>`-l.width`</td>
+-- <td>`-width`</td>
-- </tr>
-- <tr>
--- <td>`n.color_text`</td>
+-- <td>`color_text_node`</td>
-- <td>`whatsit`</td>
-- <td>`pdf_colorstack`</td>
-- <td>Text color</td>
@@ -854,13 +869,13 @@ end
-- <td>Text to show</td>
-- </tr>
-- <tr>
--- <td>`n.tail`</td>
+-- <td>`tail_node`</td>
-- <td>`glyph`</td>
-- <td></td>
-- <td>Last glyph in hlist</td>
-- </tr>
-- <tr>
--- <td>`n.color_reset`</td>
+-- <td>`color_reset_node`</td>
-- <td>`whatsit`</td>
-- <td>`pdf_colorstack`</td>
-- <td>Reset color</td>
@@ -873,7 +888,7 @@ end
-- <table>
-- <thead>
-- <tr>
--- <th>`n.strut`</th>
+-- <th>`strut_node`</th>
-- <th>`kern`</th>
-- <th></th>
-- <th>width = 0</th>
@@ -881,31 +896,30 @@ end
-- </thead>
-- <tbody>
-- <tr>
--- <td>`n.line`</td>
+-- <td>`line_node`</td>
-- <td>`rule`</td>
-- <td></td>
--- <td>`l.width` (Width from hlist)</td>
+-- <td>`width` (Width from hlist)</td>
-- </tr>
-- </tbody>
-- </table>
--
-- @tparam node head_node The head of a node list.
-function cloze.par(head_node)
- local l = {} -- length
- local n = {} -- node
- for hlist in node.traverse_id(node.id('hlist'), head_node) do
- for whatsit in node.traverse_id(node.id('whatsit'), hlist.head) do
+local function make_par(head_node)
+ local strut_node, line_node, width
+ for hlist_node in node.traverse_id(node.id('hlist'), head_node) do
+ for whatsit in node.traverse_id(node.id('whatsit'), hlist_node.head) do
registry.get_marker(whatsit, 'par', 'start')
end
- l.width = hlist.width
- hlist, n.strut, n.head = insert_strut_into_hlist(hlist)
- n.line = nodex.insert_line(n.strut, l.width)
+ width = hlist_node.width
+ hlist_node, strut_node, _ = insert_strut_into_hlist(hlist_node)
+ line_node = nodex.insert_line(strut_node, width)
if registry.get_value_show() then
nodex.insert_list(
'after',
- n.line,
+ line_node,
{
- create_kern_node(-l.width),
+ create_kern_node(-width),
nodex.create_color('text')
}
)
@@ -915,53 +929,82 @@ function cloze.par(head_node)
{nodex.create_color('reset')}
)
else
- n.line.next = nil
+ line_node.next = nil
end
end
return head_node
end
+---
+-- @tparam string callback_name The name of a callback
+-- @tparam function func A function to register for the callback
+-- @tparam string description Only used in LuaLatex
+local function register_callback(callback_name, func, description)
+ if luatexbase then
+ luatexbase.add_to_callback(
+ callback_name,
+ func,
+ description
+ )
+ else
+ callback.register(callback_name, func)
+ end
+end
+
+---
+-- @tparam string callback_name The name of a callback
+-- @tparam string description Only used in LuaLatex
+local function unregister_callback(callback_name, description)
+ if luatexbase then
+ luatexbase.remove_from_callback(
+ callback_name,
+ description
+ )
+ else
+ callback.register(callback_name, nil)
+ end
+end
+
--- Basic module functions.
-- The `base` table contains functions which are published to the
-- `cloze.sty` file.
-- @section base
---- This function registers the functions `cloze.par`, `cloze.basic` and
--- `cloze.fix` the Lua callbacks.
+--- This function registers the functions `make_par`, `make_basic` and
+-- `make_fix` the Lua callbacks.
--
--- `cloze.par` and `cloze.basic` are registered to the callback
--- `post_linebreak_filter` and `cloze.fix` to the callback
+-- `make_par` and `make_basic` are registered to the callback
+-- `post_linebreak_filter` and `make_fix` to the callback
-- `pre_linebreak_filter`. The argument `mode` accepts the string values
-- `basic`, `fix` and `par`. A special treatment is needed for clozes in
-- display math mode. The `post_linebreak_filter` is not called on
-- display math formulas. I’m not sure if the `pre_output_filter` is the
-- right choice to capture the display math formulas.
function base.register(mode)
- local basic
if mode == 'par' then
- luatexbase.add_to_callback(
+ register_callback(
'post_linebreak_filter',
- cloze.par,
+ make_par,
mode
)
return true
end
if not base.is_registered[mode] then
if mode == 'basic' then
- luatexbase.add_to_callback(
+ register_callback(
'post_linebreak_filter',
- cloze.basic,
+ make_basic,
mode
)
- luatexbase.add_to_callback(
+ register_callback(
'pre_output_filter',
- cloze.basic,
+ make_basic,
mode
)
elseif mode == 'fix' then
- luatexbase.add_to_callback(
+ register_callback(
'pre_linebreak_filter',
- cloze.fix,
+ make_fix,
mode
)
else
@@ -978,12 +1021,12 @@ end
-- `basic`, `fix` and `par`.
function base.unregister(mode)
if mode == 'basic' then
- luatexbase.remove_from_callback('post_linebreak_filter', mode)
- luatexbase.remove_from_callback('pre_output_filter', mode)
+ unregister_callback('post_linebreak_filter', mode)
+ unregister_callback('pre_output_filter', mode)
elseif mode == 'fix' then
- luatexbase.remove_from_callback('pre_linebreak_filter', mode)
+ unregister_callback('pre_linebreak_filter', mode)
else
- luatexbase.remove_from_callback('post_linebreak_filter', mode)
+ unregister_callback('post_linebreak_filter', mode)
end
end
diff --git a/macros/luatex/generic/cloze/cloze.pdf b/macros/luatex/generic/cloze/cloze.pdf
new file mode 100644
index 0000000000..5901e8dd85
--- /dev/null
+++ b/macros/luatex/generic/cloze/cloze.pdf
Binary files differ
diff --git a/macros/luatex/latex/cloze/cloze.dtx b/macros/luatex/latex/cloze/cloze.dtx
deleted file mode 100644
index f2ec1be8c5..0000000000
--- a/macros/luatex/latex/cloze/cloze.dtx
+++ /dev/null
@@ -1,1929 +0,0 @@
-% \iffalse meta-comment
-%
-% Copyright (C) 2015-2020 by Josef Friedrich <josef@friedrich.rocks>
-% ----------------------------------------------------------------------
-% 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 Josef Friedrich.
-%
-% This work consists of the files cloze.dtx and cloze.ins
-% and the derived filebase cloze.sty and cloze.lua.
-%
-% \fi
-%
-% \iffalse
-%<*driver>
-\ProvidesFile{cloze.dtx}
-%</driver>
-%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{cloze}
-%<*package>
- [2020/05/27 v1.5 Package to typeset cloze worksheets or cloze tests]
-%</package>
-%<*driver>
-\documentclass{ltxdoc}
-\usepackage[show]{cloze}
-\usepackage{graphicx}
-\usepackage{paralist}
-\usepackage{titlesec}
-\usepackage{mdframed}
-\titleformat{\paragraph}[hang]{%
- \normalfont\normalsize\bfseries%
- }{\theparagraph}{1em}{}
-\titleformat{\subparagraph}[hang]{%
- \normalfont\small\bfseries%
- }{\thesubparagraph}{1em}{}
- \titlespacing*{\subparagraph}{0pt}{*1}{0pt}
-
-\usepackage[
- colorlinks=true,
- linkcolor=red,
- filecolor=red,
- urlcolor=red,
-]{hyperref}
-
-\usepackage{minted}
-\usemintedstyle{colorful}
-\BeforeBeginEnvironment{minted}{\begin{mdframed}[backgroundcolor=gray!3]}
-\AfterEndEnvironment{minted}{\end{mdframed}}
-\setminted{
- breaklines=true,
- fontsize=\footnotesize,
-}
-
-
-\MakeShortVerb{\|}
-
-\setlength{\fboxrule}{0.2pt}
-\setlength{\fboxsep}{4pt}
-
-\makeatletter
-\newcommand{\@minipagerestore}{\setlength{\parindent}{10pt}}
-\makeatother
-
-\newmdenv{example}
-\definecolor{graybackground}{gray}{0.97}
-\surroundwithmdframed[backgroundcolor=graybackground]{verbatim}
-
-\newcommand{\getdefaults}[1]{%
- \directlua{tex.print(cloze.get_defaults('#1'))}%
-}
-
-\newcommand{\expdesc}[1]{(|#1|)}
-
-\newcommand{\desc}[1]{%
- \hfill%
- \expdesc{#1}%
- \par%
-}
-
-\def\tt#1{\texttt{#1}}
-
-\def\secref#1{(\rightarrow\ \ref{#1})}
-
-\newcommand{\option}[2]{\tt{[#1=}\meta{#2}\tt{]}}
-\newcommand{\clozeluafunction}[1]{
- \marginpar{%
- \raggedleft%
- \MacroFont%
- \tt{%
- \scantokens{\catcode`\_=12\relax#1}%
- }%
- }%
-}
-
-\newcommand{\nodelisthfont}{\bfseries\sffamily}
-
-\newcommand{\nodelistheader}{
- \hline
- \nodelisthfont Variable name &
- \nodelisthfont Node type &
- \nodelisthfont Node subtype &
- \nodelisthfont Parameter \\
- \hline
-}
-
-\newenvironment{nodelist}{
- \noindent
- \begingroup
- \footnotesize
- \begin{tabular}{llll}
- \nodelistheader
-}{
- \hline
- \end{tabular}
- \endgroup
-}
-
-\EnableCrossrefs
-\CodelineIndex
-\RecordChanges
-\begin{document}
-
-\providecommand*{\url}{\texttt}
-\GetFileInfo{cloze.dtx}
-\title{The \cloze{cloze} package%
- \thanks{Many thanks to Robert-Michael Huber for his advice
-and to Paul Isambert for his article \emph{"Three things you can do with
-Lua\TeX{} that would be extremely painful otherwise"} in TUGboat, Volume
-31 (2010), No. 3. This article helped a lot to write this package.}%
-}
-\author{%
- Josef Friedrich\\%
- \url{josef@friedrich.rocks}\\%
- \href{https://github.com/Josef-Friedrich/cloze}{github.com/Josef-Friedrich/cloze}%
-}
-\date{\fileversion~from \filedate}
-
-\maketitle\vfill
-
-\pagebreak
-
-\setcounter{secnumdepth}{5}
-\setcounter{tocdepth}{5}
-\tableofcontents
-
-%-----------------------------------------------------------------------
-% Introduction
-%-----------------------------------------------------------------------
-
-\pagebreak
-\section{Introduction}
-
-\emph{cloze} is a \LaTeX{} package to generate cloze texts. It uses
-the capabilities of the modern \TeX{} engine \emph{Lua\TeX}. Therefore,
-you must use Lua\LaTeX{} to create documents containing gaps.
-
-\begin{verbatim}
-lualatex cloze-text.tex
-\end{verbatim}
-
-The main feature of the package is that the formatting doesn't change
-when using the |hide| and |show| \secref{sec:option-hide} options.
-
-\newcommand{\clozelorem}{%
-Lorem ipsum \cloze{dolor sit} amet, consectetur \cloze{adipisicing}
-elit, sed do eiusmod tempor incididunt ut labore et \cloze{dolore magna}
-aliqua. Ut enim ad minim veniam, quis nostrud \cloze{exercitation}
-ullamco laboris nisi ut \cloze{aliquip} ex ea commodo consequat.%
-}
-
-\begin{example}
-\clozelorem
-\end{example}
-
-\clozeset{hide}
-
-The command |\clozeset{hide}| only shows gaps. When you put both texts
-on top of each other you will see that they perfectly match.
-
-\begin{example}
-\clozelorem
-\end{example}
-
-\clozeset{show}
-
-%-----------------------------------------------------------------------
-% Usage
-%-----------------------------------------------------------------------
-
-\section{Usage}
-
-There are the commands
-\cmd{\cloze},
-\cmd{\clozefix},
-\cmd{\clozefil},
-\cmd{\clozenol},
-\cmd{\clozestrike} and the environments
-|clozepar| and
-|clozebox|
-to generate cloze texts.
-
-%%
-% \cloze
-%%
-
-\subsection{The commands and environments}
-
-\subsubsection{\cmd{\cloze}}
-\label{sec:command-cloze}
-
-\DescribeMacro{\cloze} \cmd{\cloze}\oarg{options}\marg{some text}: The
-command \cmd{\cloze} is similar to a command that offers the possibility
-to underline the texts. \cmd{\cloze} does not prevent line breaks. The
-width of a gap depends on the number of letters and the font used.
-The only option which affects the widths of a gap is the option
-|margin| \secref{sec:option-margin}.
-
-\begin{example}
-Lorem ipsum \cloze{dolor} sit amet, \cloze{consectetur} adipisicing
-elit, sed do eiusmod tempor incididunt ut labore et dolore
-\cloze{magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
-ullamco laboris nisi} ut aliquip ex ea commodo consequat.
-\end{example}
-
-\noindent It is possible to convert a complete paragraph into a `gap'.
-But don't forget: There is a special environment for this: \tt{clozepar}
-\secref{sec:command-clozepar}.
-
-\begin{example}
-\cloze{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
-eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
-minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
-ex ea commodo consequat.}
-\end{example}
-
-\noindent The command \cmd{\cloze} doesn't change the behavior of the
-hyphenation. Let's try some long German words:
-
-\begin{example}
-es
-\cloze{Te\-le\-kom\-mu\-ni\-ka\-tions\-ü\-ber\-wach\-ung}
-geht
-\cloze{Un\-ter\-neh\-mens\-steu\-er\-fort\-ent\-wick\-lungs\-ge\-setz}
-\cloze{Ab\-teil\-ungs\-lei\-ter\-in}
-\cloze{Ober\-kom\-mi\-sar\-in}
-auch
-\cloze{Fil\-lial\-lei\-ter\-in}
-kurz
-\cloze{Ober\-kom\-mi\-sar\-in}
-\cloze{Un\-ter\-neh\-mens\-steu\-er\-fort\-ent\-wick\-lungs\-ge\-setz}
-\cloze{Fil\-lial\-lei\-ter\-in}
-\cloze{Metz\-ger\-mei\-ster\-in}
-in
-\cloze{Ab\-teil\-ungs\-lei\-ter\-in}
-der
-\cloze{Ober\-kom\-mi\-sar\-in}
-\cloze{Hoch\-lei\-stungs\-flüs\-sig\-keits\-chro\-ma\-to\-gra\-phie}
-\cloze{Fil\-lial\-lei\-ter\-in}
-Kürze
-\cloze{Un\-ter\-neh\-mens\-steu\-er\-fort\-ent\-wick\-lungs\-ge\-setz}
-\cloze{Metz\-ger\-mei\-ster\-in}
-liegt
-\cloze{Ab\-teil\-ungs\-lei\-ter\-in}
-die
-\cloze{Metz\-ger\-mei\-ster\-in}
-\cloze{Ab\-teil\-ungs\-lei\-ter\-in}
-Würze
-\cloze{Ober\-kom\-mi\-sar\-in}
-\end{example}
-
-%%
-% \clozesetfont
-%%
-
-\subsubsection{\cmd{\clozesetfont}}
-\label{sec:command-clozesetfont}
-\label{sec:command-clozefont}
-
-\DescribeMacro{\clozesetfont}
-The gap font can be changed by using the command
-\cmd{\clozesetfont}. \tt{\string\cloze\-set\-font} redefines the command
-\cmd{\clozefont} which contains the font definition.
-Thus, the command \tt{\string\clozesetfont\string{\string\Large\string}}
-has the same effect as
-\tt{\string\re\-new\-com\-mand\string{\string\cloze\-font\string}%
-\string{\string\Large\string}}.
-
-\clozesetfont{\Large}
-
-\begin{example}
-Excepteur \cloze{sint} occaecat \cloze{cupidatat} non proident.
-\end{example}
-
-\noindent Please do not put any color definitions in
-\cmd{\clozesetfont}, as it won't work. Use the option
-|textcolor| instead \secref{sec:option-textcolor}.
-
-|\clozesetfont{\ttfamily\normalsize}| changes the gap text for example
-into a normal sized typewriter font.
-
-\clozesetfont{\ttfamily\normalsize}
-
-\begin{example}
-Excepteur \cloze{sint} occaecat \cloze{cupidatat} non proident.
-\end{example}
-
-\clozesetfont{\itshape}
-
-%%
-% \clozefix
-%%
-
-\subsubsection{\cmd{\clozefix}}
-\label{sec:command-clozefix}
-
-\DescribeMacro{\clozefix} \cmd{\clozefix}\oarg{options}\marg{some text}:
-The command \cmd{\clozefix} creates gaps with a fixed width. The
-clozes are default concering the width \tt{\getdefaults{width}}.
-
-\begin{example}
-\noindent Lorem ipsum dolor sit amet:
-\begin{compactenum}
-\item \clozefix[width=5cm]{consectetur}
-\item \clozefix[width=5cm]{adipisicing}
-\item \clozefix[width=5cm]{elit}
-\end{compactenum}
-sed do eiusmod.
-\end{example}
-
-Gaps with a fixed width are much harder to solve.
-
-\begin{example}
-Lorem ipsum dolor \clozefix[align=center,width=3cm]{sit} amet,
-\clozefix[align=center,width=3cm]{consectetur} adipisicing elit, sed do
-eiusmod tempor incididunt \clozefix[align=center,width=3cm]{ut} labore
-et dolore magna aliqua.
-\end{example}
-
-Using the option |align| you can make nice tabulars like this:
-
-\begin{example}
-\begin{tabular}{p{5cm}p{4cm}}
-\raggedleft Composer & Life span \\
-\clozefix[width=5cm,align=right]{Joseph Haydn} & \clozefix{1723-1809} \\
-\clozefix[width=5cm,align=right]{Wolfgang Amadeus Mozart} & \clozefix{1756-1791} \\
-\clozefix[width=5cm,align=right]{Ludwig van Beethoven} & \clozefix{1770-1827} \\
-\end{tabular}
-\end{example}
-
-%%
-% \clozenol
-%%
-
-\subsubsection{\cmd{\clozenol}}
-\label{sec:command-clozenol}
-\DescribeMacro{\clozenol} \cmd{\clozenol}\oarg{options}\marg{some text}:
-The macro name |clozenol| stands for \emph{“cloze no line”}. As the
-the name suggests this macro typesets cloze texts without a line.
-
-\begin{minted}{latex}
-Lorem \clozenol{ipsum dolor} sit amet.
-\end{minted}
-
-\begin{example}
-Lorem \clozenol{ipsum dolor} sit amet.
-\end{example}
-
-\begin{minted}{latex}
-Lorem \clozenol[textcolor=green]{ipsum dolor} sit amet.
-\end{minted}
-
-\begin{example}
-Lorem \clozenol[textcolor=green]{ipsum dolor} sit amet.
-\end{example}
-
-%%
-% \clozefil
-%%
-
-\subsubsection{\cmd{\clozefil}}
-\label{sec:command-clozefil}
-
-\DescribeMacro{\clozefil} \cmd{\clozefil}\oarg{options}\marg{some text}:
-The name of the command is inspired by \cmd{\hfil}, \cmd{\hfill}, and
-\cmd{\hfilll}. Only \cmd{\clozefil} fills out all available horizontal
-spaces with a line.
-
-\begin{example}
-Lorem ipsum dolor sit amet, \clozefil{consectetur adipisicing elit, sed
-do eiusmod.}
-
-Ut enim \clozefil{ad minim veniam} exercitation.
-\end{example}
-
-%%
-% \clozeextend
-%%
-
-\subsubsection{\cmd{\clozeextend}}
-\label{sec:command-clozeextend}
-
-\DescribeMacro{\clozeextend} \cmd{\clozeextend}\oarg{spaces}:
-The command |\clozeextend| adds some invisible placeholders to extend
-some cloze texts with blank space.
-
-\begin{minted}{latex}
-\begin{itemize}
-\item \clozefil{Lorem ipsum dolor sit amet, consectetur adipisicing
-elit, sed do eiusmod tempor incididunt ut labore et dolore magna
-aliqua.}
-\item \clozefil{Ut enim ad minim veniam \clozeextend[20]}
-\item \clozefil{quis nostrud \clozeextend[20]}
-\end{itemize}
-\end{minted}
-
-\begin{example}
-\begin{itemize}
-\item \clozefil{Lorem ipsum dolor sit amet, consectetur adipisicing
-elit, sed do eiusmod tempor incididunt ut labore et dolore magna
-aliqua.}
-\item \clozefil{Ut enim ad minim veniam \clozeextend[20]}
-\item \clozefil{quis nostrud \clozeextend[20]}
-\end{itemize}
-\end{example}
-
-%%
-% clozepar
-%%
-
-\subsubsection{\tt{clozepar}}
-\label{sec:command-clozepar}
-
-\DescribeEnv{clozepar} |\begin{clozepar}|\oarg{options} \dots
-\textit{some text} \dots |\end{clozepar}|: The environment \tt{clozepar}
-transforms a complete paragraph into a cloze text. The options |align|,
-|margin| and |width| have no effect on this environment.
-
-\begin{example}
-Lorem ipsum dolor sit amet, consectetur adipisicing elit ullamco laboris
-nisi.
-
-\begin{clozepar}
-Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
-ut aliquip ex ea commodo consequat. Duis aute irure dolor in
-reprehenderit in voluptate velit esse cillum.
-\end{clozepar}
-
-Excepteur sint occaecat cupidatat non proident.
-\end{example}
-
-%%
-% clozebox
-%%
-
-\subsubsection{\tt{clozebox}}
-\label{sec:command-clozebox}
-
-\DescribeEnv{clozebox} |\begin{clozebox}|*\oarg{options} \dots
-\textit{some text} \dots |\end{clozebox}|: The environment \tt{clozebox}
-surrounds a text with a box. The starred version omits the line
-around the box. Use the options |boxwidth| and |boxheight| to specify
-the dimensions of the box. By default the width of the box is
-|\linewidth|.
-
-\begin{minted}{latex}
-\begin{clozebox}
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{minted}
-
-\bigskip
-\noindent
-|\clozehide|
-\clozehide
-\bigskip
-
-\begin{center}
-\begin{clozebox}[boxwidth=8cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{center}
-
-\bigskip
-\noindent
-|\clozeshow|
-\clozeshow
-\bigskip
-
-\begin{center}
-\begin{clozebox}[boxwidth=8cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{center}
-
-\paragraph{Option boxwidth}
-\label{sec:command-clozebox-boxwidth}
-See the documentation about the option \secref{sec:option-boxwidth}.
-
-\begin{minted}{latex}
-\begin{clozebox}[boxwidth=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{minted}
-
-\begin{center}
-\begin{clozebox}[boxwidth=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{center}
-
-\paragraph{Option boxheight}
-\label{sec:command-clozebox-boxheight}
-See the documentation about the option \secref{sec:option-boxheight}.
-
-\begin{minted}{latex}
-\begin{clozebox}[boxwidth=5cm,boxheight=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{minted}
-
-\begin{center}
-\begin{clozebox}[boxwidth=5cm,boxheight=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{center}
-
-\paragraph{starred}
-
-% starred
-\begin{minted}{latex}
-\begin{clozebox}*[boxwidth=5cm,boxheight=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{minted}
-
-\begin{center}
-\begin{clozebox}*[boxwidth=5cm,boxheight=5cm]
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
-tempor incididunt ut labore et dolore magna aliqua.
-\end{clozebox}
-\end{center}
-
-%%
-% clozespace
-%%
-
-\subsubsection{\tt{clozespace}}
-\label{sec:command-clozespace}
-
-\DescribeEnv{clozespace} |\begin{clozespace}|\oarg{options} \dots
-\textit{some text} \dots |\end{clozespace}|
-
-\begin{minted}{latex}
-\begin{clozespace}[spacing=2]
-\clozesetfont{\ttfamily\Huge}
-Lorem \cloze{ipsum} dolor sit \cloze{amet}, consectetur adipisicing
-elit, sed do eiusmod tempor incididunt ut labore et dolore magna
-aliqua. Ut enim ad minim veniam, quis \cloze{nostrud}
-exercitation ullamco \cloze{laboris} nisi ut aliquip ex ea commodo
-consequat.
-\end{clozespace}
-\end{minted}
-
-\begin{example}
-\begin{clozespace}[spacing=2]
-\clozesetfont{\ttfamily\Huge}
-Lorem \cloze{ipsum} dolor sit \cloze{amet}, consectetur adipisicing
-elit, sed do eiusmod tempor incididunt ut labore et dolore magna
-aliqua. Ut enim ad minim veniam, quis \cloze{nostrud}
-exercitation ullamco \cloze{laboris} nisi ut aliquip ex ea commodo
-consequat.
-\vspace{-0.8cm}
-\end{clozespace}
-\end{example}
-
-%%
-% \clozeline
-%%
-
-\subsubsection{\cmd{\clozeline}}
-\label{sec:command-clozeline}
-
-\DescribeMacro{\clozeline}
-\cmd{\clozeline}\oarg{options}:
-To create a cloze line of a certain width, use the command
-\cmd{\clozeline}. The default width of the line is
-\tt{\getdefaults{width}}. In combination with the other cloze commands
-you can create for example an irregular alignment of the cloze text.
-
-\begin{minted}{latex}
-Ut enim ad
-\clozeline[width=1cm]\cloze{minim}\clozeline[width=3cm]
-minim veniam
-\end{minted}
-
-\begin{example}
-Ut enim ad \clozeline[width=1cm]\cloze{minim}\clozeline[width=3cm] minim
-veniam,
-\end{example}
-
-%%
-% \clozelinefil
-%%
-
-\subsubsection{\cmd{\clozelinefil}}
-\label{sec:command-clozelinefil}
-
-\DescribeMacro{\clozelinefil}
-\cmd{\clozelinefil}\oarg{options}:
-This command \cmd{\clozelinefil} fills the
-complete available horizontal space with a line. Moreover,
-\cmd{\clozelinefil} was used to create \cmd{\clozefil}.
-
-\begin{example}
-Lorem\clozelinefil
-\end{example}
-
-%%
-% \clozestrike
-%%
-
-\subsubsection{\cmd{\clozestrike}}
-\label{sec:command-clozelinefil}
-
-\DescribeMacro{\clozestrike}
-\cmd{\clozestrike}\oarg{options}\marg{wrong text}\marg{correct text}
-
-\begin{minted}{latex}
-Lorem \clozestrike{ipsum}{dolor} sit amet.
-\end{minted}
-
-\begin{example}
-Lorem \clozestrike{ipsum}{dolor} sit amet.
-\end{example}
-
-\begin{minted}{latex}
-Lorem \clozestrike[textcolor=red]{ipsum}{dolor} sit amet.
-\end{minted}
-
-\begin{example}
-Lorem \clozestrike[textcolor=red]{ipsum}{dolor} sit amet.
-\end{example}
-
-\begin{example}
-\begin{clozespace}
-invidunt ut \clozestrike{labore}{et dolore magna aliquyam erat}, sed
-diam voluptua. At \clozestrike{vero eos}{et accusam et justo} duo
-dolores et ea \clozestrike{rebum. Stet}{clita kasd gubergren}, no sea
-takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
-\clozestrike{dolor sit amet, consetetur }{sadipscing elitr, sed diam}
-nonumy eirmod tempor invidunt ut labore et dolore magna
-aliquyam erat, \clozestrike{sed diam voluptua}{At vero}.
-\end{clozespace}
-\end{example}
-
-\begin{example}
-\clozehide
-\begin{clozespace}
-invidunt ut \clozestrike{labore}{et dolore magna aliquyam erat}, sed
-diam voluptua. At \clozestrike{vero eos}{et accusam et justo} duo
-dolores et ea \clozestrike{rebum. Stet}{clita kasd gubergren}, no sea
-takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
-\clozestrike{dolor sit amet, consetetur }{sadipscing elitr, sed diam}
-nonumy eirmod tempor invidunt ut labore et dolore magna
-aliquyam erat, \clozestrike{sed diam voluptua}{At vero}.
-\end{clozespace}
-\clozeshow
-\end{example}
-
-%-----------------------------------------------------------------------
-% Options
-%-----------------------------------------------------------------------
-
-\subsection{The options}
-
-%%
-% Local and global options
-%%
-
-\subsubsection{Local and global options}
-
-The \emph{cloze} package distinguishs between \emph{local} and
-\emph{global} options. Besides the possiblity to set \emph{global}
-options in the \cmd{\usepackage}\oarg{global options}\marg{cloze}
-declaration, the cloze package offers a special command to set
-\emph{global} options:
-\cmd{\clozeset}\marg{global options}
-
-%%
-% \clozeset
-%%
-
-\subsubsection{\cmd{\clozeset}}
-\label{sec:command-clozeset}
-
-\DescribeMacro{\clozeset}
-\cmd{\clozeset}\marg{global options}: The command can set \emph{global}
-options for each paragraph.
-
-\begin{minted}{latex}
-\clozeset{textcolor=red} Lorem \cloze{ipsum} dolor \par
-\clozeset{textcolor=green} Lorem \cloze{ipsum} dolor
-\end{minted}
-
-\begin{example}
-\clozeset{textcolor=red} Lorem \cloze{ipsum} dolor \par
-\clozeset{textcolor=green} Lorem \cloze{ipsum} dolor
-\end{example}
-
-\noindent \cmd{\clozeset} does not change the options within a
-paragraph. As you can see in the example below the last \cmd{\clozeset}
-applies the color green for both gaps.
-
-\begin{minted}{latex}
-\clozeset{textcolor=red} Lorem \cloze{ipsum} dolor
-\clozeset{textcolor=green} Lorem \cloze{ipsum} dolor
-\end{minted}
-
-\begin{example}
-\clozeset{textcolor=red} Lorem \cloze{ipsum} dolor
-\clozeset{textcolor=green} Lorem \cloze{ipsum} dolor
-\end{example}
-
-\clozereset
-
-%%
-% \clozereset
-%%
-
-\subsubsection{\cmd{\clozereset}}
-\label{sec:command-clozereset}
-
-\DescribeMacro{\clozereset}
-\cmd{\clozereset}: The command resets all \emph{global} options to the
-default values. It has no effect on the \emph{local} options.
-
-\begin{minted}{latex}
-\clozeset{
- thickness=3mm,
- linecolor=yellow,
- textcolor=magenta,
- margin=-2pt
-}
-\end{minted}
-
-\clozeset{thickness=3mm,linecolor=yellow,textcolor=magenta,margin=-2pt}
-
-\begin{example}
-Very \cloze{silly} global \cloze{options}.
-\end{example}
-
-\begin{minted}{latex}
-\clozereset
-\end{minted}
-\clozereset
-
-\begin{example}
-\cloze{Relax!} We can reset \cloze{those} options.
-\end{example}
-
-%%
-% \clozereset
-%%
-
-\subsubsection{\cmd{\clozeshow} and \cmd{\clozehide}}
-\label{sec:command-clozeshow}
-\label{sec:command-clozehide}
-
-\DescribeMacro{\clozeshow} \DescribeMacro{\clozehide}
-\cmd{\clozeshow} and \cmd{\clozehide}: This commands are shortcuts for
-\cmd{\clozeset}\marg{show} and \cmd{\clozeset}\marg{hide}.
-
-\begin{minted}{latex}
-\clozehide
-\end{minted}
-\clozehide
-
-\begin{example}
-Lorem \cloze{ipsum dolor sit} amet, consectetur \cloze{adipisicing}
-elit.
-\end{example}
-
-\begin{minted}{latex}
-\clozeshow
-\end{minted}
-\clozeshow
-
-\begin{example}
-Lorem \cloze{ipsum dolor sit} amet, consectetur \cloze{adipisicing}
-elit.
-\end{example}
-
-%%
-% align
-%%
-
-\subsubsection{\tt{align}}
-\label{sec:option-align}
-
-\option{align}{left/center/right}:
-Only the macro \cmd{\clozefix} \secref{sec:command-clozefix} takes the
-option \tt{align} into account. Possible values are \tt{left},
-\tt{center} and \tt{right}. This option only makes sense, if the width
-of the line is larger than the width of the text.
-
-\newcommand{\optionsalign}[1]{%
- \noindent%
- \clozefix[align=#1,width=8cm]{Lorem ipsum}%
- \desc{#1}%
-}
-
-\begin{example}
-\optionsalign{left}
-\optionsalign{center}
-\optionsalign{right}
-\end{example}
-
-%%
-% boxheight
-%%
-
-\subsubsection{\tt{boxheight}}
-\label{sec:option-boxheight}
-
-|boxheight| specifies the height of a cloze box. This option has only
-an effect on the environment |clozebox| \secref{sec:command-clozebox}.
-An example can be found in the section about the environment
-\secref{sec:command-clozebox-boxheight}.
-
-%%
-% boxwidth
-%%
-
-\subsubsection{\tt{boxwidth}}
-\label{sec:option-boxwidth}
-
-|boxwidth| specifies the width of a cloze box. This option has only
-an effect on the environment |clozebox| \secref{sec:command-clozebox}.
-An example can be found in the section about the environment
-\secref{sec:command-clozebox-boxwidth}.
-
-%%
-% distance
-%%
-
-\subsubsection{\tt{distance}}
-\label{sec:option-distance}
-
-\option{distance}{dimen}:
-The option |distance| specifies the spacing between the baseline of the
-text and the gap line. The larger the dimension of the option
-|distance|, the more moves the line down. Negative values cause the line
-to appear above the baseline. The default value is
-\tt{\getdefaults{distance}}.
-
-\newcommand{\optiondistance}[1]{%
- \noindent%
- \clozefil[distance=#1]{Lorem ipsum dolor sit amet.}
- \expdesc{#1}
- \par%
-}
-
-\begin{example}
-\optiondistance{\getdefaults{distance}}
-\optiondistance{3pt}
-\optiondistance{-3pt}
-\end{example}
-
-%%
-% hide and show
-%%
-
-\subsubsection{\tt{hide} and \tt{show}}
-\label{sec:option-hide}
-\label{sec:option-show}
-
-\tt{[hide]} and \tt{[show]}:
-By default the cloze text is displayed. Use the option |hide| to remove
-the cloze text from the output. If you accidentally specify both
-options -- |hide| and |show| -- the last option "wins".
-
-\newcommand{\optionshow}[1]{%
- \noindent%
- Lorem ipsum \cloze[#1]{dolor sit amet}, consectetur
- \cloze[#1]{adipisicing} elit.%
- \desc{#1}%
-}
-
-\begin{example}
-\optionshow{hide}
-\optionshow{show}
-\optionshow{show,hide}
-\optionshow{hide,show}
-\end{example}
-
-%%
-% linecolor and textcolor
-%%
-
-\subsubsection{\tt{linecolor} and \tt{textcolor}}
-\label{sec:option-linecolor}
-\label{sec:option-textcolor}
-
-\option{linecolor}{color name} and
-\option{textcolor}{color name}:
-Values for both color options are color names used by the xcolor
-package. To define your own color use the following command:
-
-\begin{minted}{latex}
-\definecolor{myclozecolor}{rgb}{0.1,0.4,0.6}
-\cloze[textcolor=myclozecolor]{Lorem ipsum}
-\end{minted}
-\definecolor{myclozecolor}{rgb}{0.1,0.4,0.6}
-
-\newcommand{\optioncolor}[2]{%
- \noindent%
- \clozefil[#1=#2]{Lorem ipsum dolor sit amet, consectetur} %
- \expdesc{#2}%
- \par%
-}
-
-\begin{example}
-\optioncolor{textcolor}{myclozecolor}
-\optioncolor{textcolor}{red}
-\optioncolor{textcolor}{green}
-\end{example}
-
-\noindent You can use the same color names to colorize the cloze lines.
-
-\begin{example}
-\optioncolor{linecolor}{myclozecolor}
-\optioncolor{linecolor}{red}
-\optioncolor{linecolor}{green}
-\end{example}
-
-\noindent
-And now hide the clozes:
-
-\clozehide
-\begin{example}
-\optioncolor{linecolor}{myclozecolor}
-\optioncolor{linecolor}{red}
-\optioncolor{linecolor}{green}
-\end{example}
-\clozeshow
-
-%%
-% margin
-%%
-
-\subsubsection{\tt{margin}}
-\label{sec:option-margin}
-
-\option{margin}{dimen}:
-The option |margin| indicates how far the line sticks up from the text.
-The option can be used with the commands \cmd{\cloze}, \cmd{\clozefix}
-and \cmd{\clozefil}. The default value of the option is
-\tt{\getdefaults{margin}}.
-
-\newcommand{\optionmargin}[1]{%
- \noindent%
- Lorem ipsum \cloze[margin=#1]{dolor} sit amet.%
- \desc{#1}%
-}
-
-\begin{example}
-\optionmargin{0pt}
-\optionmargin{5mm}
-\optionmargin{1cm}
-\optionmargin{6em}
-\optionmargin{-4pt}
-\end{example}
-
-% Folgt ein Satzzeichen direkt auf eine Lücke, so findet der
-% Zeilenumbruch erst nach dem Satzzeichen statt. Auch ein noch so großer
-% Wert für |margin| beeinflusst dieses Verhalten nicht.
-\noindent Is a punctation mark placed directly after a gap, then the
-line breaks after this punctation mark. Even the most large value of
-|margin| does not affect this behavior.
-
-\begin{example}
-\clozeset{margin=3mm}
-\cloze{Lorem}, \cloze{ipsum}. \cloze{dolor}; \cloze{sit}: \cloze{amet},
-\cloze{consectetur}. \cloze{adipisicing}; \cloze{elit}: \cloze{sed},
-\cloze{do}. \cloze{eiusmod}; \cloze{tempor}.
-\end{example}
-
-\clozereset
-
-%%
-% spacing
-%%
-
-\subsubsection{\tt{spacing}}
-\label{sec:option-spacing}
-
-\option{spacing}{number}: This option provides support for setting the
-spacing between lines. A larger font used for the cloze texts needs
-more line space to avoid unsteady line distances.
-This option only affects the environment |clozespace|
-\secref{sec:command-clozespace}.
-
-%%
-% thickness
-%%
-
-\subsubsection{\tt{thickness}}
-\label{sec:option-thickness}
-
-\option{thickness}{dimen}:
-The option |thickness| indicates how thick the line is. The option
-|distance| \secref{sec:option-distance} is not affected by this option,
-because the bottom of the line moves down. The default value of this
-option is \tt{\getdefaults{thickness}}.
-
-\newcommand{\optionthickness}[1]{%
- \noindent%
- Lorem \cloze[thickness=#1]{ipsum dolor sit} amet.%
- \desc{#1}%
-}
-
-\begin{example}
-\optionthickness{0.01pt}
-\optionthickness{1pt}
-\optionthickness{2pt}
-\end{example}
-
-%%
-% width
-%%
-
-\subsubsection{\tt{width}}\label{sec:option-width}
-
-\option{width}{dimen}:
-The only command which can be changed by the option |width| is
-\cmd{\clozefix} \secref{sec:command-clozefix}. The default value of the
-option is \tt{\getdefaults{width}}.
-
-\newcommand{\optionwidth}[1]{%
- \noindent%
- Lorem \clozefix[width=#1]{dolor} amet.%
- \desc{#1}%
-}
-
-\begin{example}
-\optionwidth{3cm}
-\optionwidth{5cm}
-\optionwidth{7cm}
-\end{example}
-
-%-----------------------------------------------------------------------
-% Special application areas
-%-----------------------------------------------------------------------
-
-\subsection{Special application areas}
-
-This section lists examples that didn’t work in older versions of
-the cloze package and required special treatment to work as expected.
-
-\subsubsection{The math mode}
-
-By default the package uses |\itshape| to format the cloze text. In
-math mode you have to reset the cloze text format by calling
-|\clozesetfont{}|. A known bug ist: You can’t show and hide
-single display math formulas. Only the last |\clozeshow| or |\clozehide|
-takes effect on the whole document. Side note: The usage of the \TeX
-primitive syntax |$$| is not recommended.
-
-\clozesetfont{}
-
-\begin{minted}{latex}
-\clozesetfont{}
-$$1 + 1 = \cloze{2}$$
-\clozesetfont{\itshape}
-\end{minted}
-
-$$1 + 1 = \cloze{2}$$
-
-\noindent
-|\[\]| should be used instead.
-
-\begin{minted}{latex}
-\[123 + 456 = \cloze{579}\]
-\end{minted}
-
-\[123 + 456 = \cloze{579}\]
-
-\begin{minted}{latex}
-\begin{displaymath}
-2^{\cloze{2}} = 4
-\end{displaymath}
-\end{minted}
-
-\begin{displaymath}
-2^{\cloze{2}} = 4
-\end{displaymath}
-
-\noindent
-The inline math mode works too:
-
-\begin{minted}{latex}
-${\sqrt[3]{\cloze{8}}} = 2$ and ${\sqrt[\cloze{3}]{\cloze{8}}} = 2$
-\end{minted}
-
-\begin{center}
-${\sqrt[3]{\cloze{8}}} = 2$ and ${\sqrt[\cloze{3}]{\cloze{8}}} = 2$
-\end{center}
-
-\clozesetfont{\itshape}
-
-%%
-% tabbing
-%%
-
-\subsubsection{The \tt{tabbing} environment}
-
-\begin{minted}{latex}
-\begin{tabbing}
-col1 \hspace{1cm} \= col2 \hspace{1cm} \= col3 \hspace{1cm} \= col4 \\
-\cloze{col1} \> \> \clozefix{col3} \\
-\end{tabbing}
-\end{minted}
-
-\begin{example}
-\begin{tabbing}
-col1 \hspace{1cm} \= col2 \hspace{1cm} \= col3 \hspace{1cm} \= col4 \\
-\cloze{col1} \> \> \clozefix{col3} \\
-\end{tabbing}
-\end{example}
-
-%%
-% picture
-%%
-
-\subsubsection{The \tt{picture} environment}
-
-\begin{minted}{latex}
-\begin{picture}(320,100)
-\put(80,25){\cloze{Lorem}}
-\put(160,50){\clozefix{ipsum}}
-\put(240,75){\clozefil{dolor}}
-\end{picture}
-\end{minted}
-
-\begin{example}
-\begin{picture}(320,100)
-\put(80,25){\cloze{Lorem}}
-\put(160,50){\clozefix{ipsum}}
-\put(240,75){\clozefil{dolor}}
-\end{picture}
-\end{example}
-
-%%
-% tabular
-%%
-
-\subsubsection{The \tt{tabular} environment}
-
-\begin{minted}{latex}
-\begin{tabular}{l c}
-\cloze{Lorem} & \cloze{ipsum} \\
-\clozefix{amet} & \clozefix{consectetur} \\
-\cloze{sed} & \cloze{do} \\
-\end{tabular}
-\end{minted}
-
-% No |c| inside because of short verbatim.
-
-\begin{example}
-\clozeset{width=1cm}
-\begin{tabular}{l c}
-\cloze{Lorem} & \cloze{ipsum} \\
-\clozefix{amet} & \clozefix{consectetur} \\
-\cloze{sed} & \cloze{do} \\
-\end{tabular}
-\end{example}
-
-\section{Some graphics for better understanding of the node tree}
-
-\subsection{Paragraph}
-
-\noindent\includegraphics[width=\linewidth]{graphics/par}
-
-\subsection{Tabular environment}
-
-\noindent\includegraphics[width=\linewidth]{graphics/tabular}
-
-\subsection{Picture environment}
-
-\noindent\includegraphics[width=\linewidth]{graphics/picture}
-
-\DocInput{cloze.dtx}
-
-\subsection{The file cloze.lua}
-
-\inputminted{lua}{cloze.lua}
-
-\pagebreak
-\PrintChanges
-\pagebreak
-\PrintIndex
-\end{document}
-%</driver>
-% \fi
-%
-% \CheckSum{0}
-%
-% \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 \~}
-%
-%
-% \changes{v0.1}{2015/06/16}{Converted to DTX file}
-%
-% \changes{v1.0}{2015/07/08}{Inital release}
-%
-% \changes{v1.1}{2016/06/13}{Make cloze compatible to LuaTeX version
-% 0.95}
-%
-% \changes{v1.2}{2016/06/23}{The cloze makros are now working in
-% tabular, tabbing and picture environments}
-%
-% \changes{v1.3}{2017/03/13}{Add the new macros \cmd{\clozenol} and
-% \cmd{\clozeextend} and the environments \texttt{clozebox} and
-% \texttt{clozespace} (This version was not published on CTAN.)}
-%
-% \changes{v1.4}{2020/05/20}{Add the new macro \cmd{\clozestrike} and
-% improve the documentation}
-%
-% \changes{v1.5}{2020/05/27}{
-% The Lua part of the package (cloze.lua) is now being developed in a
-% separate file.
-% The readme file is now a standalone mardown file and not embedded in
-% the dtx file any more.
-% \href{https://github.com/stevedonovan/LDoc}{LDoc} is being used
-% to generate
-% \href{https://josef-friedrich.github.io/cloze}{source code documentation}.
-% This version fixes two bugs (cloze in display math, line color and
-% hide).
-% }
-%
-% \DoNotIndex{\newcommand,\newenvironment,\def,\directlua}
-%
-% \StopEventually{}
-% \pagebreak
-% \section{Implementation}
-%
-% \iffalse
-%<*package>
-% \fi
-% \MacroTopsep = 10pt plus 2pt minus 2pt
-% \MacrocodeTopsep = 10pt plus 1.2pt minus 1pt
-%
-% \makeatletter
-% \c@CodelineNo 25 \relax
-% \makeatother
-%
-% \subsection{The file \tt{cloze.sty}}
-%
-% This packages are used to build \emph{cloze}:
-%
-% \subsubsection{Dependencies}
-%
-% The package \href{https://www.ctan.org/pkg/fontspec}{fontspec} is not
-% necessarily required. When using Lua\LaTeX{} it is good form to load
-% it. Apart from this the package supplies helpful messages, when you
-% compile a Lua\LaTeX{} document with pdf\LaTeX{}.
-% \begin{macrocode}
-\RequirePackage{fontspec}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/luatexbase}{luatexbase}
-% allows to register multiple Lua callbacks.
-% \begin{macrocode}
-\RequirePackage{luatexbase-mcb}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/kvoptions}{kvoptions}
-% takes the handling of the options.
-% \begin{macrocode}
-\RequirePackage{kvoptions}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/setspace}{setspace} is used
-% by the environment |clozespace|.
-% \begin{macrocode}
-\RequirePackage{setspace}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/xcolor}{xcolor} is required
-% to colorize the text and the line of a gap.
-% \begin{macrocode}
-\RequirePackage{xcolor}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/xcolor}{xparse} is used by
-% the environment |clozebox|.
-% \begin{macrocode}
-\RequirePackage{xparse}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/stackengine}{stackengine}
-% is required by the command |\clozestrike{}{}|.
-% \begin{macrocode}
-\RequirePackage{stackengine}
-% \end{macrocode}
-% The package \href{https://www.ctan.org/pkg/ulem}{ulem} is required by
-% the command |\clozestrike{}{}|.
-% \begin{macrocode}
-\RequirePackage{ulem}
-\normalem
-% \end{macrocode}
-%
-% \begin{macrocode}
-\RequirePackage{transparent}
-% \end{macrocode}
-%
-% Load the cloze lua module and put all return values in the variable
-% |cloze|.
-%
-% \begin{macrocode}
-\directlua{
- cloze = require('cloze')
-}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\newif\ifclozeshow\clozeshowtrue
-% \end{macrocode}
-%
-% \subsubsection{Internal macros}
-%
-% \begin{macro}{\cloze@set@to@global}
-% Set the Lua variable |registry.is_global| to |true|. All options
-% are then stored in the variable |registry.global_options|.
-% \begin{macrocode}
-\def\cloze@set@to@global{%
- \directlua{cloze.set_is_global(true)}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@set@to@local}
-% First unset the variable |registry.local_options|. Now set the Lua
-% variable |registry.is_global| to |false|. All options are then stored
-% in the variable |registry.local_options|.
-% \begin{macrocode}
-\def\cloze@set@to@local{%
- \directlua{
- cloze.unset_local_options()
- cloze.set_is_global(false)
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@set@option}
-% \cmd{\cloze@set@option} is a wrapper for the Lua function
-% |registry.set_option|. \cmd{\cloze@set@option}\oarg{key}\marg{value}
-% sets a key \meta{key} to the value \meta{value}.
-% \begin{macrocode}
-\def\cloze@set@option[#1]#2{%
- \directlua{cloze.set_option('#1', '#2')}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@color}
-% Convert a color definiton name to a PDF colorstack string, for example
-% convert the color name |blue| to the colorstack string
-% |0 0 1 rg 0 0 1 RG|. The macro definition |\cloze@color{blue}|
-% builds itself the macro |\color@blue|, which expands to the PDF
-% colorstack string. The colorstack string is necessary to generate a
-% PDF colorstack whatsit.
-% \begin{macrocode}
-\def\cloze@color#1{\csname\string\color@#1\endcsname}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@set@local@options}
-% This macro is used in all cloze commands to handle the optional
-% arguments. First it sets the option storage to local and then it
-% commits the options to the package \emph{kvoptions} via the macro
-% |\kvsetkeys{CLZ}{}|.
-% \begin{macrocode}
-\def\cloze@set@local@options#1{%
- \cloze@set@to@local%
- \kvsetkeys{CLZ}{#1}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@start@marker}
-% At the begining |\cloze@start@marker| registers the required Lua
-% callbacks. Then it inserts a whatsit marker which marks the begin of a
-% gap.
-% \begin{macrocode}
-\def\cloze@start@marker#1{%
- \strut\directlua{
- cloze.register('#1')
- cloze.marker('#1', 'start')
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@stop@marker}
-% \cmd{\cloze@stop@marker} inserts a whatsit marker that marks the end
-% of gap.
-% \begin{macrocode}
-\def\cloze@stop@marker#1{%
- \strut\directlua{
- cloze.marker('#1', 'stop')
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@margin}
-% \cmd{\cloze@margin} surrounds a text in a gap with two |kerns|.
-% \begin{macrocode}
-\def\cloze@margin#1{%
- \directlua{cloze.margin()}%
- #1%
- \directlua{cloze.margin()}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \subsubsection{Options}
-%
-% \emph{cloze} offers key-value pairs to use as options. For processing
-% the key-value pairs we use the package
-% \href{https://www.ctan.org/pkg/kvoptions}{kvoptions}.
-% To make all key-value pairs accessibly to Lua code, we use the
-% declaration
-% \cmd{\define@key}\marg{CLZ}\marg{option}\oarg[]\marg{\dots}. This
-% declaration comes from the package
-% \href{https://www.ctan.org/pkg/keyval}{keyval}.
-%
-% At start all values are declared as global options. At the Lua side
-% all values are now stored in the |registry.global_options| table.
-%
-% \begin{macrocode}
-\cloze@set@to@global
-% \end{macrocode}
-%
-% We use the abbreviation |CLZ| for \emph{cloze} as family name and
-% prefix.
-%
-% \begin{macrocode}
-\SetupKeyvalOptions{
- family=CLZ,
- prefix=CLZ@
-}
-% \end{macrocode}
-%
-% \paragraph{\tt{align}}
-%
-% \noindent Please read the section \secref{sec:option-align} how to use
-% the option |align|. |align| affects only the command \cmd{\clozefix}
-% \secref{sec:command-clozefix}.
-%
-% \begin{macrocode}
-\DeclareStringOption{align}
-\define@key{CLZ}{align}[]{\cloze@set@option[align]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{boxheight}}
-%
-% \noindent Please read the section \secref{sec:sec:command-clozebox}
-% how to use the option |boxheight|. |boxheight| affects only the
-% environment \cmd{clozebox}.
-% \secref{sec:command-clozefix}.
-%
-% \begin{macrocode}
-\DeclareStringOption{boxheight}
-\define@key{CLZ}{boxheight}[]{\cloze@set@option[boxheight]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{boxwidth}}
-%
-% \noindent Please read the section \secref{sec:sec:command-clozebox}
-% how to use the option |boxwidth|. |boxwidth| affects only the
-% environment \cmd{clozebox}.
-% \secref{sec:command-clozefix}.
-%
-% \begin{macrocode}
-\DeclareStringOption{boxwidth}
-\define@key{CLZ}{boxwidth}[]{\cloze@set@option[boxwidth]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{distance}}
-%
-% \noindent Please read the section \secref{sec:option-distance} how to
-% use the option |distance|.
-%
-% \begin{macrocode}
-\DeclareStringOption{distance}
-\define@key{CLZ}{distance}[]{\cloze@set@option[distance]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{hide}}
-%
-% \noindent If the option |hide| appears in the commands, |hide| will be
-% set to \emph{true} and |show| to \emph{false} on the Lua side. Please
-% read the section \secref{sec:option-hide} how to use the option
-% |hide|.
-%
-% \begin{macrocode}
-\DeclareVoidOption{hide}{%
- \clozeshowfalse%
- \cloze@set@option[hide]{true}%
- \cloze@set@option[show]{false}%
-}
-% \end{macrocode}
-%
-% \paragraph{\tt{linecolor}}
-%
-% \noindent Please read the section \secref{sec:option-linecolor} how to
-% use the option |linecolor|.
-%
-% \begin{macrocode}
-\DeclareStringOption{linecolor}
-\define@key{CLZ}{linecolor}[]{%
- \cloze@set@option[linecolor]{\cloze@color{#1}}%
- \cloze@set@option[linecolor_name]{#1}%
-}
-% \end{macrocode}
-%
-% \paragraph{\tt{margin}}
-%
-% \noindent Please read the section \secref{sec:option-margin} how to
-% use the option |margin|.
-%
-% \begin{macrocode}
-\DeclareStringOption{margin}
-\define@key{CLZ}{margin}[]{\cloze@set@option[margin]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{show}}
-%
-% \noindent If the option |show| appears in the commands, |show| will be
-% set to \emph{true} and |true| to \emph{false} on the Lua side. Please
-% read the section \secref{sec:option-show} how to use the option
-% |show|.
-%
-% \begin{macrocode}
-\DeclareVoidOption{show}{%
- \clozeshowtrue%
- \cloze@set@option[show]{true}%
- \cloze@set@option[hide]{false}%
-}
-% \end{macrocode}
-%
-% \paragraph{\tt{spacing}}
-%
-% \noindent Please read the section \secref{sec:option-spacing} how to
-% use the option |spacing|.
-%
-% \begin{macrocode}
-\DeclareStringOption{spacing}
-\define@key{CLZ}{spacing}[]{\cloze@set@option[spacing]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{textcolor}}
-%
-% \noindent Please read the section \secref{sec:option-textcolor} how to
-% use the option |textcolor|.
-%
-% \begin{macrocode}
-\DeclareStringOption{textcolor}
-\define@key{CLZ}{textcolor}[]{%
- \cloze@set@option[textcolor]{\cloze@color{#1}}%
- \cloze@set@option[textcolor_name]{#1}%
-}
-% \end{macrocode}
-%
-% \paragraph{\tt{thickness}}
-%
-% \noindent Please read the section \secref{sec:option-thickness} how to
-% use the option |thickness|.
-%
-% \begin{macrocode}
-\DeclareStringOption{thickness}
-\define@key{CLZ}{thickness}[]{\cloze@set@option[thickness]{#1}}
-% \end{macrocode}
-%
-% \paragraph{\tt{width}}
-%
-% \noindent Please read the section \secref{sec:option-width} how to use
-% the option |width|. |width| affects only the command \cmd{\clozefix}
-% \secref{sec:command-clozefix}.
-%
-% \begin{macrocode}
-\DeclareStringOption{width}
-\define@key{CLZ}{width}[]{\cloze@set@option[width]{#1}}
-% \end{macrocode}
-%
-% \begin{macrocode}
-\ProcessKeyvalOptions{CLZ}
-% \end{macrocode}
-%
-% \subsubsection{Public macros}
-%
-% All public macros are prefixed with |\cloze|.
-%
-% \begin{macro}{\clozeset}
-% The usage of the command \cmd{\clozeset} is described in detail in
-% section \secref{sec:command-clozeset}.
-% \begin{macrocode}
-\newcommand{\clozeset}[1]{%
- \cloze@set@to@global%
- \kvsetkeys{CLZ}{#1}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozereset}
-% The usage of the command \cmd{\clozereset} is described in detail in
-% section \secref{sec:command-clozereset}.
-% \begin{macrocode}
-\newcommand{\clozereset}{%
- \directlua{cloze.reset()}
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozeshow}
-% The usage of the command \cmd{\clozeshow} is described in detail in
-% section \secref{sec:command-clozeshow}.
-% \begin{macrocode}
-\newcommand{\clozeshow}{%
- \clozeset{show}
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozehide}
-% The usage of the command \cmd{\clozehide} is described in detail in
-% section \secref{sec:command-clozehide}.
-% \begin{macrocode}
-\newcommand{\clozehide}{%
- \clozeset{hide}
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozefont}
-% The usage of the command \cmd{\clozefont} is described in detail in
-% section \secref{sec:command-clozefont}.
-% \begin{macrocode}
-\newcommand{\clozefont}{\itshape}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozesetfont}
-% The usage of the command \cmd{\clozesetfont} is described in detail in
-% section \secref{sec:command-clozesetfont}.
-% \begin{macrocode}
-\newcommand{\clozesetfont}[1]{%
- \renewcommand{\clozefont}[1]{%
- #1%
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze}
-% The usage of the command \cmd{\cloze} is described in detail in
-% section \secref{sec:command-cloze}.
-% \begin{macrocode}
-\newcommand{\cloze}[2][]{%
- \cloze@set@local@options{#1}%
- \cloze@start@marker{basic}%
- {%
- \clozefont\relax%
- \cloze@margin{#2}%
- }%
- \cloze@stop@marker{basic}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozefix}
-% The usage of the command \cmd{\clozefix} is described in detail in
-% section \secref{sec:command-clozefix}.
-% \begin{macrocode}
-\newcommand{\clozefix}[2][]{%
- \cloze@set@local@options{#1}%
- \cloze@start@marker{fix}%
- {%
- \clozefont\relax%
- \cloze@margin{#2}%
- }%
- \cloze@stop@marker{fix}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozenol}
-% The usage of the command \cmd{\clozenol} is described in detail in
-% section \secref{sec:command-clozenol}.
-% TODO: Realize this macro with lua code, without ugly |\color{white}|.
-% command.
-% \begin{macrocode}
-\newcommand{\clozenol}[2][]{%
- {%
- \cloze@set@local@options{#1}%
- \clozefont\relax%
- \ifclozeshow%
- \color{\directlua{tex.print(cloze.get_value('textcolor_name'))}}%
- \else%
- \color{white}%
- \fi%
- #2%
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{environment}{clozepar}
-% The usage of the environment |clozepar| is described in detail in
-% section \secref{sec:command-clozepar}.
-% \begin{macrocode}
-\newenvironment{clozepar}[1][]%
-{%
- \par%
- \cloze@set@local@options{#1}%
- \cloze@start@marker{par}%
- \clozefont\relax%
-}%
-{%
- \cloze@stop@marker{par}%
- \par%
- \directlua{cloze.unregister('par')}%
-}
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{macro}{\cloze@get@value}
-% \begin{macrocode}
-\newcommand{\cloze@get@value}[1]{%
- \directlua{
- tex.print(cloze.get_value('#1'))
- }%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{environment}{clozebox}
-% The usage of the environment |clozebox| is described in detail in
-% section \secref{sec:command-clozebox}.
-% TODO: Realize this macro with lua code, without ugly |\color{white}|
-% command.
-% \begin{macrocode}
-\newsavebox{\cloze@box}
-\NewDocumentEnvironment{clozebox}{ s O{} +b}{%
- \cloze@set@local@options{#2}%
- \noindent%
- \begin{lrbox}{\cloze@box}%
- \directlua{
- local boxheight = cloze.get_value('boxheight')
- local boxwidth = cloze.get_value('boxwidth')
- if boxheight then
- tex.print('\\begin{minipage}[t][' .. boxheight .. '][t]{' .. boxwidth .. '}')
- else
- tex.print('\\begin{minipage}[t]{' .. boxwidth .. '}')
- end
- }
- \clozefont\relax%
- \ifclozeshow%
- \color{\directlua{tex.print(cloze.get_value('textcolor_name'))}}#3%
- \else%
- \color{white}#3%
- \fi%
- \end{minipage}%
- \end{lrbox}%
- \IfBooleanTF{#1}%
- {\usebox{\cloze@box}}%
- {\fbox{\usebox{\cloze@box}}}%
-}{}
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{environment}{clozespace}
-% The usage of the environment |clozespace| is described in detail in
-% section \secref{sec:command-clozespace}.
-% TODO: Realization without setspace package.
-% \begin{macrocode}
-\newenvironment{clozespace}[1][]%
-{%
- \cloze@set@local@options{#1}%
- \begin{spacing}{\directlua{tex.print(cloze.get_value('spacing'))}}%
-}{\end{spacing}}
-% \end{macrocode}
-% \end{environment}
-%
-% \begin{macro}{\clozefil}
-% The usage of the command \cmd{\clozefil} is described in detail in
-% section \secref{sec:command-clozefil}.
-% \begin{macrocode}
-\newcommand{\clozefil}[2][]{%
- \cloze[#1]{#2}\clozelinefil[#1]%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozeextend}
-% TODO: Use node library to create kern nodes.
-% \begin{macrocode}
-\newcommand{\clozeextend}[1][1]{%
- \directlua{
- local loop = #1
- for variable = 1, loop do
- tex.print(' \string\\hspace{1em} \string\\strut')
- end
- }
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozeline}
-% The usage of the command \cmd{\clozeline} is described in detail in
-% section \secref{sec:command-clozeline}.
-% \begin{macrocode}
-\newcommand{\clozeline}[1][]{%
- \cloze@set@local@options{#1}%
- \directlua{cloze.line()}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozelinefil}
-% The usage of the command \cmd{\clozelinefil} is described in detail in
-% section \secref{sec:command-clozelinefil}.
-% \begin{macrocode}
-\newcommand{\clozelinefil}[1][]{%
- \cloze@set@local@options{#1}%
- \strut%
- \directlua{cloze.linefil()}%
- \strut%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@text@color}
-% \begin{macrocode}
-\newcommand{\cloze@text@color}[1]{%
- \textcolor%
- {\directlua{tex.print(cloze.get_value('textcolor_name'))}}%
- {#1}%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\cloze@strike@line}
-% \begin{macrocode}
-\newcommand\cloze@strike@line{%
- \bgroup%
- \markoverwith{%
- \cloze@text@color{%
- \rule[0.5ex]{2pt}{1pt}%
- }%
- }%
- \ULon%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\clozestrike}
-% \begin{macrocode}
-\newcommand{\clozestrike}[3][]{%
- \cloze@set@local@options{#1}%
- \ifclozeshow%
- \stackengine%
- {\Sstackgap}% \Sstackgap or \Lstackgap or \stackgap or stacklength
- {\cloze@strike@line{#2}}% anchor
- {\cloze@text@color{\clozefont{}#3}}% item
- {O}% O or U
- {c}% \stackalignment or l or c or r
- {\quietstack}% \quietstack or T or F
- {T}% \useanchorwidth or T or F
- {\stacktype}% \stacktype or S or L
- \else%
- \stackengine%
- {\Sstackgap}% \Sstackgap or \Lstackgap or \stackgap or stacklength
- {#2}% anchor
- {\texttransparent{0}{\clozefont{}#3}}% item
- {O}% O or U
- {c}% \stackalignment or l or c or r
- {\quietstack}% \quietstack or T or F
- {T}% \useanchorwidth or T or F
- {\stacktype}% \stacktype or S or L
- \fi%
-}
-% \end{macrocode}
-% \end{macro}
-%
-% \iffalse
-%</package>
-% \fi
-%
-% \Finale
-\endinput
diff --git a/macros/luatex/latex/cloze/cloze.pdf b/macros/luatex/latex/cloze/cloze.pdf
deleted file mode 100644
index 8f9b26bf23..0000000000
--- a/macros/luatex/latex/cloze/cloze.pdf
+++ /dev/null
Binary files differ