diff options
Diffstat (limited to 'macros')
203 files changed, 3759 insertions, 959 deletions
diff --git a/macros/generic/polexpr/README.md b/macros/generic/polexpr/README.md index 0f70c6cb34..7dd46d2f34 100644 --- a/macros/generic/polexpr/README.md +++ b/macros/generic/polexpr/README.md @@ -1,7 +1,7 @@ Package polexpr README ====================== -Version ``0.8.7`` of ``2022/05/14``. +Version ``0.8.7a`` of ``2022/05/19``. Abstract -------- @@ -21,7 +21,7 @@ rational rounds found exactly. In memoriam: Jürgen Gilg ------------------------ -`polexpr` is dedicated to the memory of Jürgen Gilg (1967-2022). +`polexpr` is dedicated to the memory of Jürgen Gilg (1966-2022). His question in January 2018 about using [xintexpr](http://www.ctan.org/pkg/xintexpr) to compute derivatives @@ -61,16 +61,16 @@ Recent changes G.C.D.'s, derivatives or indefinite integrals previously available via macros. - 0.8.1 (2021/04/12) - Bugfix: a typo broke the 0.8 ``diff1()`` and related functions. + Bug fix: a typo broke the 0.8 ``diff1()`` and related functions. - 0.8.2 (2021/05/05) Track `xintexpr` 1.4e changes - 0.8.3 (2021/05/27) Track `xintexpr` 1.4h changes - 0.8.4 (2021/11/01) - Bugfix: `PolSturmIsolateZeros**` did not declare the square free + Bug fix: `PolSturmIsolateZeros**` did not declare the square free part of the original polynomial if no real root existed. - 0.8.5 (2021/11/30) - Bugfix: `intfrom()` was documented at `0.8` but not declared to parser. + Bug fix: `intfrom()` was documented at `0.8` but not declared to parser. Track (belatedly) `xintexpr` 1.4g changes - 0.8.6 (2022/01/09) Separate `polexpr-examples.{tex,pdf}` from the `polexpr.html` reference. @@ -79,7 +79,8 @@ Recent changes three files. Catcode protection for `\poldef` now matches long-standing behaviour of `\xintdefvar`. This fixes issues with ``babel+french``. - +- 0.8.7a (2022/05/19) + Documentation improvements. License ------- diff --git a/macros/generic/polexpr/polexpr-changes.html b/macros/generic/polexpr/polexpr-changes.html index 51392f6565..3cce3e7612 100644 --- a/macros/generic/polexpr/polexpr-changes.html +++ b/macros/generic/polexpr/polexpr-changes.html @@ -6,7 +6,7 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> - <title>CHANGES — polexpr 0.8.7 documentation</title> + <title>CHANGES — polexpr 0.8.7a documentation</title> <link rel="stylesheet" type="text/css" href="polexpr.css" /> <link rel="prev" title="polexpr reference" href="polexpr-ref.html" /> </head><body> @@ -16,7 +16,7 @@ <li class="right" style="margin-right: 10px"> <a href="polexpr-ref.html" title="polexpr reference" accesskey="P">previous</a></li> - <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">CHANGES</a></li> </ul> </div> @@ -28,8 +28,8 @@ <section id="changes"> <h1>CHANGES</h1> -<section id="v0-1-2018-01-11-initial-release-features"> -<span id="firstrelease"></span><h2>v0.1 (2018/01/11): initial release. Features:</h2> +<section id="initial-release-features"> +<span id="firstrelease"></span><h2>0.1 (2018/01/11): initial release. Features:</h2> <ul class="simple"> <li><p>The <a class="reference internal" href="polexpr-ref.html#poldef"><span class="std std-ref">\poldef</span></a> parser itself,</p></li> <li><p>Differentiation and anti-differentiation,</p></li> @@ -40,8 +40,8 @@ </ul> <p>Only one-variable polynomials so far.</p> </section> -<section id="v0-2-2018-01-14"> -<h2>v0.2 (2018/01/14)</h2> +<section id="id1"> +<h2>0.2 (2018/01/14)</h2> <ul class="simple"> <li><p>Fix: <code class="docutils literal notranslate"><span class="pre">"README</span> <span class="pre">thinks</span> <span class="pre">\numexpr</span> <span class="pre">recognizes</span> <span class="pre">^</span> <span class="pre">operator"</span></code>.</p></li> <li><p>Convert README to reStructuredText markup.</p></li> @@ -52,12 +52,12 @@ <p>Due to lack of available time the test suite might not be extensive enough. Bug reports are very welcome!</p> </section> -<section id="v0-3-2018-01-17"> -<h2>v0.3 (2018/01/17)</h2> +<section id="id2"> +<h2>0.3 (2018/01/17)</h2> <ul> -<li><p>bug fixes:</p> +<li><p>Bug fixes:</p> <ul> -<li><p>the <code class="docutils literal notranslate"><span class="pre">0.1</span></code> <a class="reference internal" href="polexpr-ref.html#polevalat"><span class="std std-ref">\PolEval</span></a> accepted expressions for its +<li><p>The <code class="docutils literal notranslate"><span class="pre">0.1</span></code> <a class="reference internal" href="polexpr-ref.html#polevalat"><span class="std std-ref">\PolEval</span></a> accepted expressions for its second argument, but this was removed by mistake at <code class="docutils literal notranslate"><span class="pre">0.2</span></code>. Restored.</p> <p><strong>Attention</strong>: at <code class="docutils literal notranslate"><span class="pre">0.4</span></code> this has been reverted again, and <a class="reference internal" href="polexpr-ref.html#polevalatexpr"><span class="std std-ref">\PolEval{P}\AtExpr{foo}</span></a> syntax is needed for @@ -65,11 +65,11 @@ using expressions in the second argument.</p> </li> </ul> </li> -<li><p>incompatible or breaking changes:</p> +<li><p>Incompatible or breaking changes:</p> <ul class="simple"> <li><p><a class="reference internal" href="polexpr-ref.html#poltoexpr"><span class="std std-ref">\PolToExpr</span></a> now by default uses <em>descending</em> powers (it also treats differently coefficients equal to 1 or -1.) -Use <a class="reference internal" href="polexpr-ref.html#id78"><span class="std std-ref">\PolToExpr*</span></a> for <em>ascending</em> powers.</p></li> +Use <a class="reference internal" href="polexpr-ref.html#id79"><span class="std std-ref">\PolToExpr*</span></a> for <em>ascending</em> powers.</p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polevalat"><span class="std std-ref">\PolEval</span></a> reduced the output to smallest terms, but as this is costly with big fractions and not needed if e.g. wrapped in an <code class="docutils literal notranslate"><span class="pre">\xintRound</span></code> or <code class="docutils literal notranslate"><span class="pre">\xintFloat</span></code>, this step has been @@ -77,7 +77,7 @@ removed; the former meaning is available as <a class="reference internal" href="polexpr-ref.html#polevalreducedat"><span class="std std-ref">\PolEvalReduced</span></a>.</p></li> </ul> </li> -<li><p>new (or newly documented) macros:</p> +<li><p>New (or newly documented) macros:</p> <ul class="simple"> <li><p><a class="reference internal" href="polexpr-ref.html#poltypesetcmd"><span class="std std-ref">\PolTypesetCmd</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#poltypesetcmdprefix"><span class="std std-ref">\PolTypesetCmdPrefix</span></a></p></li> @@ -93,11 +93,11 @@ removed; the former meaning is available as <li><p><a class="reference internal" href="polexpr-ref.html#poltoexprtimes"><span class="std std-ref">\PolToExprTimes</span></a></p></li> </ul> </li> -<li><p>improvements:</p> +<li><p>Improvements:</p> <ul> -<li><p>documentation has a table of contents, internal hyperlinks, +<li><p>Documentation has a table of contents, internal hyperlinks, standardized signature notations and added explanations.</p></li> -<li><p>one can do <code class="docutils literal notranslate"><span class="pre">\PolLet{g}={f}</span></code> or <code class="docutils literal notranslate"><span class="pre">\PolLet{g}{f}</span></code>.</p></li> +<li><p>One can do <code class="docutils literal notranslate"><span class="pre">\PolLet{g}={f}</span></code> or <code class="docutils literal notranslate"><span class="pre">\PolLet{g}{f}</span></code>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">\PolToExpr{f}</span></code> is highly customizable.</p></li> <li><p><a class="reference internal" href="polexpr-ref.html#poldef"><span class="std std-ref">\poldef</span></a> and other defining macros prepare the polynomial functions for usage within <code class="docutils literal notranslate"><span class="pre">\xintthefloatexpr</span></code> (or @@ -113,16 +113,16 @@ generation floating point polynomial functions.</p> </li> </ul> </section> -<section id="v0-3-1-2018-01-18"> -<h2>v0.3.1 (2018/01/18)</h2> +<section id="id3"> +<h2>0.3.1 (2018/01/18)</h2> <p>Fixes two typos in example code included in the documentation.</p> </section> -<section id="v0-4-2018-02-16"> -<h2>v0.4 (2018/02/16)</h2> +<section id="id4"> +<h2>0.4 (2018/02/16)</h2> <ul> -<li><p>bug fixes:</p> +<li><p>Bug fixes:</p> <ul class="simple"> -<li><p>when Euclidean division gave a zero remainder, the internal +<li><p>When Euclidean division gave a zero remainder, the internal representation of this zero polynomial could be faulty; this could cause mysterious bugs in conjunction with other package macros such as <a class="reference internal" href="polexpr-ref.html#polmapcoeffs"><span class="std std-ref">\PolMapCoeffs</span></a>.</p></li> @@ -130,9 +130,9 @@ macros such as <a class="reference internal" href="polexpr-ref.html#polmapcoeffs of lesser degree than the second one.</p></li> </ul> </li> -<li><p>breaking changes:</p> +<li><p>Breaking changes:</p> <ul> -<li><p>formerly <a class="reference internal" href="polexpr-ref.html#polevalat"><span class="std std-ref">\PolEval{P}\At{foo}</span></a> allowed <code class="docutils literal notranslate"><span class="pre">foo</span></code> to +<li><p>Formerly <a class="reference internal" href="polexpr-ref.html#polevalat"><span class="std std-ref">\PolEval{P}\At{foo}</span></a> allowed <code class="docutils literal notranslate"><span class="pre">foo</span></code> to be an expression, which was transparently handled via <code class="docutils literal notranslate"><span class="pre">\xinttheexpr</span></code>. Now, <code class="docutils literal notranslate"><span class="pre">foo</span></code> must be a fraction (or a macro expanding to such) in the format acceptable by <code class="docutils literal notranslate"><span class="pre">xintfrac.sty</span></code> @@ -142,7 +142,7 @@ name of a variable known to <code class="docutils literal notranslate"><span cla <p>The same holds for <a class="reference internal" href="polexpr-ref.html#polevalreducedat"><span class="std std-ref">\PolEvalReduced</span></a> and <a class="reference internal" href="polexpr-ref.html#polfloatevalat"><span class="std std-ref">\PolFloatEval</span></a>.</p> </li> -<li><p>the <code class="docutils literal notranslate"><span class="pre">3.0</span></code> automatic generation of floating point variants has +<li><p>The <code class="docutils literal notranslate"><span class="pre">3.0</span></code> automatic generation of floating point variants has been reverted. Not only do <em>not</em> the package macros automatically generate floating point variants of newly created polynomials, they actually make pre-existing such variant undefined.</p> @@ -150,7 +150,7 @@ they actually make pre-existing such variant undefined.</p> </li> </ul> </li> -<li><p>new non-expandable macros:</p> +<li><p>New non-expandable macros:</p> <ul class="simple"> <li><p><a class="reference internal" href="polexpr-ref.html#polgenfloatvariant"><span class="std std-ref">\PolGenFloatVariant</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polgloballet"><span class="std std-ref">\PolGlobalLet</span></a></p></li> @@ -158,23 +158,23 @@ they actually make pre-existing such variant undefined.</p> <li><p><a class="reference internal" href="polexpr-ref.html#polquo"><span class="std std-ref">\PolQuo</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polrem"><span class="std std-ref">\PolRem</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#poltosturm"><span class="std std-ref">\PolToSturm</span></a></p></li> -<li><p><a class="reference internal" href="polexpr-ref.html#id35"><span class="std std-ref">\PolToSturm*</span></a></p></li> +<li><p><a class="reference internal" href="polexpr-ref.html#id36"><span class="std std-ref">\PolToSturm*</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsettosturmchainsignchangesat"><span class="std std-ref">\PolSetToSturmChainSignChangesAt</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsettonbofzeroswithin"><span class="std std-ref">\PolSetToNbOfZerosWithin</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polrefineinterval"><span class="std std-ref">\PolRefineInterval*</span></a></p></li> -<li><p><a class="reference internal" href="polexpr-ref.html#id46"><span class="std std-ref">\PolRefineInterval[N]</span></a></p></li> +<li><p><a class="reference internal" href="polexpr-ref.html#id47"><span class="std std-ref">\PolRefineInterval[N]</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polensureintervallength"><span class="std std-ref">\PolEnsureIntervalLength</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polensureintervallengths"><span class="std std-ref">\PolEnsureIntervalLengths</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervals"><span class="std std-ref">\PolPrintIntervals</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsprintexactzero"><span class="std std-ref">\PolPrintIntervalsPrintExactZero</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsprintleftendpoint"><span class="std std-ref">\PolPrintIntervalsPrintLeftEndPoint</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsprintrightendpoint"><span class="std std-ref">\PolPrintIntervalsPrintRightEndPoint</span></a></p></li> -<li><p><a class="reference internal" href="polexpr-ref.html#id20"><span class="std std-ref">\PolReduceCoeffs*</span></a></p></li> +<li><p><a class="reference internal" href="polexpr-ref.html#id21"><span class="std std-ref">\PolReduceCoeffs*</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polmakemonic"><span class="std std-ref">\PolMakeMonic</span></a></p></li> </ul> </li> -<li><p>new expandable macros:</p> +<li><p>New expandable macros:</p> <ul class="simple"> <li><p><a class="reference internal" href="polexpr-ref.html#poltoexpronetermstylea"><span class="std std-ref">\PolToExprOneTermStyleA</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polifcoeffisplusorminusone"><span class="std std-ref">\PolIfCoeffIsPlusOrMinusOne</span></a></p></li> @@ -193,24 +193,24 @@ they actually make pre-existing such variant undefined.</p> <li><p><a class="reference internal" href="polexpr-ref.html#poldectostring"><span class="std std-ref">\PolDecToString</span></a></p></li> </ul> </li> -<li><p>improvements:</p> +<li><p>Improvements:</p> <p>The main new feature is implementation of the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm algorithm</a> for localization of the real roots of polynomials.</p> </li> </ul> </section> -<section id="v0-4-1-2018-03-01"> -<h2>v0.4.1 (2018/03/01)</h2> +<section id="id5"> +<h2>0.4.1 (2018/03/01)</h2> <p>Synced with xint 1.3.</p> </section> -<section id="v0-4-2-2018-03-03"> -<h2>v0.4.2 (2018/03/03)</h2> +<section id="id6"> +<h2>0.4.2 (2018/03/03)</h2> <p>Documentation fix.</p> </section> -<section id="v0-5-2018-04-08"> -<h2>v0.5 (2018/04/08)</h2> +<section id="id7"> +<h2>0.5 (2018/04/08)</h2> <ul class="simple"> -<li><p>bug fixes:</p> +<li><p>Bug fix:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#polget"><span class="std std-ref">\PolGet{polname}\fromarray\macro</span></a> crashed when <code class="docutils literal notranslate"><span class="pre">\macro</span></code> was @@ -218,68 +218,68 @@ an <a class="reference external" href="https://www.ctan.org/pkg/xint">xinttools< polynomial.</p></li> </ul> </li> -<li><p>breaking changes:</p> +<li><p>Breaking changes:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#poltosturm"><span class="std std-ref">\PolToSturm</span></a> creates primitive integer coefficients polynomials. This speeds up localization of roots via <a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros</span></a>. In case of user protests the author will make available again the code producing the bona fide Sturm polynomials as used formerly.</p></li> -<li><p>polynomials created from <a class="reference internal" href="polexpr-ref.html#polfromcsv"><span class="std std-ref">\PolFromCSV</span></a> or +<li><p>Polynomials created from <a class="reference internal" href="polexpr-ref.html#polfromcsv"><span class="std std-ref">\PolFromCSV</span></a> or <a class="reference internal" href="polexpr-ref.html#polget"><span class="std std-ref">\PolGet</span></a> get their coefficients normalized via <a class="reference external" href="https://www.ctan.org/pkg/xint">xintfrac</a>‘s <code class="docutils literal notranslate"><span class="pre">\xintRaw</span></code>.</p></li> </ul> </li> -<li><p>experimental change:</p> +<li><p>Experimental change:</p> <ul> -<li><p>optional argument to <a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros</span></a> +<li><p>Optional argument to <a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros</span></a> (see <code class="docutils literal notranslate"><span class="pre">The</span> <span class="pre">degree</span> <span class="pre">41</span> <span class="pre">polynomial</span> <span class="pre">with</span> <span class="pre">-2,</span> <span class="pre">-1.9,</span> <span class="pre">-1.8,</span> <span class="pre">...,</span> <span class="pre">0,</span> <span class="pre">0.1,</span> <span class="pre">...,</span> <span class="pre">1.9,</span> <span class="pre">2</span> <span class="pre">as</span> <span class="pre">roots</span></code> in <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code>). It will presumably be replaced in future by an interval specification.</p></li> </ul> </li> -<li><p>new non-expandable macro:</p> +<li><p>New non-expandable macro:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#polmakeprimitive"><span class="std std-ref">\PolMakePrimitive</span></a></p></li> </ul> </li> -<li><p>new expandable macro:</p> +<li><p>New expandable macro:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#policontent"><span class="std std-ref">\PolIContent</span></a></p></li> </ul> </li> </ul> </section> -<section id="v0-5-1-2018-04-22"> -<h2>v0.5.1 (2018/04/22)</h2> +<section id="id8"> +<h2>0.5.1 (2018/04/22)</h2> <ul class="simple"> -<li><p>new feature:</p> +<li><p>New feature:</p> <ul> -<li><p>the character <code class="docutils literal notranslate"><span class="pre">'</span></code> can be used in polynomial names.</p></li> +<li><p>The character <code class="docutils literal notranslate"><span class="pre">'</span></code> can be used in polynomial names.</p></li> </ul> </li> </ul> </section> -<section id="v0-6-2018-11-20"> -<h2>v0.6 (2018/11/20)</h2> +<section id="id9"> +<h2>0.6 (2018/11/20)</h2> <ul class="simple"> -<li><p>bugfix:</p> +<li><p>Bug fixes:</p> <ul> -<li><p>the starred variant -<a class="reference internal" href="polexpr-ref.html#id35"><span class="std std-ref">\PolToSturm*{<polname>}{<sturmname>}</span></a> +<li><p>The starred variant +<a class="reference internal" href="polexpr-ref.html#id36"><span class="std std-ref">\PolToSturm*{<polname>}{<sturmname>}</span></a> was broken. On the occasion of the fix, its meaning has been modified, see its documentation.</p></li> -<li><p>using <a class="reference internal" href="polexpr-ref.html#poltosturm"><span class="std std-ref">\PolToSturm</span></a> with a constant polynomial +<li><p>Using <a class="reference internal" href="polexpr-ref.html#poltosturm"><span class="std std-ref">\PolToSturm</span></a> with a constant polynomial caused a division by zero error.</p></li> </ul> </li> -<li><p>new macro:</p> +<li><p>New macro:</p> <ul> -<li><p><a class="reference internal" href="polexpr-ref.html#id38"><span class="std std-ref">\PolSturmIsolateZeros*</span></a> +<li><p><a class="reference internal" href="polexpr-ref.html#id39"><span class="std std-ref">\PolSturmIsolateZeros*</span></a> acts like the <a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">non-starred variant</span></a> then computes all the multiplicities.</p></li> </ul> </li> -<li><p>new expandable macros:</p> +<li><p>New expandable macros:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmisolatedzeromultiplicity"><span class="std std-ref">\PolSturmIsolatedZeroMultiplicity{<sturmname>}{<index>}</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmnbofrootsoflessthanorequalto"><span class="std std-ref">\PolSturmNbOfRootsOf{<sturmname>}\LessThanOrEqualTo{<value>}</span></a></p></li> @@ -290,12 +290,12 @@ acts like the <a class="reference internal" href="polexpr-ref.html#polsturmisola </li> </ul> </section> -<section id="v0-7-2018-12-08-v0-7-1-bugfix-v0-7-2-2nd-bugfix-2018-12-09"> -<h2>v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09)</h2> +<section id="bugfix-0-7-2-2nd-bugfix-2018-12-09"> +<h2>0.7 (2018/12/08), 0.7.1 (bugfix), 0.7.2 (2nd bugfix) (2018/12/09)</h2> <ul class="simple"> -<li><p>breaking changes:</p> +<li><p>Breaking changes:</p> <ul> -<li><p>although <a class="reference internal" href="polexpr-ref.html#polprintintervals"><span class="std std-ref">\PolPrintIntervals[<varname>]{<sturmname>}</span></a> default output +<li><p>Although <a class="reference internal" href="polexpr-ref.html#polprintintervals"><span class="std std-ref">\PolPrintIntervals[<varname>]{<sturmname>}</span></a> default output remains the same, some auxiliary macros for user-customization have been removed: <code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheEndPoint</span></code>, <code class="docutils literal notranslate"><span class="pre">\PolIfEndPointIsPositive{T}{F}</span></code>, @@ -303,9 +303,9 @@ have been removed: <code class="docutils literal notranslate"><span class="pre"> <code class="docutils literal notranslate"><span class="pre">\PolIfEndPointIsZero{T}{F}</span></code>.</p></li> </ul> </li> -<li><p>bugfix:</p> +<li><p>Bug fixes:</p> <ul> -<li><p>it could happen that, contrarily to documentation, an interval computed +<li><p>It could happen that, contrarily to documentation, an interval computed by <a class="reference internal" href="polexpr-ref.html#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros{<sturmname>}</span></a> had zero as an endpoint,</p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polensureintervallength"><span class="std std-ref">\PolEnsureIntervalLength{<sturmname>}{<index>}{<exponent>}</span></a> could under certain circumstances erroneously @@ -315,13 +315,13 @@ real roots, hence for which no isolation intervals existed (thanks to Thomas Söll for report).</p></li> </ul> </li> -<li><p>new macros:</p> +<li><p>New macros:</p> <ul> -<li><p><a class="reference internal" href="polexpr-ref.html#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a></p></li> +<li><p><a class="reference internal" href="polexpr-ref.html#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmisolatezerosgetmultiplicitiesandrationalroots"><span class="std std-ref">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{<sturmname>}</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmisolatezerosandfindrationalroots"><span class="std std-ref">\PolSturmIsolateZerosAndFindRationalRoots{<sturmname>}</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polexprsetup"><span class="std std-ref">\polexprsetup</span></a></p></li> -<li><p><a class="reference internal" href="polexpr-ref.html#id61"><span class="std std-ref">\PolPrintIntervals*</span></a></p></li> +<li><p><a class="reference internal" href="polexpr-ref.html#id62"><span class="std std-ref">\PolPrintIntervals*</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsnorealroots"><span class="std std-ref">\PolPrintIntervalsNoRealRoots</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsbeginenv"><span class="std std-ref">\PolPrintIntervalsBeginEnv</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsendenv"><span class="std std-ref">\PolPrintIntervalsEndEnv</span></a></p></li> @@ -330,7 +330,7 @@ Thomas Söll for report).</p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsprintmultiplicity"><span class="std std-ref">\PolPrintIntervalsPrintMultiplicity</span></a></p></li> </ul> </li> -<li><p>new expandable macros:</p> +<li><p>New expandable macros:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmnbofrationalroots"><span class="std std-ref">\PolSturmNbOfRationalRoots{<sturmname>}</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polsturmnbofrationalrootswithmultiplicities"><span class="std std-ref">\PolSturmNbOfRationalRootsWithMultiplicities{<sturmname>}</span></a></p></li> @@ -344,16 +344,16 @@ Thomas Söll for report).</p></li> </li> </ul> </section> -<section id="v0-7-3-2019-02-04"> -<h2>v0.7.3 (2019/02/04)</h2> +<section id="id10"> +<h2>0.7.3 (2019/02/04)</h2> <ul class="simple"> -<li><p>bugfix:</p> +<li><p>Bug fixes:</p> <ul> <li><p>Debugging information not destined to user showed in log if root finding was done under <code class="docutils literal notranslate"><span class="pre">\xintverbosetrue</span></code> regime.</p></li> <li><p><a class="reference internal" href="polexpr-ref.html#polprintintervalsthevar"><span class="std std-ref">\PolPrintIntervalsTheVar</span></a> remained defined after <a class="reference internal" href="polexpr-ref.html#polprintintervals"><span class="std std-ref">\PolPrintIntervals</span></a> but was -left undefined after <a class="reference internal" href="polexpr-ref.html#id61"><span class="std std-ref">\PolPrintIntervals*</span></a> +left undefined after <a class="reference internal" href="polexpr-ref.html#id62"><span class="std std-ref">\PolPrintIntervals*</span></a> (reported by Jürgen Gilg). Now remains defined in both cases, and <a class="reference internal" href="polexpr-ref.html#polprintintervalsthesturmname"><span class="std std-ref">\PolPrintIntervalsTheSturmName</span></a> also.</p></li> @@ -363,10 +363,10 @@ Söll).</p></li> </li> </ul> </section> -<section id="v0-7-4-2019-02-12"> -<h2>v0.7.4 (2019/02/12)</h2> +<section id="id11"> +<h2>0.7.4 (2019/02/12)</h2> <ul class="simple"> -<li><p>bugfix:</p> +<li><p>Bug fix:</p> <ul> <li><p>20000000000 is too big for <code class="docutils literal notranslate"><span class="pre">\numexpr</span></code>, shouldn’t I know that? Thanks to Jürgen Gilg for report.</p></li> @@ -374,15 +374,15 @@ Thanks to Jürgen Gilg for report.</p></li> </li> </ul> </section> -<section id="v0-7-5-2020-01-31"> -<h2>v0.7.5 (2020/01/31)</h2> +<section id="id12"> +<h2>0.7.5 (2020/01/31)</h2> <p>Synced with xintexpr 1.4. Requires it.</p> </section> -<section id="v0-8-2021-03-29"> -<span id="polexpr08release"></span><h2>v0.8 (2021/03/29)</h2> +<section id="polexpr08release"> +<span id="id13"></span><h2>0.8 (2021/03/29)</h2> <p>Synced with xintexpr 1.4d. Requires it.</p> <ul class="simple"> -<li><p>breaking changes:</p> +<li><p>Breaking changes:</p> <ul> <li><p>As the usability of character <code class="docutils literal notranslate"><span class="pre">'</span></code> in names has been extended from <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> to also generally <code class="docutils literal notranslate"><span class="pre">\xintexpr</span></code>, <code class="docutils literal notranslate"><span class="pre">\xintdefvar</span></code>, @@ -396,13 +396,13 @@ be replaced by the <code class="docutils literal notranslate"><span class="pre"> <a class="reference internal" href="polexpr-ref.html#poltoexprcaret"><span class="std std-ref">\PolToExprCaret</span></a>.</p></li> </ul> </li> -<li><p>deprecated:</p> +<li><p>Deprecated:</p> <ul> <li><p>Usage of <code class="docutils literal notranslate"><span class="pre">P/Q</span></code> for the euclidean quotient of two polynomials is deprecated. Start using <code class="docutils literal notranslate"><span class="pre">quo(P,Q)</span></code> in its place.</p></li> </ul> </li> -<li><p>bugfix:</p> +<li><p>Bug fixes:</p> <ul> <li><p>The <code class="docutils literal notranslate"><span class="pre">\xintglobaldefstrue</span></code> setting was obeyed only partially by the polexpr macros defining polynomials.</p></li> @@ -417,18 +417,18 @@ extended possibilities for xintexpr 1.4 user-declared functions. Hopefully <code class="docutils literal notranslate"><span class="pre">0.8</span></code> achieves full functionality in this context.</p></li> </ul> </li> -<li><p>new macros:</p> +<li><p>New macros:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#polnewpolverbosefalse"><span class="std std-ref">\polnewpolverbosefalse</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#poltoexprcaret"><span class="std std-ref">\PolToExprCaret</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#poltoexprinvar"><span class="std std-ref">\PolToExprInVar</span></a></p></li> -<li><p>alongside the major new functionalities described in the next item +<li><p>Alongside the major new functionalities described in the next item <a class="reference internal" href="polexpr-ref.html#poltypeset"><span class="std std-ref">\PolTypeset</span></a> and <a class="reference internal" href="polexpr-ref.html#poltoexpr"><span class="std std-ref">\PolToExpr</span></a> have been enhanced to accept as argument a general expression and not only a pre-declared polynomial name.</p></li> </ul> </li> -<li><p>new features:</p> +<li><p>New features:</p> <ul> <li><p>The package is usable under Plain and probably most any TeX format, and not only under LaTeX.</p></li> @@ -453,16 +453,16 @@ macro interface such as gcd computations.</p></li> <p>See the updated <a class="reference internal" href="polexpr-ref.html#quick"><span class="std std-ref">Quick syntax overview</span></a> and then <a class="reference internal" href="polexpr-ref.html#polexpr08"><span class="std std-ref">the extended syntax description</span></a>.</p> </section> -<section id="v0-8-1-2021-04-12"> -<h2>v0.8.1 (2021/04/12)</h2> +<section id="id14"> +<h2>0.8.1 (2021/04/12)</h2> <ul class="simple"> -<li><p>breaking changes:</p> +<li><p>Breaking changes:</p> <ul> -<li><p>renamed v0.8’s <code class="docutils literal notranslate"><span class="pre">icontent()</span></code> to <a class="reference internal" href="polexpr-ref.html#cont"><span class="std std-ref">cont()</span></a>.</p></li> -<li><p>renamed v0.8’s <code class="docutils literal notranslate"><span class="pre">lcoeff()</span></code> to <a class="reference internal" href="polexpr-ref.html#lc"><span class="std std-ref">lc()</span></a>.</p></li> +<li><p>Renamed 0.8’s <code class="docutils literal notranslate"><span class="pre">icontent()</span></code> to <a class="reference internal" href="polexpr-ref.html#cont"><span class="std std-ref">cont()</span></a>.</p></li> +<li><p>Renamed 0.8’s <code class="docutils literal notranslate"><span class="pre">lcoeff()</span></code> to <a class="reference internal" href="polexpr-ref.html#lc"><span class="std std-ref">lc()</span></a>.</p></li> </ul> </li> -<li><p>bugfix:</p> +<li><p>Bug fixes:</p> <ul> <li><p>Sadly, <code class="docutils literal notranslate"><span class="pre">diff1()</span></code>, <code class="docutils literal notranslate"><span class="pre">diff2()</span></code>, <code class="docutils literal notranslate"><span class="pre">diffn()</span></code> were broken for polynomials of degrees 8 or more, due to a typo and @@ -476,7 +476,7 @@ was broken by an end-of-line space, left-over from mass conversion from LaTeX to TeX syntax.</p></li> </ul> </li> -<li><p>added:</p> +<li><p>Added:</p> <ul> <li><p><a class="reference internal" href="polexpr-ref.html#lpol"><span class="std std-ref">lpol()</span></a></p></li> <li><p><a class="reference internal" href="polexpr-ref.html#lcoeffs"><span class="std std-ref">lcoeffs()</span></a></p></li> @@ -484,16 +484,16 @@ from mass conversion from LaTeX to TeX syntax.</p></li> </li> </ul> </section> -<section id="v0-8-2-2021-05-05"> -<h2>v0.8.2 (2021/05/05)</h2> +<section id="id15"> +<h2>0.8.2 (2021/05/05)</h2> <ul class="simple"> -<li><p>breaking change:</p> +<li><p>Breaking change:</p> <ul> -<li><p>usage of <code class="docutils literal notranslate"><span class="pre">\xintPFloat</span></code> in place of <code class="docutils literal notranslate"><span class="pre">\xintFloat</span></code> for +<li><p>Usage of <code class="docutils literal notranslate"><span class="pre">\xintPFloat</span></code> in place of <code class="docutils literal notranslate"><span class="pre">\xintFloat</span></code> for <a class="reference internal" href="polexpr-ref.html#poltofloatexprcmd"><span class="std std-ref">\PolToFloatExprCmd</span></a>.</p></li> </ul> </li> -<li><p>improved:</p> +<li><p>Improved:</p> <ul> <li><p>Some <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> functions such as <code class="docutils literal notranslate"><span class="pre">rseq()</span></code> use the semi-colon, and it was mentioned in the documentation that <a class="reference internal" href="polexpr-ref.html#poldef"><span class="std std-ref">\poldef</span></a> @@ -504,60 +504,66 @@ this work-around. With this relase only <a class="reference internal" href="pol not <a class="reference internal" href="polexpr-ref.html#id5"><span class="std std-ref">\PolDef</span></a> needs the work-around.</p></li> </ul> </li> -<li><p>track <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <code class="docutils literal notranslate"><span class="pre">1.4e</span></code> changes relative to powers.</p></li> +<li><p>Track <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <code class="docutils literal notranslate"><span class="pre">1.4e</span></code> changes relative to powers.</p></li> </ul> </section> -<section id="v0-8-3-2021-05-27"> -<h2>v0.8.3 (2021/05/27)</h2> +<section id="id16"> +<h2>0.8.3 (2021/05/27)</h2> <ul class="simple"> -<li><p>small internal update to track an <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <code class="docutils literal notranslate"><span class="pre">1.4h</span></code> change +<li><p>Small internal update to track an <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <code class="docutils literal notranslate"><span class="pre">1.4h</span></code> change regarding handling of exceptions. Will require this version at least on loading.</p></li> </ul> </section> -<section id="v0-8-4-2021-11-01"> -<h2>v0.8.4 (2021/11/01)</h2> +<section id="id17"> +<h2>0.8.4 (2021/11/01)</h2> <ul class="simple"> -<li><p>bugfix: <a class="reference internal" href="polexpr-ref.html#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> did not declare the <code class="docutils literal notranslate"><span class="pre"><sturmname>_norr</span></code> and +<li><p>Bug fix: <a class="reference internal" href="polexpr-ref.html#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> did not declare the <code class="docutils literal notranslate"><span class="pre"><sturmname>_norr</span></code> and <code class="docutils literal notranslate"><span class="pre"><sturmname>_sqf_norr</span></code> polynomials if original polynomial had no real root!</p></li> </ul> </section> -<section id="v0-8-5-2021-11-30"> -<h2>v0.8.5 (2021/11/30)</h2> +<section id="id18"> +<h2>0.8.5 (2021/11/30)</h2> <ul class="simple"> -<li><p>bugfix: support for the <code class="docutils literal notranslate"><span class="pre">intfrom()</span></code> function was in the code, +<li><p>Bug fix: support for the <code class="docutils literal notranslate"><span class="pre">intfrom()</span></code> function was in the code, but the declaration to the polynomial parser had not been done.</p></li> -<li><p>track (belatedly) upstream deprecation of <code class="docutils literal notranslate"><span class="pre">\xintSignedFrac</span></code> and +<li><p>Track (belatedly) upstream deprecation of <code class="docutils literal notranslate"><span class="pre">\xintSignedFrac</span></code> and <code class="docutils literal notranslate"><span class="pre">\xintSignedFwOver</span></code> at <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <code class="docutils literal notranslate"><span class="pre">1.4g</span></code></p></li> </ul> </section> -<section id="v0-8-6-2022-01-09"> -<h2>v0.8.6 (2022/01/09)</h2> +<section id="id19"> +<h2>0.8.6 (2022/01/09)</h2> <ul class="simple"> -<li><p>provide a separate <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code> with examples formerly +<li><p>Provide a separate <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code> with examples formerly shown as part of the html documentation.</p></li> -<li><p>minor improvement to the computation of a priori bounds on real roots.</p></li> -<li><p>add <a class="reference internal" href="polexpr-ref.html#polprintintervalsrowseparator"><span class="std std-ref">\PolPrintIntervalsRowSeparator</span></a> +<li><p>Minor improvement to the computation of a priori bounds on real roots.</p></li> +<li><p>Add <a class="reference internal" href="polexpr-ref.html#polprintintervalsrowseparator"><span class="std std-ref">\PolPrintIntervalsRowSeparator</span></a> and allow usage of <code class="docutils literal notranslate"><span class="pre">amsmath</span></code> environments in custom <a class="reference internal" href="polexpr-ref.html#polprintintervalsbeginenv"><span class="std std-ref">\PolPrintIntervalsBeginEnv</span></a> and <a class="reference internal" href="polexpr-ref.html#polprintintervalsendenv"><span class="std std-ref">\PolPrintIntervalsEndEnv</span></a>.</p></li> </ul> </section> -<section id="v0-8-7-2022-05-14"> -<h2>v0.8.7 (2022/05/14)</h2> +<section id="id20"> +<h2>0.8.7 (2022/05/14)</h2> <ul class="simple"> -<li><p>bugfix: catcode sanitization by <a class="reference internal" href="polexpr-ref.html#poldef"><span class="std std-ref">\poldef</span></a> was minimal +<li><p>Bug fix: catcode sanitization by <a class="reference internal" href="polexpr-ref.html#poldef"><span class="std std-ref">\poldef</span></a> was minimal ever since <code class="docutils literal notranslate"><span class="pre">0.1</span></code> and handled only the semi-colon. Thus e.g. the active <code class="docutils literal notranslate"><span class="pre">!</span></code> from babel-french caused errors and <code class="docutils literal notranslate"><span class="pre">\string!</span></code> was needed as work-around for factorials. Now the same sanitization as for <code class="docutils literal notranslate"><span class="pre">\xintdefvar</span></code> and <code class="docutils literal notranslate"><span class="pre">\xintdeffunc</span></code> is applied. This however can only work at locations where the catcodes are not yet frozen at the time <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> expands.</p></li> -<li><p>split the html documentation into three files and enhance it via CSS +<li><p>Split the html documentation into three files and enhance it via CSS styling.</p></li> </ul> </section> +<section id="a-2022-05-19"> +<h2>0.8.7a (2022/05/19)</h2> +<ul class="simple"> +<li><p>Documentation updates.</p></li> +</ul> +</section> </section> @@ -569,28 +575,29 @@ styling.</p></li> <div class="sphinxsidebarwrapper"><h3>Contents of this page</h3> <ul> <li><a class="reference internal" href="#">CHANGES</a><ul> -<li><a class="reference internal" href="#v0-1-2018-01-11-initial-release-features">v0.1 (2018/01/11): initial release. Features:</a></li> -<li><a class="reference internal" href="#v0-2-2018-01-14">v0.2 (2018/01/14)</a></li> -<li><a class="reference internal" href="#v0-3-2018-01-17">v0.3 (2018/01/17)</a></li> -<li><a class="reference internal" href="#v0-3-1-2018-01-18">v0.3.1 (2018/01/18)</a></li> -<li><a class="reference internal" href="#v0-4-2018-02-16">v0.4 (2018/02/16)</a></li> -<li><a class="reference internal" href="#v0-4-1-2018-03-01">v0.4.1 (2018/03/01)</a></li> -<li><a class="reference internal" href="#v0-4-2-2018-03-03">v0.4.2 (2018/03/03)</a></li> -<li><a class="reference internal" href="#v0-5-2018-04-08">v0.5 (2018/04/08)</a></li> -<li><a class="reference internal" href="#v0-5-1-2018-04-22">v0.5.1 (2018/04/22)</a></li> -<li><a class="reference internal" href="#v0-6-2018-11-20">v0.6 (2018/11/20)</a></li> -<li><a class="reference internal" href="#v0-7-2018-12-08-v0-7-1-bugfix-v0-7-2-2nd-bugfix-2018-12-09">v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09)</a></li> -<li><a class="reference internal" href="#v0-7-3-2019-02-04">v0.7.3 (2019/02/04)</a></li> -<li><a class="reference internal" href="#v0-7-4-2019-02-12">v0.7.4 (2019/02/12)</a></li> -<li><a class="reference internal" href="#v0-7-5-2020-01-31">v0.7.5 (2020/01/31)</a></li> -<li><a class="reference internal" href="#v0-8-2021-03-29">v0.8 (2021/03/29)</a></li> -<li><a class="reference internal" href="#v0-8-1-2021-04-12">v0.8.1 (2021/04/12)</a></li> -<li><a class="reference internal" href="#v0-8-2-2021-05-05">v0.8.2 (2021/05/05)</a></li> -<li><a class="reference internal" href="#v0-8-3-2021-05-27">v0.8.3 (2021/05/27)</a></li> -<li><a class="reference internal" href="#v0-8-4-2021-11-01">v0.8.4 (2021/11/01)</a></li> -<li><a class="reference internal" href="#v0-8-5-2021-11-30">v0.8.5 (2021/11/30)</a></li> -<li><a class="reference internal" href="#v0-8-6-2022-01-09">v0.8.6 (2022/01/09)</a></li> -<li><a class="reference internal" href="#v0-8-7-2022-05-14">v0.8.7 (2022/05/14)</a></li> +<li><a class="reference internal" href="#initial-release-features">0.1 (2018/01/11): initial release. Features:</a></li> +<li><a class="reference internal" href="#id1">0.2 (2018/01/14)</a></li> +<li><a class="reference internal" href="#id2">0.3 (2018/01/17)</a></li> +<li><a class="reference internal" href="#id3">0.3.1 (2018/01/18)</a></li> +<li><a class="reference internal" href="#id4">0.4 (2018/02/16)</a></li> +<li><a class="reference internal" href="#id5">0.4.1 (2018/03/01)</a></li> +<li><a class="reference internal" href="#id6">0.4.2 (2018/03/03)</a></li> +<li><a class="reference internal" href="#id7">0.5 (2018/04/08)</a></li> +<li><a class="reference internal" href="#id8">0.5.1 (2018/04/22)</a></li> +<li><a class="reference internal" href="#id9">0.6 (2018/11/20)</a></li> +<li><a class="reference internal" href="#bugfix-0-7-2-2nd-bugfix-2018-12-09">0.7 (2018/12/08), 0.7.1 (bugfix), 0.7.2 (2nd bugfix) (2018/12/09)</a></li> +<li><a class="reference internal" href="#id10">0.7.3 (2019/02/04)</a></li> +<li><a class="reference internal" href="#id11">0.7.4 (2019/02/12)</a></li> +<li><a class="reference internal" href="#id12">0.7.5 (2020/01/31)</a></li> +<li><a class="reference internal" href="#polexpr08release">0.8 (2021/03/29)</a></li> +<li><a class="reference internal" href="#id14">0.8.1 (2021/04/12)</a></li> +<li><a class="reference internal" href="#id15">0.8.2 (2021/05/05)</a></li> +<li><a class="reference internal" href="#id16">0.8.3 (2021/05/27)</a></li> +<li><a class="reference internal" href="#id17">0.8.4 (2021/11/01)</a></li> +<li><a class="reference internal" href="#id18">0.8.5 (2021/11/30)</a></li> +<li><a class="reference internal" href="#id19">0.8.6 (2022/01/09)</a></li> +<li><a class="reference internal" href="#id20">0.8.7 (2022/05/14)</a></li> +<li><a class="reference internal" href="#a-2022-05-19">0.8.7a (2022/05/19)</a></li> </ul> </li> </ul> @@ -617,7 +624,7 @@ styling.</p></li> <li class="right" style="margin-right: 10px"> <a href="polexpr-ref.html" title="polexpr reference" >previous</a></li> - <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">CHANGES</a></li> </ul> </div> diff --git a/macros/generic/polexpr/polexpr-changes.rst.txt b/macros/generic/polexpr/polexpr-changes.rst.txt index c1f2c834ec..5ecc66f5f5 100644 --- a/macros/generic/polexpr/polexpr-changes.rst.txt +++ b/macros/generic/polexpr/polexpr-changes.rst.txt @@ -6,8 +6,8 @@ .. _firstrelease: -v0.1 (2018/01/11): initial release. Features: ---------------------------------------------- +0.1 (2018/01/11): initial release. Features: +-------------------------------------------- * The :ref:`\\poldef <poldef;>` parser itself, * Differentiation and anti-differentiation, @@ -18,8 +18,8 @@ v0.1 (2018/01/11): initial release. Features: Only one-variable polynomials so far. -v0.2 (2018/01/14) ------------------ +0.2 (2018/01/14) +---------------- * Fix: ``"README thinks \numexpr recognizes ^ operator"``. * Convert README to reStructuredText markup. @@ -30,18 +30,18 @@ v0.2 (2018/01/14) Due to lack of available time the test suite might not be extensive enough. Bug reports are very welcome! -v0.3 (2018/01/17) ------------------ +0.3 (2018/01/17) +---------------- -* bug fixes: +* Bug fixes: - - the ``0.1`` :ref:`\\PolEval <PolEvalAt>` accepted expressions for its + - The ``0.1`` :ref:`\\PolEval <PolEvalAt>` accepted expressions for its second argument, but this was removed by mistake at ``0.2``. Restored. **Attention**: at ``0.4`` this has been reverted again, and :ref:`\\PolEval{P}\\AtExpr{foo} <PolEvalAtExpr>` syntax is needed for using expressions in the second argument. -* incompatible or breaking changes: +* Incompatible or breaking changes: - :ref:`\\PolToExpr <PolToExpr>` now by default uses *descending* powers (it also treats differently coefficients equal to 1 or -1.) @@ -51,7 +51,7 @@ v0.3 (2018/01/17) wrapped in an ``\xintRound`` or ``\xintFloat``, this step has been removed; the former meaning is available as :ref:`\\PolEvalReduced <PolEvalReducedAt>`. -* new (or newly documented) macros: +* New (or newly documented) macros: - :ref:`\\PolTypesetCmd <PolTypesetCmd>` - :ref:`\\PolTypesetCmdPrefix <PolTypesetCmdPrefix>` @@ -65,11 +65,11 @@ v0.3 (2018/01/17) - :ref:`\\PolToExprTermPrefix <PolToExprTermPrefix>` - :ref:`\\PolToExprVar <PolToExprVar>` - :ref:`\\PolToExprTimes <PolToExprTimes>` -* improvements: +* Improvements: - - documentation has a table of contents, internal hyperlinks, + - Documentation has a table of contents, internal hyperlinks, standardized signature notations and added explanations. - - one can do ``\PolLet{g}={f}`` or ``\PolLet{g}{f}``. + - One can do ``\PolLet{g}={f}`` or ``\PolLet{g}{f}``. - ``\PolToExpr{f}`` is highly customizable. - :ref:`\\poldef <poldef;>` and other defining macros prepare the polynomial functions for usage within ``\xintthefloatexpr`` (or @@ -82,25 +82,25 @@ v0.3 (2018/01/17) :ref:`\\PolGenFloatVariant <PolGenFloatVariant>` must be used for generation floating point polynomial functions. -v0.3.1 (2018/01/18) -------------------- +0.3.1 (2018/01/18) +------------------ Fixes two typos in example code included in the documentation. -v0.4 (2018/02/16) ------------------ +0.4 (2018/02/16) +---------------- -* bug fixes: +* Bug fixes: - - when Euclidean division gave a zero remainder, the internal + - When Euclidean division gave a zero remainder, the internal representation of this zero polynomial could be faulty; this could cause mysterious bugs in conjunction with other package macros such as :ref:`\\PolMapCoeffs <PolMapCoeffs>`. - :ref:`\\PolGCD <PolGCD>` was buggy in case of first polynomial being of lesser degree than the second one. -* breaking changes: +* Breaking changes: - - formerly :ref:`\\PolEval{P}\\At{foo} <PolEvalAt>` allowed ``foo`` to + - Formerly :ref:`\\PolEval{P}\\At{foo} <PolEvalAt>` allowed ``foo`` to be an expression, which was transparently handled via ``\xinttheexpr``. Now, ``foo`` must be a fraction (or a macro expanding to such) in the format acceptable by ``xintfrac.sty`` @@ -110,13 +110,13 @@ v0.4 (2018/02/16) The same holds for :ref:`\\PolEvalReduced <PolEvalReducedAt>` and :ref:`\\PolFloatEval <PolFloatEvalAt>`. - - the ``3.0`` automatic generation of floating point variants has + - The ``3.0`` automatic generation of floating point variants has been reverted. Not only do *not* the package macros automatically generate floating point variants of newly created polynomials, they actually make pre-existing such variant undefined. See :ref:`\\PolGenFloatVariant <PolGenFloatVariant>`. -* new non-expandable macros: +* New non-expandable macros: - :ref:`\\PolGenFloatVariant <PolGenFloatVariant>` - :ref:`\\PolGlobalLet <PolGlobalLet>` @@ -138,7 +138,7 @@ v0.4 (2018/02/16) - :ref:`\\PolPrintIntervalsPrintRightEndPoint <PolPrintIntervalsPrintRightEndPoint>` - :ref:`\\PolReduceCoeffs* <PolReduceCoeffs*>` - :ref:`\\PolMakeMonic <PolMakeMonic>` -* new expandable macros: +* New expandable macros: - :ref:`\\PolToExprOneTermStyleA <PolToExprOneTermStyleA>` - :ref:`\\PolIfCoeffIsPlusOrMinusOne <PolIfCoeffIsPlusOrMinusOne>` @@ -155,80 +155,80 @@ v0.4 (2018/02/16) - ``\PolIfEndPointIsZero`` (removed at 0.7) - :ref:`\\PolIntervalWidth <PolIntervalWidth>` - :ref:`\\PolDecToString <PolDecToString>` -* improvements: +* Improvements: The main new feature is implementation of the `Sturm algorithm`_ for localization of the real roots of polynomials. -v0.4.1 (2018/03/01) -------------------- +0.4.1 (2018/03/01) +------------------ Synced with xint 1.3. -v0.4.2 (2018/03/03) -------------------- +0.4.2 (2018/03/03) +------------------ Documentation fix. -v0.5 (2018/04/08) ------------------ +0.5 (2018/04/08) +---------------- -* bug fixes: +* Bug fix: - :ref:`\\PolGet{polname}\\fromarray\\macro <PolGet>` crashed when ``\macro`` was an xinttools_ array macro with no items. It now produces the zero polynomial. -* breaking changes: +* Breaking changes: - :ref:`\\PolToSturm <PolToSturm>` creates primitive integer coefficients polynomials. This speeds up localization of roots via :ref:`\\PolSturmIsolateZeros <PolSturmIsolateZeros>`. In case of user protests the author will make available again the code producing the bona fide Sturm polynomials as used formerly. - - polynomials created from :ref:`\\PolFromCSV <PolFromCSV>` or + - Polynomials created from :ref:`\\PolFromCSV <PolFromCSV>` or :ref:`\\PolGet <PolGet>` get their coefficients normalized via xintfrac_\ 's ``\xintRaw``. -* experimental change: +* Experimental change: - - optional argument to :ref:`\\PolSturmIsolateZeros <PolSturmIsolateZeros>` + - Optional argument to :ref:`\\PolSturmIsolateZeros <PolSturmIsolateZeros>` (see ``The degree 41 polynomial with -2, -1.9, -1.8, ..., 0, 0.1, ..., 1.9, 2 as roots`` in ``polexpr-examples.pdf``). It will presumably be replaced in future by an interval specification. -* new non-expandable macro: +* New non-expandable macro: - :ref:`\\PolMakePrimitive <PolMakePrimitive>` -* new expandable macro: +* New expandable macro: - :ref:`\\PolIContent <PolIContent>` -v0.5.1 (2018/04/22) -------------------- +0.5.1 (2018/04/22) +------------------ -* new feature: +* New feature: - - the character ``'`` can be used in polynomial names. + - The character ``'`` can be used in polynomial names. -v0.6 (2018/11/20) ------------------ +0.6 (2018/11/20) +---------------- -* bugfix: +* Bug fixes: - - the starred variant + - The starred variant :ref:`\\PolToSturm*{\<polname\>}{\<sturmname\>} <PolToSturm*>` was broken. On the occasion of the fix, its meaning has been modified, see its documentation. - - using :ref:`\\PolToSturm <PolToSturm>` with a constant polynomial + - Using :ref:`\\PolToSturm <PolToSturm>` with a constant polynomial caused a division by zero error. -* new macro: +* New macro: - :ref:`\\PolSturmIsolateZeros* <PolSturmIsolateZeros*>` acts like the :ref:`non-starred variant <PolSturmIsolateZeros>` then computes all the multiplicities. -* new expandable macros: +* New expandable macros: - :ref:`\\PolSturmIsolatedZeroMultiplicity{\<sturmname\>}{\<index\>} <PolSturmIsolatedZeroMultiplicity>` - :ref:`\\PolSturmNbOfRootsOf{\<sturmname\>}\\LessThanOrEqualTo{\<value\>} <PolSturmNbOfRootsOfLessThanOrEqualTo>` @@ -236,21 +236,21 @@ v0.6 (2018/11/20) - :ref:`\\PolSturmNbWithMultOfRootsOf{\<sturmname\>}\\LessThanOrEqualTo{\<value\>} <PolSturmNbWithMultOfRootsOfLessThanOrEqualTo>` - :ref:`\\PolSturmNbWithMultOfRootsOf{\<sturmname\>}\\LessThanOrEqualToExpr{\<num. expr.\>} <PolSturmNbWithMultOfRootsOfLessThanOrEqualToExpr>` -v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09) --------------------------------------------------------------------- +0.7 (2018/12/08), 0.7.1 (bugfix), 0.7.2 (2nd bugfix) (2018/12/09) +----------------------------------------------------------------- -* breaking changes: +* Breaking changes: - - although :ref:`\\PolPrintIntervals[\<varname\>]{\<sturmname\>} <PolPrintIntervals>` default output + - Although :ref:`\\PolPrintIntervals[\<varname\>]{\<sturmname\>} <PolPrintIntervals>` default output remains the same, some auxiliary macros for user-customization have been removed: ``\PolPrintIntervalsTheEndPoint``, ``\PolIfEndPointIsPositive{T}{F}``, ``\PolIfEndPointIsNegative{T}{F}``, and ``\PolIfEndPointIsZero{T}{F}``. -* bugfix: +* Bug fixes: - - it could happen that, contrarily to documentation, an interval computed + - It could happen that, contrarily to documentation, an interval computed by :ref:`\\PolSturmIsolateZeros{\<sturmname\>} <PolSturmIsolateZeros>` had zero as an endpoint, - :ref:`\\PolEnsureIntervalLength{\<sturmname\>}{\<index\>}{\<exponent\>} @@ -261,7 +261,7 @@ v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09) real roots, hence for which no isolation intervals existed (thanks to Thomas Söll for report). -* new macros: +* New macros: - :ref:`\\PolSturmIsolateZeros**{\<sturmname\>} <PolSturmIsolateZeros**>` - :ref:`\\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots{\<sturmname\>} <PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots>` @@ -275,7 +275,7 @@ v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09) - :ref:`\\PolPrintIntervalsUnknownRoot <PolPrintIntervalsUnknownRoot>` - :ref:`\\PolPrintIntervalsPrintMultiplicity <PolPrintIntervalsPrintMultiplicity>` -* new expandable macros: +* New expandable macros: - :ref:`\\PolSturmNbOfRationalRoots{\<sturmname\>} <PolSturmNbOfRationalRoots>` - :ref:`\\PolSturmNbOfRationalRootsWithMultiplicities{\<sturmname\>} <PolSturmNbOfRationalRootsWithMultiplicities>` @@ -286,10 +286,10 @@ v0.7 (2018/12/08), v0.7.1 (bugfix), v0.7.2 (2nd bugfix) (2018/12/09) - :ref:`\\PolPrintIntervalsTheSturmName <PolPrintIntervalsTheSturmName>` - :ref:`\\PolPrintIntervalsTheMultiplicity <PolPrintIntervalsTheMultiplicity>` -v0.7.3 (2019/02/04) -------------------- +0.7.3 (2019/02/04) +------------------ -* bugfix: +* Bug fixes: - Debugging information not destined to user showed in log if root finding was done under ``\xintverbosetrue`` regime. @@ -302,27 +302,27 @@ v0.7.3 (2019/02/04) - Polynomial names ending in digits caused errors (reported by Thomas Söll). -v0.7.4 (2019/02/12) -------------------- +0.7.4 (2019/02/12) +------------------ -* bugfix: +* Bug fix: - 20000000000 is too big for ``\numexpr``, shouldn't I know that? Thanks to Jürgen Gilg for report. -v0.7.5 (2020/01/31) -------------------- +0.7.5 (2020/01/31) +------------------ Synced with xintexpr 1.4. Requires it. .. _polexpr08release: -v0.8 (2021/03/29) ------------------ +0.8 (2021/03/29) +---------------- Synced with xintexpr 1.4d. Requires it. -* breaking changes: +* Breaking changes: - As the usability of character ``'`` in names has been extended from ``\poldef`` to also generally ``\xintexpr``, ``\xintdefvar``, @@ -336,12 +336,12 @@ Synced with xintexpr 1.4d. Requires it. ``^``. See its documentation and the new configuration :ref:`\\PolToExprCaret <PolToExprCaret>`. -* deprecated: +* Deprecated: - Usage of ``P/Q`` for the euclidean quotient of two polynomials is deprecated. Start using ``quo(P,Q)`` in its place. -* bugfix: +* Bug fixes: - The ``\xintglobaldefstrue`` setting was obeyed only partially by the polexpr macros defining polynomials. @@ -358,17 +358,17 @@ Synced with xintexpr 1.4d. Requires it. extended possibilities for xintexpr 1.4 user-declared functions. Hopefully ``0.8`` achieves full functionality in this context. -* new macros: +* New macros: - :ref:`\\polnewpolverbosefalse <polnewpolverbosefalse>` - :ref:`\\PolToExprCaret <PolToExprCaret>` - :ref:`\\PolToExprInVar <PolToExprInVar>` - - alongside the major new functionalities described in the next item + - Alongside the major new functionalities described in the next item :ref:`\\PolTypeset <PolTypeset>` and :ref:`\\PolToExpr <PolToExpr>` have been enhanced to accept as argument a general expression and not only a pre-declared polynomial name. -* new features: +* New features: - The package is usable under Plain and probably most any TeX format, and not only under LaTeX. @@ -392,15 +392,15 @@ Synced with xintexpr 1.4d. Requires it. See the updated :ref:`Quick syntax overview <quick>` and then :ref:`the extended syntax description <polexpr08>`. -v0.8.1 (2021/04/12) -------------------- +0.8.1 (2021/04/12) +------------------ -* breaking changes: +* Breaking changes: - - renamed v0.8's ``icontent()`` to :ref:`cont() <cont>`. - - renamed v0.8's ``lcoeff()`` to :ref:`lc() <lc>`. + - Renamed 0.8's ``icontent()`` to :ref:`cont() <cont>`. + - Renamed 0.8's ``lcoeff()`` to :ref:`lc() <lc>`. -* bugfix: +* Bug fixes: - Sadly, ``diff1()``, ``diff2()``, ``diffn()`` were broken for polynomials of degrees 8 or more, due to a typo and @@ -415,20 +415,20 @@ v0.8.1 (2021/04/12) was broken by an end-of-line space, left-over from mass conversion from LaTeX to TeX syntax. -* added: +* Added: - :ref:`lpol() <lpol>` - :ref:`lcoeffs() <lcoeffs>` -v0.8.2 (2021/05/05) -------------------- +0.8.2 (2021/05/05) +------------------ -* breaking change: +* Breaking change: - - usage of ``\xintPFloat`` in place of ``\xintFloat`` for + - Usage of ``\xintPFloat`` in place of ``\xintFloat`` for :ref:`\\PolToFloatExprCmd <PolToFloatExprCmd>`. -* improved: +* Improved: - Some xintexpr_ functions such as ``rseq()`` use the semi-colon, and it was mentioned in the documentation that :ref:`\\poldef <poldef;>` @@ -438,49 +438,49 @@ v0.8.2 (2021/05/05) this work-around. With this relase only :ref:`\\poldef <poldef;>` but not :ref:`\\PolDef <PolDef>` needs the work-around. -* track xintexpr_ ``1.4e`` changes relative to powers. +* Track xintexpr_ ``1.4e`` changes relative to powers. -v0.8.3 (2021/05/27) -------------------- +0.8.3 (2021/05/27) +------------------ -* small internal update to track an xintexpr_ ``1.4h`` change +* Small internal update to track an xintexpr_ ``1.4h`` change regarding handling of exceptions. Will require this version at least on loading. -v0.8.4 (2021/11/01) -------------------- +0.8.4 (2021/11/01) +------------------ -* bugfix: :ref:`\\PolSturmIsolateZeros**{\<sturmname\>} +* Bug fix: :ref:`\\PolSturmIsolateZeros**{\<sturmname\>} <PolSturmIsolateZeros**>` did not declare the ``<sturmname>_norr`` and ``<sturmname>_sqf_norr`` polynomials if original polynomial had no real root! -v0.8.5 (2021/11/30) -------------------- +0.8.5 (2021/11/30) +------------------ -* bugfix: support for the ``intfrom()`` function was in the code, +* Bug fix: support for the ``intfrom()`` function was in the code, but the declaration to the polynomial parser had not been done. -* track (belatedly) upstream deprecation of ``\xintSignedFrac`` and +* Track (belatedly) upstream deprecation of ``\xintSignedFrac`` and ``\xintSignedFwOver`` at xintexpr_ ``1.4g`` -v0.8.6 (2022/01/09) -------------------- +0.8.6 (2022/01/09) +------------------ -* provide a separate ``polexpr-examples.pdf`` with examples formerly +* Provide a separate ``polexpr-examples.pdf`` with examples formerly shown as part of the html documentation. -* minor improvement to the computation of a priori bounds on real roots. +* Minor improvement to the computation of a priori bounds on real roots. -* add :ref:`\\PolPrintIntervalsRowSeparator <PolPrintIntervalsRowSeparator>` +* Add :ref:`\\PolPrintIntervalsRowSeparator <PolPrintIntervalsRowSeparator>` and allow usage of ``amsmath`` environments in custom :ref:`\\PolPrintIntervalsBeginEnv <PolPrintIntervalsBeginEnv>` and :ref:`\\PolPrintIntervalsEndEnv <PolPrintIntervalsEndEnv>`. -v0.8.7 (2022/05/14) -------------------- +0.8.7 (2022/05/14) +------------------ -* bugfix: catcode sanitization by :ref:`\\poldef <poldef;>` was minimal +* Bug fix: catcode sanitization by :ref:`\\poldef <poldef;>` was minimal ever since ``0.1`` and handled only the semi-colon. Thus e.g. the active ``!`` from babel-french caused errors and ``\string!`` was needed as work-around for factorials. Now the same sanitization as @@ -488,9 +488,14 @@ v0.8.7 (2022/05/14) only work at locations where the catcodes are not yet frozen at the time ``\poldef`` expands. -* split the html documentation into three files and enhance it via CSS +* Split the html documentation into three files and enhance it via CSS styling. +0.8.7a (2022/05/19) +------------------- + +* Documentation updates. + .. _xinttools: .. _xintfrac: diff --git a/macros/generic/polexpr/polexpr-examples.pdf b/macros/generic/polexpr/polexpr-examples.pdf Binary files differindex 5be0a95a42..943e251c82 100644 --- a/macros/generic/polexpr/polexpr-examples.pdf +++ b/macros/generic/polexpr/polexpr-examples.pdf diff --git a/macros/generic/polexpr/polexpr-ref.html b/macros/generic/polexpr/polexpr-ref.html index 9f3767c48d..7f1b54b749 100644 --- a/macros/generic/polexpr/polexpr-ref.html +++ b/macros/generic/polexpr/polexpr-ref.html @@ -6,7 +6,7 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> - <title>polexpr reference — polexpr 0.8.7 documentation</title> + <title>polexpr reference — polexpr 0.8.7a documentation</title> <link rel="stylesheet" type="text/css" href="polexpr.css" /> <link rel="next" title="CHANGES" href="polexpr-changes.html" /> <link rel="prev" title="Introduction to polexpr" href="polexpr.html" /> @@ -20,7 +20,7 @@ <li class="right" > <a href="polexpr.html" title="Introduction to polexpr" accesskey="P">previous</a> |</li> - <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">polexpr reference</a></li> </ul> </div> @@ -49,18 +49,15 @@ and, so far (but this may change in future) neither does <a class="reference int See <a class="reference internal" href="#rdcoeffs"><span class="std std-ref">rdcoeffs()</span></a> and the macro <a class="reference internal" href="#polreducecoeffs"><span class="std std-ref">\PolReduceCoeffs</span></a>.</p> </div> -<ul class="simple"> +<ul> <li><p>In place of <code class="docutils literal notranslate"><span class="pre">x</span></code> an arbitrary <em>dummy variable</em> is authorized, i.e. per default one <code class="docutils literal notranslate"><span class="pre">a,</span> <span class="pre">..,</span> <span class="pre">z,</span> <span class="pre">A,</span> <span class="pre">..,</span> <span class="pre">Z</span></code> (more letters can be declared under Unicode engines).</p></li> -<li><p><code class="docutils literal notranslate"><span class="pre">polname</span></code> consists of <em>letters</em>, <em>digits</em>, and also the <code class="docutils literal notranslate"><span class="pre">_</span></code> and -<code class="docutils literal notranslate"><span class="pre">'</span></code> characters are allowed. The polynomial name <strong>must</strong> start with -a letter: do not use the underscore <code class="docutils literal notranslate"><span class="pre">_</span></code> as <em>first character</em> of a -polynomial name (even if of catcode letter). No warning is emitted -but dire consequences will ensue. The <code class="docutils literal notranslate"><span class="pre">@</span></code> is also allowed -(independently of its catcode “letter” or “other”, which does not -matter). It is recommended to avoid using it as first character, -except for temporary polynomial variables.</p></li> +<li><p><code class="docutils literal notranslate"><span class="pre">polname</span></code> is a word (no space) built with <em>letters</em>, <em>digits</em>, and +the <code class="docutils literal notranslate"><span class="pre">@</span></code>, <code class="docutils literal notranslate"><span class="pre">_</span></code> and <code class="docutils literal notranslate"><span class="pre">'</span></code> characters are allowed. The polynomial +name <strong>must</strong> start with a letter.</p> +<p>For guidelines regarding <code class="docutils literal notranslate"><span class="pre">_</span></code> and <code class="docutils literal notranslate"><span class="pre">@</span></code> see <a class="reference internal" href="#technicalities">Technicalities</a>.</p> +</li> <li><p>The colon before the equality sign is optional and its (reasonable) catcode does not matter.</p></li> <li><p>The semi-colon at the end of the expression is mandatory. It is not @@ -248,7 +245,7 @@ coefficients.</p> <p>This is useful for console or file output. This syntax is Maple and PSTricks <code class="docutils literal notranslate"><span class="pre">\psplot[algebraic]</span></code> compatible; and also it is compatible with <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> input syntax, of course. See -<a class="reference internal" href="#id69">\PolToExprCaret</a> for configuration of the <code class="docutils literal notranslate"><span class="pre">^</span></code>, for example to +<a class="reference internal" href="#id70">\PolToExprCaret</a> for configuration of the <code class="docutils literal notranslate"><span class="pre">^</span></code>, for example to use rather <code class="docutils literal notranslate"><span class="pre">**</span></code> for Python syntax compliance.</p> <p>Changed at <code class="docutils literal notranslate"><span class="pre">0.8</span></code>: the <code class="docutils literal notranslate"><span class="pre">^</span></code> in output is by default of catcode 12 so in a draft document one can use <code class="docutils literal notranslate"><span class="pre">\PolToExpr{P}</span></code> inside the @@ -966,7 +963,8 @@ coefficients in a private structure accessible later via other package macros, used with argument <code class="docutils literal notranslate"><span class="pre">polname</span></code>. Of course the <em>expression</em> can make use of previously defined polynomials.</p> <p>Polynomial names must start with a letter and are constituted of -letters, digits, underscores and the right tick <code class="docutils literal notranslate"><span class="pre">'</span></code>.</p> +letters, digits, underscores, the <code class="docutils literal notranslate"><span class="pre">@</span></code> (see <a class="reference internal" href="#technicalities">Technicalities</a>) and +the right tick <code class="docutils literal notranslate"><span class="pre">'</span></code>.</p> <p>The whole <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> syntax is authorized, as long as the final result is of polynomial type:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\poldef</span> polname(z) := add((-1)<span class="nb">^</span>i z<span class="nb">^</span>(2i+1)/(2i+1)!, i = 0..10); @@ -983,16 +981,16 @@ as well as in <code class="docutils literal notranslate"><span class="pre">\xint and also other polynomials (via their names, thanks to previous item).</p></li> </ul> -<p>Notice that any function defined via <code class="docutils literal notranslate"><span class="pre">\xintdeffunc</span></code> and using -only algebraic operations (and ople indexing or slicing operations) -should work fine in <code class="docutils literal notranslate"><span class="pre">\xintexpr/\xinteval</span></code> with such polynomial -names as argument.</p> -<p>In the case of a constant polynomial, the <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> variable (not the -internal data structure on which the package macros operate) +<p>Any function defined via <code class="docutils literal notranslate"><span class="pre">\xintdeffunc</span></code> and only algebraic +operations, as well as ople indexing or slicing operations, should +work fine in <code class="docutils literal notranslate"><span class="pre">\xintexpr/\xinteval</span></code> with such polynomial names as +argument.</p> +<p>In the case of a constant polynomial, the <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> <em>variable</em> (not +the internal data structure on which the package macros operate) associated to it is indistinguishable from a scalar, it is actually a scalar and has lost all traces from its origins as a polynomial -(so for example can be used as argument to the <code class="docutils literal notranslate"><span class="pre">cos()</span></code> function).</p> -<p>The <em>function</em> on the other hand remains a one-argument function, +(so for example can be used as argument to the <code class="docutils literal notranslate"><span class="pre">cos()</span></code> function). +The <em>function</em> on the other hand remains a one-argument function, which simply has a constant value.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> @@ -1001,7 +999,7 @@ which simply has a constant value.</p> context. It will be unknown to <code class="docutils literal notranslate"><span class="pre">\xintfloateval</span></code>.</p> <p>Worse, a previously existing floating point function of the same name will -be let undefined again, to avoid hard to debug mismatches between +be made undefined again, to avoid hard to debug mismatches between exact and floating point polynomials. This also applies when the polynomial is produced not via <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> or <code class="docutils literal notranslate"><span class="pre">\PolDef</span></code> but as result of usage of the other package macros.</p> @@ -1058,18 +1056,18 @@ the new polynomial is to be used in <code class="docutils literal notranslate">< </div></blockquote> </section> <section id="poltypeset"> -<span id="id7"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolTypeset{}</span></code></h3> -<p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolTypeset{<pol.</span> <span class="pre">expr.>}</span></code></p> +<span id="id7"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolTypeset[]{}</span></code></h3> +<p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolTypeset[<letter>]{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> <div><p>Typesets in descending powers, switching to math mode if in text mode, after evaluating the polynomial expression:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\PolTypeset</span><span class="nb">{</span>mul(x-i,i=1..5)<span class="nb">}</span><span class="c">% possible since polexpr 0.8</span> </pre></div> </div> -<p>The letter used in the input expression is by default <code class="docutils literal notranslate"><span class="pre">x</span></code>, -but can be modified by a redefinition of <a class="reference internal" href="#id67">\PolToExprInVar</a>.</p> -<p>It uses also by default the letter <code class="docutils literal notranslate"><span class="pre">x</span></code> on output but this one can -be changed via an optional argument:</p> +<p>The letter used in the input is by default assumed to be <code class="docutils literal notranslate"><span class="pre">x</span></code>, +but can be modified by a redefinition of <a class="reference internal" href="#id68">\PolToExprInVar</a>.</p> +<p>The letter used in the output is also by default <code class="docutils literal notranslate"><span class="pre">x</span></code>. This one +can be changed on-the-fly via the optional <code class="docutils literal notranslate"><span class="pre"><letter></span></code>:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\PolTypeset</span><span class="na">[z]</span><span class="nb">{</span>polname or polynomial expression<span class="nb">}</span> </pre></div> </div> @@ -1148,18 +1146,19 @@ separator in the typeset formula. Not used for the first term.</p> </section> </section> <section id="id13"> -<span id="id14"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolTypeset*{}</span></code></h3> -<p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolTypeset*{<pol.</span> <span class="pre">expr.>}</span></code></p> +<span id="id14"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolTypeset*[]{}</span></code></h3> +<p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolTypeset*[<letter>]{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> -<div><p>Typesets in ascending powers. Use <code class="docutils literal notranslate"><span class="pre">[<letter>]</span></code> optional argument -(after the <code class="docutils literal notranslate"><span class="pre">*</span></code>) to use another letter than <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p> +<div><p>Typesets in ascending powers. The <code class="docutils literal notranslate"><span class="pre"><letter></span></code> optional argument +(after the <code class="docutils literal notranslate"><span class="pre">*</span></code>) declares the letter to use in the <em>output</em>. +As for <a class="reference external" href="PolTypeset">\PolTypeset</a>, it defaults to <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p> +<p>To modify the expected <code class="docutils literal notranslate"><span class="pre">x</span></code> in the <em>input</em>, see <a class="reference internal" href="#id68">\PolToExprInVar</a>.</p> <p>Extended at <code class="docutils literal notranslate"><span class="pre">0.8</span></code> to accept general expressions and not only -polynomial names. Redefine <a class="reference internal" href="#id67">\PolToExprInVar</a> to use in the -expression another letter than default <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p> +polynomial names.</p> </div></blockquote> </section> <section id="pollet"> -<span id="id15"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolLet{}={}</span></code></h3> +<span id="id16"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolLet{}={}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolLet{<polname_2>}={<polname_1>}</span></code></p> <blockquote> <div><p>Makes a copy of the already defined polynomial <code class="docutils literal notranslate"><span class="pre">polname_1</span></code> to a @@ -1170,7 +1169,7 @@ new one <code class="docutils literal notranslate"><span class="pre">polname_2</ </div></blockquote> </section> <section id="polgloballet"> -<span id="id16"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolGlobalLet{}={}</span></code></h3> +<span id="id17"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolGlobalLet{}={}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolGlobalLet{<polname_2>}={<polname_1>}</span></code></p> <blockquote> <div><p>Acts globally.</p> @@ -1212,7 +1211,7 @@ via <a class="reference external" href="https://www.ctan.org/pkg/xint">xintfrac< </div></blockquote> </section> <section id="polfromcsv"> -<span id="id17"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolFromCSV{}{}</span></code></h3> +<span id="id18"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolFromCSV{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolFromCSV{<polname>}{<csv>}</span></code></p> <blockquote> <div><p>Defines a polynomial directly from the comma separated list of values @@ -1230,7 +1229,7 @@ form via <a class="reference external" href="https://www.ctan.org/pkg/xint">xint </div></blockquote> </section> <section id="polmapcoeffs"> -<span id="id18"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMapCoeffs{}{}</span></code></h3> +<span id="id19"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMapCoeffs{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolMapCoeffs{\macro}{<polname>}</span></code></p> <blockquote> <div><p>It modifies (‘in-place’: original coefficients get lost) each @@ -1251,15 +1250,15 @@ expressed in terms of macros from the <a class="reference external" href="https: </div></blockquote> </section> <section id="polreducecoeffs"> -<span id="id19"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs{}</span></code></h3> +<span id="id20"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs{<polname>}</span></code></p> <blockquote> <div><p>Reduces the internal representations of the coefficients to their lowest terms.</p> </div></blockquote> </section> -<section id="id20"> -<span id="id21"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs*{}</span></code></h3> +<section id="id21"> +<span id="id22"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs*{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs*{<polname>}</span></code></p> <blockquote> <div><p>Reduces the internal representations of the coefficients to their @@ -1275,18 +1274,18 @@ remain generally smaller.</p> </div></blockquote> </section> <section id="polmakemonic"> -<span id="id22"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMakeMonic{}</span></code></h3> +<span id="id23"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMakeMonic{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolMakeMonic{<polname>}</span></code></p> <blockquote> <div><p>Divides by the leading coefficient. It is recommended to execute -<a class="reference internal" href="#id20"><span class="std std-ref">\PolReduceCoeffs*{<polname>}</span></a> immediately afterwards. This is not +<a class="reference internal" href="#id21"><span class="std std-ref">\PolReduceCoeffs*{<polname>}</span></a> immediately afterwards. This is not done automatically, in case the original polynomial had integer coefficients and the user wants to keep the leading one as common denominator for typesetting purposes.</p> </div></blockquote> </section> <section id="polmakeprimitive"> -<span id="id23"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMakePrimitive{}</span></code></h3> +<span id="id24"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolMakePrimitive{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolMakePrimitive{<polname>}</span></code></p> <blockquote> <div><p>Divides by the integer content see (<a class="reference internal" href="#policontent">\PolIContent</a>). @@ -1296,7 +1295,7 @@ coefficient is not modified.</p> </div></blockquote> </section> <section id="poldiff"> -<span id="id24"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDiff{}{}</span></code></h3> +<span id="id25"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDiff{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolDiff{<polname_1>}{<polname_2>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_2</span></code> to the first derivative of <code class="docutils literal notranslate"><span class="pre">polname_1</span></code>. It @@ -1306,8 +1305,8 @@ by <code class="docutils literal notranslate"><span class="pre">f'</span></code> (see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p> </div></blockquote> </section> -<section id="id25"> -<span id="id26"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDiff[]{}{}</span></code></h3> +<section id="id26"> +<span id="id27"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDiff[]{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolDiff[N]{<polname_1>}{<polname_2>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_2</span></code> to the <code class="docutils literal notranslate"><span class="pre">N</span></code>-th derivative of <code class="docutils literal notranslate"><span class="pre">polname_1</span></code>. @@ -1317,7 +1316,7 @@ using <code class="docutils literal notranslate"><span class="pre">\PolAntiDiff< </div></blockquote> </section> <section id="polantidiff"> -<span id="id27"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff{}{}</span></code></h3> +<span id="id28"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolAntiDiff{<polname_1>}{<polname_2>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_2</span></code> to the primitive of <code class="docutils literal notranslate"><span class="pre">polname_1</span></code> vanishing @@ -1326,8 +1325,8 @@ at zero.</p> (see <a class="reference internal" href="#technicalities">Technicalities</a> for the whole story.)</p> </div></blockquote> </section> -<section id="id28"> -<span id="id29"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff[]{}{}</span></code></h3> +<section id="id29"> +<span id="id30"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff[]{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolAntiDiff[N]{<polname_1>}{<polname_2>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_2</span></code> to the result of <code class="docutils literal notranslate"><span class="pre">N</span></code> successive integrations on @@ -1335,7 +1334,7 @@ at zero.</p> </div></blockquote> </section> <section id="poldivide"> -<span id="id30"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDivide{}{}{}{}</span></code></h3> +<span id="id31"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDivide{}{}{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolDivide{<polname_1>}{<polname_2>}{<polname_Q>}{<polname_R>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_Q</span></code> and <code class="docutils literal notranslate"><span class="pre">polname_R</span></code> to be the quotient and @@ -1344,7 +1343,7 @@ remainder in the Euclidean division of <code class="docutils literal notranslate </div></blockquote> </section> <section id="polquo"> -<span id="id31"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolQuo{}{}{}</span></code></h3> +<span id="id32"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolQuo{}{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolQuo{<polname_1>}{<polname_2>}{<polname_Q>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_Q</span></code> to be the quotient in the Euclidean division @@ -1352,7 +1351,7 @@ of <code class="docutils literal notranslate"><span class="pre">polname_1</span> </div></blockquote> </section> <section id="polrem"> -<span id="id32"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolRem{}{}{}</span></code></h3> +<span id="id33"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolRem{}{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolRem{<polname_1>}{<polname_2>}{<polname_R>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_R</span></code> to be the remainder in the Euclidean division @@ -1360,7 +1359,7 @@ of <code class="docutils literal notranslate"><span class="pre">polname_1</span> </div></blockquote> </section> <section id="polgcd"> -<span id="id33"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolGCD{}{}{}</span></code></h3> +<span id="id34"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolGCD{}{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolGCD{<polname_1>}{<polname_2>}{<polname_GCD>}</span></code></p> <blockquote> <div><p>This sets <code class="docutils literal notranslate"><span class="pre">polname_GCD</span></code> to be the (monic) GCD of <code class="docutils literal notranslate"><span class="pre">polname_1</span></code> @@ -1377,7 +1376,7 @@ additional polynomial or scalar variables with names based on <code class="docut prefix, it is advisable to keep the <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> namespace separate from the one applying to <code class="docutils literal notranslate"><span class="pre">\xintexpr</span></code> variables generally, or to polynomials.</p> <section id="poltosturm"> -<span id="id34"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToSturm{}{}</span></code></h4> +<span id="id35"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToSturm{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToSturm{<polname>}{<sturmname>}</span></code></p> <blockquote> <div><p>With <code class="docutils literal notranslate"><span class="pre"><polname></span></code> being for example <code class="docutils literal notranslate"><span class="pre">P</span></code>, and <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> being @@ -1433,15 +1432,18 @@ other polynomials after having done latter will behave erroneously.</p> <div class="admonition note"> <p class="admonition-title">Note</p> -<p>The declaration of the <code class="docutils literal notranslate"><span class="pre">S_k</span></code>‘s will overwrite -with no warning previously declared polynomials with identical -names <code class="docutils literal notranslate"><span class="pre">S_k</span></code>. This is original reason why the macro expects two -names: <code class="docutils literal notranslate"><span class="pre"><polname></span></code> and <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code>.</p> +<p>The declaration of the <code class="docutils literal notranslate"><span class="pre">S_k</span></code>‘s will overwrite with no warning +previously declared polynomials with identical names <code class="docutils literal notranslate"><span class="pre">S_k</span></code>, +i.e. <code class="docutils literal notranslate"><span class="pre"><sturmname>_k</span></code>. This is why the macro was designed +to expect two names: <code class="docutils literal notranslate"><span class="pre"><polname></span></code> and <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code>.</p> <p>It is allowed to use the polynomial name <code class="docutils literal notranslate"><span class="pre">P</span></code> as Sturm chain -name <code class="docutils literal notranslate"><span class="pre">S</span></code>: <code class="docutils literal notranslate"><span class="pre">\PolToSturm{f}(f}</span></code>, but of course fusing the -namespaces is slightly dangerous. And, also <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> creates variables sharing -the <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> prefix, which must be taken into account to -avoid name clashes.</p> +name <code class="docutils literal notranslate"><span class="pre">S</span></code>: <code class="docutils literal notranslate"><span class="pre">\PolToSturm{P}{P}</span></code>, but this is considered bad +practice for the reason mentioned in the previous paragraph.</p> +<p>Furthermore, <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> +creates <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> variables whose names start with +<code class="docutils literal notranslate"><span class="pre"><sturmname>L_</span></code>, <code class="docutils literal notranslate"><span class="pre"><sturmname>R_</span></code>, and <code class="docutils literal notranslate"><span class="pre"><sturmname>Z_</span></code>, also +<code class="docutils literal notranslate"><span class="pre"><sturmname>M_</span></code> for holding the multiplicities, and this may +overwrite pre-existing user-defined <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> variables.</p> </div> <div class="admonition warning"> <p class="admonition-title">Warning</p> @@ -1462,8 +1464,8 @@ the number of distinct real roots is at most <code class="docutils literal notra most the degree of <code class="docutils literal notranslate"><span class="pre">S_0</span></code>.</p> </div></blockquote> </section> -<section id="id35"> -<span id="id36"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToSturm*{}{}</span></code></h4> +<section id="id36"> +<span id="id37"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToSturm*{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToSturm*{<polname>}{<sturmname>}</span></code></p> <blockquote> <div><p>Does the same as <a class="reference internal" href="#poltosturm">un-starred version</a> and additionally it @@ -1474,7 +1476,7 @@ polynomials <code class="docutils literal notranslate"><span class="pre">sturmna </div></blockquote> </section> <section id="polsturmisolatezeros"> -<span id="id37"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros{}</span></code></h4> +<span id="id38"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros{<sturmname>}</span></code></p> <blockquote> <div><p>The macro locates, using the <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a>, as many disjoint @@ -1574,8 +1576,8 @@ are studied in numerical mathematics.</p> </div> </div></blockquote> </section> -<section id="id38"> -<span id="id39"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros*{}</span></code></h4> +<section id="id39"> +<span id="id40"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros*{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros*{<sturmname>}</span></code></p> <blockquote> <div><p>The macro does the same as <a class="reference internal" href="#polsturmisolatezeros"><span class="std std-ref">\PolSturmIsolateZeros{<sturmname>}</span></a> and @@ -1592,7 +1594,7 @@ computed.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>Somewhat counter-intuitively, it is not necessary to have -executed the <a class="reference internal" href="#id35"><span class="std std-ref">\PolToSturm*</span></a> +executed the <a class="reference internal" href="#id36"><span class="std std-ref">\PolToSturm*</span></a> starred variant: during its execution, <a class="reference internal" href="#poltosturm"><span class="std std-ref">\PolToSturm</span></a>, even though it does not declare the @@ -1603,18 +1605,18 @@ polynomials, stores their data in private macros.</p> <span class="pre">roots</span></code> example in <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code>.</p> </div></blockquote> <section id="polsturmisolatezerosandgetmultiplicities"> -<span id="id40"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{}</span></code></h5> +<span id="id41"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{}</span></code></h5> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{<sturmname>}</span></code></p> <blockquote> -<div><p>This is another name for <a class="reference internal" href="#id38"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a>.</p> +<div><p>This is another name for <a class="reference internal" href="#id39"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a>.</p> </div></blockquote> </section> </section> -<section id="id41"> -<span id="id42"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros**{}</span></code></h4> +<section id="id42"> +<span id="id43"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros**{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros**{<sturmname>}</span></code></p> <blockquote> -<div><p>The macro does the same as <a class="reference internal" href="#id38"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> and +<div><p>The macro does the same as <a class="reference internal" href="#id39"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> and in addition it does the extra work to determine all the <em>rational</em> roots.</p> <div class="admonition note"> @@ -1634,18 +1636,18 @@ the original polynomial, with the same multiplicities.</p> <span class="pre">roots</span></code> in <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code>.</p> </div></blockquote> <section id="polsturmisolatezerosgetmultiplicitiesandrationalroots"> -<span id="id43"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots</span></code></h5> +<span id="id44"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots</span></code></h5> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots</span></code></p> <blockquote> -<div><p>This is another name for <a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a>.</p> +<div><p>This is another name for <a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a>.</p> </div></blockquote> </section> </section> <section id="polsturmisolatezerosandfindrationalroots"> -<span id="id44"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{}</span></code></h4> +<span id="id45"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{<sturmname>}</span></code></p> <blockquote> -<div><p>This works exactly like <a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> +<div><p>This works exactly like <a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> (inclusive of declaring the polynomials <code class="docutils literal notranslate"><span class="pre">sturmname_sqf_norr</span></code> and <code class="docutils literal notranslate"><span class="pre">sturmname_norr</span></code> with no rational roots) except that it does <em>not</em> compute the multiplicities of the <em>non-rational</em> roots.</p> @@ -1662,7 +1664,7 @@ multiplicities and it leaves the multiplicity array (whose accessor is <a class="reference internal" href="#polsturmisolatedzeromultiplicity"><span class="std std-ref">\PolSturmIsolatedZeroMultiplicity{<sturmname>}{<index>}</span></a>) into a broken state, as all non-rational roots will supposedly have multiplicity one. This means that the output of -<a class="reference internal" href="#id61">\PolPrintIntervals*</a> will be +<a class="reference internal" href="#id62">\PolPrintIntervals*</a> will be erroneous regarding the multiplicities of irrational roots.</p> <p>I decided to document it because finding multiplicities of the non rational roots is somewhat costly, and one may be interested @@ -1673,7 +1675,7 @@ rational root anyhow).</p> </div></blockquote> </section> <section id="polrefineinterval"> -<span id="id45"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval*{}{}</span></code></h4> +<span id="id46"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval*{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolRefineInterval*{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>The <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval (starting indexing at one) is further @@ -1683,8 +1685,8 @@ the original interval. As a consequence, the <code class="docutils literal notr strictly separated from the other roots.</p> </div></blockquote> </section> -<section id="id46"> -<span id="id47"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval[]{}{}</span></code></h4> +<section id="id47"> +<span id="id48"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval[]{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolRefineInterval[N]{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>The <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval (starting count at one) is further @@ -1693,7 +1695,7 @@ subdivided once, reducing its length by a factor of 10. This is done </div></blockquote> </section> <section id="polensureintervallength"> -<span id="id48"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLength{}{}{}</span></code></h4> +<span id="id49"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLength{}{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLength{<sturmname>}{<index>}{<exponent>}</span></code></p> <blockquote> <div><p>The <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval is subdivided until its length becomes at @@ -1702,7 +1704,7 @@ after decimal mark of the <code class="docutils literal notranslate"><span class </div></blockquote> </section> <section id="polensureintervallengths"> -<span id="id49"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLengths{}{}</span></code></h4> +<span id="id50"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLengths{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLengths{<sturmname>}{<exponent>}</span></code></p> <blockquote> <div><p>The intervals as obtained from <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros</span></code> are (if @@ -1713,7 +1715,7 @@ each of them to have length at most <code class="docutils literal notranslate">< </div></blockquote> </section> <section id="polsettosturmchainsignchangesat"> -<span id="id50"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSetToSturmChainSignChangesAt{}{}{}</span></code></h4> +<span id="id51"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSetToSturmChainSignChangesAt{}{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSetToSturmChainSignChangesAt{\foo}{<sturmname>}{<value>}</span></code></p> <blockquote> <div><p>Sets macro <code class="docutils literal notranslate"><span class="pre">\foo</span></code> to store the number of sign changes in the @@ -1726,7 +1728,7 @@ acceptable by the <a class="reference external" href="https://www.ctan.org/pkg/x </div></blockquote> </section> <section id="polsettonbofzeroswithin"> -<span id="id51"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSetToNbOfZerosWithin{}{}{}{}</span></code></h4> +<span id="id52"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSetToNbOfZerosWithin{}{}{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSetToNbOfZerosWithin{\foo}{<sturmname>}{<value_left>}{<value_right>}</span></code></p> <blockquote> <div><p>Sets, assuming the normalized Sturm chain has been already computed, @@ -1746,7 +1748,7 @@ which however requires prior execution of <a class="reference internal" href="#p <p>See also the expandable <a class="reference internal" href="#polsturmnbwithmultofrootsoflessthanorequalto"><span class="std std-ref">\PolSturmNbWithMultOfRootsOf{<sturmname>}\LessThanOrEqualTo{value}</span></a> which requires prior execution of -<a class="reference internal" href="#id38">\PolSturmIsolateZeros*</a>.</p> +<a class="reference internal" href="#id39">\PolSturmIsolateZeros*</a>.</p> </div></blockquote> </section> </section> @@ -1773,7 +1775,7 @@ primitives.</p> <p>The next macros which govern its output.</p> </div></blockquote> <section id="polprintintervalsnorealroots"> -<span id="id52"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsNoRealRoots</span></code></h4> +<span id="id53"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsNoRealRoots</span></code></h4> <blockquote> <div><p>Executed in place of an <code class="docutils literal notranslate"><span class="pre">array</span></code> environment, when there are no real roots. Default definition:</p> @@ -1783,7 +1785,7 @@ real roots. Default definition:</p> </div></blockquote> </section> <section id="polprintintervalsbeginenv"> -<span id="id53"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsBeginEnv</span></code></h4> +<span id="id54"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsBeginEnv</span></code></h4> <blockquote> <div><p>Default definition (given here for LaTeX, Plain has a variant):</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsBeginEnv</span><span class="nb">{</span><span class="sb">\[</span><span class="nv">\begin</span><span class="nb">{array}{rcccl}}</span> @@ -1791,14 +1793,14 @@ real roots. Default definition:</p> </div> <p>A simpler <code class="docutils literal notranslate"><span class="pre">center</span></code> environment provides a straightforward way to obtain a display allowing pagebreaks. Of course redefinitions must -at any rate be kept in sync with <a class="reference internal" href="#id56">\PolPrintIntervalsKnownRoot</a> and -<a class="reference internal" href="#id57">\PolPrintIntervalsUnknownRoot</a>.</p> +at any rate be kept in sync with <a class="reference internal" href="#id57">\PolPrintIntervalsKnownRoot</a> and +<a class="reference internal" href="#id58">\PolPrintIntervalsUnknownRoot</a>.</p> <p>Prior to <code class="docutils literal notranslate"><span class="pre">0.8.6</span></code> it was not possible to use here for example <code class="docutils literal notranslate"><span class="pre">\begin{align}</span></code> due to the latter executing twice in contents.</p> </div></blockquote> </section> <section id="polprintintervalsendenv"> -<span id="id54"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsEndEnv</span></code></h4> +<span id="id55"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsEndEnv</span></code></h4> <blockquote> <div><p>Default definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsEndEnv</span><span class="nb">{</span><span class="k">\end</span><span class="nb">{</span>array<span class="nb">}</span><span class="k">\]</span><span class="nb">}</span> @@ -1807,14 +1809,14 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervalsrowseparator"> -<span id="id55"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsRowSeparator</span></code></h4> +<span id="id56"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsRowSeparator</span></code></h4> <blockquote> <div><p>Expands by default to <code class="docutils literal notranslate"><span class="pre">\\</span></code> with LaTeX and to <code class="docutils literal notranslate"><span class="pre">\cr</span></code> with Plain</p> <p>Added at <code class="docutils literal notranslate"><span class="pre">0.8.6</span></code>.</p> </div></blockquote> </section> <section id="polprintintervalsknownroot"> -<span id="id56"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsKnownRoot</span></code></h4> +<span id="id57"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsKnownRoot</span></code></h4> <blockquote> <div><p>Default definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsKnownRoot</span><span class="nb">{</span><span class="c">%</span> @@ -1826,7 +1828,7 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervalsunknownroot"> -<span id="id57"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsUnknownRoot</span></code></h4> +<span id="id58"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsUnknownRoot</span></code></h4> <blockquote> <div><p>Default definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsUnknownRoot</span><span class="nb">{</span><span class="c">%</span> @@ -1839,7 +1841,7 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervalsprintexactzero"> -<span id="id58"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintExactZero</span></code></h4> +<span id="id59"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintExactZero</span></code></h4> <blockquote> <div><p>Default definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsPrintExactZero</span><span class="nb">{</span><span class="k">\PolPrintIntervalsTheLeftEndPoint</span><span class="nb">}</span> @@ -1848,7 +1850,7 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervalsprintleftendpoint"> -<span id="id59"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintLeftEndPoint</span></code></h4> +<span id="id60"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintLeftEndPoint</span></code></h4> <blockquote> <div><p>Default definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsPrintLeftEndPoint</span><span class="nb">{</span><span class="k">\PolPrintIntervalsTheLeftEndPoint</span><span class="nb">}</span> @@ -1857,7 +1859,7 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervalsprintrightendpoint"> -<span id="id60"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintRightEndPoint</span></code></h4> +<span id="id61"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintRightEndPoint</span></code></h4> <blockquote> <div><p>Default definition is:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsPrintRightEndPoint</span><span class="nb">{</span><span class="k">\PolPrintIntervalsTheRightEndPoint</span><span class="nb">}</span> @@ -1866,15 +1868,15 @@ at any rate be kept in sync with <a class="reference internal" href="#id56">\Pol </div></blockquote> </section> <section id="polprintintervals-varname"> -<span id="id61"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervals*[<varname>]{}</span></code></h4> +<span id="id62"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervals*[<varname>]{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolPrintIntervals*[<varname>]{<sturmname>}</span></code></p> <blockquote> <div><p>This starred variant produces an alternative output (which displays the root multiplicity), and is provided as an example of customization.</p> -<p>As replacement for <a class="reference internal" href="#id56">\PolPrintIntervalsKnownRoot</a>, -<a class="reference internal" href="#id58">\PolPrintIntervalsPrintExactZero</a>, -<a class="reference internal" href="#id57">\PolPrintIntervalsUnknownRoot</a> it uses its own +<p>As replacement for <a class="reference internal" href="#id57">\PolPrintIntervalsKnownRoot</a>, +<a class="reference internal" href="#id59">\PolPrintIntervalsPrintExactZero</a>, +<a class="reference internal" href="#id58">\PolPrintIntervalsUnknownRoot</a> it uses its own <code class="docutils literal notranslate"><span class="pre">\POL@@PrintIntervals...</span></code> macros. We only reproduce here one definition:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\POL</span>@@PrintIntervalsPrintExactZero<span class="nb">{</span><span class="c">%</span> @@ -1886,7 +1888,7 @@ definition:</p> <p>Multiplicities are printed using this auxiliary macro:</p> </div></blockquote> <section id="polprintintervalsprintmultiplicity"> -<span id="id62"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintMultiplicity</span></code></h5> +<span id="id63"></span><h5><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsPrintMultiplicity</span></code></h5> <blockquote> <div><p>whose default definition is:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\newcommand\PolPrintIntervalsPrintMultiplicity</span><span class="nb">{</span>(<span class="k">\mbox</span><span class="nb">{</span>mult. <span class="nb">}</span><span class="k">\PolPrintIntervalsTheMultiplicity</span>)<span class="nb">}</span> @@ -1910,19 +1912,19 @@ if testing with a non LaTeX macro format.</p> <code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr</span></code> which need a <code class="docutils literal notranslate"><span class="pre">\write</span></code>, <code class="docutils literal notranslate"><span class="pre">\edef</span></code> or a <code class="docutils literal notranslate"><span class="pre">\csname...\endcsname</span></code> context.</p> <section id="poltoexpr"> -<span id="id63"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToExpr{}</span></code></h3> +<span id="id64"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToExpr{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExpr{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> -<div><p>Produces expandably <a class="footnote-reference brackets" href="#id65" id="id64" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a> the string <code class="docutils literal notranslate"><span class="pre">coeff_N*x^N+...</span></code>, i.e. the +<div><p>Produces expandably <a class="footnote-reference brackets" href="#id66" id="id65" role="doc-noteref"><span class="fn-bracket">[</span>3<span class="fn-bracket">]</span></a> the string <code class="docutils literal notranslate"><span class="pre">coeff_N*x^N+...</span></code>, i.e. the polynomial is using descending powers.</p> -<aside class="footnote brackets" id="id65" role="note"> -<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id64">3</a><span class="fn-bracket">]</span></span> +<aside class="footnote brackets" id="id66" role="note"> +<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id65">3</a><span class="fn-bracket">]</span></span> <p>requires exhaustive expansion, for example as triggered by <code class="docutils literal notranslate"><span class="pre">\write</span></code> or <code class="docutils literal notranslate"><span class="pre">\edef</span></code>.</p> </aside> <p>Since <code class="docutils literal notranslate"><span class="pre">0.8</span></code> the input is not restricted to be a polynomial name but is allowed to be an arbitrary expression. Then <code class="docutils literal notranslate"><span class="pre">x</span></code> is expected as -indeterminate but this can be customized via <a class="reference internal" href="#id67">\PolToExprInVar</a>.</p> +indeterminate but this can be customized via <a class="reference internal" href="#id68">\PolToExprInVar</a>.</p> <p>The output uses the letter <code class="docutils literal notranslate"><span class="pre">x</span></code> by default, this is customizable via <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a>. The default output is compatible both with</p> <ul class="simple"> @@ -1930,7 +1932,7 @@ via <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a>. The d <li><p>and the PSTricks <code class="docutils literal notranslate"><span class="pre">\psplot[algebraic]</span></code> input format.</p></li> </ul> <p>Attention that it is not compatible with Python, see further -<a class="reference internal" href="#id69">\PolToExprCaret</a> in this context.</p> +<a class="reference internal" href="#id70">\PolToExprCaret</a> in this context.</p> <p>The following applies:</p> <ul class="simple"> <li><p>vanishing coefficients are skipped (issue <code class="docutils literal notranslate"><span class="pre">\poltoexpralltrue</span></code> to @@ -1953,16 +1955,19 @@ is not supposed to be a typesetting macro.</p></li> redefinition must maintain the expandability property.</p> </div></blockquote> <section id="poltoexprvar"> -<span id="id66"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprVar</span></code></h4> +<span id="id67"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprVar</span></code></h4> <blockquote> <div><p>Defaults to <code class="docutils literal notranslate"><span class="pre">x</span></code>. The letter used in the macro output.</p> </div></blockquote> </section> <section id="poltoexprinvar"> -<span id="id67"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprInVar</span></code></h4> +<span id="id68"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprInVar</span></code></h4> <blockquote> <div><p>Defaults to <code class="docutils literal notranslate"><span class="pre">x</span></code>: the letter used as the polynomial indeterminate -in the macro input.</p> +in the macro input:</p> +<div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\def\PolToExprInVar</span><span class="nb">{</span>x<span class="nb">}</span><span class="c">% (default)</span> +</pre></div> +</div> <p>Recall that declared polynomials are more efficiently used in algebraic expressions without the <code class="docutils literal notranslate"><span class="pre">(x)</span></code>, i.e. <code class="docutils literal notranslate"><span class="pre">P*Q</span></code> is better than <code class="docutils literal notranslate"><span class="pre">P(x)*Q(x)</span></code>. Thus the input, even if an expression, does not @@ -1971,13 +1976,13 @@ have to contain any <code class="docutils literal notranslate"><span class="pre" </div></blockquote> </section> <section id="poltoexprtimes"> -<span id="id68"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprTimes</span></code></h4> +<span id="id69"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprTimes</span></code></h4> <blockquote> <div><p>Defaults to <code class="docutils literal notranslate"><span class="pre">*</span></code>.</p> </div></blockquote> </section> <section id="poltoexprcaret"> -<span id="id69"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprCaret</span></code></h4> +<span id="id70"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprCaret</span></code></h4> <blockquote> <div><p>Defaults to <code class="docutils literal notranslate"><span class="pre">^</span></code> of catcode 12. Set it to expand to <code class="docutils literal notranslate"><span class="pre">**</span></code> for Python compatible output.</p> @@ -1985,7 +1990,7 @@ expand to <code class="docutils literal notranslate"><span class="pre">**</span </div></blockquote> </section> <section id="poltoexprcmd"> -<span id="id70"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprCmd{}</span></code></h4> +<span id="id71"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprCmd{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExprCmd{<raw_coeff>}</span></code></p> <blockquote> <div><p>Defaults to <code class="docutils literal notranslate"><span class="pre">\xintPRaw{\xintRawWithZeros{#1}}</span></code>.</p> @@ -2005,25 +2010,25 @@ and not their finite decimal expansion with no denominator.</p> </div></blockquote> </section> <section id="poltoexproneterm"> -<span id="id71"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTerm{}{}</span></code></h4> +<span id="id72"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTerm{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExprOneTerm{<raw_coeff>}{<exponent>}</span></code></p> <blockquote> <div><p>This is the macro which from the coefficient and the exponent produces the corresponding term in output, such as <code class="docutils literal notranslate"><span class="pre">2/3*x^7</span></code>.</p> <p>For its default definition, see the source code. It uses <a class="reference internal" href="#poltoexprcmd">\PolToExprCmd</a>, <a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a>, <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a> and -<a class="reference internal" href="#id69">\PolToExprCaret</a>.</p> +<a class="reference internal" href="#id70">\PolToExprCaret</a>.</p> </div></blockquote> </section> <section id="poltoexpronetermstylea"> -<span id="id72"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleA{}{}</span></code></h4> +<span id="id73"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleA{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleA{<raw_coeff>}{<exponent>}</span></code></p> <blockquote> <div><p>This holds the default package meaning of <code class="docutils literal notranslate"><span class="pre">\PolToExprOneTerm</span></code>.</p> </div></blockquote> </section> <section id="poltoexpronetermstyleb"> -<span id="id73"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleB{}{}</span></code></h4> +<span id="id74"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleB{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExprOneTermStyleB{<raw_coeff>}{<exponent>}</span></code></p> <blockquote> <div><p>This holds an alternative meaning, which puts the fractional part of @@ -2032,14 +2037,14 @@ a coefficient after the monomial, i.e. like this:</p> </pre></div> </div> <p><a class="reference internal" href="#poltoexprcmd">\PolToExprCmd</a> isn’t used at all in this style. But -<a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a>, <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a> and <a class="reference internal" href="#id69">\PolToExprCaret</a> are obeyed.</p> +<a class="reference internal" href="#poltoexprtimes">\PolToExprTimes</a>, <a class="reference internal" href="#poltoexprvar">\PolToExprVar</a> and <a class="reference internal" href="#id70">\PolToExprCaret</a> are obeyed.</p> <p>To activate it use <code class="docutils literal notranslate"><span class="pre">\let\PolToExprOneTerm\PolToExprOneTermStyleB</span></code>. To revert to the package default behaviour, issue <code class="docutils literal notranslate"><span class="pre">\let\PolToExprOneTerm\PolToExprOneTermStyleA</span></code>.</p> </div></blockquote> </section> <section id="poltoexprtermprefix"> -<span id="id74"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprTermPrefix{}</span></code></h4> +<span id="id75"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToExprTermPrefix{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExprTermPrefix{<raw_coeff>}</span></code></p> <blockquote> <div><p>It receives as argument the coefficient. Its default behaviour is @@ -2051,7 +2056,7 @@ positive coefficient does not output an explicit <code class="docutils literal n </section> </section> <section id="poltofloatexpr"> -<span id="id75"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr{}</span></code></h3> +<span id="id76"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> <div><p>Similar to <a class="reference internal" href="#poltoexpr"><span class="std std-ref">\PolToExpr{<pol. expr.>}</span></a> but using @@ -2069,7 +2074,7 @@ in between).</p> <p>Extended at <code class="docutils literal notranslate"><span class="pre">0.8</span></code> to accept general expressions as input.</p> </div></blockquote> <section id="poltofloatexproneterm"> -<span id="id76"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToFloatExprOneTerm{}{}</span></code></h4> +<span id="id77"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToFloatExprOneTerm{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToFloatExprOneTerm{<raw_coeff>}{<exponent>}</span></code></p> <blockquote> <div><p>Similar to <a class="reference internal" href="#poltoexproneterm"><span class="std std-ref">\PolToExprOneTerm{<raw_coeff>}{<exponent>}</span></a>. But does not treat @@ -2077,7 +2082,7 @@ especially coefficients equal to plus or minus one.</p> </div></blockquote> </section> <section id="poltofloatexprcmd"> -<span id="id77"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToFloatExprCmd{}</span></code></h4> +<span id="id78"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolToFloatExprCmd{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToFloatExprCmd{<raw_coeff>}</span></code></p> <blockquote> <div><p>The one-argument macro used by <code class="docutils literal notranslate"><span class="pre">\PolToFloatExprOneTerm</span></code>. @@ -2087,8 +2092,8 @@ zeroes.</p> </div></blockquote> </section> </section> -<section id="id78"> -<span id="id79"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToExpr*{}</span></code></h3> +<section id="id79"> +<span id="id80"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToExpr*{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToExpr*{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> <div><p>Ascending powers: <code class="docutils literal notranslate"><span class="pre">coeff_0+coeff_1*x+coeff_2*x^2+...</span></code>.</p> @@ -2097,8 +2102,8 @@ zeroes.</p> <a class="reference internal" href="#poltoexpr"><span class="std std-ref">\PolToExpr{<pol. expr.>}</span></a>.</p> </div></blockquote> </section> -<section id="id80"> -<span id="id81"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr*{}</span></code></h3> +<section id="id81"> +<span id="id82"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr*{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr*{<pol.</span> <span class="pre">expr.>}</span></code></p> <blockquote> <div><p>Ascending powers.</p> @@ -2106,7 +2111,7 @@ zeroes.</p> </div></blockquote> </section> <section id="polnthcoeff"> -<span id="id82"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolNthCoeff{}{}</span></code></h3> +<span id="id83"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolNthCoeff{}{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolNthCoeff{<polname>}{<index>}</span></code></p> <blockquote> <div><p>It expands to the raw <code class="docutils literal notranslate"><span class="pre">N</span></code>-th coefficient (<code class="docutils literal notranslate"><span class="pre">N=0</span></code> corresponds to @@ -2118,14 +2123,14 @@ for <code class="docutils literal notranslate"><span class="pre">N<-1-degree< </div></blockquote> </section> <section id="polleadingcoeff"> -<span id="id83"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolLeadingCoeff{}</span></code></h3> +<span id="id84"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolLeadingCoeff{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolLeadingCoeff{<polname>}</span></code></p> <blockquote> <div><p>Expands to the leading coefficient.</p> </div></blockquote> </section> <section id="poldegree"> -<span id="id84"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDegree{}</span></code></h3> +<span id="id85"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDegree{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolDegree{<polname>}</span></code></p> <blockquote> <div><p>It expands to the degree. This is <code class="docutils literal notranslate"><span class="pre">-1</span></code> if zero polynomial but this @@ -2133,7 +2138,7 @@ may change in future. Should it then expand to <code class="docutils literal not </div></blockquote> </section> <section id="policontent"> -<span id="id85"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolIContent{}</span></code></h3> +<span id="id86"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolIContent{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolIContent{<polname>}</span></code></p> <blockquote> <div><p>It expands to the contents of the polynomial, i.e. to the positive @@ -2143,7 +2148,7 @@ with integer coefficients having no common prime divisor.</p> </div></blockquote> </section> <section id="poltolist"> -<span id="id86"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToList{}</span></code></h3> +<span id="id87"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToList{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToList{<polname>}</span></code></p> <blockquote> <div><p>Expands to <code class="docutils literal notranslate"><span class="pre">{coeff_0}{coeff_1}...{coeff_N}</span></code> with <code class="docutils literal notranslate"><span class="pre">N</span></code> = degree, and @@ -2153,7 +2158,7 @@ empty output.)</p> </div></blockquote> </section> <section id="poltocsv"> -<span id="id87"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToCSV{}</span></code></h3> +<span id="id88"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolToCSV{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolToCSV{<polname>}</span></code></p> <blockquote> <div><p>Expands to <code class="docutils literal notranslate"><span class="pre">coeff_0,</span> <span class="pre">coeff_1,</span> <span class="pre">coeff_2,</span> <span class="pre">.....,</span> <span class="pre">coeff_N</span></code>, starting @@ -2205,12 +2210,12 @@ been issued before.</p> </div> <p>To use the <em>exact coefficients</em> with <em>exactly executed</em> additions and multiplications and do the rounding only as the final last step, -the following syntax can be used: <a class="footnote-reference brackets" href="#id89" id="id88" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a></p> +the following syntax can be used: <a class="footnote-reference brackets" href="#id90" id="id89" role="doc-noteref"><span class="fn-bracket">[</span>4<span class="fn-bracket">]</span></a></p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\xintfloateval</span><span class="nb">{</span>3.27*<span class="k">\xintexpr</span> f(2.53)<span class="k">\relax</span><span class="nb">^</span>2<span class="nb">}</span> </pre></div> </div> -<aside class="footnote brackets" id="id89" role="note"> -<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id88">4</a><span class="fn-bracket">]</span></span> +<aside class="footnote brackets" id="id90" role="note"> +<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id89">4</a><span class="fn-bracket">]</span></span> <p>Cf. <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> documentation about nested expressions.</p> </aside> </div></blockquote> @@ -2226,7 +2231,7 @@ to) a format acceptable to the <a class="reference external" href="https://www.c <section id="expandable-macros-in-relation-to-root-localization-via-sturm-theorem"> <h3>Expandable macros in relation to root localization via <a class="reference external" href="https://en.wikipedia.org/wiki/Sturm%27s_theorem">Sturm Theorem</a></h3> <section id="polsturmchainlength"> -<span id="id90"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmChainLength{}</span></code></h4> +<span id="id91"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmChainLength{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmChainLength{<sturmname>}</span></code></p> <blockquote> <div><p>Returns the integer <code class="docutils literal notranslate"><span class="pre">N</span></code> such that <code class="docutils literal notranslate"><span class="pre">sturmname_N</span></code> is the last one @@ -2235,7 +2240,7 @@ in the Sturm chain <code class="docutils literal notranslate"><span class="pre"> </div></blockquote> </section> <section id="polsturmifzeroexactlyknown"> -<span id="id91"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIfZeroExactlyKnown{}{}{}{}</span></code></h4> +<span id="id92"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIfZeroExactlyKnown{}{}{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIfZeroExactlyKnown{<sturmname>}{<index>}{T}{F}</span></code></p> <blockquote> <div><p>Executes <code class="docutils literal notranslate"><span class="pre">T</span></code> if the <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval reduces to a singleton, @@ -2243,7 +2248,7 @@ i.e. the root is known exactly, else <code class="docutils literal notranslate"> </div></blockquote> </section> <section id="polsturmisolatedzeroleft"> -<span id="id92"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroLeft{}{}</span></code></h4> +<span id="id93"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroLeft{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroLeft{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>Expands to the left end-point for the <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval, as @@ -2251,14 +2256,14 @@ computed by some earlier <a class="reference internal" href="#polsturmisolatezer <div class="admonition note"> <p class="admonition-title">Note</p> <p>Execution of this macro after some -<a class="reference internal" href="#id46">\PolRefineInterval{<sturmname>}{<index>}</a> +<a class="reference internal" href="#id47">\PolRefineInterval{<sturmname>}{<index>}</a> will take into account the now known tighter bounds.</p> </div> <p>The value is pre-formatted using <a class="reference internal" href="#poldectostring">\PolDecTostring</a>.</p> </div></blockquote> </section> <section id="polsturmisolatedzeroright"> -<span id="id93"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroRight{}{}</span></code></h4> +<span id="id94"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroRight{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroRight{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>Expands to the right end-point for the <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval as @@ -2268,21 +2273,21 @@ possibly refined afterwards.</p> </div></blockquote> </section> <section id="polsturmisolatedzeromultiplicity"> -<span id="id94"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroMultiplicity{}{}</span></code></h4> +<span id="id95"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroMultiplicity{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmIsolatedZeroMultiplicity{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>Expands to the multiplicity of the unique root contained in the <code class="docutils literal notranslate"><span class="pre">index</span></code>-th interval.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p>A prior execution of <a class="reference internal" href="#id38"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> is mandatory.</p> +<p>A prior execution of <a class="reference internal" href="#id39"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> is mandatory.</p> </div> <p>See <code class="docutils literal notranslate"><span class="pre">The</span> <span class="pre">degree</span> <span class="pre">nine</span> <span class="pre">polynomial</span> <span class="pre">with</span> <span class="pre">0.99,</span> <span class="pre">0.999,</span> <span class="pre">0.9999</span> <span class="pre">as</span> <span class="pre">triple</span> <span class="pre">roots</span></code> in <code class="docutils literal notranslate"><span class="pre">polexpr-examples.pdf</span></code>.</p> </div></blockquote> </section> <section id="polsturmnbofisolatedzeros"> -<span id="id95"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfIsolatedZeros{}</span></code></h4> +<span id="id96"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfIsolatedZeros{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfIsolatedZeros{<sturmname>}</span></code></p> <blockquote> <div><p>Expands to the number of real roots of the polynomial @@ -2339,7 +2344,7 @@ the polynomial used to create the Sturm chain) which are less than or equal to the given <code class="docutils literal notranslate"><span class="pre">value</span></code>.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id38"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> (or the double starred +<p><a class="reference internal" href="#id39"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> (or the double starred variant) must have been executed beforehand.</p> </div> </div></blockquote> @@ -2352,50 +2357,50 @@ variant) must have been executed beforehand.</p> which are less than or equal to the given <code class="docutils literal notranslate"><span class="pre">expression</span></code>.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id38"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> (or the double starred +<p><a class="reference internal" href="#id39"><span class="std std-ref">\PolSturmIsolateZeros*{<sturmname>}</span></a> (or the double starred variant) must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polsturmnbofrationalroots"> -<span id="id96"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRoots{}</span></code></h4> +<span id="id97"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRoots{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRoots{<sturmname>}</span></code></p> <blockquote> <div><p>Expands to the number of rational roots (without multiplicities).</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed +<p><a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polsturmnbofrationalrootswithmultiplicities"> -<span id="id97"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRootsWithMultiplicities{}</span></code></h4> +<span id="id98"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRootsWithMultiplicities{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmNbOfRationalRootsWithMultiplicities{<sturmname>}</span></code></p> <blockquote> <div><p>Expands to the number of rational roots (counted with multiplicities).</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed +<p><a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polsturmrationalroot"> -<span id="id98"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRoot{}{}</span></code></h4> +<span id="id99"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRoot{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRoot{<sturmname>}{<k>}</span></code></p> <blockquote> <div><p>Expands to the k-th rational root. They are enumerated from left to right starting at index value <code class="docutils literal notranslate"><span class="pre">1</span></code>.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed +<p><a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polsturmrationalrootindex"> -<span id="id99"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootIndex{}{}</span></code></h4> +<span id="id100"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootIndex{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootIndex{<sturmname>}{<k>}</span></code></p> <blockquote> <div><p>Expands to the index of the <code class="docutils literal notranslate"><span class="pre">k</span></code>th rational root as part of the @@ -2407,25 +2412,25 @@ this nested call:</p> </div> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed +<p><a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polsturmrationalrootmultiplicity"> -<span id="id100"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootMultiplicity{}{}</span></code></h4> +<span id="id101"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootMultiplicity{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolSturmRationalRootMultiplicity{<sturmname>}{<k>}</span></code></p> <blockquote> <div><p>Expands to the multiplicity of the <code class="docutils literal notranslate"><span class="pre">k</span></code>th rational root.</p> <div class="admonition attention"> <p class="admonition-title">Attention</p> -<p><a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed +<p><a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> must have been executed beforehand.</p> </div> </div></blockquote> </section> <section id="polintervalwidth"> -<span id="id101"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolIntervalWidth{}{}</span></code></h4> +<span id="id102"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolIntervalWidth{}{}</span></code></h4> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolIntervalWidth{<sturmname>}{<index>}</span></code></p> <blockquote> <div><p>The <code class="docutils literal notranslate"><span class="pre">10^E</span></code> width of the current <code class="docutils literal notranslate"><span class="pre">index</span></code>-th root localization @@ -2436,13 +2441,13 @@ interval. Output is in <a class="reference external" href="https://www.ctan.org/ <section id="expandable-macros-for-use-within-execution-of-polprintintervals"> <h3>Expandable macros for use within execution of <code class="docutils literal notranslate"><span class="pre">\PolPrintIntervals</span></code></h3> <p>These macros are for usage within custom user redefinitions of -<a class="reference internal" href="#id56">\PolPrintIntervalsKnownRoot</a>, <a class="reference internal" href="#id57">\PolPrintIntervalsUnknownRoot</a>, or +<a class="reference internal" href="#id57">\PolPrintIntervalsKnownRoot</a>, <a class="reference internal" href="#id58">\PolPrintIntervalsUnknownRoot</a>, or in redefinitions of <a class="reference internal" href="#polprintintervalsprintexactzero">PolPrintIntervalsPrintExactZero</a> (used in the -default for the former) and of <a class="reference internal" href="#id59">\PolPrintIntervalsPrintLeftEndPoint</a>, -<a class="reference internal" href="#id60">\PolPrintIntervalsPrintRightEndPoint</a> (used in the default for the +default for the former) and of <a class="reference internal" href="#id60">\PolPrintIntervalsPrintLeftEndPoint</a>, +<a class="reference internal" href="#id61">\PolPrintIntervalsPrintRightEndPoint</a> (used in the default for the latter).</p> <section id="polprintintervalsthevar"> -<span id="id102"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheVar</span></code></h4> +<span id="id103"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheVar</span></code></h4> <blockquote> <div><p>Expands to the name (default <code class="docutils literal notranslate"><span class="pre">Z</span></code>) used for representing the roots, which was passed as optional argument <code class="docutils literal notranslate"><span class="pre">varname</span></code> to @@ -2450,31 +2455,31 @@ which was passed as optional argument <code class="docutils literal notranslate" </div></blockquote> </section> <section id="polprintintervalstheindex"> -<span id="id103"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheIndex</span></code></h4> +<span id="id104"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheIndex</span></code></h4> <blockquote> <div><p>Expands to the index of the considered interval (indexing starting at 1 for the leftmost interval).</p> </div></blockquote> </section> <section id="polprintintervalsthesturmname"> -<span id="id104"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheSturmName</span></code></h4> +<span id="id105"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheSturmName</span></code></h4> <blockquote> <div><p>Expands to the argument which was passed as <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> to <a class="reference internal" href="#polprintintervals"><span class="std std-ref">\PolPrintIntervals[varname]{<sturmname>}</span></a>.</p> </div></blockquote> </section> <section id="polprintintervalstheleftendpoint"> -<span id="id105"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheLeftEndPoint</span></code></h4> +<span id="id106"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheLeftEndPoint</span></code></h4> <blockquote> <div><p>The left end point of the interval, as would be produced by <a class="reference internal" href="#polsturmisolatedzeroleft">\PolSturmIsolatedZeroLeft</a> if it was used with arguments the Sturm chain name and interval index returned -by <a class="reference internal" href="#id104">\PolPrintIntervalsTheSturmName</a> and -<a class="reference internal" href="#id103">\PolPrintIntervalsTheIndex</a>.</p> +by <a class="reference internal" href="#id105">\PolPrintIntervalsTheSturmName</a> and +<a class="reference internal" href="#id104">\PolPrintIntervalsTheIndex</a>.</p> </div></blockquote> </section> <section id="polprintintervalstherightendpoint"> -<span id="id106"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheRightEndPoint</span></code></h4> +<span id="id107"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheRightEndPoint</span></code></h4> <blockquote> <div><p>The right end point of the interval, as would be produced by <a class="reference internal" href="#polsturmisolatedzeroright">\PolSturmIsolatedZeroRight</a> for @@ -2482,10 +2487,10 @@ this Sturm chain name and index.</p> </div></blockquote> </section> <section id="polprintintervalsthemultiplicity"> -<span id="id107"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheMultiplicity</span></code></h4> +<span id="id108"></span><h4><code class="docutils literal notranslate"><span class="pre">\PolPrintIntervalsTheMultiplicity</span></code></h4> <blockquote> <div><p>The multiplicity of the unique root within the interval of index -<a class="reference internal" href="#id103">\PolPrintIntervalsTheIndex</a>. Makes sense only if the starred (or +<a class="reference internal" href="#id104">\PolPrintIntervalsTheIndex</a>. Makes sense only if the starred (or double-starred) variant of <a class="reference internal" href="#polsturmisolatezeros">\PolSturmIsolateZeros</a> was used earlier.</p> </div></blockquote> </section> @@ -2494,7 +2499,7 @@ double-starred) variant of <a class="reference internal" href="#polsturmisolatez <section id="tex-booleans-with-names-enacting-their-defaults"> <h2>TeX Booleans (with names enacting their defaults)</h2> <section id="xintverbosefalse"> -<span id="id108"></span><h3><code class="docutils literal notranslate"><span class="pre">\xintverbosefalse</span></code></h3> +<span id="id109"></span><h3><code class="docutils literal notranslate"><span class="pre">\xintverbosefalse</span></code></h3> <blockquote> <div><p>This is actually an <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> configuration. Setting it to <code class="docutils literal notranslate"><span class="pre">true</span></code> triggers the writing of information to the log when new @@ -2507,7 +2512,7 @@ considered unstable and undocumented internal structures.</p> </div></blockquote> </section> <section id="polnewpolverbosefalse"> -<span id="id109"></span><h3><code class="docutils literal notranslate"><span class="pre">\polnewpolverbosefalse</span></code></h3> +<span id="id110"></span><h3><code class="docutils literal notranslate"><span class="pre">\polnewpolverbosefalse</span></code></h3> <blockquote> <div><p>When <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> is used, both a variable and a function are defined. The default <code class="docutils literal notranslate"><span class="pre">\polnewpolverbosefalse</span></code> setting suppresses @@ -2528,14 +2533,14 @@ roots obey only the <code class="docutils literal notranslate"><span class="pre" </div></blockquote> </section> <section id="poltypesetallfalse"> -<span id="id110"></span><h3><code class="docutils literal notranslate"><span class="pre">\poltypesetallfalse</span></code></h3> +<span id="id111"></span><h3><code class="docutils literal notranslate"><span class="pre">\poltypesetallfalse</span></code></h3> <blockquote> <div><p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, <a class="reference internal" href="#poltypeset">\PolTypeset</a> will also typeset the vanishing coefficients.</p> </div></blockquote> </section> <section id="poltoexprallfalse"> -<span id="id111"></span><h3><code class="docutils literal notranslate"><span class="pre">\poltoexprallfalse</span></code></h3> +<span id="id112"></span><h3><code class="docutils literal notranslate"><span class="pre">\poltoexprallfalse</span></code></h3> <blockquote> <div><p>If <code class="docutils literal notranslate"><span class="pre">true</span></code>, <a class="reference internal" href="#poltoexpr"><span class="std std-ref">\PolToExpr{<pol. expr.>}</span></a> and <a class="reference internal" href="#poltofloatexpr"><span class="std std-ref">\PolToFloatExpr{<pol. expr.>}</span></a> will also @@ -2546,7 +2551,7 @@ include the vanishing coefficients in their outputs.</p> <section id="utilities"> <h2>Utilities</h2> <section id="poldectostring"> -<span id="id112"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDecToString{}</span></code></h3> +<span id="id113"></span><h3><code class="docutils literal notranslate"><span class="pre">\PolDecToString{}</span></code></h3> <p>Syntax: <code class="docutils literal notranslate"><span class="pre">\PolDecToString{decimal</span> <span class="pre">number}</span></code></p> <blockquote> <div><p>This is a utility macro to print decimal numbers. It is an alias @@ -2571,11 +2576,11 @@ documentation.</p> <div><p>Serves to customize the package. Currently only two keys are recognized:</p> <ul class="simple"> -<li><p><code class="docutils literal notranslate"><span class="pre">norr</span></code>: the postfix that <a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> +<li><p><code class="docutils literal notranslate"><span class="pre">norr</span></code>: the postfix that <a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> should append to <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> to declare the primitive polynomial obtained from original one after removal of all rational roots. The default value is <code class="docutils literal notranslate"><span class="pre">_norr</span></code> (standing for “no rational roots”).</p></li> -<li><p><code class="docutils literal notranslate"><span class="pre">sqfnorr</span></code>: the postfix that <a class="reference internal" href="#id41"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> +<li><p><code class="docutils literal notranslate"><span class="pre">sqfnorr</span></code>: the postfix that <a class="reference internal" href="#id42"><span class="std std-ref">\PolSturmIsolateZeros**{<sturmname>}</span></a> should append to <code class="docutils literal notranslate"><span class="pre"><sturmname></span></code> to declare the primitive polynomial obtained from original one after removal of all rational roots and suppression of all multiplicities. @@ -2590,15 +2595,20 @@ no rational roots”).</p></li> <section id="technicalities"> <h2>Technicalities</h2> <ul> -<li><p>The <code class="docutils literal notranslate"><span class="pre">@</span></code> is allowed in the name of a polynomial (independently of -whether it is of catcode letter or other.) This has always been the -case, but was not documented by polexpr prior to <code class="docutils literal notranslate"><span class="pre">0.8</span></code>, as the -author has never found the time to provide some official guidelines on -how to name temporary variables and the <code class="docutils literal notranslate"><span class="pre">@</span></code> is used already as such -internally; time has still not yet been found to review the situation -but it seems reasonable to recommend at any rate to restrict usage of -<code class="docutils literal notranslate"><span class="pre">@</span></code> to scratch variables of defined macros and to avoid using it to -name document variable.</p></li> +<li><p>Do not use the underscore <code class="docutils literal notranslate"><span class="pre">_</span></code> as the <em>first character</em> of a +polynomial name, even if of catcode letter. This may cause an +infinite loop.</p></li> +<li><p>The <code class="docutils literal notranslate"><span class="pre">@</span></code> is allowed in the names of polynomials, independently of +whether it is of catcode letter or other. In defining macros which +will use <code class="docutils literal notranslate"><span class="pre">\poldef</span></code> to create polynomials it seems reasonable to +adopt the convention that <code class="docutils literal notranslate"><span class="pre">@</span></code> as <em>first</em> character in polynomial +names is to be reserved to temporary auxiliary polynomials.</p> +<div class="admonition attention"> +<p class="admonition-title">Attention</p> +<p>Do not use <code class="docutils literal notranslate"><span class="pre">@_</span></code> at start of polynomial names. This is reserved for +internal usage by the package.</p> +</div> +</li> <li><p>Catcodes are set temporarily by <a class="reference internal" href="#poldef">\poldef</a> macro to safe values prior to grab the polynomial expression up to the terminator <code class="docutils literal notranslate"><span class="pre">;</span></code>, and also by <a class="reference internal" href="#id5">\PolDef</a> prior to grab the @@ -2709,7 +2719,7 @@ documented and unstable. Don’t use them.</p></li> <li><a class="reference internal" href="#poldef-polname-letter-expression-using-the-letter-as-indeterminate"><code class="docutils literal notranslate"><span class="pre">\poldef</span> <span class="pre">polname(letter):=</span> <span class="pre">expression</span> <span class="pre">using</span> <span class="pre">the</span> <span class="pre">letter</span> <span class="pre">as</span> <span class="pre">indeterminate;</span></code></a></li> <li><a class="reference internal" href="#poldef-letter-polname-expr-using-the-letter-as-indeterminate"><code class="docutils literal notranslate"><span class="pre">\PolDef[<letter>]{<polname>}{<expr.</span> <span class="pre">using</span> <span class="pre">the</span> <span class="pre">letter</span> <span class="pre">as</span> <span class="pre">indeterminate>}</span></code></a></li> <li><a class="reference internal" href="#polgenfloatvariant"><code class="docutils literal notranslate"><span class="pre">\PolGenFloatVariant{}</span></code></a></li> -<li><a class="reference internal" href="#poltypeset"><code class="docutils literal notranslate"><span class="pre">\PolTypeset{}</span></code></a><ul> +<li><a class="reference internal" href="#poltypeset"><code class="docutils literal notranslate"><span class="pre">\PolTypeset[]{}</span></code></a><ul> <li><a class="reference internal" href="#poltypesetcmd"><code class="docutils literal notranslate"><span class="pre">\PolTypesetCmd{}</span></code></a><ul> <li><a class="reference internal" href="#polifcoeffisplusorminusone"><code class="docutils literal notranslate"><span class="pre">\PolIfCoeffIsPlusOrMinusOne{}{}</span></code></a></li> </ul> @@ -2719,7 +2729,7 @@ documented and unstable. Don’t use them.</p></li> <li><a class="reference internal" href="#poltypesetcmdprefix"><code class="docutils literal notranslate"><span class="pre">\PolTypesetCmdPrefix{}</span></code></a></li> </ul> </li> -<li><a class="reference internal" href="#id13"><code class="docutils literal notranslate"><span class="pre">\PolTypeset*{}</span></code></a></li> +<li><a class="reference internal" href="#id13"><code class="docutils literal notranslate"><span class="pre">\PolTypeset*[]{}</span></code></a></li> <li><a class="reference internal" href="#pollet"><code class="docutils literal notranslate"><span class="pre">\PolLet{}={}</span></code></a></li> <li><a class="reference internal" href="#polgloballet"><code class="docutils literal notranslate"><span class="pre">\PolGlobalLet{}={}</span></code></a></li> <li><a class="reference internal" href="#polassign-toarray"><code class="docutils literal notranslate"><span class="pre">\PolAssign{}\toarray{}</span></code></a></li> @@ -2727,32 +2737,32 @@ documented and unstable. Don’t use them.</p></li> <li><a class="reference internal" href="#polfromcsv"><code class="docutils literal notranslate"><span class="pre">\PolFromCSV{}{}</span></code></a></li> <li><a class="reference internal" href="#polmapcoeffs"><code class="docutils literal notranslate"><span class="pre">\PolMapCoeffs{}{}</span></code></a></li> <li><a class="reference internal" href="#polreducecoeffs"><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs{}</span></code></a></li> -<li><a class="reference internal" href="#id20"><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs*{}</span></code></a></li> +<li><a class="reference internal" href="#id21"><code class="docutils literal notranslate"><span class="pre">\PolReduceCoeffs*{}</span></code></a></li> <li><a class="reference internal" href="#polmakemonic"><code class="docutils literal notranslate"><span class="pre">\PolMakeMonic{}</span></code></a></li> <li><a class="reference internal" href="#polmakeprimitive"><code class="docutils literal notranslate"><span class="pre">\PolMakePrimitive{}</span></code></a></li> <li><a class="reference internal" href="#poldiff"><code class="docutils literal notranslate"><span class="pre">\PolDiff{}{}</span></code></a></li> -<li><a class="reference internal" href="#id25"><code class="docutils literal notranslate"><span class="pre">\PolDiff[]{}{}</span></code></a></li> +<li><a class="reference internal" href="#id26"><code class="docutils literal notranslate"><span class="pre">\PolDiff[]{}{}</span></code></a></li> <li><a class="reference internal" href="#polantidiff"><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff{}{}</span></code></a></li> -<li><a class="reference internal" href="#id28"><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff[]{}{}</span></code></a></li> +<li><a class="reference internal" href="#id29"><code class="docutils literal notranslate"><span class="pre">\PolAntiDiff[]{}{}</span></code></a></li> <li><a class="reference internal" href="#poldivide"><code class="docutils literal notranslate"><span class="pre">\PolDivide{}{}{}{}</span></code></a></li> <li><a class="reference internal" href="#polquo"><code class="docutils literal notranslate"><span class="pre">\PolQuo{}{}{}</span></code></a></li> <li><a class="reference internal" href="#polrem"><code class="docutils literal notranslate"><span class="pre">\PolRem{}{}{}</span></code></a></li> <li><a class="reference internal" href="#polgcd"><code class="docutils literal notranslate"><span class="pre">\PolGCD{}{}{}</span></code></a></li> <li><a class="reference internal" href="#root-localization-routines-via-the-sturm-theorem">Root localization routines via the Sturm Theorem</a><ul> <li><a class="reference internal" href="#poltosturm"><code class="docutils literal notranslate"><span class="pre">\PolToSturm{}{}</span></code></a></li> -<li><a class="reference internal" href="#id35"><code class="docutils literal notranslate"><span class="pre">\PolToSturm*{}{}</span></code></a></li> +<li><a class="reference internal" href="#id36"><code class="docutils literal notranslate"><span class="pre">\PolToSturm*{}{}</span></code></a></li> <li><a class="reference internal" href="#polsturmisolatezeros"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros{}</span></code></a></li> -<li><a class="reference internal" href="#id38"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros*{}</span></code></a><ul> +<li><a class="reference internal" href="#id39"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros*{}</span></code></a><ul> <li><a class="reference internal" href="#polsturmisolatezerosandgetmultiplicities"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndGetMultiplicities{}</span></code></a></li> </ul> </li> -<li><a class="reference internal" href="#id41"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros**{}</span></code></a><ul> +<li><a class="reference internal" href="#id42"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZeros**{}</span></code></a><ul> <li><a class="reference internal" href="#polsturmisolatezerosgetmultiplicitiesandrationalroots"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosGetMultiplicitiesAndRationalRoots</span></code></a></li> </ul> </li> <li><a class="reference internal" href="#polsturmisolatezerosandfindrationalroots"><code class="docutils literal notranslate"><span class="pre">\PolSturmIsolateZerosAndFindRationalRoots{}</span></code></a></li> <li><a class="reference internal" href="#polrefineinterval"><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval*{}{}</span></code></a></li> -<li><a class="reference internal" href="#id46"><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval[]{}{}</span></code></a></li> +<li><a class="reference internal" href="#id47"><code class="docutils literal notranslate"><span class="pre">\PolRefineInterval[]{}{}</span></code></a></li> <li><a class="reference internal" href="#polensureintervallength"><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLength{}{}{}</span></code></a></li> <li><a class="reference internal" href="#polensureintervallengths"><code class="docutils literal notranslate"><span class="pre">\PolEnsureIntervalLengths{}{}</span></code></a></li> <li><a class="reference internal" href="#polsettosturmchainsignchangesat"><code class="docutils literal notranslate"><span class="pre">\PolSetToSturmChainSignChangesAt{}{}{}</span></code></a></li> @@ -2795,8 +2805,8 @@ documented and unstable. Don’t use them.</p></li> <li><a class="reference internal" href="#poltofloatexprcmd"><code class="docutils literal notranslate"><span class="pre">\PolToFloatExprCmd{}</span></code></a></li> </ul> </li> -<li><a class="reference internal" href="#id78"><code class="docutils literal notranslate"><span class="pre">\PolToExpr*{}</span></code></a></li> -<li><a class="reference internal" href="#id80"><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr*{}</span></code></a></li> +<li><a class="reference internal" href="#id79"><code class="docutils literal notranslate"><span class="pre">\PolToExpr*{}</span></code></a></li> +<li><a class="reference internal" href="#id81"><code class="docutils literal notranslate"><span class="pre">\PolToFloatExpr*{}</span></code></a></li> <li><a class="reference internal" href="#polnthcoeff"><code class="docutils literal notranslate"><span class="pre">\PolNthCoeff{}{}</span></code></a></li> <li><a class="reference internal" href="#polleadingcoeff"><code class="docutils literal notranslate"><span class="pre">\PolLeadingCoeff{}</span></code></a></li> <li><a class="reference internal" href="#poldegree"><code class="docutils literal notranslate"><span class="pre">\PolDegree{}</span></code></a></li> @@ -2886,7 +2896,7 @@ documented and unstable. Don’t use them.</p></li> <li class="right" > <a href="polexpr.html" title="Introduction to polexpr" >previous</a> |</li> - <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="polexpr.html">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">polexpr reference</a></li> </ul> </div> diff --git a/macros/generic/polexpr/polexpr-ref.rst.txt b/macros/generic/polexpr/polexpr-ref.rst.txt index 028e68626f..0c6ab082af 100644 --- a/macros/generic/polexpr/polexpr-ref.rst.txt +++ b/macros/generic/polexpr/polexpr-ref.rst.txt @@ -33,14 +33,11 @@ exactly arbitrarily big integers or fractions. i.e. per default one ``a, .., z, A, .., Z`` (more letters can be declared under Unicode engines). -- ``polname`` consists of *letters*, *digits*, and also the ``_`` and - ``'`` characters are allowed. The polynomial name **must** start with - a letter: do not use the underscore ``_`` as *first character* of a - polynomial name (even if of catcode letter). No warning is emitted - but dire consequences will ensue. The ``@`` is also allowed - (independently of its catcode "letter" or "other", which does not - matter). It is recommended to avoid using it as first character, - except for temporary polynomial variables. +- ``polname`` is a word (no space) built with *letters*, *digits*, and + the ``@``, ``_`` and ``'`` characters are allowed. The polynomial + name **must** start with a letter. + + For guidelines regarding ``_`` and ``@`` see Technicalities_. - The colon before the equality sign is optional and its (reasonable) catcode does not matter. @@ -1079,7 +1076,8 @@ Non-expandable macros *expression* can make use of previously defined polynomials. Polynomial names must start with a letter and are constituted of - letters, digits, underscores and the right tick ``'``. + letters, digits, underscores, the ``@`` (see Technicalities_) and + the right tick ``'``. The whole xintexpr_ syntax is authorized, as long as the final result is of polynomial type:: @@ -1100,17 +1098,16 @@ Non-expandable macros and also other polynomials (via their names, thanks to previous item). - Notice that any function defined via ``\xintdeffunc`` and using - only algebraic operations (and ople indexing or slicing operations) - should work fine in ``\xintexpr/\xinteval`` with such polynomial - names as argument. + Any function defined via ``\xintdeffunc`` and only algebraic + operations, as well as ople indexing or slicing operations, should + work fine in ``\xintexpr/\xinteval`` with such polynomial names as + argument. - In the case of a constant polynomial, the xintexpr_ variable (not the - internal data structure on which the package macros operate) + In the case of a constant polynomial, the xintexpr_ *variable* (not + the internal data structure on which the package macros operate) associated to it is indistinguishable from a scalar, it is actually a scalar and has lost all traces from its origins as a polynomial (so for example can be used as argument to the ``cos()`` function). - The *function* on the other hand remains a one-argument function, which simply has a constant value. @@ -1122,7 +1119,7 @@ Non-expandable macros Worse, a previously existing floating point function of the same name will - be let undefined again, to avoid hard to debug mismatches between + be made undefined again, to avoid hard to debug mismatches between exact and floating point polynomials. This also applies when the polynomial is produced not via ``\poldef`` or ``\PolDef`` but as result of usage of the other package macros. @@ -1187,21 +1184,21 @@ Syntax: ``\PolGenFloatVariant{<polname>}`` .. _PolTypeset: -``\PolTypeset{}`` -~~~~~~~~~~~~~~~~~ +``\PolTypeset[]{}`` +~~~~~~~~~~~~~~~~~~~ -Syntax: ``\PolTypeset{<pol. expr.>}`` +Syntax: ``\PolTypeset[<letter>]{<pol. expr.>}`` Typesets in descending powers, switching to math mode if in text mode, after evaluating the polynomial expression:: \PolTypeset{mul(x-i,i=1..5)}% possible since polexpr 0.8 - The letter used in the input expression is by default ``x``, + The letter used in the input is by default assumed to be ``x``, but can be modified by a redefinition of `\\PolToExprInVar`_. - It uses also by default the letter ``x`` on output but this one can - be changed via an optional argument:: + The letter used in the output is also by default ``x``. This one + can be changed on-the-fly via the optional ``<letter>``:: \PolTypeset[z]{polname or polynomial expression} @@ -1294,17 +1291,19 @@ Syntax: ``\PolTypesetCmdPrefix{<raw_coeff>}`` .. _PolTypeset*: -``\PolTypeset*{}`` -~~~~~~~~~~~~~~~~~~ +``\PolTypeset*[]{}`` +~~~~~~~~~~~~~~~~~~~~ -Syntax: ``\PolTypeset*{<pol. expr.>}`` +Syntax: ``\PolTypeset*[<letter>]{<pol. expr.>}`` - Typesets in ascending powers. Use ``[<letter>]`` optional argument - (after the ``*``) to use another letter than ``x``. + Typesets in ascending powers. The ``<letter>`` optional argument + (after the ``*``) declares the letter to use in the *output*. + As for `\\PolTypeset <PolTypeset>`_, it defaults to ``x``. + + To modify the expected ``x`` in the *input*, see `\\PolToExprInVar`_. Extended at ``0.8`` to accept general expressions and not only - polynomial names. Redefine `\\PolToExprInVar`_ to use in the - expression another letter than default ``x``. + polynomial names. .. _PolLet: @@ -1667,17 +1666,20 @@ Syntax: ``\PolToSturm{<polname>}{<sturmname>}`` .. note:: - The declaration of the ``S_k``\ 's will overwrite - with no warning previously declared polynomials with identical - names ``S_k``. This is original reason why the macro expects two - names: ``<polname>`` and ``<sturmname>``. + The declaration of the ``S_k``\ 's will overwrite with no warning + previously declared polynomials with identical names ``S_k``, + i.e. ``<sturmname>_k``. This is why the macro was designed + to expect two names: ``<polname>`` and ``<sturmname>``. It is allowed to use the polynomial name ``P`` as Sturm chain - name ``S``: ``\PolToSturm{f}(f}``, but of course fusing the - namespaces is slightly dangerous. And, also `\\PolSturmIsolateZeros - <PolSturmIsolateZeros_>`_ creates variables sharing - the ``<sturmname>`` prefix, which must be taken into account to - avoid name clashes. + name ``S``: ``\PolToSturm{P}{P}``, but this is considered bad + practice for the reason mentioned in the previous paragraph. + + Furthermore, `\\PolSturmIsolateZeros <PolSturmIsolateZeros_>`_ + creates xintexpr_ variables whose names start with + ``<sturmname>L_``, ``<sturmname>R_``, and ``<sturmname>Z_``, also + ``<sturmname>M_`` for holding the multiplicities, and this may + overwrite pre-existing user-defined xintexpr_ variables. .. warning:: @@ -2300,7 +2302,9 @@ Syntax: ``\PolToExpr{<pol. expr.>}`` ^^^^^^^^^^^^^^^^^^^ Defaults to ``x``: the letter used as the polynomial indeterminate - in the macro input. + in the macro input:: + + \def\PolToExprInVar{x}% (default) Recall that declared polynomials are more efficiently used in algebraic expressions without the ``(x)``, i.e. ``P*Q`` is better @@ -3086,16 +3090,20 @@ Syntax: ``\PolDecToString{decimal number}`` Technicalities -------------- +- Do not use the underscore ``_`` as the *first character* of a + polynomial name, even if of catcode letter. This may cause an + infinite loop. + +- The ``@`` is allowed in the names of polynomials, independently of + whether it is of catcode letter or other. In defining macros which + will use ``\poldef`` to create polynomials it seems reasonable to + adopt the convention that ``@`` as *first* character in polynomial + names is to be reserved to temporary auxiliary polynomials. + + .. attention:: -- The ``@`` is allowed in the name of a polynomial (independently of - whether it is of catcode letter or other.) This has always been the - case, but was not documented by polexpr prior to ``0.8``, as the - author has never found the time to provide some official guidelines on - how to name temporary variables and the ``@`` is used already as such - internally; time has still not yet been found to review the situation - but it seems reasonable to recommend at any rate to restrict usage of - ``@`` to scratch variables of defined macros and to avoid using it to - name document variable. + Do not use ``@_`` at start of polynomial names. This is reserved for + internal usage by the package. - Catcodes are set temporarily by `\\poldef <poldef;_>`_ macro to safe values prior to grab the polynomial expression up to the terminator diff --git a/macros/generic/polexpr/polexpr.css b/macros/generic/polexpr/polexpr.css index b95962ac84..c780cab085 100644 --- a/macros/generic/polexpr/polexpr.css +++ b/macros/generic/polexpr/polexpr.css @@ -230,6 +230,10 @@ blockquote::after { clear: both; } +.footnote { + background-color: #f8f9de; /* polexpr.css */ +} + .footnote:target { background-color: #ffa; } diff --git a/macros/generic/polexpr/polexpr.html b/macros/generic/polexpr/polexpr.html index 23dafab2c2..bcb4dba227 100644 --- a/macros/generic/polexpr/polexpr.html +++ b/macros/generic/polexpr/polexpr.html @@ -6,7 +6,7 @@ <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> - <title>Introduction to polexpr — polexpr 0.8.7 documentation</title> + <title>Introduction to polexpr — polexpr 0.8.7a documentation</title> <link rel="stylesheet" type="text/css" href="polexpr.css" /> <link rel="next" title="polexpr reference" href="polexpr-ref.html" /> </head><body> @@ -16,7 +16,7 @@ <li class="right" style="margin-right: 10px"> <a href="polexpr-ref.html" title="polexpr reference" accesskey="N">next</a></li> - <li class="nav-item nav-item-0"><a href="#">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="#">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">Introduction to polexpr</a></li> </ul> </div> @@ -28,6 +28,8 @@ <section id="introduction-to-polexpr"> <h1>Introduction to polexpr</h1> +<div class="toctree-wrapper compound"> +</div> <p><a class="reference external" href="https://www.ctan.org/pkg/polexpr">polexpr</a> is a TeX and LaTeX macro package.</p> <p>To use it with Plain or formats other than LaTeX:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="k">\input</span> polexpr.sty @@ -63,7 +65,7 @@ work):</p> <section id="usage-via-xintsession"> <h2>Usage via <a class="reference external" href="https://www.ctan.org/pkg/xintsession">xintsession</a></h2> <p>The simplest manner to get a feeling for the package abilities regarding -in particularl root localization is to use it on the command line +in particular root localization is to use it on the command line via the <a class="reference external" href="https://www.ctan.org/pkg/xintsession">xintsession</a> interface. Here is an example:</p> <div class="highlight-latex notranslate"><div class="highlight"><pre><span></span><span class="s">$</span><span class="nb"> rlwrap etex xintsession</span> <span class="o">[</span><span class="nb">...xintsession welcome message...</span><span class="o">]</span><span class="nb"></span> @@ -111,8 +113,8 @@ defined by <code class="docutils literal notranslate"><span class="pre">polexpr< LaTeX Project Public License version 1.3c.</p> <p>See README.md for details.</p> </section> -<section id="in-memoriam-jurgen-gilg-1967-2022"> -<h2>In memoriam: Jürgen Gilg (1967-2022)</h2> +<section id="in-memoriam-jurgen-gilg-1966-2022"> +<h2>In memoriam: Jürgen Gilg (1966-2022)</h2> <p>My first contact with Jürgen was in January 2018, and his <em>little question</em> about usage of <a class="reference external" href="https://www.ctan.org/pkg/xintexpr">xintexpr</a> for differentiating polynomials proved the direct cause for the <a class="reference internal" href="polexpr-changes.html#firstrelease"><span class="std std-ref">creation of polexpr</span></a>. His regular comments and questions (often, jointly @@ -129,8 +131,6 @@ thought I had been knowing him for at least 10 years, but it is actually only a bit more than 4 years… I will sorely miss this friendship with a gentle soul from <em>over the Rhine</em>.</p> <p>I dedicate the work which has gone into <a class="reference external" href="https://www.ctan.org/pkg/polexpr">polexpr</a> to Jürgen’s memory.</p> -<div class="toctree-wrapper compound"> -</div> </section> </section> @@ -145,7 +145,7 @@ a gentle soul from <em>over the Rhine</em>.</p> <li><a class="reference internal" href="#">Introduction to polexpr</a><ul> <li><a class="reference internal" href="#usage-via-xintsession">Usage via xintsession</a></li> <li><a class="reference internal" href="#license-is-lppl-1-3c">License is LPPL 1.3c</a></li> -<li><a class="reference internal" href="#in-memoriam-jurgen-gilg-1967-2022">In memoriam: Jürgen Gilg (1967-2022)</a></li> +<li><a class="reference internal" href="#in-memoriam-jurgen-gilg-1966-2022">In memoriam: Jürgen Gilg (1966-2022)</a></li> </ul> </li> </ul> @@ -178,7 +178,7 @@ a gentle soul from <em>over the Rhine</em>.</p> <li class="right" style="margin-right: 10px"> <a href="polexpr-ref.html" title="polexpr reference" >next</a></li> - <li class="nav-item nav-item-0"><a href="#">polexpr 0.8.7 documentation</a> »</li> + <li class="nav-item nav-item-0"><a href="#">polexpr 0.8.7a documentation</a> »</li> <li class="nav-item nav-item-this"><a href="">Introduction to polexpr</a></li> </ul> </div> diff --git a/macros/generic/polexpr/polexpr.rst.txt b/macros/generic/polexpr/polexpr.rst.txt index 3186ab3680..c20ab4ba4f 100644 --- a/macros/generic/polexpr/polexpr.rst.txt +++ b/macros/generic/polexpr/polexpr.rst.txt @@ -1,9 +1,23 @@ .. comment: -*- fill-column: 72; mode: rst -*- + ========================= Introduction to polexpr ========================= +.. toctree:: + :hidden: + :maxdepth: 2 + + polexpr-ref + polexpr-changes + + +.. only :: latex + + Introduction to polexpr + ----------------------- + polexpr_ is a TeX and LaTeX macro package. To use it with Plain or formats other than LaTeX:: @@ -48,7 +62,7 @@ Usage via xintsession_ ---------------------- The simplest manner to get a feeling for the package abilities regarding -in particularl root localization is to use it on the command line +in particular root localization is to use it on the command line via the xintsession_ interface. Here is an example:: $ rlwrap etex xintsession @@ -101,7 +115,7 @@ LaTeX Project Public License version 1.3c. See README.md for details. -In memoriam: Jürgen Gilg (1967-2022) +In memoriam: Jürgen Gilg (1966-2022) ------------------------------------ My first contact with Jürgen was in January 2018, and his *little @@ -143,15 +157,6 @@ I dedicate the work which has gone into polexpr_ to Jürgen's memory. .. _DocUtils: http://docutils.sourceforge.net/docs/index.html -.. toctree:: - :hidden: - :maxdepth: 2 - - polexpr-ref - polexpr-changes - - - .. Local variables: .. sentence-end-double-space: t; .. End: diff --git a/macros/generic/polexpr/polexpr.sty b/macros/generic/polexpr/polexpr.sty index b652675d91..b6b6fba245 100644 --- a/macros/generic/polexpr/polexpr.sty +++ b/macros/generic/polexpr/polexpr.sty @@ -2,7 +2,7 @@ % License: LPPL 1.3c (author-maintained) % Usage: \input polexpr.sty (Plain or other macro formats) % or \usepackage{polexpr} (LaTeX macro format) -% Release 0.8.7 (2022/05/14) of polexpr.sty. This file inputs +% Release 0.8.7a (2022/05/19) of polexpr.sty. This file inputs % polexprcore.tex % polexprexpr.tex % polexprsturm.tex @@ -54,7 +54,7 @@ \XINTsetupcatcodes% (does \endlinechar13 in particular) \XINT_providespackage \ProvidesPackage{polexpr}% - [2022/05/14 v0.8.7 Polynomial expressions with rational coefficients (JFB)]% + [2022/05/19 v0.8.7a Polynomial expressions with rational coefficients (JFB)]% \begingroup \def\x#1/#2/#3 #4\xint:{#1#2#3}% \ifnum\expandafter\x\expanded{\csname ver@xintexpr.sty\endcsname}\xint: diff --git a/macros/generic/polexpr/polexprcore.tex b/macros/generic/polexpr/polexprcore.tex index 8bf7fe2fd0..d3e42d1f1f 100644 --- a/macros/generic/polexpr/polexprcore.tex +++ b/macros/generic/polexpr/polexprcore.tex @@ -1,5 +1,5 @@ %% filename: polexprcore.tex -%% Part of the polexpr package (0.8.7, 2022/05/14) +%% Part of the polexpr package (0.8.7a, 2022/05/19) %% %% Core routines for infix operators +, -, *, //, /:, ^, ** and functions %% diff --git a/macros/generic/polexpr/polexprexpr.tex b/macros/generic/polexpr/polexprexpr.tex index 91087bcf4d..ca4cff963b 100644 --- a/macros/generic/polexpr/polexprexpr.tex +++ b/macros/generic/polexpr/polexprexpr.tex @@ -1,5 +1,5 @@ %% filename: polexprexpr.tex -%% Part of the polexpr package (0.8.7, 2022/05/14) +%% Part of the polexpr package (0.8.7a, 2022/05/19) %% %% Polynomial extensions to the \xintexpr syntax: %% diff --git a/macros/generic/polexpr/polexprsturm.tex b/macros/generic/polexpr/polexprsturm.tex index 2f417c3333..59f0a5d244 100644 --- a/macros/generic/polexpr/polexprsturm.tex +++ b/macros/generic/polexpr/polexprsturm.tex @@ -1,5 +1,5 @@ %% filename: polexprsturm.tex -%% Part of the polexpr package (0.8.7, 2022/05/14) +%% Part of the polexpr package (0.8.7a, 2022/05/19) %% %% Implements the Sturm localization Algorithm %% Added at polexpr 0.4 diff --git a/macros/latex-dev/base/README.md b/macros/latex-dev/base/README.md index 65c4673cca..538308afb5 100644 --- a/macros/latex-dev/base/README.md +++ b/macros/latex-dev/base/README.md @@ -1,7 +1,7 @@ The LaTeX kernel ================ -Release 2022-06-01 pre-release 3 +Release 2022-06-01 pre-release 4 Overview -------- diff --git a/macros/latex-dev/base/alltt.pdf b/macros/latex-dev/base/alltt.pdf Binary files differindex d612e91b3b..bc983daed3 100644 --- a/macros/latex-dev/base/alltt.pdf +++ b/macros/latex-dev/base/alltt.pdf diff --git a/macros/latex-dev/base/cfgguide.pdf b/macros/latex-dev/base/cfgguide.pdf Binary files differindex e96dd1eadd..8315ec1650 100644 --- a/macros/latex-dev/base/cfgguide.pdf +++ b/macros/latex-dev/base/cfgguide.pdf diff --git a/macros/latex-dev/base/changes.txt b/macros/latex-dev/base/changes.txt index b9bea0a54a..a201a2a5af 100644 --- a/macros/latex-dev/base/changes.txt +++ b/macros/latex-dev/base/changes.txt @@ -6,6 +6,90 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ================================================================================ +2022-05-17 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx (subsection{Setting rules for hooks code}): + Refuse sorting one-time hooks (gh/818). + +2022-05-17 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + + * ltmeta.dtx: + Added dummy definitions for target commands. + +2022-05-13 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * lthooks.dtx (subsection{Using the hook}): + Avoid l3debug error on an undeclared variable in \hook_use_once:nnn. + +2022-05-08 Marcel Krüger <Marcel.Krueger@latex-project.org> + + * utf8ienc.dtx: + Declare Unicode codepoints U+3008 and U+3009 to be equivalent + to their canonical equivalent codepoints 2329/232A (corresponding + to \textlangle/\textrangle) + +2022-05-08 Marcel Krüger <Marcel.Krueger@latex-project.org> + + * ltmath.dtx: Use more consistent default math styles on LuaLaTeX + +2022-04-13 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + + * ltxref.dtx: + Added starred versions of \ref, \pageref and \Ref + Added expandable version for \pageref and \ref + * ifthen.dtx: + use new expandable version for \pageref and \ref + +2022-05-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltshipout.dtx (subsection{Handling the end of job hook}): + Handle case where shipout/lastpage is run too early and issue + a warning (gh/813) + +2022-04-21 Joseph Wright <Joseph.Wright@latex-project.org> + + * ltfinal.dtx (subsection{Lccodes and uccodes}): + Support \noexpand in arg. to \MakeUppercase and + \MakeLowercase + +2022-04-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltmath.dtx (subsubsection{The UNSORTED Rest}): + Make \openup robust (gh/123) + +2022-04-03 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltmarks.dtx: New module to implement new marks mechanism + + * ltpage.dtx (section| command.): + Updates to \markboth and \markright to interface with new mark mechanism + + * ltoutput.dtx (subsection{Floats}): + Interface with new mark mechanism + + * ltfinal.dtx (subsection{Typesetting parameters}): + Integration of new mark management interface + +2022-04-01 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * ltfiles.dtx (section{File Handling}): + Process include/excluded hook(s) if an include file is bypassed + + * lthooks.dtx (subsection{Adding or removing hook code}): + Add support for generic include/.../excluded hooks + + * ltfilehook.dtx: document include/excluded hooks + +2022-03-18 Phelype Oleinik <phelype.oleinik@latex-project.org> + + * ltcmd.dtx (subsection{Utilities}): + Fix \@@_cmd_type_cases:NnnnnF prematurely expanding macros (gh/795). + +2022-03-18 Joseph Wright <joseph.wright@latex-project.org> + + * ltkeys.dtx: + Remove \ProcessKeyPackageOptions + 2022-03-10 Phelype Oleinik <phelype.oleinik@latex-project.org> * ltfilehook.dtx (subsection{Selecting a file (\cs{set@curr@file})}): @@ -140,7 +224,7 @@ are not part of the distribution. 2021-12-10 David Carlisle <David.Carlisle@latex-project.org> - * utf8ienc.dtx: Add inputenc UTF-8 support for for Digraphs U_01C4-U+01CC + * utf8ienc.dtx: Add inputenc UTF-8 support for Digraphs U+01C4-U+01CC 2021-12-09 Frank Mittelbach <Frank.Mittelbach@latex-project.org> @@ -1633,8 +1717,8 @@ All changes above are only part of the development branch for the next release. * fontdef.dtx (subsection{Defaults}): Set \shapedefault explicitly to "n" not \updefault - \bfdefault set to to "b" not "bx" (but bx for CM fonts) - \updefault set to to "up" not "n". + \bfdefault set to "b" not "bx" (but bx for CM fonts) + \updefault set to "up" not "n". Part of extending the series and shape handling, see ltnews31. 2019-12-17 Frank Mittelbach <Frank.Mittelbach@latex-project.org> @@ -12205,7 +12289,7 @@ All changes above are only part of the development branch for the next release. * unpack2e.ins: Removed unnecessary .drv generation (some are still there) - Added the the WITHOUT ANY WARRANTY message to some preambles. + Added the WITHOUT ANY WARRANTY message to some preambles. * oldgerm.dtx: Moved the driver code in front so that the documentation can be diff --git a/macros/latex-dev/base/classes.pdf b/macros/latex-dev/base/classes.pdf Binary files differindex 9d7cd6a797..cbc4d1fb76 100644 --- a/macros/latex-dev/base/classes.pdf +++ b/macros/latex-dev/base/classes.pdf diff --git a/macros/latex-dev/base/clsguide.pdf b/macros/latex-dev/base/clsguide.pdf Binary files differindex 77158a1f32..c0ef4af945 100644 --- a/macros/latex-dev/base/clsguide.pdf +++ b/macros/latex-dev/base/clsguide.pdf diff --git a/macros/latex-dev/base/cmfonts.pdf b/macros/latex-dev/base/cmfonts.pdf Binary files differindex a281182d36..2807736b25 100644 --- a/macros/latex-dev/base/cmfonts.pdf +++ b/macros/latex-dev/base/cmfonts.pdf diff --git a/macros/latex-dev/base/cyrguide.pdf b/macros/latex-dev/base/cyrguide.pdf Binary files differindex f03a3e508b..1b82918cf5 100644 --- a/macros/latex-dev/base/cyrguide.pdf +++ b/macros/latex-dev/base/cyrguide.pdf diff --git a/macros/latex-dev/base/doc-code.pdf b/macros/latex-dev/base/doc-code.pdf Binary files differindex d9fa6ad544..4ac1ea4981 100644 --- a/macros/latex-dev/base/doc-code.pdf +++ b/macros/latex-dev/base/doc-code.pdf diff --git a/macros/latex-dev/base/doc.pdf b/macros/latex-dev/base/doc.pdf Binary files differindex 7963d5c27a..cc5d0ad4d3 100644 --- a/macros/latex-dev/base/doc.pdf +++ b/macros/latex-dev/base/doc.pdf diff --git a/macros/latex-dev/base/docstrip.pdf b/macros/latex-dev/base/docstrip.pdf Binary files differindex da31ca03b2..a71f006131 100644 --- a/macros/latex-dev/base/docstrip.pdf +++ b/macros/latex-dev/base/docstrip.pdf diff --git a/macros/latex-dev/base/encguide.pdf b/macros/latex-dev/base/encguide.pdf Binary files differindex 5d607801b2..6084673c5d 100644 --- a/macros/latex-dev/base/encguide.pdf +++ b/macros/latex-dev/base/encguide.pdf diff --git a/macros/latex-dev/base/exscale.pdf b/macros/latex-dev/base/exscale.pdf Binary files differindex 69119b9f01..bc20e6ccb6 100644 --- a/macros/latex-dev/base/exscale.pdf +++ b/macros/latex-dev/base/exscale.pdf diff --git a/macros/latex-dev/base/fix-cm.pdf b/macros/latex-dev/base/fix-cm.pdf Binary files differindex eb83169c23..5c56b6041e 100644 --- a/macros/latex-dev/base/fix-cm.pdf +++ b/macros/latex-dev/base/fix-cm.pdf diff --git a/macros/latex-dev/base/fntguide.pdf b/macros/latex-dev/base/fntguide.pdf Binary files differindex 83e562aba3..a5c53bd701 100644 --- a/macros/latex-dev/base/fntguide.pdf +++ b/macros/latex-dev/base/fntguide.pdf diff --git a/macros/latex-dev/base/format.ins b/macros/latex-dev/base/format.ins index 88d33d3c4e..369f01a7c5 100644 --- a/macros/latex-dev/base/format.ins +++ b/macros/latex-dev/base/format.ins @@ -202,6 +202,7 @@ the system are in the document `cfgguide.tex'. \from{ltfloat.dtx}{2ekernel} \from{ltidxglo.dtx}{2ekernel} \from{ltbibl.dtx}{2ekernel} + \from{ltmarks.dtx}{trace,2ekernel} % L3 layer module \from{ltpage.dtx}{2ekernel} \from{ltclass.dtx}{2ekernel,tracerollback} \from{ltkeys.dtx}{2ekernel} % L3 layer module diff --git a/macros/latex-dev/base/graphpap.pdf b/macros/latex-dev/base/graphpap.pdf Binary files differindex 655a201a8d..b955b8e02c 100644 --- a/macros/latex-dev/base/graphpap.pdf +++ b/macros/latex-dev/base/graphpap.pdf diff --git a/macros/latex-dev/base/ifthen.dtx b/macros/latex-dev/base/ifthen.dtx index 0bf54b619a..d36042990d 100644 --- a/macros/latex-dev/base/ifthen.dtx +++ b/macros/latex-dev/base/ifthen.dtx @@ -42,7 +42,7 @@ %<driver>\ProvidesFile{ifthen.drv} % \fi % \ProvidesFile{ifthen.dtx} - [2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)] + [2022/04/13 v1.1d Standard LaTeX ifthen package (DPC)] % % \iffalse %<*driver> @@ -80,6 +80,7 @@ % \changes{v1.0k}{1995/04/25}{Fix `driver' docstrip guards.} % \changes{v1.0n}{1997/11/03}{Documentation fix.} % \changes{v1.0o}{1998/08/17}{Documentation fix.} +% \changes{v1.1d}{2022/04/13}{Make reference command locally expandable.} % % \section{Introduction} % @@ -263,6 +264,14 @@ % macros expanding to |T| or |F| has been completely replaced by a % simpler system using |\iftrue|, which furthermore allows lazy % evaluation on the second pass. +% With a LaTeX 2022/06/01 we have to ensure that |\pageref| is expandable. +% \begin{macrocode} +\@ifl@t@r\fmtversion{2022/06/01} + {\def\TE@ref@exp{\let\pageref\@kernel@pageref@exp + \let\ref\@kernel@ref@exp}} + {\def\TE@ref@exp{\def\@setref##1##2##3{% + \ifx##1\relax\z@\else\expandafter##2##1\fi}}} +% \end{macrocode} % \begin{macrocode} \long\def\ifthenelse#1{% % \end{macrocode} @@ -295,11 +304,11 @@ % \changes{v1.0l}{1996/03/22} % {Use \cs{begingroup} not \cs{bgroup} for latex/2105} % \changes{v1.1a}{1999/01/07}{\cs{isundefined} added for /2824} +% \changes{v1.1d}{2022/04/13}{changed method to make \cs{pageref} and \cs{ref} locally expandable.} % \begin{macrocode} \begingroup \let\protect\@unexpandable@protect - \def\@setref##1##2##3{% - \ifx##1\relax\z@\else\expandafter##2##1\fi}% + \TE@ref@exp \def\value##1{\the\csname c@##1\endcsname}% \let\equal\TE@equal \let\(\TE@lparen \let\)\TE@rparen \let\isodd\TE@odd \let\lengthtest\TE@length diff --git a/macros/latex-dev/base/ifthen.pdf b/macros/latex-dev/base/ifthen.pdf Binary files differindex 08266fb274..44e1254fc7 100644 --- a/macros/latex-dev/base/ifthen.pdf +++ b/macros/latex-dev/base/ifthen.pdf diff --git a/macros/latex-dev/base/inputenc.pdf b/macros/latex-dev/base/inputenc.pdf Binary files differindex 5d0a747d3c..ed4ce98b80 100644 --- a/macros/latex-dev/base/inputenc.pdf +++ b/macros/latex-dev/base/inputenc.pdf diff --git a/macros/latex-dev/base/lamport-manual.pdf b/macros/latex-dev/base/lamport-manual.pdf Binary files differindex 1e39b271b2..b06c9fa36f 100644 --- a/macros/latex-dev/base/lamport-manual.pdf +++ b/macros/latex-dev/base/lamport-manual.pdf diff --git a/macros/latex-dev/base/latexrelease.ins b/macros/latex-dev/base/latexrelease.ins index cfba0f5c6e..b5e97a9479 100644 --- a/macros/latex-dev/base/latexrelease.ins +++ b/macros/latex-dev/base/latexrelease.ins @@ -129,6 +129,7 @@ extension .ins) which are part of the distribution. \from{ltfloat.dtx} {latexrelease}% \from{ltidxglo.dtx} {latexrelease}% empty \from{ltbibl.dtx} {latexrelease}% empty + \from{ltmarks.dtx} {latexrelease}% L3 layer module \from{ltpage.dtx} {latexrelease}% empty \from{ltclass.dtx} {latexrelease,tracerollback}% \from{ltfilehook.dtx} {latexrelease}% empty % L3 layer module diff --git a/macros/latex-dev/base/latexrelease.pdf b/macros/latex-dev/base/latexrelease.pdf Binary files differindex c0c395ee65..3917a237d8 100644 --- a/macros/latex-dev/base/latexrelease.pdf +++ b/macros/latex-dev/base/latexrelease.pdf diff --git a/macros/latex-dev/base/latexsym.pdf b/macros/latex-dev/base/latexsym.pdf Binary files differindex 5b1fc23b4e..fa2020f802 100644 --- a/macros/latex-dev/base/latexsym.pdf +++ b/macros/latex-dev/base/latexsym.pdf diff --git a/macros/latex-dev/base/lb2.pdf b/macros/latex-dev/base/lb2.pdf Binary files differindex a7ae8aa79c..94d2e4cb83 100644 --- a/macros/latex-dev/base/lb2.pdf +++ b/macros/latex-dev/base/lb2.pdf diff --git a/macros/latex-dev/base/letter.pdf b/macros/latex-dev/base/letter.pdf Binary files differindex 0b843b79a0..07fbb31013 100644 --- a/macros/latex-dev/base/letter.pdf +++ b/macros/latex-dev/base/letter.pdf diff --git a/macros/latex-dev/base/lgc2.pdf b/macros/latex-dev/base/lgc2.pdf Binary files differindex a644e1fb93..bace4811a6 100644 --- a/macros/latex-dev/base/lgc2.pdf +++ b/macros/latex-dev/base/lgc2.pdf diff --git a/macros/latex-dev/base/lppl.pdf b/macros/latex-dev/base/lppl.pdf Binary files differindex cafe15d94c..751e539025 100644 --- a/macros/latex-dev/base/lppl.pdf +++ b/macros/latex-dev/base/lppl.pdf diff --git a/macros/latex-dev/base/ltclass.dtx b/macros/latex-dev/base/ltclass.dtx index 0ff3f71162..20e59353ec 100644 --- a/macros/latex-dev/base/ltclass.dtx +++ b/macros/latex-dev/base/ltclass.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltclass.dtx} - [2021/12/09 v1.5a LaTeX Kernel (Class & Package Interface)] + [2022/04/16 v1.5b LaTeX Kernel (Class & Package Interface)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltclass.dtx} @@ -2175,9 +2175,10 @@ % \begin{macrocode} \@ifl@aded\@currext\@currname % \end{macrocode} +% \changes{v1.5b}{2022/03/18}{Switch to \cs{ProcessKeyOptions}} % In the current preferred approach, a key family name will exist for % processing using \pkg{ltkeys}. In that case, we replace the previous -% package options with with the new ones, then call the key handler. +% package options with the new ones, then call the key handler. % Otherwise, we use the more classical clash handler. % \begin{macrocode} {% @@ -2185,7 +2186,7 @@ {\@onefilewithoptions@clashchk{#2}} {% \@namedef{opt@\@currname.\@currext}{#2}% - \expandafter\expandafter\expandafter\ProcessKeyPackageOptions + \expandafter\expandafter\expandafter\ProcessKeyOptions \expandafter\expandafter\expandafter [\csname opt@fam@\@currname.\@currext\endcsname]% }% diff --git a/macros/latex-dev/base/ltcmd.dtx b/macros/latex-dev/base/ltcmd.dtx index f52b32479e..59aa5bf475 100644 --- a/macros/latex-dev/base/ltcmd.dtx +++ b/macros/latex-dev/base/ltcmd.dtx @@ -34,8 +34,8 @@ %%% From File: ltcmd.dtx % % \begin{macrocode} -\def\ltcmdversion{v1.0k} -\def\ltcmddate{2022-02-28} +\def\ltcmdversion{v1.0l} +\def\ltcmddate{2022-03-18} % \end{macrocode} % %<*driver> @@ -4097,8 +4097,10 @@ % \begin{macro}{\@@_cmd_type_cases:Nnnnn} % \changes{v1.0d}{2021/04/19}{Renamed \cs{__cmd_cmd_if_xparse:NTF} to % \cs{__kernel_cmd_if_xparse:NTF} for cross-module usage} -% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:Nnnnn} for +% \changes{v1.0d}{2021/07/30}{Added \cs{@@_cmd_type_cases:NnnnnF} for % \cs{NewCommandCopy} and \cs{ShowCommand} support} +% \changes{v1.0l}{2022/03/18}{Fix \cs{@@_cmd_type_cases:NnnnnF} +%" prematurely expanding macros (gh/795)} % \begin{macro}{\@@_cmd_if_xparse_aux:N} % % To determine whether the command is an \pkg{xparse} command check @@ -4117,22 +4119,14 @@ \exp_args:Ne \str_case_e:nnF { \exp_args:Nf \tl_if_empty:nT { \cs_argument_spec:N #1 } - { - \token_if_macro:NT #1 - { - \exp_after:wN \exp_after:wN - \exp_after:wN \token_to_str:N - \exp_after:wN \use_i_delimit_by_q_stop:nw - #1 \scan_stop: \q_stop - } - } + { \exp_not:N \exp_not:n { \exp_not:e { \tl_head:N #1 } } } } { - { \token_to_str:N \@@_start:nNNnnn } {#2} - { \token_to_str:N \@@_start_expandable:nNNNNn } {#3} - { \token_to_str:N \@@_start_env:nnnnn } {#4} + { \exp_not:N \@@_start:nNNnnn } {#2} + { \exp_not:N \@@_start_expandable:nNNNNn } {#3} + { \exp_not:N \@@_start_env:nnnnn } {#4} { - \exp_after:wN \token_to_str:N + \exp_after:wN \exp_not:N \cs:w environment~ \exp_last_unbraced:Ne \use_none:nnn { \cs_to_str:N #1 } ~end~aux \cs_end: diff --git a/macros/latex-dev/base/ltcmdhooks-code.pdf b/macros/latex-dev/base/ltcmdhooks-code.pdf Binary files differindex 12928555fb..94ce0ae1df 100644 --- a/macros/latex-dev/base/ltcmdhooks-code.pdf +++ b/macros/latex-dev/base/ltcmdhooks-code.pdf diff --git a/macros/latex-dev/base/ltcmdhooks-doc.pdf b/macros/latex-dev/base/ltcmdhooks-doc.pdf Binary files differindex e4e197446f..4bda875791 100644 --- a/macros/latex-dev/base/ltcmdhooks-doc.pdf +++ b/macros/latex-dev/base/ltcmdhooks-doc.pdf diff --git a/macros/latex-dev/base/ltdefns.dtx b/macros/latex-dev/base/ltdefns.dtx index 3a92e827fe..9e1fa43fad 100644 --- a/macros/latex-dev/base/ltdefns.dtx +++ b/macros/latex-dev/base/ltdefns.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltdefns.dtx} - [2021/06/04 v1.5q LaTeX Kernel (definition commands)] + [2022/05/13 v1.5q LaTeX Kernel (definition commands)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltdefns.dtx} @@ -1601,7 +1601,7 @@ % But more importantly, the most common use case of copying a command is to % redefine it later, while preserving the old definition, as in: % \begin{verbatim} -% \ProvideComandCopy \A \B +% \ProvideCommandCopy \A \B % \renewcommand \B { ... \A ... } % \end{verbatim} % then, if \verb=\A= is already defined the first line is skipped, an in this diff --git a/macros/latex-dev/base/ltfilehook-code.pdf b/macros/latex-dev/base/ltfilehook-code.pdf Binary files differindex 58f4b7c4a4..ed49754bc3 100644 --- a/macros/latex-dev/base/ltfilehook-code.pdf +++ b/macros/latex-dev/base/ltfilehook-code.pdf diff --git a/macros/latex-dev/base/ltfilehook-doc.pdf b/macros/latex-dev/base/ltfilehook-doc.pdf Binary files differindex d2b75528d2..b49703fba7 100644 --- a/macros/latex-dev/base/ltfilehook-doc.pdf +++ b/macros/latex-dev/base/ltfilehook-doc.pdf diff --git a/macros/latex-dev/base/ltfilehook.dtx b/macros/latex-dev/base/ltfilehook.dtx index af503b262f..8b5e982591 100644 --- a/macros/latex-dev/base/ltfilehook.dtx +++ b/macros/latex-dev/base/ltfilehook.dtx @@ -32,28 +32,13 @@ % % \begin{macrocode} \providecommand\ltfilehookversion{v1.0m} -\providecommand\ltfilehookdate{2022/03/10} +\providecommand\ltfilehookdate{2022/04/01} % \end{macrocode} % %<*driver> \documentclass{l3doc} -% bug fix fo l3doc.cls -\ExplSyntaxOn -\cs_set_protected:Npn \__codedoc_macro_typeset_one:nN #1#2 - { - \vbox_set:Nn \l__codedoc_macro_box - { - \vbox_unpack_drop:N \l__codedoc_macro_box - \hbox { \llap { \__codedoc_print_macroname:nN {#1} #2 - \MacroFont % <----- without it the \ is in lmr10 if a link is made - \ - } } - } - \int_incr:N \l__codedoc_macro_int - } -\ExplSyntaxOff \providecommand\InternalDetectionOff{} \providecommand\InternalDetectionOn{} @@ -73,9 +58,10 @@ % % \long\def\fmi#1{\begin{quote}\itshape Todo: #1\end{quote}} % -% \let\hook\texttt +% \providecommand\hook[1]{\texttt{#1}} +% % -% \title{The \texttt{ltfilehook} package\thanks{This package has version +% \title{The \texttt{ltfilehook} documentation\thanks{This code has version % \ltfilehookversion\ dated \ltfilehookdate, \copyright\ \LaTeX\ % Project.}} % @@ -120,7 +106,7 @@ % } % These are: % \begin{description} -% \item[\texttt{file/before}, \texttt{file/\meta{file-name}/before}] +% \item[\hook{file/before}, \hook{file/\meta{file-name}/before}] % % These hooks are executed in that order just before the file is % loaded for reading. The code of the first hook is used @@ -128,16 +114,16 @@ % file with matching \meta{file-name} allowing you to specify % code that only applies to one file. % -% \item[\texttt{file/\meta{file-name}/after}, \texttt{file/after}] +% \item[\hook{file/\meta{file-name}/after}, \hook{file/after}] % % These hooks are after the file with name \meta{file-name} has % been fully consumed. The order is swapped (the specific one -% comes first) so that the \texttt{before} and \texttt{after} +% comes first) so that the \hook{/before} and \hook{/after} % hooks nest properly, which is important if any of them involve % grouping (e.g., contain environments, for example). % Furthermore both hooks are reversed hooks to support correct % nesting of different packages adding code to both -% \texttt{/before} and \texttt{/after} hooks. +% \hook{/before} and \hook{/after} hooks. % % \end{description} % \end{variable} @@ -216,7 +202,7 @@ % \cs{RequirePackage}, \cs{LoadPackageWithOptions}, etc.) offer the % hooks from section~\ref{sec:general-file-hooks} when they are % used to load a package or class file, e.g., -% \texttt{file/array.sty/after} would be called after the +% \hook{file/array.sty/after} would be called after the % \pkg{array} package got loaded. But as packages and classes form as special group % of files, there are some additional hooks available that only % apply when a package or class is loaded. @@ -230,21 +216,21 @@ % } % These are: % \begin{description} -% \item[\texttt{package/before}, \texttt{package/after}] +% \item[\hook{package/before}, \hook{package/after}] % % These hooks are called for each package being loaded. % -% \item[\texttt{package/\meta{name}/before}, -% \texttt{package/\meta{name}/after}] +% \item[\hook{package/\meta{name}/before}, +% \hook{package/\meta{name}/after}] % % These hooks are additionally called if the package name is % \meta{name} (without extension). % -% \item[\texttt{class/before}, \texttt{class/after}] +% \item[\hook{class/before}, \hook{class/after}] % % These hooks are called for each class being loaded. % -% \item[\texttt{class/\meta{name}/before}, \texttt{class/\meta{name}/after}] +% \item[\hook{class/\meta{name}/before}, \hook{class/\meta{name}/after}] % % These hooks are additionally called if the class name is % \meta{name} (without extension). @@ -269,8 +255,8 @@ % \>\cs{UseHook}\marg{\hook{package/\meta{package name}/after}} \\ % \>\cs{UseHook}\marg{\hook{package/after}} % \end{tabbing} -% and similar for class file loading, except that \texttt{package/} -% is replaced by \texttt{class/} and \cs{AtEndOfPackage} by +% and similar for class file loading, except that \hook{package/} +% is replaced by \hook{class/} and \cs{AtEndOfPackage} by % \cs{AtEndOfClass}. % % If a package or class is not loaded (or it was loaded before the @@ -321,7 +307,7 @@ % These are: % \begin{description} % -% \item[\texttt{include/before}, \texttt{include/\meta{name}/before}] +% \item[\hook{include/before}, \hook{include/\meta{name}/before}] % % These hooks are executed (in that order) after the initial % \cs{clearpage} and after \texttt{.aux} file is changed to use @@ -331,14 +317,14 @@ % file. % % -% \item[\texttt{include/\meta{name}/end}, \texttt{include/end}] +% \item[\hook{include/\meta{name}/end}, \hook{include/end}] % % These hooks are executed (in that order) after \LaTeX{} has % stopped reading from the \cs{include} file, but before it has % issued a \cs{clearpage} to output any deferred floats. % % -% \item[\texttt{include/\meta{name}/after}, \texttt{include/after}] +% \item[\hook{include/\meta{name}/after}, \hook{include/after}] % % These hooks are executed (in that order) after \LaTeX{} has % issued the \cs{clearpage} but before is has switched back @@ -349,6 +335,19 @@ % included material and bypassed if it is not loaded because of % some \cs{includeonly} statement.\footnotemark % +% \item[\hook{include/excluded}, \hook{include/\meta{name}/excluded}] +% +% The above hooks for \cs{include} files are only executed when +% the file is loaded (or more exactly the load is attempted). If, +% however, the \cs{include} file is explicitly excluded (through +% an \cs{includeonly} statement) the above +% hooks are bypassed and instead the \hook{include/excluded} +% hook followed by the \hook{include/\meta{name}/excluded} hook +% are executed. This happens after +% \LaTeX{} has loaded the \texttt{.aux} file for this include file, +% i.e., after \LaTeX{} has updated its counters to pretend that the file +% was seen. +% % \end{description} % \end{variable}\footnotetext{For that reason % another \cs{clearpage} is executed after these hooks which @@ -359,6 +358,9 @@ % All \hook{include} hooks involving the name of the included file are implemented as % one-time hooks (whereas all other such hooks are normal hooks). % +% If you want to execute code that is run for every \cs{include} +% regardless of whether or not it is excluded, use the +% \hook{cmd/include/before} or \hook{cmd/include/after} hooks. % % % @@ -728,7 +730,7 @@ % this declaration is done for you automatically and, indeed, they should % not be declared explicitly. % -% Those named \hook{.../after} and \texttt{include/.../end} +% Those named \hook{.../after} and \hook{include/.../end} % are, when code is added, declared as reversed hooks. % % @@ -742,8 +744,8 @@ % \begin{macro}{\@input@file@exists@with@hooks} % \begin{macro}{\unqu@tefilef@und} % \cs{InputIfFileExists} loads any file if it is available so we -% have to add the hooks \texttt{file/before} and -% \texttt{file/after} in the right places. If the file doesn't +% have to add the hooks \hook{file/before} and +% \hook{file/after} in the right places. If the file doesn't % exist no hooks should be executed. % \begin{macrocode} %</2ekernel> @@ -783,7 +785,7 @@ % can't rely on that still being true after the file has been % processed. Thus for using the name in the file hooks we need to % preserve the name and then restore it for the -% \texttt{file/.../after} hook. +% \hook{file/.../after} hook. % % The hook always refers to the file requested by the user. The hook % is \emph{always} loaded for \cs{CurrentFile} which usually is the diff --git a/macros/latex-dev/base/ltfiles.dtx b/macros/latex-dev/base/ltfiles.dtx index 9b31b50197..2a87756da5 100644 --- a/macros/latex-dev/base/ltfiles.dtx +++ b/macros/latex-dev/base/ltfiles.dtx @@ -32,7 +32,7 @@ %<*driver> % \fi \ProvidesFile{ltfiles.dtx} - [2021/10/14 v1.2p LaTeX Kernel (File Handling)] + [2022/04/01 v1.2q LaTeX Kernel (File Handling)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfiles.dtx} @@ -817,7 +817,7 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease>\IncludeInRelease{2022/06/01}% %<latexrelease> {\@include}{Spaces in file names and hooks}% % \end{macrocode} % @@ -899,6 +899,16 @@ % \begin{macrocode} \deadcycles\z@ \@nameuse{cp@#1}% +% \end{macrocode} +% We also execute a hook in this case, first a general used for +% every include file that is exclude and then a specific one that +% contains the name of the include file. +% \changes{v1.2q}{2022/04/01}{Process some hooks is an include file is bypassed} +% \begin{macrocode} +%----------------------------------------- + \UseHook{include/excluded}% + \UseOneTimeHook{include/#1/excluded}% +%----------------------------------------- \fi \let\@auxout\@mainaux % \end{macrocode} @@ -917,13 +927,66 @@ \NewHook{include/before} \NewReversedHook{include/end} \NewReversedHook{include/after} +\NewHook{include/excluded} %<latexrelease>\EndIncludeInRelease %</2ekernel|latexrelease> % \end{macrocode} % % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease> {\@include}{Spaces in file names and hooks}% +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\def\@include#1 {% +%<latexrelease>\ifx\@nodocument\relax +%<latexrelease> \clearpage +%<latexrelease> \if@filesw +%<latexrelease> \immediate\write\@mainaux{\string\@input{#1.aux}}% +%<latexrelease> \fi +%<latexrelease> \@tempswatrue +%<latexrelease> \if@partsw +%<latexrelease> \@tempswafalse +%<latexrelease> \edef\reserved@b{#1}% +%<latexrelease> \@for\reserved@a:=\@partlist\do +%<latexrelease> {\ifx\reserved@a\reserved@b\@tempswatrue\fi}% +%<latexrelease> \fi +%<latexrelease> \if@tempswa +%<latexrelease> \let\@auxout\@partaux +%<latexrelease> \if@filesw +%<latexrelease> \immediate\openout\@partaux "#1.aux" +%<latexrelease> \immediate\write\@partaux{\relax}% +%<latexrelease> \fi +%<latexrelease> \@filehook@set@CurrentFile +%<latexrelease> \UseHook{include/before}% +%<latexrelease> \UseOneTimeHook{include/#1/before}% +%<latexrelease> \@input@{#1.tex}% +%<latexrelease> \UseOneTimeHook{include/#1/end}% +%<latexrelease> \UseHook{include/end}% +%<latexrelease> \clearpage +%<latexrelease> \UseOneTimeHook{include/#1/after}% +%<latexrelease> \UseHook{include/after}% +%<latexrelease> \clearpage +%<latexrelease> \@writeckpt{#1}% +%<latexrelease> \if@filesw +%<latexrelease> \immediate\closeout\@partaux +%<latexrelease> \fi +%<latexrelease> \else +%<latexrelease> \deadcycles\z@ +%<latexrelease> \@nameuse{cp@#1}% +%<latexrelease> \fi +%<latexrelease> \let\@auxout\@mainaux +%<latexrelease>\else +%<latexrelease>\@latex@warning{% +%<latexrelease> \noexpand\include should only be used after \string\begin{document}}% +%<latexrelease>\@input@{#1}% +%<latexrelease>\fi} +%<latexrelease>\NewHook{include/before} +%<latexrelease>\NewReversedHook{include/end} +%<latexrelease>\NewReversedHook{include/after} +% \end{macrocode} +% +% \begin{macrocode} %<latexrelease>\IncludeInRelease{0000/00/00}% -%<latexrelease> {\@include}{Spaces in file names}% +%<latexrelease> {\@include}{Spaces in file names and hooks}% %<latexrelease>\def\@include#1 {% %<latexrelease> \clearpage %<latexrelease> \if@filesw diff --git a/macros/latex-dev/base/ltfinal.dtx b/macros/latex-dev/base/ltfinal.dtx index 4f3b3f15a1..5857e6cf58 100644 --- a/macros/latex-dev/base/ltfinal.dtx +++ b/macros/latex-dev/base/ltfinal.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltfinal.dtx} - [2022/02/20 v2.2r LaTeX Kernel (Final Settings)] + [2022/04/21 v2.2t LaTeX Kernel (Final Settings)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltfinal.dtx} @@ -153,6 +153,34 @@ % \end{macrocode} % \end{macro} % +% +% +% Allocate 3 mark classes to be used in \cs{markboth} and +% \cs{markright}. Should be done earlier but for that definition of +% \cs{newmarks} needs moving (which it should I guess). +% \changes{v2.2s}{2022/04/03}{Integration of new mark management interface} +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/06/01}% +%<latexrelease> {2e-left}{Delayed legacy marks}% +\NewMarkClass {2e-left} +\NewMarkClass {2e-right} +\NewMarkClass {2e-right-nonempty} +% \end{macrocode} +% No rollback really, the marks will remain. +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {2e-left}{Delayed legacy marks}% +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> +% \end{macrocode} + + +% %\begin{macro}{\newXeTeXintercharclass} % \changes{v2.0a}{2014/12/30}{macro added} % \changes{v2.0b}{2015/01/23}{use reserved count 257} @@ -1076,14 +1104,15 @@ % \changes{v2.1h}{2019/09/14}{Expand UTF8 chars when case changing (github/177)} % \changes{v2.2r}{2022/02/20} % {Use \cs{@expl@text@uppercase@@n}, removing local redefinition of \cs{UTF@two@octets@noexpand}}% +% \changes{v2.2t}{2022/04/21}{Support \cs{noexpand} in argument of \cs{@expl@text@uppercase@@n}} % \begin{macrocode} - \protected@edef\reserved@a{\@expl@text@uppercase@@n{#1}}% + \protected@edef\reserved@a{\@expl@text@uppercase@@n{\noexpand\unexpanded{#1}}}% \reserved@a }} \DeclareRobustCommand{\MakeLowercase}[1]{{% \def\reserved@a##1##2{\let##2##1\reserved@a}% \expandafter\reserved@a\@uclclist\reserved@b{\reserved@b\@gobble}% - \protected@edef\reserved@a{\@expl@text@lowercase@@n{#1}}% + \protected@edef\reserved@a{\@expl@text@lowercase@@n{\noexpand\unexpanded{#1}}}% \reserved@a }} % \end{macrocode} diff --git a/macros/latex-dev/base/lthooks-code.pdf b/macros/latex-dev/base/lthooks-code.pdf Binary files differindex 41ad4ad269..525b56beb7 100644 --- a/macros/latex-dev/base/lthooks-code.pdf +++ b/macros/latex-dev/base/lthooks-code.pdf diff --git a/macros/latex-dev/base/lthooks-doc.pdf b/macros/latex-dev/base/lthooks-doc.pdf Binary files differindex 9c58a21a15..079168d1ac 100644 --- a/macros/latex-dev/base/lthooks-doc.pdf +++ b/macros/latex-dev/base/lthooks-doc.pdf diff --git a/macros/latex-dev/base/lthooks.dtx b/macros/latex-dev/base/lthooks.dtx index 97edc2461a..06a0e8258f 100644 --- a/macros/latex-dev/base/lthooks.dtx +++ b/macros/latex-dev/base/lthooks.dtx @@ -31,8 +31,8 @@ %%% From File: lthooks.dtx % % \begin{macrocode} -\def\lthooksversion{v1.0s} -\def\lthooksdate{2022/01/06} +\def\lthooksversion{v1.0u} +\def\lthooksdate{2022/05/19} % \end{macrocode} % %<*driver> @@ -1378,7 +1378,7 @@ % in real documents. % % For example, \pkg{babel} may want to provide hooks such as -% \hook{babel/afterextras/\meta{language}}. Language support in +% \hook{babel/\meta{language}/afterextras}. Language support in % \pkg{babel} is often done through external language % packages. Thus doing the activation for all languages inside the % core \pkg{babel} code is not a viable approach. Instead it needs @@ -1946,6 +1946,20 @@ % \end{description} % % +% +% \subsection{Hook provided by the mark mechanism} +% +% See \texttt{ltmarks-doc.pdf} for details. +% \begin{description} +% +% \item[\hook{insertmark}] +% +% This hook allows for a special setup while \cs{InsertMark} +% inserts a mark. It is executed in group so local changes only +% apply to the mark being inserted. +% +% \end{description} +% % \MaybeStop{\setlength\IndexMin{200pt} \PrintIndex } % % @@ -2182,7 +2196,6 @@ % \end{macro} % % -% % \subsection{Providing new hooks} % % \subsubsection{The data structures of a hook} @@ -3442,7 +3455,12 @@ } \tl_const:cn { c_@@_generic_env/./begin_tl } { + } \tl_const:cn { c_@@_generic_env/./end_tl } { + } +% \end{macrocode} +% +% \changes{v1.0t}{2022/04/01}{Support generic \texttt{include/.../excluded} hooks} +% \begin{macrocode} \tl_const:cn { c_@@_generic_include/./end_tl } { - } +\tl_const:cn { c_@@_generic_include/./excluded_tl } { + } % \end{macrocode} % % Deprecated generic hooks: @@ -3608,6 +3626,11 @@ % \end{macrocode} % % \begin{macrocode} +%<latexrelease>\IncludeInRelease{2022/06/01}{\@@_gset_rule:nnnn} +%<latexrelease> {Refuse~setting~rule~for~one-time~hooks} +% \end{macrocode} +% +% \begin{macrocode} \cs_new_protected:Npn \@@_gset_rule:nnnn #1#2#3#4 { \@@_if_deprecated_generic:nT {#1} @@ -3615,7 +3638,13 @@ \@@_deprecated_generic_warn:n {#1} \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1} {#2} {#3} {#4} - \exp_after:wN \use_none:nnnnnnnnn \use_none:n + \@@_clean_to_scan:w + } + \@@_if_execute_immediately:nT {#1} + { + \msg_error:nnnnnn { hooks } { rule-too-late } + {#1} {#2} {#3} {#4} + \@@_clean_to_scan:w } % \end{macrocode} % First we ensure the basic data structure of the hook exists: @@ -3634,10 +3663,41 @@ {#1} {#2} {#4} \@@_update_hook_code:n {#1} } - { \msg_error:nnnnnn { hooks } { unknown-rule } - {#1} {#2} {#3} {#4} } + { + \msg_error:nnnnnn { hooks } { unknown-rule } + {#1} {#2} {#3} {#4} + } + \s_@@_mark } % \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}{\@@_gset_rule:nnnn} +%<latexrelease> {Refuse~setting~rule~for~one-time~hooks} +%<latexrelease>\cs_new_protected:Npn \@@_gset_rule:nnnn #1#2#3#4 +%<latexrelease> { +%<latexrelease> \@@_if_deprecated_generic:nT {#1} +%<latexrelease> { +%<latexrelease> \@@_deprecated_generic_warn:n {#1} +%<latexrelease> \@@_do_deprecated_generic:Nn \@@_gset_rule:nnnn {#1} +%<latexrelease> {#2} {#3} {#4} +%<latexrelease> \exp_after:wN \use_none:nnnnnnnnn \use_none:n +%<latexrelease> } +%<latexrelease> \@@_init_structure:n {#1} +%<latexrelease> \@@_rule_gclear:nnn {#1} {#2} {#4} +%<latexrelease> \cs_if_exist_use:cTF { @@_rule_#3_gset:nnn } +%<latexrelease> { +%<latexrelease> {#1} {#2} {#4} +%<latexrelease> \@@_update_hook_code:n {#1} +%<latexrelease> } +%<latexrelease> { +%<latexrelease> \msg_error:nnnnnn { hooks } { unknown-rule } +%<latexrelease> {#1} {#2} {#3} {#4} +%<latexrelease> } +%<latexrelease> } +%<latexrelease>\EndIncludeInRelease +% \end{macrocode} % \end{macro} % \end{macro} % @@ -3815,7 +3875,6 @@ % \end{macro} % % -% % \begin{macro}{\@@_initialize_hook_code:n} % Initializing or reinitializing the fast execution hook code. In % the preamble this is selectively done in case a hook gets used @@ -3824,8 +3883,8 @@ % \begin{macrocode} \cs_new_protected:Npn \@@_initialize_hook_code:n #1 { - \@@_debug:n{ \iow_term:x{^^JUpdate~ code~ for~ hook~ - '#1' \on@line :^^J} } + \@@_debug:n + { \iow_term:x { ^^J Update~code~for~hook~'#1' \on@line :^^J } } % \end{macrocode} % This does the sorting and the updates. % First thing we do is to check if a legacy hook macro exists and @@ -3843,6 +3902,7 @@ % \cs{@@_initialize_single:NNn} and pass to it ready made csnames % as they are needed several times inside. This way we save a bit % on processing time if we do that up front. +% \changes{v1.0u}{2022/05/17}{Refuse sorting one-time hooks (gh/818).} % \begin{macrocode} \@@_if_usable:nT {#1} { @@ -3857,7 +3917,7 @@ { % \end{macrocode} % By default the algorithm sorts the code chunks and then saves the -% result in a token list for fast execution; this is done by adding the code chunks +% result in a token list for fast execution; this is done by adding the code chunks % one after another, using \cs{tl_gput_right:NV}. When we sort code for % a reversed hook, all we have to do is to add the code chunks in % the opposite order into the token list. So all we have to do @@ -3886,8 +3946,8 @@ % i.e., we are only interested in storing the keys and the value is % arbitrary. % \begin{macrocode} - \@@_debug:n{ \exp_args:NNx \prop_gput:Nnn - \g_@@_used_prop {#1}{} } + \@@_debug:n + { \exp_args:NNx \prop_gput:Nnn \g_@@_used_prop {#1} { } } } } } @@ -4304,16 +4364,17 @@ % \@@_apply_-rule_>:nnn, % \@@_apply_-rule_<-:nnn, % \@@_apply_-rule_->:nnn, -% \@@_apply_-rule_x:nnn, +% \@@_apply_-rule_xW:nnn, +% \@@_apply_-rule_xE:nnn, % } % Reversed rules. % \begin{macrocode} -\cs_new_eq:cc { @@_apply_-rule_<:nnn } { @@_apply_rule_>:nnn } -\cs_new_eq:cc { @@_apply_-rule_>:nnn } { @@_apply_rule_<:nnn } +\cs_new_eq:cc { @@_apply_-rule_<:nnn } { @@_apply_rule_>:nnn } +\cs_new_eq:cc { @@_apply_-rule_>:nnn } { @@_apply_rule_<:nnn } \cs_new_eq:cc { @@_apply_-rule_<-:nnn } { @@_apply_rule_<-:nnn } \cs_new_eq:cc { @@_apply_-rule_->:nnn } { @@_apply_rule_->:nnn } -\cs_new_eq:cc { @@_apply_-rule_xE:nnn } { @@_apply_rule_xE:nnn } -\cs_new_eq:cc { @@_apply_-rule_xW:nnn } { @@_apply_rule_xW:nnn } +\cs_new_eq:cc { @@_apply_-rule_xE:nnn } { @@_apply_rule_xE:nnn } +\cs_new_eq:cc { @@_apply_-rule_xW:nnn } { @@_apply_rule_xW:nnn } % \end{macrocode} % \end{macro} % @@ -4831,6 +4892,7 @@ % clears the hook so that any further call to \cs{hook_use:n} or % \cs{hook_use_once:n} will expand to nothing. % \changes{v1.0r}{2021/09/06}{Clean up after \cs{UseOneTimeHook} (gh/606)} +% \changes{v1.0u}{2022/05/13}{Check if prop exists to avoid l3debug error} % \begin{macrocode} \cs_new_protected:Npn \@@_use_once_set:n #1 { \@@_tl_gset:cn { g_@@_#1_reversed_tl } { I } } @@ -4839,7 +4901,7 @@ \@@_tl_gclear:c { @@~#1 } \@@_tl_gclear:c { @@_next~#1 } \@@_tl_gclear:c { @@_toplevel~#1 } - \prop_gclear:c { g_@@_#1_code_prop } + \prop_gclear_new:c { g_@@_#1_code_prop } } % \end{macrocode} % \end{macro} @@ -4856,7 +4918,7 @@ % empty. % \changes{v1.0r}{2021/09/06}{Macro added (gh/606)} % \begin{macrocode} -\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { F, TF } +\prg_new_conditional:Npnn \@@_if_execute_immediately:n #1 { T, F, TF } { \@@_if_usable:nTF {#1} { @@ -5097,7 +5159,8 @@ % % \begin{macrocode} \msg_new:nnnn { hooks } { unknown-rule } - { Unknown~ relationship~ '#3'~ + { + Unknown~ relationship~ '#3'~ between~ labels~ '#2'~ and~ '#4'~ \str_if_eq:nnF {#1} {??} { ~in~hook~'#1' }. ~ Perhaps~ a~ misspelling? @@ -5114,6 +5177,22 @@ % \end{macrocode} % % \begin{macrocode} +\msg_new:nnnn { hooks } { rule-too-late } + { + Sorting~rule~for~'#1'~hook~applied~too~late.\\ + Try~setting~this~rule~earlier. + } + { + You~tried~to~set~the~ordering~of~hook~'#1'~using\\ + \ \ \iow_char:N\\DeclareHookRule{#1}{#2}{#3}{#4}\\ + but~hook~'#1'~was~already~used~as~a~one-time~hook,~ + thus~sorting~is\\ + no~longer~possible.~Declare~the~rule~ + before~the~hook~is~used. + } +% \end{macrocode} +% +% \begin{macrocode} \msg_new:nnnn { hooks } { misused-top-level } { Illegal~use~of~\iow_char:N \\AddToHook{#1}[top-level]{...}.\\ diff --git a/macros/latex-dev/base/ltkeys.dtx b/macros/latex-dev/base/ltkeys.dtx index c606d8284d..00c2600289 100644 --- a/macros/latex-dev/base/ltkeys.dtx +++ b/macros/latex-dev/base/ltkeys.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltkeys.dtx} - [2022/02/21 v1.0e LaTeX Kernel (Kevyal options)] + [2022/02/21 v1.0f LaTeX Kernel (Kevyal options)] % \iffalse \documentclass{l3doc} \GetFileInfo{ltkeys.dtx} @@ -99,8 +99,8 @@ % \texttt{second-name} can be given anywhere, and will save its value in % \cs{@mypkg@other@name}. % -% Keys created \emph{before} the use of -% \cs{ProcessKeyOptions}/\cs{ProcessKeyPackageOptions} act as package options. +% Keys created \emph{before} the use of \cs{ProcessKeyOptions}act as +% package options. % \end{function} % % \begin{function}{\DeclareUnknownKeyHandler} @@ -124,17 +124,6 @@ % is called in a package. % \end{function} % -% \begin{function}{\ProcessKeyPackageOptions} -% \begin{syntax} -% \cs{ProcessKeyPackageOptions} \oarg{family} -% \end{syntax} -% This function works in a similar manner to \cs{ProcessKeyOptions}. -% When used in a package, \cs{ProcessKeyPackageOptions} -% will not examine any global (class) class options available. In contrast, -% \cs{ProcessKeyOptions} does parse class options (in common with the -% classical \cs{ProcessOptions} command). -% \end{function} -% % \begin{function}{\SetKeys} % \begin{syntax} % \cs{SetKeys} \oarg{family} \Arg{keyvals} @@ -142,7 +131,7 @@ % Sets (applies) the explicit list of \meta{keyvals} for the \meta{family}: % it the latter is not given, the value of \cs{@currname} used. This command % may be used within a package to set options before or after using -% \cs{ProcessKeyOptions}/\cs{ProcessKeyPackageOptions}. +% \cs{ProcessKeyOptions}. % \end{function} % % \StopEventually{} @@ -211,8 +200,9 @@ % \end{macrocode} % \end{variable} % -% \begin{macro}{\@@_options:Nn} -% \begin{macro}{\@@_options:nN} +% \begin{macro}{\@@_options:n} +% \changes{v1.0f}{2022/03/18}{Simplify to always cover global options} +% \begin{macro}{\@@_options_aux:n} % \changes{v1.0b}{2022/01/15} % {Clear option list in end-of-package hook} % \begin{macro}{\@@_options_end:} @@ -226,14 +216,14 @@ % with the key family not matching the file name, we store the family % in all cases. % \begin{macrocode} -\cs_new_protected:Npn \@@_options:Nn #1#2 - { \@@_options_expand_module:Nn \@@_options:nN {#2} #1 } -\cs_new_protected:Npn \@@_options:nN #1#2 +\cs_new_protected:Npn \@@_options:n #1 + { \@@_options_expand_module:Nn \@@_options_aux:n {#1} } +\cs_new_protected:Npn \@@_options_aux:n #1 { \cs_gset_nopar:cpn { opt@fam@\@currname.\@currext } {#1} \cs_set_protected:Npn \@@_option_end: { } \clist_clear:N \l_@@_options_clist - \@@_options_global:Nn #2 {#1} + \@@_options_global:n {#1} \@@_options_local: \keys_if_exist:nnF {#1} { unknown } { @@ -266,23 +256,21 @@ % \end{macro} % \end{macro} % -% \begin{macro}{\@@_options_global:Nn} +% \begin{macro}{\@@_options_global:n} +% \changes{v1.0f}{2022/03/18}{Simplify to always cover global options} % Global (class) options are handled differently for \LaTeXe{} packages % and classes. Hence this function is essentially a check on the current % file type. The initial test is needed as \LaTeXe{} allows variables to % be equal to \cs{scan_stop:}, which is usually forbidden in \pkg{expl3} % code. % \begin{macrocode} -\cs_new_protected:Npn \@@_options_global:Nn #1#2 +\cs_new_protected:Npn \@@_options_global:n #1 { \cs_if_eq:NNF \@classoptionslist \scan_stop: { \cs_if_eq:NNTF \@currext \@clsextension - { \@@_options_class:n {#2} } - { - \bool_if:NT #1 - { \@@_options_package:n {#2} } - } + { \@@_options_class:n {#1} } + { \@@_options_package:n {#1} } } } % \end{macrocode} @@ -427,20 +415,18 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\ProcessKeyOptions, \ProcessKeyPackageOptions} +% \begin{macro}{\ProcessKeyOptions} % \changes{v1.0c}{2022/02/15}{Expand module argument} % \changes{v1.0d}{2022/02/16}{Allow for active characters in module argument} +% \changes{v1.0f}{2022/03/18}{Remove \cs{ProcessKeyPackageOptions}} % We need to deal with the older interface from \pkg{l3keys2e} here: it had % a mandatory argument. We can mop that up using a look-ahead, and then % exploit that information to determine whether the package option handling % is set up for the new approach for clash handling. % \begin{macrocode} \NewDocumentCommand \ProcessKeyOptions { O { \@currname } } - { \@@_options:Nn \c_true_bool {#1} } -\NewDocumentCommand \ProcessKeyPackageOptions { O { \@currname } } - { \@@_options:Nn \c_false_bool {#1} } + { \@@_options:n {#1} } \@onlypreamble \ProcessKeyOptions -\@onlypreamble \ProcessKeyPackageOptions % \end{macrocode} % \end{macro} % diff --git a/macros/latex-dev/base/ltluatex.pdf b/macros/latex-dev/base/ltluatex.pdf Binary files differindex 819c98563f..fb8c77ee95 100644 --- a/macros/latex-dev/base/ltluatex.pdf +++ b/macros/latex-dev/base/ltluatex.pdf diff --git a/macros/latex-dev/base/ltmarks-code.pdf b/macros/latex-dev/base/ltmarks-code.pdf Binary files differnew file mode 100644 index 0000000000..984ab8635a --- /dev/null +++ b/macros/latex-dev/base/ltmarks-code.pdf diff --git a/macros/latex-dev/base/ltmarks-code.tex b/macros/latex-dev/base/ltmarks-code.tex new file mode 100644 index 0000000000..7a3b9173bb --- /dev/null +++ b/macros/latex-dev/base/ltmarks-code.tex @@ -0,0 +1,5 @@ +% This will typeset documentation + code +% + +\AtBeginDocument{\AlsoImplementation} +\input{ltmarks.dtx} diff --git a/macros/latex-dev/base/ltmarks-doc.pdf b/macros/latex-dev/base/ltmarks-doc.pdf Binary files differnew file mode 100644 index 0000000000..73362580a4 --- /dev/null +++ b/macros/latex-dev/base/ltmarks-doc.pdf diff --git a/macros/latex-dev/base/ltmarks-doc.tex b/macros/latex-dev/base/ltmarks-doc.tex new file mode 100644 index 0000000000..8a62bb95c6 --- /dev/null +++ b/macros/latex-dev/base/ltmarks-doc.tex @@ -0,0 +1,8 @@ +% This will typeset only documentation but not the code +% + +\AtBeginDocument{\OnlyDescription +% \let\tableofcontents\relax + \RenewCommandCopy\MaybeStop\StopEventually + } +\input{ltmarks.dtx} diff --git a/macros/latex-dev/base/ltmarks.dtx b/macros/latex-dev/base/ltmarks.dtx new file mode 100644 index 0000000000..e8971c9d6c --- /dev/null +++ b/macros/latex-dev/base/ltmarks.dtx @@ -0,0 +1,1602 @@ +% \iffalse meta-comment +% +%% File: ltmarks.dtx (C) Copyright 2022 +% Frank Mittelbach, LaTeX Team +% +% It may be distributed and/or modified under the conditions of the +% LaTeX Project Public License (LPPL), either version 1.3c of this +% license or (at your option) any later version. The latest version +% of this license is in the file +% +% https://www.latex-project.org/lppl.txt +% +% +%%% From File: ltmarks.dtx +% +% \begin{macrocode} +\def\ltmarksversion{v1.0c} +\def\ltmarksdate{2022/05/06} +% \end{macrocode} +%<*driver> +\documentclass{l3doc} + +%\usepackage{ltmarks} + +% Fixing footnotes in functions and variables: this should be in l3doc! + +\newcommand\fixfootnote[2]{\footnotemark + \AddToHookNext{env/#1/after}{\footnotetext{#2}}} +\AddToHook{env/function/begin}{\def\footnote{\fixfootnote{function}}} +\AddToHook{env/variable/begin}{\def\footnote{\fixfootnote{variable}}} + +\EnableCrossrefs +\CodelineIndex +\begin{document} + \DocInput{ltmarks.dtx} +\end{document} +%</driver> +% +% \fi +% +% \providecommand\hook[1]{\texttt{#1}} +% \providecommand\env[1]{\texttt{#1}} +% +% +% +% \title{The \texttt{ltmarks.dtx} code\thanks{This file has version +% \ltmarksversion\ dated \ltmarksdate, \copyright\ \LaTeX\ +% Project.}} +% \author{^^A +% Frank Mittelbach, \LaTeX{} Project\thanks +% {^^A +% E-mail: +% \href{mailto:latex-team@latex-project.org} +% {latex-team@latex-project.org}^^A +% }^^A +% } +% +% \maketitle +% +% +% \begin{abstract} +% Marks are used to communicate information about the content of a +% page to the output routine. For example, in order to construct +% running headers, the output routine needs information about which +% section names are present on a page, and this information is +% passed to it through the mark system. However, marks may also be +% used for other purposes. This module provides a generalized +% mechanism for marks of independent classes. +% \end{abstract} +% +% \tableofcontents +% +% ^^A \begin{documentation} +% +% \section{Introduction} +% +% The \TeX{} engines offer a low-level mark mechanism to +% communicate information about the content of the current page to +% the asynchronous operating output routine. It works by placing +% \cs{mark} commands into the source document. When the material +% for the current page is assembled in box 255, \TeX{} scans for +% such marks and sets the commands \cs{topmark}, \cs{firstmark} and +% \cs{botmark}. The \cs{firstmark} receives the content of the +% first \cs{mark} seen in box 255 and \cs{botmark} the content of +% the last mark seen. The \cs{topmark} holds the content of the +% last mark seen on the previous page or more exactly the value of +% \cs{botmark} from the previous page. If there are no marks on +% the current page then all three are made equal to the +% \cs{botmark} from the previous page. +% +% This mechanism works well for simple formats (such as plain \TeX) +% whose output routines are only called to generate pages. It +% fails, however, in \LaTeX{} (and other more complex formats), +% because here the output routine is sometimes called without +% producing a page, e.g., when encountering a float and placing it +% into one of the float regions. In that case the output routine is +% called, determines where to place the float, alters the goal for +% assembling text material (if the float was added to the top or +% bottom region) and then it resumes collecting textual material. +% +% As a result the \cs{botmark} gets updated and so \cs{topmark} no +% longer reflects the situation at the top of the next page when that +% page is finally boxed. +% +% Another problem for \LaTeX{} was that it wanted to use several +% \enquote{independent} marks and in the early implementations of +% \TeX{} there was only a single \cs{mark} command available. +% For that reason \LaTeX{} implemented its own mark +% mechanism where the marks always contained two parts with their +% own interfaces: \cs{markboth} and \cs{markright} to set marks and +% \cs{leftmark} and \cs{rightmark} to retrieve them. +% +% However, this extended mechanism (while supporting scenarios such +% as chapter/section marks) was far from general. The mark +% situation at the top of a page (i.e., \cs{topmark}) remained +% unusable and the two marks offered were not really independent of +% each other because \cs{markboth} (as the name indicates) was +% always setting both. +% +% The new mechanism overcomes both +% issues: +% \begin{itemize} +% \item +% It provides arbitrarily many, fully independent named marks, that +% can be allocated and, from that point onwards, used. +% \item +% It offers access for each such marks to retrieve its top, +% first, and bottom values separately. +% \item +% Furthermore, the mechanism is augmented to give access to marks +% in different \enquote{regions} which may not be just full pages. +% \end{itemize} +% +% +% \section{Design-level and code-level interfaces} +% +% The interfaces are mainly meant for package developers, but they +% are usable (with appropriate care) also in the document +% preamble, for example, when setting up special running headers +% with \pkg{fancyhdr}, etc. They are therefore available both as +% CamelCase commands as well as commands for use in the L3 +% programming layer. Both are described together below. +% +% \begin{function}{\NewMarkClass,\mark_new_class:n} +% \begin{syntax} +% \cs{NewMarkClass} \Arg{class} +% \cs{mark_new_class:n} \Arg{class} +% \end{syntax} +% Declares a new \meta{class} of marks to be tracked by \LaTeX{}. Each \meta{class} +% must be declared before it is used. +% +% Mark classes can only be declared before \verb=\begin{document}=. +% \end{function} +% +% \begin{function}{\InsertMark,\mark_insert:nn} +% \begin{syntax} +% \cs{InsertMark} \Arg{class} \Arg{text} +% \cs{mark_insert:nn} \Arg{class} \Arg{text} +% \end{syntax} +% Adds a mark to the current galley for the \meta{class}, containing the +% \meta{text}. +% +% It has no effect in places in which you can't place floats, e.g., +% a mark inside a box or inside a footnote never shows up anywhere. +% +% If used in vertical mode it obeys \LaTeX's internal +% \cs{@nobreak} switch, i.e., it does not introduce a +% breakpoint if used after a heading. If used in horizontal mode it +% doesn't handle spacing (like, for example, \cs{index} or +% \cs{label} does, so it should be attached to material that is +% typeset. +% \end{function} +% +% \begin{variable}{insertmark} +% \begin{syntax} +% \cs{AddToHook} \texttt{\{insertmark\}} \Arg{code} +% \end{syntax} +% When marks are inserted, the mark content may need some special +% treatment, e.g., by default \cs{label}, \cs{index}, and +% \cs{glossary} do not expand at this time (but only later if and when the +% mark content is actually used. +% In order to allow packages to augment or alter this setup there is +% a public hook \hook{insertmark} that is executed at this point. It +% runs in a group so local modification to commands are only applied +% to the \meta{text} argument of \cs{InsertMark} or \cs{mark_insert:nn}. +% \end{variable} +% +% \begin{function}[EXP]{\TopMark, \FirstMark, \LastMark, +% \mark_use_top:nn,\mark_use_first:nn,\mark_use_last:nn,} +% \begin{syntax} +% \cs{TopMark} \oarg{region} \Arg{class} +% \cs{FirstMark} \oarg{region} \Arg{class} +% \cs{LastMark} \oarg{region} \Arg{class} +% \cs{mark_use_top:nn} \Arg{region} \Arg{class} +% \cs{mark_use_first:nn} \Arg{region} \Arg{class} +% \cs{mark_use_last:nn} \Arg{region} \Arg{class} +% \end{syntax} +% These functions expand to the appropriate mark \meta{text} for +% the given \meta{class} in the specified \meta{region}. +% The default \meta{region} in the design-level commands is \texttt{page}. +% Note that with the L3 layer commands there are no +% optional arguments, i.e., both arguments have to be provided. +% \begin{texnote} +% The result is returned within the \tn{unexpanded} +% primitive (\cs{exp_not:n}), which means that the \meta{text} +% does not expand further when appearing in an \texttt{x}-type +% or \texttt{e}-type argument expansion. +% \end{texnote} +% +% The \enquote{first} and \enquote{last} marks are +% those seen first and last in the current region/page, respectively. The +% \enquote{top} mark is the last mark of the \meta{class} seen +% in an earlier region, i.e., the \meta{text} what would be \enquote{current} at the +% very top of the region. +% +% \noindent\llap{\bfseries Important!\qquad}\indent +% The commands are only meaningful inside the output routine, in +% other places their result is (while not random) unpredictable due +% to the way \LaTeX{} cuts text material into pages. +%% \end{function} +% +% +% +% Currently, \meta{region} is one of +% \texttt{page}, +% \texttt{previous-page}, +% \texttt{column}, and +% \texttt{previous-column}. +% If a page has just been finished then the region \texttt{page} +% refers to the current page and \texttt{previous-page}, as the name +% indicates, to the page that has been finished previously. This +% means you are able to access mark information for the current page +% as well as for the page before if you are inside the output +% routine, without the need to explicitly save that information +% beforehand. +% +% In single column documents the \texttt{column} is the same as the +% \texttt{page} region, but in two-column documents, \texttt{column} +% refers to the current column that just got finished and +% \text{previous-column} to the one previously finished. Code for +% running headers are (in standard \LaTeX{}) only evaluated when +% both columns are assembled, which is another way of saying that in +% that case \texttt{previous-column} refers to the left column and +% \texttt{column} to the right column. +% However, to make this a bit nicer to access, there are also alias +% regions named \texttt{first-column} and +% \texttt{last-column}\footnote{This is called \enquote{last} not \enquote{second} +% in anticipation of extending the mechanism to multiple columns, +% where first and last would still make sense.} to +% access these regions.\footnote{At the moment there aren't any +% \texttt{previous-...-column} regions to access the columns from +% the previous page. If necessary, the mechanism could be +% easily augmented to cover them too, though.} +% +% Note that you can only look backwards at already processed regions, +% e.g., in a \texttt{twoside} document finishing a recto (odd, +% right-hand) page you can access the data from the facing verso +% (left-hand) page, but if you are finishing a left-hand page you +% can't integrate data from the upcoming right-hand page. If such a +% scenario needs to be realized then it is necessary to save the +% left-hand page temporarily instead of finalizing it, process +% material for the right-hand page and once both are ready, attach +% running headers and footers and shipout out both in one +% go.\footnote{As of now that scenario is not yet officially supported.} +% +% \begin{function}[EXP]{\IfMarksEqualTF,\mark_if_eq:nnnnTF,\mark_if_eq:nnnnnnTF} +% \begin{syntax} +% \cs{IfMarksEqualTF} \oarg{region} \Arg{class} \Arg{pos_1} \Arg{pos_2} \Arg{true} \Arg{false} +% \cs{mark_if_eq:nnnnTF} \Arg{region} \Arg{class} \Arg{pos_1} \Arg{pos_2} \Arg{true} \Arg{false} +% \cs{mark_if_eq:nnnnnnTF} \Arg{region_1} \Arg{class_1} \Arg{pos_1} +% \verb= = \Arg{region_2} \Arg{class_2} \Arg{pos_2} \Arg{true} \Arg{false} +% \end{syntax} +% These conditionals allow you to compare the content of two marks +% and act based on the result. The commands work in an expansion +% context, if necessary. +% \end{function} +% +% It is quite common when programming with marks to need to +% interrogate conditions such as whether marks have appeared on a +% previous page, or if there are multiple marks present on the +% current page, and so on. +% The tests above allow for the construction of a variety of +% typical test scenarios, with three examples presented below. +% +% The first two conditionals cover only the common scenarios. Both +% marks are picked up from the same \meta{region} (by default +% \texttt{page}) and they have to be of the same +% \meta{class}.\footnote{If an undeclared mark class is used the +% tests return \emph{true} (not an error).} +% The \meta{pos\textsubscript{\itshape i}} argument can be either +% \texttt{top}, \texttt{first}, or \texttt{last}. +% +% If you wish to compare marks across different regions or across +% different classes, you have to do it using the generic test only +% available in the L3 programming layer or do it manually, i.e., +% get the marks and then compare the values yourself.\footnote{If +% two undeclared mark classes are compared the result is always +% \emph{true}; if a declared and an undeclared mark class is used +% it is always \emph{false}.} +% +% However, the basic version is enough for the following typical use cases: +% \begin{description} +% \item[Test for at most one mark of class \texttt{myclass} on current +% page:] +% +% If the first and last mark in a region are the same then +% either there was no mark at all, or there was at most one. To test +% this on the current page: +%\begin{verbatim} +% \NewMarkClass{myclass} +% \IfMarksEqualTF{myclass}{first}{last} +% { <zero or one mark> }{ <two or more marks> } +%\end{verbatim} +% +% \item[Test for no mark of class \texttt{myclass} in the previous +% page:] +% +% If the top mark is the same as the first mark, there is no mark +% in the region at all. If we wanted to do this test for the +% previous page: +%\begin{verbatim} +% \IfMarksEqualTF[previous-page]{myclass}{top}{first} +% { <no marks> }{ <at least one mark> } +%\end{verbatim} +% Comparing \texttt{top} and \texttt{last} would give you the +% same result. +% +% \item[Test for zero, one, or more than one:] +% +% Combining the two tests from above you can test for zero, one +% or more than one mark. +%\begin{verbatim} +% \IfMarksEqualTF{myclass}{top}{first} +% { <no marks> } +% {\IfMarksEqualTF{myclass}{first}{last} +% { <exactly one mark> }{ <more than one mark> }} +%\end{verbatim} +% +% \end{description} +% +% If you need one of such tests more often (or if you want a separate +% command for it for readability), then consider defining: +%\begin{verbatim} +% \providecommand\IfNoMarkTF[2][page]{\IfMarksEqualTF[#1]{#2}{first}{last}} +%\end{verbatim} +% +% +% +% \subsection{Debugging mark code} +% +% +% \begin{function}{\DebugMarksOn,\DebugMarksOff, +% \mark_debug_on:,\mark_debug_off:} +% \begin{syntax} +% \cs{DebugMarksOn} ... \cs{DebugMarksOff} +% \end{syntax} +% +% Commands to turn the debugging of mark code on or off. The +% debugging output is rather coarse and not really intended for +% normal use at this point in time. +% +% \end{function} +% +% +% +% \section{Application examples} +% +% If you want to figure out if a break was taken at a specific point, +% e.g., whether a heading appears at the top of the page, +% you can do something like this: +%\begin{verbatim} +% \newcounter{breakcounter} +% \NewMarkClass{break} +% \newcommand\markedbreak[1]{\stepcounter{breakcounter}% +% \InsertMark{break}{\arabic{breakcounter}% +% \penalty #1\relax +% \InsertMark{break}{-\arabic{breakcounter}} +%\end{verbatim} +% To test if the break was taken you can test if +% \verb=\TopMark{break}= is positive (taken) or negative (not taken) +% or zero (there was never any marked break so far). +% The absolute value can be used to keep track of which break it +% was (with some further coding). +% +% +% \emph{to be extended with additional application examples} +% +% +% +% \section{Legacy \LaTeXe{} interface} +% +% Here we describe the interfaces that \LaTeXe{} offered since the +% early nineties and some minor extensions. +% +% \subsection{Legacy design-level and document-level interfaces} +% +% \begin{function}{\markboth, \markright} +% \begin{syntax} +% \cs{markboth} \Arg{left} \Arg{right} +% \cs{markright} \Arg{right} +% \end{syntax} +% \LaTeXe{} uses two marks which aren't fully independent. A +% \enquote{left} mark generated by the first argument of \cs{markboth} +% and a \enquote{right} mark generated by the second argument of +% \cs{markboth} or by the only argument of \cs{markright}. The +% command \cs{markboth} and \cs{markright} are in turn called from +% heading commands such as \cs{chaptermark} or \cs{sectionmark} and +% their behavior is controlled by the document class. +% +% For example, in the \cls{article} class with \texttt{twoside} in +% force the \cs{sectionmark} will issue \cs{markboth} with an empty +% second argument and \cs{subsectionmark} will issue +% \cs{markright}. As a result the left mark will contain chapter +% titles and the right mark subsection titles. +% +% Note, however, that in one-sided documents the standard behavior is +% that only \cs{markright} is used, i.e., there will only be +% right-marks but no left marks! +% \end{function} +% +% \begin{function}[EXP]{\leftmark, \rightmark} +% \begin{syntax} +% \cs{leftmark} +% \cs{rightmark} +% \end{syntax} +% These functions return the appropriate mark value from the current page +% and work as before, that is \cs{leftmark} will get the last (!) +% left mark from the page and \cs{rightmark} the first (!) right +% mark. +% +% In other words they work reasonably well if you want to show the +% section title that is current when you are about to turn the page and +% also show the first subsection title on the current page (or the last +% from the previous page if there wasn't one). Other combinations +% can't be shown using this interface. +% +% The commands are fully expandable, because this is how they have +% been always defined in \LaTeX{}. However, this is of course +% only true if the content of the mark they return is itself +% expandable and does not contain any fragile material. Given that +% this can't be guaranteed for arbitrary content, a programmer using +% them in this way should use \cs{protected@edef} and \emph{not} +% \cs{edef} to avoid bad surprises as far as this is possible, or use +% the new interfaces (\cs{TopMark}, \cs{FirstMark}, and \cs{LastMark}) +% which return the \meta{text} in \cs{exp_not:n} to prevent +% uncontrolled expansion. +% \end{function} +% +% +% \subsection{Legacy interface extensions} +% +% The new implementation adds three mark classes: \texttt{2e-left}, +% \texttt{2e-right} and \texttt{2e-right-nonempty} and patches +% \cs{markboth} and \cs{markright} slightly so that they also update +% these new mark classes, so that the new classes work with existing +% document classes. +% +% As a result you can use \verb=\LastMark{2e-left}= and +% \verb=\FirstMark{2e-right}= instead of \cs{leftmark} and +% \cs{rightmark}. But more importantly, you can use any of the other +% retrieval commands to get a different status value from those +% marks, e.g., \verb=\LastMark{2e-right}= would return the last +% subsection on the page (instead of the first as +% returned by \cs{rightmark}). +% +% The difference between \texttt{2e-right} and +% \texttt{2e-right-nonempty} is that the latter will only be updated +% if the material for the mark is not empty. Thus +% \verb=\markboth{title}{}= as issued by, say, \cs{sectionmark}, +% sets a \texttt{2e-left} mark with \texttt{title} and a +% \texttt{2e-right} mark with the empty string but does not add a +% \texttt{2e-right-nonempty} mark. +% +% Thus, if you have a section at the start of a page and you would +% ask for \verb=\FirstMark{2e-right}= you would get an empty string +% even if there are subsections on that page. But +% \texttt{2e-right-nonempty} would then give you the first or last subsection +% on that page. Of course, nothing is simple. If there are no +% subsections it would tell you the last subsection from an earlier +% page. We therefore need comparison tools, e.g., if top and +% first are identical you know that the value is +% bogus, i.e., a suitable implementation would be +%\begin{verbatim} +% \IfMarksEqualTF{2e-right-nonempty}{top}{first} +% { <appropriate action if there was no real mark> } +% {\FirstMark{2e-right-nonempty}} +%\end{verbatim} +% +% +% +% \section{Notes on the mechanism} +% +% In contrast to vanilla \TeX, \eTeX{} extends the mark system to +% allow multiple independent marks. However, it does not solve the +% \cs{topmark} problem which means that \LaTeX{} still needs to manage +% marks almost independently of \TeX{}. The reason for this is that +% the more complex output routine used by \LaTeX{} to handle floats +% (and related structures) means that \tn{topmark(s)} remain +% unreliable. Each time the output routine is fired up, \TeX{} moves +% \tn{botmark} to \tn{topmark}, and while \eTeX{} extends this to +% multiple registers the fundamental concept remains the same. That +% means that the state of marks needs to be tracked by \LaTeX{} +% itself. An early implementation of this package used \TeX{}'s +% \tn{botmark} only to ensure the correct interaction with the output +% routine (this was before the \eTeX{} mechanism was even +% available). However, other than in a prototype implementation for +% \LaTeX3, this package was never made public. +% +% The new implementation now uses \eTeX{}'s marks as they have some +% advantages, because with them we can leave the mark text within the +% galley and only extract the marks during the output routine when we +% are finally shipping out a page or storing away a column for use in +% the next page. That means we do not have to maintain a global data +% structure that we have to keep in sync with informational marks in +% the galley but can rely on everything being in one place and thus +% manipulations (e.g.~reordering of material) will take the marks with +% them without a need for updating a fragile linkage. + +% To allow for completely independent marks we use the following +% procedure: +% \begin{itemize} +% \item +% +% For every type of marks we allocate a mark class so +% that in the output routine \TeX{} can calculate for each class +% the current +% top, first, and bottom mark independently. For this we use +% \cs{newmarks}, i.e., one marks register per class. +% +% \item +% +% As already mentioned firing up an output routine without +% shipping out a page means that \TeX's top marks get wrong so it +% is impossible to rely on \TeX's approach directly. What we do +% instead is to keep track of the real marks (for the last page or +% more generally last region) in some global variables. +% +% \item +% +% These variables are updated in the output routine at defined +% places, i.e., when we do real output processing but not if we +% use special output routines to do internal housekeeping. +% +% \item +% +% The trick we use to get correctly updated variables is the +% following: the material that contains new marks (for example the +% page to be shipped out) is stored in a box. We then use \TeX{} +% primitive box splitting functions by splitting off the largest +% amount possible (which should be the whole box if nothing goes +% really wrong). While that seems a rather pointless thing to do, it +% has one important side effect: \TeX{} sets up first and bottom +% marks for each mark class from the material it has split off. This +% way we get the first and last marks (if there have been any) from +% the material in the box. +% +% \item +% +% The top marks are simply the last marks from the previous +% page or region. And if there hasn't been a first or bottom mark in +% the box then the new top mark also becomes new first and last mark +% for that class. +% +% \item +% +% That mark data is then stored in global token lists for use +% during the output routine and legacy commands such as +% \cs{leftmark} or new commands such as \cs{TopMark} simply access +% the data stored in these token lists. +% \end{itemize} +% That's about it in a nutshell. Of course, there are some details to +% be taken care of---those are discussed in the implementation sections. +% +% +% \section{Internal output routine functions} +% +% The functions in this section are tied to the output routine and used in the +% interface to \LaTeXe{} and perhaps at some later time within a new +% output routine +% for \LaTeX. They are not meant for general use and are therefore made internal. +% Internal means that \verb|@@| automatically gets +% replaced in the code (and in the documentation) so we have to give +% it a suitable value. +% \begin{macrocode} +%<@@=mark> +% \end{macrocode} +% +% \begin{function}{\@@_update_singlecol_structures:} +% \begin{syntax} +% \cs{@@_update_singlecol_structures:} +% \end{syntax} +% \LaTeXe{} integration function in case we are doing single column +% layouts. It assumes that the page content is already stored in +% \cs{@outputbox} and processes the marks inside that box. It is +% called as part of \cs{@opcol}. +% \end{function} +% +% +% \begin{function}{\@@_update_dblcol_structures:} +% \begin{syntax} +% \cs{@@_update_singlecol_structures:} +% \end{syntax} +% \LaTeXe{} integration function mark used when we are doing double +% column documents. It assumes that the page content is already +% stored in \cs{@outputbox} and processes the marks inside that +% box. It then does different post-processing depending on the start +% of the switch \cs{if@firstcolumn}. If we are in the second column +% it also has to update page marks, otherwise it only updates column +% marks. It too is called as part of \cs{@opcol}. +% \end{function} +% +% \begin{function}{\@@_update_structure:nn} +% \begin{syntax} +% \cs{@@_update_structure:nn} \Arg{region} \Arg{material with marks} +% \end{syntax} +% Helper function that inspects the marks +% inside the second argument and assigns new mark values based on +% that to the \meta{region} given in the first argument. +% For this it first copies the mark structure from \meta{region} to +% \texttt{previous-}\meta{region} and then takes all last mark +% values currently in the region and makes them the new top mark +% values. Finally it assigns new first and last values for all mark +% classes based on what was found in the second argument. +% +% As a consequence, the allowed values for \meta{region} are +% \texttt{page} and \texttt{column} because only they have +% \texttt{previous-...} counterparts. +% +% Another important part to keep in mind is that marks are only +% recognized if they appear on top-level, e.g., if we want to +% process material stored in boxes we need to put it unboxed (using +% \cs{unvcopy} etc.)\ into the second argument. +% \end{function} +% +% +% +% \begin{function}{\@@_update_structure_alias:nn} +% \begin{syntax} +% \cs{@@_update_structure_alias:nn} \Arg{alias} \Arg{source} +% \end{syntax} +% Helper function that copies all mark values in the \meta{source} +% region to \meta{alias}, i.e., make the structures identical. Used +% to update the \texttt{previous-...} structures inside +% \cs{@@_update_structure:nn} and \texttt{first-column} and +% \texttt{last-column} structures inside +% \cs{@@_update_singlecol_structures:} or +% \cs{@@_update_dblcol_structures:}. +% \end{function} +% +% +% +% +% \begin{function}{\@@_update_structure_to_err:n} +% \begin{syntax} +% \cs{@@_update_structure_to_err:n} \Arg{region} +% \end{syntax} +% Helper function that sets all mark values in the \meta{region} to +% an error message. This is currently used for \texttt{last-column} +% at times where using marks from it would be questionable/wrong, i.e., +% when we have just processed the first column in a two-column document. +% \end{function} +% +% +% +% ^^A \end{documentation} +% +% +% +% +% +% \StopEventually{\setlength\IndexMin{200pt} \PrintIndex } +% +% +% \section{The Implementation} +% +% +% +% \begin{macrocode} +%<*2ekernel|latexrelease> +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOn +% \end{macrocode} +% +% \begin{macrocode} +%<latexrelease>\NewModuleRelease{2022/06/01}{ltmarks} +%<latexrelease> {Marks~handling} +% \end{macrocode} +% +% \subsection{Allocating new mark classes} +% +% +% \begin{variable}{\g_@@_classes_seq} +% A list holding all the mark classes that have been declared. +% \begin{macrocode} +\seq_new:N \g_@@_classes_seq +% \end{macrocode} +% \end{variable} +% +% +% +% +% \begin{macro}{\mark_new_class:n,\@@_new_class:nn} +% A mark class is created by initializing a number of data +% structures. First, we get a register number to refer to the mark class. +% The new mark class is then added to the \cs{g_@@_classes_seq} +% sequence to be able to easily loop over all classes. Finally a +% number of top-level global token lists are declared that hold +% various versions of the mark for access. +% \begin{macrocode} +\cs_new_protected:Npn \mark_new_class:n #1 +{ + \seq_if_in:NnTF \g_@@_classes_seq {#1} + { + \msg_error:nnn { mark } { class-already-defined } + {#1} + } + { \@@_new_class:nn {#1} } +} +% \end{macrocode} +% This is only available in the preamble. +% \changes{v1.0c}{2022/05/06}{Wrong command made \cs{@onlypreamble}} +% \begin{macrocode} +\@onlypreamble \mark_new_class:n +% \end{macrocode} +% The internal command carries out the necessary allocations. +% \begin{macrocode} +\cs_new_protected:Npn \@@_new_class:nn #1 +{ +%<*trace> + \@@_debug:n { \iow_term:x { Marks:~new~mark:~#1~\msg_line_context: } } +%</trace> +% \end{macrocode} +% Use the \LaTeXe{} interface for now as the L3 programming layer +% doesn't have one for marks yet. +% \begin{macrocode} + \exp_args:Nc \newmarks {c_@@_class_ #1 _mark} +% \end{macrocode} +% Remember the new class in the sequence. +% \begin{macrocode} + \seq_gput_right:Nn \g_@@_classes_seq {#1} +% \end{macrocode} +% We need three token lists for each region, one for top, first, +% and last. +% \begin{macrocode} + \tl_new:c { g_@@_page_top_ #1 _tl } + \tl_new:c { g_@@_page_first_ #1 _tl } + \tl_new:c { g_@@_page_last_ #1 _tl } +% \end{macrocode} +% For the \texttt{page} region we also keep track of the +% \texttt{previous-page}. +% \begin{macrocode} + \tl_new:c { g_@@_previous-page_top_ #1 _tl } + \tl_new:c { g_@@_previous-page_first_ #1 _tl } + \tl_new:c { g_@@_previous-page_last_ #1 _tl } +% \end{macrocode} +% Same game for \texttt{column} and \texttt{previous-column} +% \begin{macrocode} + \tl_new:c { g_@@_column_top_ #1 _tl } + \tl_new:c { g_@@_column_first_ #1 _tl } + \tl_new:c { g_@@_column_last_ #1 _tl } + \tl_new:c { g_@@_previous-column_top_ #1 _tl } + \tl_new:c { g_@@_previous-column_first_ #1 _tl } + \tl_new:c { g_@@_previous-column_last_ #1 _tl } +% \end{macrocode} +% But for columns we also allocate token lists for the alias +% regions \texttt{first-column} and \texttt{last-column}. +% \begin{macrocode} + \tl_new:c { g_@@_first-column_top_ #1 _tl } + \tl_new:c { g_@@_first-column_first_ #1 _tl } + \tl_new:c { g_@@_first-column_last_ #1 _tl } + \tl_new:c { g_@@_last-column_top_ #1 _tl } + \tl_new:c { g_@@_last-column_first_ #1 _tl } + \tl_new:c { g_@@_last-column_last_ #1 _tl } +} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Updating mark structures} +% +% +% \begin{macro}{\l_@@_box,\g_@@_tmp_tl,\g_@@_new_top_tl} +% For some operations we need a temporary private box and two +% private global token lists. +% \begin{macrocode} +\box_new:N \l_@@_box +\tl_new:N \g_@@_tmp_tl +\tl_new:N \g_@@_new_top_tl +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_update_structure:nn} +% +% This function updates the mark structures. The first argument is +% the region to update and second argument receives the material +% that holds the marks. Out of this material we extract the first +% and last marks for all classes (if there are any) to do the +% assignments. +% +% \begin{macrocode} +\cs_new_protected:Npn \@@_update_structure:nn #1#2 + { +% \end{macrocode} +% First thing we do is copying the current structure to +% \texttt{previous-...}; this leaves the current structure +% untouched so we can update it class by class (which is necessary). +% \begin{macrocode} + \@@_update_structure_alias:nn { previous-#1 } {#1} +% \end{macrocode} +% Getting the first and last marks out of the material in \verb=#2= +% is done by putting the material in a box and then doing a +% split operation to the maximum size possible (which hopefully +% means all of the content).\footnote{We could verify this, maybe we +% should.} Because this is an action only for the sake of getting +% at the mark values we don't want any underfull +% box warnings so we turn those (locally) off. +% \begin{macrocode} + \group_begin: + \dim_set_eq:NN \tex_splitmaxdepth:D \c_max_dim + \int_set_eq:NN \tex_vbadness:D \c_max_int + \dim_set_eq:NN \tex_vfuzz:D \c_max_dim +% \end{macrocode} +% There is a further complication: if the region contains infinite +% shrinking glue then a \cs{vsplit} operation will balk with a +% low-level error. Now pages or columns, which are our main concern here, can't +% have such infinite shrinkage if they are cut straight from the +% galley, however the use of \cs{enlargethispage} actually does add +% some at the very bottom (and also wraps the whole page into a box +% by itself, so if we leave it this way then a) we get this error +% and b) we don't see any marks because they are hidden one level +% down). +% +% We therefore do an \tn{unskip} to get rid of that glue if present and +% also check if we have then a \cs{vbox} as the last item and if so +% unpack that too. All this is temporary, just for getting the +% marks out, so it doesn't affect the final page production. +% +% In fact, we go one step further and set the box to a large +% negative height possible and afterwards take a look at the +% reported badness: if it is zero we know that there has still been +% infinite shrinkage in the box so that we can't do a +% \tn{vsplit}. If that is the case we generate an error message and +% bypass extracting the marks. We use only half of \cs{c_max_dim} +% because otherwise \TeX{} will report an overfull vbox despite our +% setting of \cs{tex_vfuzz:D}. This test will not find existing +% infinite shrinkage in all cases, e.g., if there are several glues +% that cancel each other, but it is the best we can do. +% \begin{macrocode} + \vbox_set_to_ht:Nnn \l_@@_box { -.5\c_max_dim } + { + #2 + \tex_unskip:D + \box_set_to_last:N \l_@@_box + \box_if_vertical:NT \l_@@_box + { \vbox_unpack:N \l_@@_box } +% \end{macrocode} +% If it wasn't a vbox, it was either an hbox or there was no box. +% Given that we are only interested in the marks we don't need put +% it back in that case. However, we have to make sure that the box +% is not totally empty (which it might have been from the start, or +% now), because \TeX{} does not report a badness for empty boxes +% which means out test would incorrectly conclude that we have +% infinite shrinking glue. A simple \tn{kern} is enough to avoid this. +% \begin{macrocode} + \tex_kern:D \c_zero_dim + } + \int_compare:nNnTF \tex_badness:D > 0 +% \end{macrocode} +% If the box had no infinite shrinkage (or rather if our test +% didn't show any) we vsplit it. Note that it +% doesn't matter that we set it to this strange size first. If there +% was infinite shrinkage after all, we end up with a low-level +% \TeX{} error, but if there is, it is a coding error and needs +% correcting. +% \begin{macrocode} + { + \vbox_set_split_to_ht:NNn \l_@@_box \l_@@_box \c_max_dim +% \end{macrocode} +% After this action we can get first and last marks of the various +% classes through \cs{tex_splitfirstmarks:D} and +% \cs{tex_splitbotmarks:D}. So now we loop over all classes stored in +% \cs{g_@@_classes_seq}. +% \begin{macrocode} + \seq_map_inline:Nn \g_@@_classes_seq + { +% \end{macrocode} +% First action: get the last mark from the previous region, i.e., +% \verb=previous-#1=. But because it is also still inside \verb=#1=, +% at the moment we use that to construct the name because this is a +% tiny bit faster. Given that we +% need this value in various assignments we store it away which +% avoids unnecessary further csname generations. +% \begin{macrocode} + \tl_gset_eq:Nc \g_@@_new_top_tl { g_@@_#1_last_##1_tl } +% \end{macrocode} +% This will first of all become the new top mark for the current class. +% \begin{macrocode} + \tl_gset_eq:cN { g_@@_#1_top_##1_tl } \g_@@_new_top_tl +% \end{macrocode} +% Next action is to get ourselves the new last mark from the +% material supplied. +% \begin{macrocode} + \tl_gset:No \g_@@_tmp_tl + { \tex_splitbotmarks:D \use:c { c_@@_class_##1_mark } } +% \end{macrocode} +% If this mark doesn't exist then obviously first mark does +% neither, so both become the last mark from the previous region. We +% have to be a little careful here: something like +% \verb=\mark_insert:nn{foo}{}= adds an \enquote{empty} mark that should +% not be confused with no mark at all. But no mark in our material +% will result in \cs{g_@@_tmp_tl} being fully empty. This is why we +% have to make sure that \enquote{empty} from \cs{mark_insert:nn} only +% appears to be empty but fails the next test (see below how this +% is done). +% \begin{macrocode} + \tl_if_empty:NTF \g_@@_tmp_tl + { + \tl_gset_eq:cN { g_@@_#1_last_ ##1_tl } + \g_@@_new_top_tl + \tl_gset_eq:cN { g_@@_#1_first_##1_tl } + \g_@@_new_top_tl + } +% \end{macrocode} +% If it wasn't empty, i.e., if it had a real value then we use this +% value for our new last mark instead. +% \begin{macrocode} + { + \tl_gset_eq:cN { g_@@_#1_last_##1_tl } \g_@@_tmp_tl +% \end{macrocode} +% Because we had a last mark we also have a first mark (which +% might be the same, but might be not), so we pick that up and +% assign it to the appropriate token list. This explains why we first +% checked for the last mark because that makes the processing +% faster in case there is none. +% \begin{macrocode} + \tl_gset:co { g_@@_#1_first_##1_tl } + { + \tex_splitfirstmarks:D + \use:c { c_@@_class_##1_mark } + } + } + } + } +% \end{macrocode} +% If the badness was zero (we actually tested for${}>0$ but it +% can't get negative) then we had infinite shrinkage, so we report +% that and set all marks to the value the last mark had before. +% \begin{macrocode} + { + \msg_error:nnn { mark } { infinite-shrinkage } {#1} + \seq_map_inline:Nn \g_@@_classes_seq + { + \tl_gset_eq:cc { g_@@_#1_top_ ##1_tl } + { g_@@_#1_last_ ##1_tl } + \tl_gset_eq:cc { g_@@_#1_first_##1_tl } + { g_@@_#1_last_ ##1_tl } + } + } +% \end{macrocode} +% Once all mark classes have been processed the data structures are +% updated and we can close the group which undoes our local +% changes and retains only the global ones. +% \begin{macrocode} + \group_end: + } +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{\@@_update_structure_alias:nn} +% This function copies the structure for one region to another +% (name), e.g., from \texttt{page} to \texttt{previous-page} above, +% or later from \texttt{column} to \texttt{first-column}, etc. +% \begin{macrocode} +\cs_new_protected:Npn \@@_update_structure_alias:nn #1#2 { +% \end{macrocode} +% This requires a simple loop through all mark classes copying the +% token list from one name to the next. +% \begin{macrocode} + \seq_map_inline:Nn \g_@@_classes_seq + { + \tl_gset_eq:cc { g_@@_ #1 _top_ ##1 _tl } + { g_@@_ #2 _top_ ##1 _tl } + \tl_gset_eq:cc { g_@@_ #1 _first_ ##1 _tl } + { g_@@_ #2 _first_ ##1 _tl } + \tl_gset_eq:cc { g_@@_ #1 _last_ ##1 _tl } + { g_@@_ #2 _last_ ##1 _tl } + } +} +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@@_update_structure_to_err:n,\@@_error:n} +% A slight variation is to install a fixed error message as the value. +% \begin{macrocode} +\cs_new_protected:Npn \@@_update_structure_to_err:n #1 { + \seq_map_inline:Nn \g_@@_classes_seq + { + \tl_gset:cn { g_@@_ #1 _top_ ##1 _tl } { \@@_error:n {#1} } + \tl_gset:cn { g_@@_ #1 _first_ ##1 _tl } { \@@_error:n {#1} } + \tl_gset:cn { g_@@_ #1 _last_ ##1 _tl } { \@@_error:n {#1} } + } +} +% \end{macrocode} +% Given that this is used in only one place, we could hardwire the +% argument which would be a bit more compact, but who knows, +% perhaps we end up with another reason to use this error command +% elsewhere, so for now we keep the argument. +% \begin{macrocode} +\cs_new_protected:Npn \@@_error:n #1 { + \msg_error:nnn { mark } { invalid-use } {#1} +} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Placing and retrieving marks} +% +% +% +% \begin{macro}{\mark_insert:nn} +% This function puts a mark for some \meta{class} at the current point. +% \begin{macrocode} +\cs_new_protected:Npn \mark_insert:nn #1#2 +{ + \seq_if_in:NnTF \g_@@_classes_seq {#1} + { +% \end{macrocode} +% We need to pass the evaluated argument into the mark but protected +% commands should not expand including those protected using the \cs{protect} approach of +% \LaTeXe{}. We also disable \cs{label} and the +% like.\footnote{Straight copy from \texttt{latex.ltx} but is this +% even correct? At least a label in a running header makes little +% sense if it get set several times! Maybe that needs looking at in +% the 2e kernel.} +% +% At this point the code eventually should get a public +% (and a kernel) hook instead of a set of hardwired settings. +% \begin{macrocode} + \group_begin: +% \end{macrocode} +% Within the group we alter some comments, e.g, \cs{label} or +% \cs{index}, to do the right at this point. This is done in the +% kernel hook \cs{@kernel@before@insertmark} which is followed by +% the public hook \hook{insertmark} that can be used by packages to +% augment or alter that setup as necessary. +% \begin{macrocode} + \@kernel@before@insertmark + \hook_use:n { insertmark } + \unrestored@protected@xdef \g_@@_tmp_tl {#2} +%<*trace> + \@@_debug:n{ \iow_term:x { Marks:~ set~#1~<-~ + '\tl_to_str:V \g_@@_tmp_tl' ~ \msg_line_context: } } +%</trace> + \tex_marks:D \use:c { c_@@_class_ #1 _mark } + { +% \end{macrocode} +% Here is the trick to avoid truly empty marks: if the result from +% the above processing is empty we add something which eventually +% becomes empty, but not immediately; otherwise we just put +% \cs{g_@@_tmp_tl} in. +% \begin{macrocode} + \tl_if_empty:NTF \g_@@_tmp_tl + { \exp_not:n { \prg_do_nothing: } } + { \exp_not:o { \g_@@_tmp_tl } } + } + \group_end: +% \end{macrocode} +% A mark introduces a possible break point and in certain +% situations that should not happen in vertical mode in \LaTeX{}. +% This needs some cleanup \ldots. +% \begin{macrocode} + \if@nobreak\ifvmode\nobreak\fi\fi + } +% \end{macrocode} +% If the mark class was not known, raise an error. +% \begin{macrocode} + { + \msg_error:nnx { mark } { unknown-class } + { \tl_to_str:n {#1} } + } +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[int]{\@kernel@before@insertmark} +% \begin{macro}{insertmark} +% By default \cs{label}, \cs{index}, and \cs{glossary} do nothing +% when the mark is inserted. +% \begin{macrocode} +\cs_new:Npn \@kernel@before@insertmark { + \cs_set_eq:NN \label \scan_stop: + \cs_set_eq:NN \index \scan_stop: + \cs_set_eq:NN \glossary \scan_stop: +} +% \end{macrocode} +% The public hook to augment the setup. +% \begin{macrocode} +\hook_new:n {insertmark} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}[EXP]{\mark_use_top:nn, \mark_use_first:nn, \mark_use_last:nn} +% +% To retrieve the first, last or top region mark, we grab the +% appropriate value stored in the corresponding token list variable +% and pass its contents back. These functions should be used only +% in output routines after \cs{@@_update_structure:nn} has acted, +% otherwise their value will be wrong. +% +% If used with an unknown class or region they generate an error +% (fairly low-level because we are in an expandable context). +% \begin{macrocode} +\cs_new:Npn \mark_use_first:nn #1#2 { \exp_not:v { g_@@_#1_first_#2_tl } } +\cs_new:Npn \mark_use_last:nn #1#2 { \exp_not:v { g_@@_#1_last_#2_tl } } +\cs_new:Npn \mark_use_top:nn #1#2 { \exp_not:v { g_@@_#1_top_#2_tl } } +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Comparing mark values} +% +% +% +% \begin{macro}[TF,EXP]{\mark_if_eq:nnnn,\mark_if_eq:nnnnnn} +% Test if in a given region (\verb=#1=) for a given class +% (\verb=#2=) the marks in position \verb=#3= and \verb=#4= (top, +% first, or last) are identical +% \begin{macrocode} +\prg_new_conditional:Npnn \mark_if_eq:nnnn #1#2#3#4 { T , F , TF } +{ + \tl_if_eq:ccTF { g_@@_ #1 _#3_ #2 _tl } + { g_@@_ #1 _#4_ #2 _tl } + \prg_return_true: + \prg_return_false: +} +% \end{macrocode} +% The fully general test (with two triplets of the form +% \meta{region}, \meta{class}, and \meta{position}) is this: +% \begin{macrocode} +\prg_new_conditional:Npnn \mark_if_eq:nnnnnn #1#2#3#4#5#6 { T , F , TF } +{ + \tl_if_eq:ccTF { g_@@_ #1 _#3_ #2 _tl } + { g_@@_ #4 _#6_ #5 _tl } + \prg_return_true: + \prg_return_false: +} +% \end{macrocode} +% \end{macro} +% +% +% +% \subsection{Messages} +% +% \begin{macrocode} +\msg_new:nnnn { mark } { class-already-defined } + { Mark~class~'#1'~already~defined } + { + \c__msg_coding_error_text_tl + LaTeX~was~asked~to~define~a~new~mark~class~called~'#1':~ + this~mark~class~already~exists. + \c__msg_return_text_tl + } +% \end{macrocode} +% +% \begin{macrocode} +\msg_new:nnnn { mark } { unknown-class } + { Unknown~mark~class~'#1'. } + { + \c__msg_coding_error_text_tl + LaTeX~was~asked~to~manipulate~a~mark~of~class~'#1',~ + but~this~class~of~marks~does~not~exist. + } +% \end{macrocode} +% +% +% \begin{macrocode} + +\msg_new:nnnn { mark } { invalid-use } + { Mark~region~'#1'~not ~usable } + { + \c__msg_coding_error_text_tl + The~region~'#1'~can~only~be~used~after~ + all~columns~have~been~assembled. + \c__msg_return_text_tl + } +% \end{macrocode} +% +% \begin{macrocode} +\msg_new:nnnn { mark } { infinite-shrinkage } + { Infinite~shrinkage~found~in~'#1'. } + { + \c__msg_coding_error_text_tl + The~mark~region~'#1'~contains~some~infinite~negative~glue~ + allowing~it~to~shrink~to~an~arbitrary~size.~ + This~makes~it~impossible~to~split~the~region~apart~to~ + get~at~its~marks.~They~are~lost. + } +% \end{macrocode} +% +% +% +% \subsection{Debugging the mark structures} +% +% Code and commands in this section are not final, it needs more +% experimentation to see what kind of tracing information is going to +% be useful in practice. For now the tracing is mainly meant to be used +% for code testing and not so much for application testing. +% +% It is quite likely that the +% commands and the behavior of the tracing might change in the +% future once we gained some experience with it. +% +% \begin{macro}{\g_@@_debug_bool} +% Holds the current debugging state. +% \begin{macrocode} +\bool_new:N \g_@@_debug_bool +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\mark_debug_on:,\mark_debug_off:} +% \begin{macro}{\@@_debug:n} +% \begin{macro}{\@@_debug_gset:} +% Turns debugging on and off by redefining \cs{@@_debug:n}. +% \begin{macrocode} +\cs_new_eq:NN \@@_debug:n \use_none:n +\cs_new_protected:Npn \mark_debug_on: + { + \bool_gset_true:N \g_@@_debug_bool + \@@_debug_gset: + } +\cs_new_protected:Npn \mark_debug_off: + { + \bool_gset_false:N \g_@@_debug_bool + \@@_debug_gset: + } +\cs_new_protected:Npn \@@_debug_gset: + { + \cs_gset_protected:Npx \@@_debug:n ##1 + { \bool_if:NT \g_@@_debug_bool {##1} } + } +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% +% \begin{macro}{\DebugMarksOn,\DebugMarksOff} +% CamelCase commands for debugging. +% \begin{macrocode} +\cs_new_eq:NN \DebugMarksOn \mark_debug_on: +\cs_new_eq:NN \DebugMarksOff \mark_debug_off: +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}{\@@_class_status:nn} +% Shows the mark values across all regions for one mark class +% (\verb=#2=). The first argument gives some \meta{info} to help +% identifying where the command was called. +% \begin{macrocode} +%<*trace> +\cs_new_protected:Npn \@@_class_status:nn #1#2 + { + \typeout{ Marks:~#2~ #1:} + \typeout{\@spaces page~ (current): + | \exp_not:v { g_@@_page_top_ #2 _tl } + | \exp_not:v { g_@@_page_first_ #2 _tl } + | \exp_not:v { g_@@_page_last_ #2 _tl } |} + \typeout{\@spaces page~ (previous): + | \exp_not:v { g_@@_previous-page_top_ #2 _tl } + | \exp_not:v { g_@@_previous-page_first_ #2 _tl } + | \exp_not:v { g_@@_previous-page_last_ #2 _tl } |} + \typeout{\@spaces column~ (previous): + | \exp_not:v { g_@@_previous-column_top_ #2 _tl } + | \exp_not:v { g_@@_previous-column_first_ #2 _tl } + | \exp_not:v { g_@@_previous-column_last_ #2 _tl } |} + \typeout{\@spaces column~ (current): + | \exp_not:v { g_@@_column_top_ #2 _tl } + | \exp_not:v { g_@@_column_first_ #2 _tl } + | \exp_not:v { g_@@_column_last_ #2 _tl } |} + \typeout{\@spaces column~ (first): + | \exp_not:v { g_@@_first-column_top_ #2 _tl } + | \exp_not:v { g_@@_first-column_first_ #2 _tl } + | \exp_not:v { g_@@_first-column_last_ #2 _tl } |} + \typeout{\@spaces column~ (second): + | \exp_not:v { g_@@_last-column_top_ #2 _tl } + | \exp_not:v { g_@@_last-column_first_ #2 _tl } + | \exp_not:v { g_@@_last-column_last_ #2 _tl } |} +} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \begin{macro}{\@@_status:n} +% Show all mark class values across all regions. +% \begin{macrocode} +\cs_new_protected:Npn \@@_status:n #1 + { + \seq_map_inline:Nn \g_@@_classes_seq + { \@@_class_status:nn {#1} {##1} } + } +%</trace> +% \end{macrocode} +% \end{macro} +% +% +% +% +% \subsection{Designer-level interfaces} +% +% +% \begin{macro}{\NewMarkClass,\InsertMark} +% These two are identical to the L3 programming layer commands. +% \begin{macrocode} +\cs_new_eq:NN \NewMarkClass \mark_new_class:n +\@onlypreamble \NewMarkClass +% \end{macrocode} +% +% \begin{macrocode} +\cs_new_eq:NN \InsertMark \mark_insert:nn +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}[EXP]{\TopMark, \FirstMark, \LastMark} +% The following commands take an optional argument that defaults to +% page. There is no checking that the region is actually valid. If +% not there is simply an empty return. +% \begin{macrocode} +\NewExpandableDocumentCommand \FirstMark { O{page} m } + { \mark_use_first:nn {#1}{#2} } +% \end{macrocode} +% +% \begin{macrocode} +\NewExpandableDocumentCommand \LastMark { O{page} m } + { \mark_use_last:nn {#1}{#2} } +% \end{macrocode} +% +% \begin{macrocode} +\NewExpandableDocumentCommand \TopMark { O{page} m } + { \mark_use_top:nn {#1}{#2} } +% \end{macrocode} +% \end{macro} +% +% +% +% \begin{macro}[EXP]{\IfMarksEqualTF} +% We only provide a CamelCase command for the case with one region +% (optional) and one class. One could think of also providing a +% version for the general case with several optional arguments, but +% use cases for this are most likely rare, so not done yet. +% \begin{macrocode} +\NewExpandableDocumentCommand \IfMarksEqualTF {O{page}mmm} { + \mark_if_eq:nnnnTF {#1}{#2}{#3}{#4} +} +% \end{macrocode} +% \end{macro} +% +% +% +% +% \section{\LaTeXe{} integration} +% +% \subsection{Core \LaTeXe{} integration} +% +% \begin{macro}{\@@_update_singlecol_structures:} +% This command updates the mark structures if we are producing a +% single column document. +% \begin{macrocode} +\cs_new_protected:Npn \@@_update_singlecol_structures: { +% \end{macrocode} +% First we update the \texttt{page} region (which also updates the +% \texttt{previous-page}. +% +% The \cs{@outputbox} is normally in \cs{vbox} in \LaTeX{} but we +% can't take that for granted (an \pkg{amsmath} test document +% changed it to an \cs{hbox} just to trip me up) so we are a little +% careful with unpack now. +% \begin{macrocode} + \box_if_vertical:NTF \@outputbox + { + \@@_update_structure:nn {page} + { \vbox_unpack:N \@outputbox } + } + { + \@@_update_structure:nn {page} + { \hbox_unpack:N \@outputbox } + } +% \end{macrocode} +% The we provide the necessary updates for the aliases. +% \begin{macrocode} + \@@_update_structure_alias:nn {previous-column}{previous-page} + \@@_update_structure_alias:nn {column}{page} + \@@_update_structure_alias:nn {first-column}{page} + \@@_update_structure_alias:nn {last-column}{page} +%<*trace> +% move this into status itself? + \@@_debug:n + { + \@@_status:n + { in~ OR~ ( + \legacy_if:nTF {@twoside} + { twoside- + \int_if_odd:nTF \c@page + { odd }{ even } + } + { oneside } + ) + } + } +%</trace> +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@@_update_dblcol_structures:} +% This commands handles the updates if we are doing two-column pages. +% \begin{macrocode} +\cs_new_protected:Npn \@@_update_dblcol_structures: { +% \end{macrocode} +% First we update the \texttt{column} and \texttt{previous-column} +% regions using the material assembled in \cs{@outputbox}. +% \begin{macrocode} + \box_if_vertical:NTF \@outputbox + { + \@@_update_structure:nn {column} + { \vbox_unpack:N \@outputbox } + } + { + \@@_update_structure:nn {column} + { \hbox_unpack:N \@outputbox } + } +% \end{macrocode} +% How we have to update the alias regions depends on whether or not +% \cs{@opcol} was called to process the first column or to produce +% the completed page +% \begin{macrocode} + \legacy_if:nTF {@firstcolumn} + { +% \end{macrocode} +% If we are processing the first column then \texttt{column} is our +% \texttt{first-column} and there is no \texttt{last-column} yet, +% so we make those an error. +% \begin{macrocode} + \@@_update_structure_alias:nn {first-column}{column} + \@@_update_structure_to_err:n {last-column} + } + { +% \end{macrocode} +% If we produce the completed page then the \texttt{first-column} +% is the same as the new \texttt{previous-column}. However, the +% structure should already be correct if you think about it +% (because is was set to \texttt{column} last time which is now the +% \texttt{previous-column}), thus there is no need to make an update. +% \begin{macrocode} +% \@@_update_structure_alias:nn {first-column}{previous-column} +% \end{macrocode} +% However, we now have a proper \texttt{last-column} so we assign that. +% \begin{macrocode} + \@@_update_structure_alias:nn {last-column}{column} +% \end{macrocode} +% What now remains doing is to update the \texttt{page} and +% \texttt{previous-page} regions. For this we have to copy the +% settings in \texttt{page} into \texttt{previous-page} and then +% update \texttt{page} such that the top and first marks are taken +% from the \texttt{first-column} region and the last marks are +% taken from the \texttt{last-column} region. All this has to be +% done for all mark classes so we loop over our sequence. +% +% Note that one loop is needed if we arrange the copy statements in +% a suitable way. +% \begin{macrocode} + \seq_map_inline:Nn \g_@@_classes_seq + { + \tl_gset_eq:cc { g_@@_previous-page_top_ ##1 _tl } + { g_@@_page_top_ ##1 _tl } + \tl_gset_eq:cc { g_@@_previous-page_first_ ##1 _tl } + { g_@@_page_first_ ##1 _tl } + \tl_gset_eq:cc { g_@@_previous-page_last_ ##1 _tl } + { g_@@_page_last_ ##1 _tl } +% \end{macrocode} +% The \texttt{page} updates need to come after the corresponding +% updates for \texttt{previous-page} otherwise we loose the +% necessary value. +% \begin{macrocode} + \tl_gset_eq:cc { g_@@_page_top_ ##1 _tl } + { g_@@_first-column_top_ ##1 _tl } + \tl_gset_eq:cc { g_@@_ page_first_ ##1 _tl } + { g_@@_first-column_first_ ##1 _tl } + \tl_gset_eq:cc { g_@@_page_last_ ##1 _tl } + { g_@@_last-column_last_ ##1 _tl } + } + } +%<*trace> + \@@_debug:n + { + \@@_status:n + { in~ OR~ ( + \legacy_if:nTF {@twoside} + { twoside- + \int_if_odd:nTF \c@page + { odd }{ even } + } + { oneside } + \space + \legacy_if:nTF {@firstcolumn} + { first~ }{ second~ } + column ) + } + } +%</trace> +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%<@@=> +% \end{macrocode} +% +% \begin{macro}[int]{\@expl@@@mark@update@singlecol@structures@@, +% \@expl@@@mark@update@dblcol@structures@@} +% \begin{macrocode} +\cs_new_eq:NN \@expl@@@mark@update@singlecol@structures@@ + \__mark_update_singlecol_structures: +\cs_new_eq:NN \@expl@@@mark@update@dblcol@structures@@ + \__mark_update_dblcol_structures: +% \end{macrocode} +% \end{macro} +% +% \subsection{Other \LaTeXe{} output routines} +% +% This section will cover \pkg{multicol} and other packages altering +% or providing their own output routine. Not done yet. +% +% +% +% +% \begin{macrocode} +%<latexrelease>\IncludeInRelease{0000/00/00}{ltmarks}% +%<latexrelease> {Undo~Marks~handling} +%<latexrelease> +% \end{macrocode} +% We keep the interface commands around even if we roll back in +% case they are used in packages that don't roll back. Not likely +% to do a lot of good, but then there is not much we can do, but +% this at least then doesn't give errors. +% \begin{macrocode} +%<latexrelease>\DeclareRobustCommand \NewMarkClass[1]{} +%<latexrelease>\DeclareRobustCommand \InsertMark[2]{} +%<latexrelease>\RenewExpandableDocumentCommand \FirstMark { O{} m } { } +%<latexrelease>\RenewExpandableDocumentCommand \LastMark { O{} m } { } +%<latexrelease>\RenewExpandableDocumentCommand \TopMark { O{} m } { } +%<latexrelease>\RenewExpandableDocumentCommand \IfMarksEqualTF { O{} mmm }{ } +%<latexrelease> +% \end{macrocode} +% Same here, this avoided extra roll back code in the OR. +% \begin{macrocode} +%<latexrelease>\let \@expl@@@mark@update@singlecol@structures@@ \relax +%<latexrelease>\let \@expl@@@mark@update@dblcol@structures@@ \relax +%<latexrelease> +%<latexrelease> +%<latexrelease>\EndModuleRelease +% \end{macrocode} +% +% \begin{macrocode} +\ExplSyntaxOff +% \end{macrocode} +% \begin{macrocode} +%</2ekernel|latexrelease> +% \end{macrocode} +% +% Reset module prefix: +% \begin{macrocode} +%<@@=> +% \end{macrocode} +% +% +% +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% diff --git a/macros/latex-dev/base/ltmath.dtx b/macros/latex-dev/base/ltmath.dtx index 9f000a41b4..1bd979f7de 100644 --- a/macros/latex-dev/base/ltmath.dtx +++ b/macros/latex-dev/base/ltmath.dtx @@ -38,7 +38,7 @@ %<*driver> % \fi \ProvidesFile{ltmath.dtx} - [2021/10/14 v1.2j LaTeX Kernel (Math Setup)] + [2022/05/08 v1.2l LaTeX Kernel (Math Setup)] % \iffalse %</driver> % @@ -467,8 +467,9 @@ % \end{macro} % % \begin{macro}{\openup} +% \changes{v1.2k}{2022/04/08}{Make \cs{protected} (gh/123)} % \begin{macrocode} -\def\openup{\afterassignment\@penup\dimen@} +\protected\def\openup{\afterassignment\@penup\dimen@} % \end{macrocode} % % \begin{macrocode} @@ -1089,6 +1090,18 @@ % \end{macrocode} % \end{macro} % +% \changes{v1.2l}{2022/05/08}{Use consistent math styles under \LuaTeX} +% \LuaTeX\ contains new math primitives to place expression over or under +% horizontally extensible glyphs. Before \LuaTeX\ 1.14 these did not work +% correctly with the |\mathstyle| primitive and sometimes did not use +% cramped style in consistent ways. For newer version, we opt into the +% corrected behavior. +% \begin{macrocode} +\ifx\mathdefaultsmode\@undefined\else + \mathdefaultsmode=1 +\fi +% \end{macrocode} +% % \begin{macrocode} %</2ekernel> % \end{macrocode} diff --git a/macros/latex-dev/base/ltmeta.dtx b/macros/latex-dev/base/ltmeta.dtx index e1c296ae1d..31c5d8dbee 100644 --- a/macros/latex-dev/base/ltmeta.dtx +++ b/macros/latex-dev/base/ltmeta.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment % -%% File: ltmeta.dtx (C) Copyright 2021 +%% File: ltmeta.dtx (C) Copyright 2021, 2022 % Frank Mittelbach, LaTeX Team % % It may be distributed and/or modified under the conditions of the @@ -14,14 +14,12 @@ %%% From File: ltmeta.dtx % % \begin{macrocode} -\def\ltmetaversion{v1.0a} -\def\ltmetadate{2021/12/07} +\def\ltmetaversion{v1.0b} +\def\ltmetadate{2022/05/18} % \end{macrocode} %<*driver> \documentclass{l3doc} -%\usepackage{ltmeta} - % Fixing footnotes in functions and variables: this should be in l3doc! \newcommand\fixfootnote[2]{\footnotemark @@ -122,11 +120,12 @@ % \end{macrocode} % % \begin{macrocode} -%<latexrelease>\NewModuleRelease{2021/06/01}{ltmeta} +%<latexrelease>\NewModuleRelease{2022/06/01}{ltmeta} %<latexrelease> {Document Metadata handling} % \end{macrocode} % % \begin{macrocode} +\let \IfDocumentMetadataTF \@secondoftwo \protected\def\DocumentMetadata{% \InputIfFileExists{documentmetadata-support.ltx}% {}% @@ -149,16 +148,44 @@ % \begin{macrocode} \let\DocumentMetadata\@gobble }% + \let \IfDocumentMetadataTF \@firstoftwo \DocumentMetadata } % \end{macrocode} % +% To allow package and class author to support for document links +% we provide also the new interface commands of the hyperref package +% for the creation of targets. +% \changes{v1.0b}{2022/05/17}{Default definition for targets added} +% \begin{macro}{\MakeLinkTarget} +% \begin{macro}{\LinkTargetOn} +% \begin{macro}{\LinkTargetOff} +% \begin{macro}{\NextLinkTarget} +% \begin{macrocode} +\NewDocumentCommand\MakeLinkTarget{sO{}m}{% + \ifvmode + \special{}% + \else + \@savsf\spacefactor + \smash{}% + \spacefactor\@savsf + \fi} +\NewDocumentCommand\LinkTargetOn{}{} +\NewDocumentCommand\LinkTargetOff{}{} +\NewDocumentCommand\NextLinkTarget{m}{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} % % -% -% +% We do not undo \cs{MakeLinkTarget} and friends if we roll back, in +% case they are used in packages that themselves do not offer +% rollback. This way a roll forward adds them, but the dummies remain +% if you roll back and you don't get missing csname errors if they +% are used. % \begin{macrocode} -% %<latexrelease>\IncludeInRelease{0000/00/00}{ltmeta}% %<latexrelease> {Undo Document Metadata handling} %<latexrelease> diff --git a/macros/latex-dev/base/ltnews.pdf b/macros/latex-dev/base/ltnews.pdf Binary files differindex b841c40b85..40747022c8 100644 --- a/macros/latex-dev/base/ltnews.pdf +++ b/macros/latex-dev/base/ltnews.pdf diff --git a/macros/latex-dev/base/ltnews01.pdf b/macros/latex-dev/base/ltnews01.pdf Binary files differindex ae346eb39f..356a298618 100644 --- a/macros/latex-dev/base/ltnews01.pdf +++ b/macros/latex-dev/base/ltnews01.pdf diff --git a/macros/latex-dev/base/ltnews02.pdf b/macros/latex-dev/base/ltnews02.pdf Binary files differindex 103776ed43..ea00f96fbb 100644 --- a/macros/latex-dev/base/ltnews02.pdf +++ b/macros/latex-dev/base/ltnews02.pdf diff --git a/macros/latex-dev/base/ltnews03.pdf b/macros/latex-dev/base/ltnews03.pdf Binary files differindex 06119e7712..a73a7d9e3a 100644 --- a/macros/latex-dev/base/ltnews03.pdf +++ b/macros/latex-dev/base/ltnews03.pdf diff --git a/macros/latex-dev/base/ltnews04.pdf b/macros/latex-dev/base/ltnews04.pdf Binary files differindex 2d752b5815..123c72c732 100644 --- a/macros/latex-dev/base/ltnews04.pdf +++ b/macros/latex-dev/base/ltnews04.pdf diff --git a/macros/latex-dev/base/ltnews05.pdf b/macros/latex-dev/base/ltnews05.pdf Binary files differindex dc337c3faa..ca1599791a 100644 --- a/macros/latex-dev/base/ltnews05.pdf +++ b/macros/latex-dev/base/ltnews05.pdf diff --git a/macros/latex-dev/base/ltnews06.pdf b/macros/latex-dev/base/ltnews06.pdf Binary files differindex 87816972de..0a31acd64f 100644 --- a/macros/latex-dev/base/ltnews06.pdf +++ b/macros/latex-dev/base/ltnews06.pdf diff --git a/macros/latex-dev/base/ltnews07.pdf b/macros/latex-dev/base/ltnews07.pdf Binary files differindex e8992a1f63..ee5db608c9 100644 --- a/macros/latex-dev/base/ltnews07.pdf +++ b/macros/latex-dev/base/ltnews07.pdf diff --git a/macros/latex-dev/base/ltnews08.pdf b/macros/latex-dev/base/ltnews08.pdf Binary files differindex 8318a2ae51..0e09195c8a 100644 --- a/macros/latex-dev/base/ltnews08.pdf +++ b/macros/latex-dev/base/ltnews08.pdf diff --git a/macros/latex-dev/base/ltnews09.pdf b/macros/latex-dev/base/ltnews09.pdf Binary files differindex 5388d757e3..f87f176694 100644 --- a/macros/latex-dev/base/ltnews09.pdf +++ b/macros/latex-dev/base/ltnews09.pdf diff --git a/macros/latex-dev/base/ltnews10.pdf b/macros/latex-dev/base/ltnews10.pdf Binary files differindex 628b86746c..d28672180f 100644 --- a/macros/latex-dev/base/ltnews10.pdf +++ b/macros/latex-dev/base/ltnews10.pdf diff --git a/macros/latex-dev/base/ltnews11.pdf b/macros/latex-dev/base/ltnews11.pdf Binary files differindex a37246fb94..3005ecb46f 100644 --- a/macros/latex-dev/base/ltnews11.pdf +++ b/macros/latex-dev/base/ltnews11.pdf diff --git a/macros/latex-dev/base/ltnews12.pdf b/macros/latex-dev/base/ltnews12.pdf Binary files differindex 2e38696a7e..571a53690a 100644 --- a/macros/latex-dev/base/ltnews12.pdf +++ b/macros/latex-dev/base/ltnews12.pdf diff --git a/macros/latex-dev/base/ltnews13.pdf b/macros/latex-dev/base/ltnews13.pdf Binary files differindex 4a04a54aa9..7f0ce1c390 100644 --- a/macros/latex-dev/base/ltnews13.pdf +++ b/macros/latex-dev/base/ltnews13.pdf diff --git a/macros/latex-dev/base/ltnews14.pdf b/macros/latex-dev/base/ltnews14.pdf Binary files differindex 7ef8a64932..5a1bc2847d 100644 --- a/macros/latex-dev/base/ltnews14.pdf +++ b/macros/latex-dev/base/ltnews14.pdf diff --git a/macros/latex-dev/base/ltnews15.pdf b/macros/latex-dev/base/ltnews15.pdf Binary files differindex a4aa674bb8..bf86fe3a1c 100644 --- a/macros/latex-dev/base/ltnews15.pdf +++ b/macros/latex-dev/base/ltnews15.pdf diff --git a/macros/latex-dev/base/ltnews16.pdf b/macros/latex-dev/base/ltnews16.pdf Binary files differindex d243dc4e78..c85a7aaa26 100644 --- a/macros/latex-dev/base/ltnews16.pdf +++ b/macros/latex-dev/base/ltnews16.pdf diff --git a/macros/latex-dev/base/ltnews17.pdf b/macros/latex-dev/base/ltnews17.pdf Binary files differindex 018b605443..1e41d77495 100644 --- a/macros/latex-dev/base/ltnews17.pdf +++ b/macros/latex-dev/base/ltnews17.pdf diff --git a/macros/latex-dev/base/ltnews18.pdf b/macros/latex-dev/base/ltnews18.pdf Binary files differindex 912c134dfa..7dccf5bbfc 100644 --- a/macros/latex-dev/base/ltnews18.pdf +++ b/macros/latex-dev/base/ltnews18.pdf diff --git a/macros/latex-dev/base/ltnews19.pdf b/macros/latex-dev/base/ltnews19.pdf Binary files differindex 4821f6f528..affec120d0 100644 --- a/macros/latex-dev/base/ltnews19.pdf +++ b/macros/latex-dev/base/ltnews19.pdf diff --git a/macros/latex-dev/base/ltnews20.pdf b/macros/latex-dev/base/ltnews20.pdf Binary files differindex 1a198102ad..79845c1b09 100644 --- a/macros/latex-dev/base/ltnews20.pdf +++ b/macros/latex-dev/base/ltnews20.pdf diff --git a/macros/latex-dev/base/ltnews21.pdf b/macros/latex-dev/base/ltnews21.pdf Binary files differindex 5c8dcdbf48..b991986c22 100644 --- a/macros/latex-dev/base/ltnews21.pdf +++ b/macros/latex-dev/base/ltnews21.pdf diff --git a/macros/latex-dev/base/ltnews22.pdf b/macros/latex-dev/base/ltnews22.pdf Binary files differindex 86b9829d51..bb70fefd4a 100644 --- a/macros/latex-dev/base/ltnews22.pdf +++ b/macros/latex-dev/base/ltnews22.pdf diff --git a/macros/latex-dev/base/ltnews23.pdf b/macros/latex-dev/base/ltnews23.pdf Binary files differindex d13112eab4..c35e6abeec 100644 --- a/macros/latex-dev/base/ltnews23.pdf +++ b/macros/latex-dev/base/ltnews23.pdf diff --git a/macros/latex-dev/base/ltnews24.pdf b/macros/latex-dev/base/ltnews24.pdf Binary files differindex d33dc9585b..a63d4fea58 100644 --- a/macros/latex-dev/base/ltnews24.pdf +++ b/macros/latex-dev/base/ltnews24.pdf diff --git a/macros/latex-dev/base/ltnews25.pdf b/macros/latex-dev/base/ltnews25.pdf Binary files differindex 4779fd294e..b238895d21 100644 --- a/macros/latex-dev/base/ltnews25.pdf +++ b/macros/latex-dev/base/ltnews25.pdf diff --git a/macros/latex-dev/base/ltnews26.pdf b/macros/latex-dev/base/ltnews26.pdf Binary files differindex 0de0ca04fa..87af0169bf 100644 --- a/macros/latex-dev/base/ltnews26.pdf +++ b/macros/latex-dev/base/ltnews26.pdf diff --git a/macros/latex-dev/base/ltnews27.pdf b/macros/latex-dev/base/ltnews27.pdf Binary files differindex a395576c01..b2ecbfb3d7 100644 --- a/macros/latex-dev/base/ltnews27.pdf +++ b/macros/latex-dev/base/ltnews27.pdf diff --git a/macros/latex-dev/base/ltnews28.pdf b/macros/latex-dev/base/ltnews28.pdf Binary files differindex 1bbcb49c28..eaf5c12224 100644 --- a/macros/latex-dev/base/ltnews28.pdf +++ b/macros/latex-dev/base/ltnews28.pdf diff --git a/macros/latex-dev/base/ltnews29.pdf b/macros/latex-dev/base/ltnews29.pdf Binary files differindex 584d2f88c1..23ab75551a 100644 --- a/macros/latex-dev/base/ltnews29.pdf +++ b/macros/latex-dev/base/ltnews29.pdf diff --git a/macros/latex-dev/base/ltnews30.pdf b/macros/latex-dev/base/ltnews30.pdf Binary files differindex 543b322d65..f0f1c1f2c9 100644 --- a/macros/latex-dev/base/ltnews30.pdf +++ b/macros/latex-dev/base/ltnews30.pdf diff --git a/macros/latex-dev/base/ltnews31.pdf b/macros/latex-dev/base/ltnews31.pdf Binary files differindex 6a97e28863..954a3d8600 100644 --- a/macros/latex-dev/base/ltnews31.pdf +++ b/macros/latex-dev/base/ltnews31.pdf diff --git a/macros/latex-dev/base/ltnews32.pdf b/macros/latex-dev/base/ltnews32.pdf Binary files differindex bf985ad362..cbd610146c 100644 --- a/macros/latex-dev/base/ltnews32.pdf +++ b/macros/latex-dev/base/ltnews32.pdf diff --git a/macros/latex-dev/base/ltnews33.pdf b/macros/latex-dev/base/ltnews33.pdf Binary files differindex 4825971649..8f16e14ba9 100644 --- a/macros/latex-dev/base/ltnews33.pdf +++ b/macros/latex-dev/base/ltnews33.pdf diff --git a/macros/latex-dev/base/ltnews34.pdf b/macros/latex-dev/base/ltnews34.pdf Binary files differindex d2c0df1bd0..3212327c00 100644 --- a/macros/latex-dev/base/ltnews34.pdf +++ b/macros/latex-dev/base/ltnews34.pdf diff --git a/macros/latex-dev/base/ltnews35.pdf b/macros/latex-dev/base/ltnews35.pdf Binary files differindex 34695cb058..2873f9de0a 100644 --- a/macros/latex-dev/base/ltnews35.pdf +++ b/macros/latex-dev/base/ltnews35.pdf diff --git a/macros/latex-dev/base/ltnews35.tex b/macros/latex-dev/base/ltnews35.tex index 671d6d337a..132dcd31b0 100644 --- a/macros/latex-dev/base/ltnews35.tex +++ b/macros/latex-dev/base/ltnews35.tex @@ -118,7 +118,7 @@ \tubcommand{\input{tubltmac}} \publicationmonth{June} -\publicationyear{2022 --- DRAFT version for upcoming release} +\publicationyear{2022} \publicationissue{35} @@ -137,6 +137,28 @@ \section{Introduction} +The 2022 June release of \LaTeX{} is again focussing on improvements +made for our multi-year project to automatically offer tagged PDF +output~\cite{35:blueprint}. These are the new document metadata +interface, the new mark mechanism for \LaTeX{}, a standard key/value +approach for options, and the introduction of the \texttt{latex-lab} +area for temporary code that can be optionally loaded by a document +(when \cs{DocumentMetadata} is used with certain test keys). These +additions are described in the first sections. Related to this effort +there are updates to \pkg{hyperref} and \pkg{tagpdf} both of which +have their own distributions. + +As usual, we also added a number of smaller improvements and bug +fixes in various components of core \LaTeX{}. Perhaps the most +interesting ones (for some users) are direct support for floating +point arithmetic (via \cs{fpeval} see below) and the ability to +properly color parts of math formulas without introducing spacing +problems. For this we now offer the command \cs{mathcolor}; see the +description near the end of the newsletter. There is also a new major +release of the \pkg{doc} package that supports a more fine-grained +classification of code elements and properly supports \pkg{hyperref}. + + \section{Document metadata interface} Until recently there was no dedicated location to declare @@ -183,6 +205,9 @@ Documentation about the new command and already existing keys are in \file{l3meta.pdf} and \file{documentmetadata-support.pdf} and also in the documentation of the \pkg{pdfmanagement-testphase} package. +Package and class authors can test if a user has used \cs{DocumentMetadata} +with \cs{IfDocumentMetadataTF}. + \section{The \pkg{latex-lab} bundle} @@ -197,7 +222,7 @@ Currently supported values are \texttt{phase-I} and \texttt{phase-II} that enable code of the tagged PDF project (phase-I is frozen and phase-II the phase we are currently working on). With \begin{verbatim} -\DocumentMetadata{testphase=phase-II} + \DocumentMetadata{testphase=phase-II} \end{verbatim} you currently enable tagging for paragraphs and footnotes, more document elements will follow soon. @@ -207,7 +232,8 @@ For more detailed testing it is also possible to pass other values to design interface based on \pkg{l3keys} can be accessed through the value \texttt{prototype}, thus \begin{verbatim} -\DocumentMetadata{testphase={phase-II,prototype}} + \DocumentMetadata + {testphase={phase-II,prototype}} \end{verbatim} will enable all of phase-II plus the draft template interface (which is not yet integrated in phase-II). @@ -218,12 +244,73 @@ require a \cs{DocumentMetadata} declaration, but you will then be able to drop the \texttt{testphase} key setting. +\section{A new mark mechanism for \LaTeX{}} +The mark mechanism is \TeX{}'s way to pass information to the +page-building process which happens asynchronously in order to +communicate relevant data for running headers and footers to the +latter, e.g., what is the first section on the page or the last +subsection, etc. However, marks may also be +used for other purposes. The new kernel module provides a generalized +mechanism for marks of independent classes. +The \TeX{} engines offer a low-level mark mechanism to +communicate information about the content of the current page to +the asynchronous operating output routine. It works by placing +\cs{mark} commands into the source document. -\section{New or improved commands} +This mechanism works well for simple formats (such as plain \TeX) +whose output routines are only called to generate pages. It +fails, however, in \LaTeX{} (and other more complex formats), +because here the output routine is sometimes called without +producing a page, e.g., when encountering a float and placing it +into one of the float regions. +% +When that happens \TeX{}'s \cs{topmark} no +longer reflects the situation at the top of the next page when that +page is finally boxed. + +Furthermore, \TeX{} only offered a single mark while \LaTeX{} wanted to +keep track of more than one piece of information. For that reason, +\LaTeX{} implemented its own mark mechanism where the marks always +contained two parts with their own interfaces: \cs{markboth} and +\cs{markright} to set marks and \cs{leftmark} and \cs{rightmark} to +retrieve them. + +Unfortunately, this extended mechanism (while supporting scenarios such +as chapter/section marks) was far from general. The mark +situation at the top of a page (i.e., \cs{topmark}) remained +unusable and the two marks offered were not really independent of +each other because \cs{markboth} (as the name indicates) was +always setting both. + + +The new mechanism now available in \LaTeX{} starting with the 2022 +release overcomes both issues: +\begin{itemize} +\item + It provides arbitrary many, fully independent named marks, that + can be allocated and from that point onwards used. +\item + It offers access for each such marks to retrieve its top, + first, and bottom value separately. +\item + Furthermore, the mechanism is augmented to give access to marks + in different ``regions'' which may not be just full pages. +\end{itemize} +The legacy interfaces, e.g., \cs{markboth}, are kept. Thus classes and +packages making use of them continue to work flawlessly. To make use +of the extended possibility a new set of commands for declaration of +mark classes, setting their values and querying their state (in the +output routine) is now available in addition. +% +You find the documentation for the new interfaces together with +examples and further notes on the mechanism in the file +\texttt{ltmarks-doc.pdf}. Just call \texttt{texdoc} +\texttt{ltmarks-doc} to display it on your computer. -\subsection{A keyval approach to option handling} + +\section{A key/value approach to option handling} The classical \LaTeXe{} method for handling options, using \cs{ProcessOptions}, treats each entry in the list as a string. Many package authors have sought to @@ -244,8 +331,6 @@ unless explicitly given as an optional argument. \begin{verbatim} \ProcessKeyOptions[family] \end{verbatim} -A version which does not consider global options, -\cs{ProcessKeyPackageOptions}, is also available. To support creating key options for this mechanism, the new command \cs{DeclareKeys} has been added. This works using the same general @@ -255,7 +340,7 @@ approach as \pkg{l3keys} or \pkg{pgfkeys}: each key has one or more Options for packages which use this new approach will not be checked for clashes by the kernel. Instead, each time a \cs{usepackage} or \cs{RequirePackage} line is encountered, the list of options given will be -passed to \cs{ProcessKeyPackageOptions}. Options which can only be given +passed to \cs{ProcessKeyOptions}. Options which can only be given the first time a package is loaded can be marked using the property \texttt{.usage = load}, and will result in a warning if used in a subsequent package loading line. @@ -264,6 +349,11 @@ Package options defined in this way can also be set within a package using the new command \cs{SetKeys}, which again takes an optional argument to specify the \emph{family}, plus a mandatory one for the options themselves. + + +\section{New or improved commands} + + \subsection{Floating point and integer calculations} The L3 programming layer offers expandable commands for calculating @@ -276,9 +366,9 @@ document-level, the small package \pkg{xfp} defined \cs{fpeval} and An example of use could be the following: \begin{verbatim} -\LaTeX{} can now compute: -\[ \frac{\sin (3.5)}{2} + 2\cdot 10^{-3} - = \fpeval{sin(3.5)/2 + 2e-3} \] + \LaTeX{} can now compute: + \[ \frac{\sin (3.5)}{2} + 2\cdot 10^{-3} + = \fpeval{sin(3.5)/2 + 2e-3} \] \end{verbatim} which produces the following output: \begin{quote} @@ -294,9 +384,9 @@ other three commands are essentially thin wrappers for \cs{numexpr}, \cs{dimexpr}, and \cs{glueexpr} \Dash therefore inheriting some syntax peculiars and limitations in expressiveness. \begin{verbatim} -\newcommand\calulateheight[1]{% - \setlength\textheight{\dimeval{\topskip - + \baselineskip * \inteval{#1-1}}}} + \newcommand\calulateheight[1]{% + \setlength\textheight{\dimeval{\topskip + + \baselineskip * \inteval{#1-1}}}} \end{verbatim} The above, for example, calculates the appropriate \cs{textheight} for a given number of text lines. @@ -392,9 +482,33 @@ lua.get_functions_table() % \githubissue{536} - - - +\subsection{Starred command version for \cs{ref}, \cs{Ref} and \cs{pageref}} + +For a long time \pkg{hyperref} provides starred versions for the reference commands +that don't create active links. This syntax extension required users and +package authors to check if \pkg{hyperref} was loaded and adjust the coding +accordingly or take the starred forms out if text was copied to a document +without \pkg{hyperref}. The commands have now been aligned with +the \pkg{hyperref} usage and always allow an optional star. The \pkg{showkeys} package +has been updated to handle the starred versions too, both with \pkg{hyperref} or \pkg{nameref} +and without. The commands are defined with \cs{NewDocumentCommand} and so no longer expand when +written to auxiliary files. This reduces the number of compilations needed to resolve references +in captions and sectioning commands. The package \pkg{ifthen} has been updated to ensure that +\cs{pageref} can still be used inside tests like \cs{isodd}. + + +\subsection{Preparation for supporting PDF in backends} + +At the current point in time, basic support for PDF in +backends is not part of \LaTeX{} core; it is provided by external +package like \pkg{hyperref}. +At some time in the future that work will be placed +into the kernel but for now it is separate and has to be +explicitly loaded in the document. To enable class and package authors +to support PDF specific task like the creation of link targets without +having to test first if \pkg{hyperref} has been loaded, dummy versions of +the commands \cs{MakeLinkTarget}, \cs{LinkTargetOn}, \cs{LinkTargetOff} and +\cs{NextLinkTarget} are provided. \section{Code improvements} @@ -505,7 +619,7 @@ changes are displayed with as the heading (instead of just \meta{version}), when using \cs{PrintChanges}. % -\githubissue{gh/531} +\githubissue{531} @@ -530,7 +644,7 @@ The document class \class{proc}, which is a small variation on the \class{article} class, now supports the \option{twoside} option displaying different data in the footer line on recto and verso pages. % -\githubissue{gh/704} +\githubissue{704} \subsection{Croatian character support} @@ -539,7 +653,7 @@ The default \pkg{inputenc} support has been extended to support the 9 characters D\v Z, D\v z, d\v z, LJ, Lj, lj, NJ, Nj, nj, input as single UTF-8 code points in the range U+01C4 to U+01CC. % -\githubissue{gh/723} +\githubissue{723} \subsection{Cleanup of the Unicode declaration interface} @@ -564,6 +678,31 @@ argument as their general purpose counterparts do. \githubissue{253} +\subsection{New hook: \hook{include/excluded}} + +A few releases ago we introduced a number of file hooks for different +types of files, see~\cite{35:ltnews32} and in +particular~\cite{35:ltfilehook-doc}. +% +The hooks for \cs{include} files now got an addition: if such a file +is not included (because \cs{includeonly} is used and its \meta{name} +is not listed in the argument) then the hooks \hook{include/excluded} +and \hook{include/\meta{name}/excluded} are executed in that +order\Dash of course, only if they contain code. This happens after +\LaTeX{} has loaded the \texttt{.aux} file for this include file, +i.e., after \LaTeX{} has updated its counters to pretend that the file +was seen. + + +\subsection{Input support for normalized angle brackets} + +Source files containing \textlangle\ or \textrangle\ directly written +as Unicode codepoints U+2329 and U+232A no longer break when the +source file gets normalized under Unicode normalization rules. +% +\githubissue{gh/714} + + \section{Bug fixes} @@ -605,11 +744,80 @@ This has finally been corrected and a warning is now generated also in this case +\subsection{Fix adding \hook{cmd} hooks to simple macros} + +A bug in how \LaTeX{} would detect the type of a command was causing a +premature forced expansion of such commands, which, depending on their +definition, could be harmless or could cause severe trouble. This has +been fixed in the latest release. +% +\githubissue{795} +\sxissue{q/637565} + + +\subsection{Warn if \hook{shipout/lastpage} hook is executed too early} + +The hook \hook{shipout/lastpage} is intended to place \cs{special}s +into the last page shipped out. This is needed for some use cases, +e.g., tagging. If that hook is nonempty and the user has added additional +pages since the last run, then \LaTeX{} executes this hook too early, +but until now without giving any indication that the document needs +rerunning. This has now been corrected and an appropriate warning is +given. +% +\githubissue{813} + + +\subsection{More consistent use of cramped math styles in \LuaTeX} + +Using \LuaTeX's \cs{Udelimiterover} to place a horizontally extensible glyph +on top of a mathematical expression now causes the expression to be set in cramped +style as used in similar situations by traditional \TeX\ math rendering. +Similarly cramped style is now used for expressions set under such a delimiter +using \cs{Uunderdelimiter} but no longer used when setting an expression on top +of such extensible glyphs using \cs{Uoverdelimiter}. +This new behavior follows \TeX's rule that cramped style is used whenever something +else appears above the expression. +Additionally the math style of these constructs can now be detected using \cs{mathstyle}. + +The old behavior can be restored by adding +\begin{verbatim} + \mathdefaultsmode=0 +\end{verbatim} +to a document. + + +\subsection{Fixed bug when setting hook rules for one-time hooks} + +If a \cs{DeclareHookRule} command is set for a one-time hook, it has to +come \emph{before} the hook gets used, because otherwise it never +applies\Dash after all, the hook is used only once. There was a bug in +the implementation in that the sorting mechanism was still applied if +the \cs{DeclareHookRule} declaration appeared while the one-time hook was +executed, causing the spurious typesetting of the code labels and the +hook name. This bug is now fixed and an error is raised when a new +sorting rule is added to an already used one-time hook. + +A possible scenario in which this new error is raised is the following: +package \pkg{AAA} declares a hook rule for \hook{begindocument} (i.e., +\cs{AtBeginDocument}) to sort out the behavior between itself and some +other package. Package \pkg{BBB} wants to load package \pkg{AAA} but +only if it hasn't been loaded in the preamble, so delays the loading to +\hook{begindocument}. In that case the hook rule declared by \pkg{AAA} +can no longer be applied and you get the error. If that happens the +solution is to load the package in \hook{begindocument/before}, which +is executed at the very end of the preamble but before +\hook{begindocument} is processed. +% +\githubissue{818} + + + \section{Changes to packages in the \pkg{amsmath} category} -\subsection{\pkg{amsopn} Do not reset \cs{operator@font}} +\subsection{\pkg{amsopn}: Do not reset \cs{operator@font}} The package \pkg{amsopn} used to define \cs{operator@font} but this command is already provided by the \LaTeX{} format (for at least 14 @@ -622,15 +830,15 @@ this reason the definition was taken out and In the unlikely event that you want the resetting to happen, use \begin{verbatim} - \makeatletter - \def\operator@font{\mathgroup\symoperators} + \makeatletter + \def\operator@font{\mathgroup\symoperators} \makeatother \end{verbatim} after loading the package. % \githubissue{734} -\subsection{\pkg{amsmath} Error in \cs{shoveleft}} +\subsection{\pkg{amsmath}: Error in \cs{shoveleft}} If \cs{shoveleft} started out with the words \enquote{plus} or \enquote{minus} it was misunderstood as part of a rubber length and @@ -641,6 +849,20 @@ is now prevented. \githubissue{714} +\subsection{\pkg{amsmath} and \pkg{amsopn}: Robustify user commands} + +Most user-level commands have been made robust in the \LaTeX{} kernel +during the last years, but variant definitions in \pkg{amsmath} turned +them back into fragile beings. We have now made most commands in +\pkg{amsmath} and \pkg{amsopn} robust as well to match the kernel +behavior. This also resolves a bug recently discovered in the +\pkg{mathtools} package, which was due to \cs{big} not being robust after +\pkg{amsmath} was loaded. +% +\githubissue{123} + + + \section{Changes to packages in the \pkg{graphics} category} \subsection{Color in formulas} @@ -655,7 +877,7 @@ right: % without {{ the superscript below is misplaced _{{\color{black} i=1}} % without {{ the \sum is black - ^{{\color{black} n}} + ^{{\color{black} n}} \color{black} % without it the x_i is red x_i \] \end{verbatim} @@ -731,26 +953,29 @@ internal syntax errors due to premature expansion. \emph{\LaTeX{} Tagged PDF \Dash A blueprint for a large project}.\\ \url{https://latex-project.org/publications/indexbyyear/2020/} -\bibitem{35:source2e} - \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\ - \url{https://latex-project.org/help/documentation/} +%\bibitem{35:source2e} +% \emph{\LaTeX{} documentation on the \LaTeX{} Project Website}.\\ +% \url{https://latex-project.org/help/documentation/} -\bibitem{35:ltnews31} \LaTeX{} Project Team: - \emph{\LaTeXe{} news 31}.\\ - \url{https://latex-project.org/news/latex2e-news/ltnews31.pdf} +%\bibitem{35:ltnews31} \LaTeX{} Project Team: +% \emph{\LaTeXe{} news 31}.\\ +% \url{https://latex-project.org/news/latex2e-news/ltnews31.pdf} \bibitem{35:ltnews32} \LaTeX{} Project Team: \emph{\LaTeXe{} news 32}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews32.pdf} -\bibitem{35:ltnews33} \LaTeX{} Project Team: - \emph{\LaTeXe{} news 33}.\\ - \url{https://latex-project.org/news/latex2e-news/ltnews33.pdf} +%\bibitem{35:ltnews33} \LaTeX{} Project Team: +% \emph{\LaTeXe{} news 33}.\\ +% \url{https://latex-project.org/news/latex2e-news/ltnews33.pdf} \bibitem{35:ltnews34} \LaTeX{} Project Team: \emph{\LaTeXe{} news 34}.\\ \url{https://latex-project.org/news/latex2e-news/ltnews34.pdf} +\bibitem{35:ltfilehook-doc} Frank Mittelbach, Phelype Oleinik, \LaTeX{} Project Team: + \emph{The \texttt{\upshape ltfilehook} documentation}.\\ + Run \texttt{texdoc} \texttt{ltfilehook-doc} to view. \end{thebibliography} diff --git a/macros/latex-dev/base/ltoutput.dtx b/macros/latex-dev/base/ltoutput.dtx index 2d9f857173..c2cb8f66b3 100644 --- a/macros/latex-dev/base/ltoutput.dtx +++ b/macros/latex-dev/base/ltoutput.dtx @@ -37,7 +37,7 @@ %<*driver> % \fi \ProvidesFile{ltoutput.dtx} - [2021/09/03 v1.4h LaTeX Kernel (Output Routine)] + [2022/04/03 v1.4i LaTeX Kernel (Output Routine)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltoutput.dtx} @@ -1648,8 +1648,18 @@ %<*2ekernel|fltrace> \def \@opcol {% \if@twocolumn +% \end{macrocode} +% \changes{v1.ih}{2022/04/03}{Interface with new mark mechanism} +% The funny-looking internal commands are interfacing with the new +% marks mechanism. We make sure (elsewhere) that those are always +% defined, even when we roll back, so here we add them +% unconditionally. This still need turning into a hook or config +% point eventually: +% \begin{macrocode} + \@expl@@@mark@update@dblcol@structures@@ \@outputdblcol \else + \@expl@@@mark@update@singlecol@structures@@ \@outputpage %<*trace> \fl@trace{PAGE: one column (float? see above) page completed}% diff --git a/macros/latex-dev/base/ltpage.dtx b/macros/latex-dev/base/ltpage.dtx index 9c0ed1fee6..1d514fc7c7 100644 --- a/macros/latex-dev/base/ltpage.dtx +++ b/macros/latex-dev/base/ltpage.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltpage.dtx} - [2020/12/05 v1.0m LaTeX Kernel (page style setup)] + [2022/04/03 v1.0n LaTeX Kernel (page style setup)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltpage.dtx} @@ -180,10 +180,11 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2019/10/01}% -%<latexrelease> {\markboth}{Make commands robust}% +%<latexrelease>\IncludeInRelease{2022/06/01}% +%<latexrelease> {\markboth}{New mark support}% % \end{macrocode} % +% % \begin{macro}{\markboth} % \begin{macro}{\markright} % \changes{v1.0d}{1994/05/20}{Changed setting for \cs{protect}.} @@ -202,18 +203,37 @@ % \changes{v1.0j}{2000/05/26}{Reimplementation to fix expansion % error (pr/3203).} % \changes{v1.0m}{2020/07/27}{Don't make the command \cs{long} (gh/354)} +% \changes{v1.0n}{2022/04/04}{Interface with new mark mechanism} % \begin{macrocode} +\ExplSyntaxOn \DeclareRobustCommand*\markboth[2]{% \begingroup \let\label\relax \let\index\relax \let\glossary\relax \unrestored@protected@xdef\@themark {{#1}{#2}}% \@temptokena \expandafter{\@themark}% +% \end{macrocode} +% In addition to generating the legacy mark we output the +% individual ones as well at the very same point. +% The legacy mark is kept unchanged in order to work with packages +% that expect that mark in exactly the way it is right now. +% +% We might want to think about how to improve this in one-side +% documents, see comments below. +% +% We have not changed all of the code to L3 prog layer convention, +% in case packages attempt to do some patching and expect the 2e +% names being around. Eventually this should and will change. +% \begin{macrocode} + \mark_insert:nn{2e-left}{#1} + \mark_insert:nn{2e-right}{#2} + \tl_if_empty:nF{#2}{ \mark_insert:nn{2e-right-nonempty}{#2} } \mark{\the\@temptokena}% \endgroup \if@nobreak\ifvmode\nobreak\fi\fi} % \end{macrocode} % % \changes{v1.0m}{2020/07/27}{Don't make the command \cs{long} (gh/354)} +% \changes{v1.0n}{2022/04/04}{Interface with new mark mechanism} % \begin{macrocode} \DeclareRobustCommand*\markright[1]{% \begingroup @@ -223,9 +243,23 @@ % \begin{macrocode} \expandafter\@markright\@themark {#1}% \@temptokena \expandafter{\@themark}% +% \end{macrocode} +% Same game with \cs{markright} more or less \ldots +% \begin{macrocode} + \mark_insert:nn{2e-right}{#1} + \tl_if_empty:nF{#1}{ \mark_insert:nn{2e-right-nonempty}{#1} } +% \end{macrocode} +% The legacy \LaTeX{} mechanism always sets left and right mark, +% i.e., if a sub-mark (i.e., right mark) is set the corresponding main +% mark also is getting a mark with the same value it had previously. +% However, for the individual mark classes this means we are losing +% information so for them that is not done. +% \begin{macrocode} +% \mark_insert:nn{2e-left}{\exp_after:wN \use_i:nn \@themark } \mark{\the\@temptokena}% \endgroup \if@nobreak\ifvmode\nobreak\fi\fi} +\ExplSyntaxOff % \end{macrocode} % \end{macro} % \end{macro} @@ -233,6 +267,27 @@ % \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2019/10/01}% +%<latexrelease> {\markboth}{Make commands robust}% +%<latexrelease> +%<latexrelease>\DeclareRobustCommand*\markboth[2]{% +%<latexrelease> \begingroup +%<latexrelease> \let\label\relax \let\index\relax \let\glossary\relax +%<latexrelease> \unrestored@protected@xdef\@themark {{#1}{#2}}% +%<latexrelease> \@temptokena \expandafter{\@themark}% +%<latexrelease> \mark{\the\@temptokena}% +%<latexrelease> \endgroup +%<latexrelease> \if@nobreak\ifvmode\nobreak\fi\fi} +%<latexrelease>\DeclareRobustCommand*\markright[1]{% +%<latexrelease> \begingroup +%<latexrelease> \let\label\relax \let\index\relax \let\glossary\relax +%<latexrelease> \expandafter\@markright\@themark {#1}% +%<latexrelease> \@temptokena \expandafter{\@themark}% +%<latexrelease> \mark{\the\@temptokena}% +%<latexrelease> \endgroup +%<latexrelease> \if@nobreak\ifvmode\nobreak\fi\fi} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{0000/00/00}% %<latexrelease> {\markboth}{Make commands robust}% %<latexrelease> diff --git a/macros/latex-dev/base/ltpara-code.pdf b/macros/latex-dev/base/ltpara-code.pdf Binary files differindex 1447a6bfa8..5aebfaa401 100644 --- a/macros/latex-dev/base/ltpara-code.pdf +++ b/macros/latex-dev/base/ltpara-code.pdf diff --git a/macros/latex-dev/base/ltpara-doc.pdf b/macros/latex-dev/base/ltpara-doc.pdf Binary files differindex 11c181ecaa..5b7cffad1a 100644 --- a/macros/latex-dev/base/ltpara-doc.pdf +++ b/macros/latex-dev/base/ltpara-doc.pdf diff --git a/macros/latex-dev/base/ltpara.dtx b/macros/latex-dev/base/ltpara.dtx index 36d07337bd..9296f2b2cd 100644 --- a/macros/latex-dev/base/ltpara.dtx +++ b/macros/latex-dev/base/ltpara.dtx @@ -15,7 +15,7 @@ % % \begin{macrocode} \def\ltparaversion{v1.0k} -\def\ltparadate{2021/11/11} +\def\ltparadate{2022/05/13} % \end{macrocode} %<*driver> \documentclass{l3doc} @@ -484,7 +484,7 @@ % % To avoid issues a paragraph started by them should always be % ended by \cs{RawParEnd}\footnote{Technical note for those who -% know their \textit{\TeX book\/}: the \cs{RawParEnd} comand +% know their \textit{\TeX book\/}: the \cs{RawParEnd} command % invokes the original \TeX{} engine definition of \cs{par} that % (soley) triggers the paragraph builder in \TeX{} when found % inside unrestricted horizontal mode and does nothing in other diff --git a/macros/latex-dev/base/ltshipout-code.pdf b/macros/latex-dev/base/ltshipout-code.pdf Binary files differindex fe21c18e00..f28ce0c27e 100644 --- a/macros/latex-dev/base/ltshipout-code.pdf +++ b/macros/latex-dev/base/ltshipout-code.pdf diff --git a/macros/latex-dev/base/ltshipout-doc.pdf b/macros/latex-dev/base/ltshipout-doc.pdf Binary files differindex 7ce31427b4..f1daaed4d7 100644 --- a/macros/latex-dev/base/ltshipout-doc.pdf +++ b/macros/latex-dev/base/ltshipout-doc.pdf diff --git a/macros/latex-dev/base/ltshipout.dtx b/macros/latex-dev/base/ltshipout.dtx index 09495dde9a..83fab820a9 100644 --- a/macros/latex-dev/base/ltshipout.dtx +++ b/macros/latex-dev/base/ltshipout.dtx @@ -32,8 +32,8 @@ %%% From File: ltshipout.dtx % % \begin{macrocode} -\providecommand\ltshipoutversion{v1.0l} -\providecommand\ltshipoutdate{2022/01/06} +\providecommand\ltshipoutversion{v1.0m} +\providecommand\ltshipoutdate{2022/05/08} % \end{macrocode} % %<*driver> @@ -1014,8 +1014,14 @@ \_@@_add_foreground_box:n { \UseHook{shipout/lastpage} \@kernel@after@shipout@lastpage } + \bool_gset_true:N \g_@@_lastpage_handled_bool +% \end{macrocode} +% We record that we have handled the \hook{shipout/lastpage} hook +% but only if we really did. +% \changes{v1.0m}{2022/05/08}{Handle case where shipout/lastpage is +% run too early (gh/813)} +% \begin{macrocode} } - \bool_gset_true:N \g_@@_lastpage_handled_bool } \@@_finalize_box: % \end{macrocode} @@ -1723,15 +1729,35 @@ \gdef\string\@abspage@last {\int_use:N \g_shipout_readonly_int}} \fi % \end{macrocode} -% But we may have guessed wrongly earlier and we still have to run the +% But we may have guessed wrongly earlier and have run it too early +% or we still have to run the % \hook{shipout/lastpage} even though there is no page to place % it into. If that is the case we make a trivial extra page and put % it there. This temporary page will then vanish again on the next % run but helps to keep pdf viewers happy. +% In either case we should put out an appropriate ``rerun'' warning. +% \changes{v1.0m}{2022/05/08}{Handle case where shipout/lastpage is +% run too early (gh/813)} % \begin{macrocode} - \bool_if:NF \g_@@_lastpage_handled_bool + \bool_if:NTF \g_@@_lastpage_handled_bool + { +% \end{macrocode} +% If the hook was already executed, we have to test if that total +% shipouts match the shipouts from last run (because that +% corresponds to the page it was executed). If not we output a warning. +% \begin{macrocode} + \int_compare:nNnF \@abspage@last = \g_shipout_readonly_int + { + \@latex@warning@no@line{Hook~ 'shipout/lastpage'~ executed~ + on~ wrong~ page~ (\@abspage@last\space not~ + \int_use:N\g_shipout_readonly_int).\MessageBreak + Rerun~ to~ correct~ this}% + } + } { % \end{macrocode} +% If the hook was not run, we need to add an extra page and place +% it there. % However, making this extra page in case the hook is actually % empty would be forcing a rerun without any reason, so we check % that condition and also check if diff --git a/macros/latex-dev/base/ltvers.dtx b/macros/latex-dev/base/ltvers.dtx index e46851de01..f4075ea2ab 100644 --- a/macros/latex-dev/base/ltvers.dtx +++ b/macros/latex-dev/base/ltvers.dtx @@ -115,7 +115,7 @@ {2022-06-01} %</2ekernel|latexrelease> %<*2ekernel> -\def\patch@level{-3} +\def\patch@level{-4} % \end{macrocode} % % \begin{macro}{\development@branch@name} diff --git a/macros/latex-dev/base/ltx3info.pdf b/macros/latex-dev/base/ltx3info.pdf Binary files differindex 372a87f113..f0cb7883b5 100644 --- a/macros/latex-dev/base/ltx3info.pdf +++ b/macros/latex-dev/base/ltx3info.pdf diff --git a/macros/latex-dev/base/ltxdoc.pdf b/macros/latex-dev/base/ltxdoc.pdf Binary files differindex b2a6e7ec7f..4b3c78e8f1 100644 --- a/macros/latex-dev/base/ltxdoc.pdf +++ b/macros/latex-dev/base/ltxdoc.pdf diff --git a/macros/latex-dev/base/ltxref.dtx b/macros/latex-dev/base/ltxref.dtx index 53224103d9..596eb2fd74 100644 --- a/macros/latex-dev/base/ltxref.dtx +++ b/macros/latex-dev/base/ltxref.dtx @@ -33,7 +33,7 @@ %<*driver> % \fi \ProvidesFile{ltxref.dtx} - [2020/12/05 v1.1o LaTeX Kernel (Cross Referencing)] + [2022/04/12 v1.1p LaTeX Kernel (Cross Referencing)] % \iffalse \documentclass{ltxdoc} \GetFileInfo{ltxref.dtx} @@ -63,17 +63,19 @@ % {Extract file ltxref from ltcntlen.} % \changes{v1.1b}{1994/05/21}{Use new warning commands} % \changes{v1.1c}{1994/05/25}{Modify documentation} +% \changes{v1.1p}{2022/04/12}{Add starred variants for the ref commands} % % \section{Cross Referencing} % The user writes |\label|\marg{foo} to define the following % cross-references: % -% |\ref|\marg{foo}: value of most recently incremented referenceable +% |\ref|*\marg{foo}: value of most recently incremented referenceable % counter. in the current environment. (Chapter, section, -% theorem and enumeration counters are -% referenceable, footnote counters are not.) +% theorem, footnote and enumeration counters and other counters +% stepped with \cs{refstepcounter} are +% referenceable.) % -% |\pageref|\marg{foo}: page number at which |\label{foo}| command +% |\pageref|*\marg{foo}: page number at which |\label{foo}| command % appeared. where foo can be any string of characters not % containing `|\|', `|{|' or `|}|'. % @@ -87,6 +89,10 @@ % leaving a space on both sides of it is equivalent to leaving % a space on either side. % +% Note: the starred versions |\ref*| and |\pageref*| are provided +% to align with the use of \pkg{hyperref}. Without \pkg{hyperref} (or some +% other package using the starred form) the star is simply ignored. +% % % \MaybeStop{} % @@ -206,8 +212,10 @@ % \end{macrocode} % \begin{macro}{\ref} % \changes{LaTeX2e}{1993/12/11}{Macro reimplemented} +% \changes{LaTeX2e}{2022/04/12}{Macro reimplemented with a starred version} % \begin{macro}{\pageref} % \changes{LaTeX2e}{1993/12/11}{Macro reimplemented} +% \changes{LaTeX2e}{2022/04/12}{Macro reimplemented with a starred version} % \begin{macro}{\@setref} % \changes{LaTeX2e}{1993/12/11}{Macro added} % \changes{v1.1h}{1995/10/24}{Switch for refundefined renamed} @@ -229,9 +237,43 @@ \else \expandafter#2#1\null \fi} -\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} -\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname - \@secondoftwo{#1}} +% \end{macrocode} +% \begin{macrocode} +%</2ekernel> +%<*2ekernel|latexrelease> +%<latexrelease>\IncludeInRelease{2022/06/01}% +%<latexrelease> {\ref}{Add starred reference commands}% +% \end{macrocode} +% \begin{macrocode} +\def\@kernel@sref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} +\def\@kernel@spageref#1{\expandafter\@setref\csname r@#1\endcsname + \@secondoftwo{#1}} +\let\@kernel@ref\@kernel@sref +\let\@kernel@pageref\@kernel@spageref +\NewDocumentCommand\ref{s} + {\IfBooleanTF{#1}{\@kernel@sref}{\@kernel@ref}} +\NewDocumentCommand\pageref{s} + {\IfBooleanTF{#1}{\@kernel@spageref}{\@kernel@pageref}} +% \end{macrocode} +% As the commands are now protected we also need expandable versions for use +% in \cs{ifthenelse}: +% \begin{macrocode} +\def\@kernel@pageref@exp#1{\csname cs_if_exist:cTF\endcsname + {r@#1}{\csname tl_item:cn\endcsname{r@#1}{2}}{0}} +\def\@kernel@ref@exp#1{\csname cs_if_exist:cTF\endcsname + {r@#1}{\csname tl_item:cn\endcsname{r@#1}{1}}{0}} +% \end{macrocode} +% \begin{macrocode} +%</2ekernel|latexrelease> +%<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{0000/00/00}% +%<latexrelease> {\ref}{Add starred reference commands}% +%<latexrelease>\def\ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoftwo{#1}} +%<latexrelease>\def\pageref#1{\expandafter\@setref\csname r@#1\endcsname +%<latexrelease> \@secondoftwo{#1}} +%<latexrelease> +%<latexrelease>\EndIncludeInRelease +%<*2ekernel> % \end{macrocode} % \end{macro} % \end{macro} @@ -311,8 +353,8 @@ % \begin{macrocode} %</2ekernel> %<*2ekernel|latexrelease> -%<latexrelease>\IncludeInRelease{2020/10/01}% -%<latexrelease> {\refstepcounter}{Add \@currentcounter}% +%<latexrelease>\IncludeInRelease{2022/06/01}% +%<latexrelease> {\Ref}{Add starred version}% % \end{macrocode} % % \begin{macro}{\refstepcounter} @@ -373,9 +415,14 @@ % normal \texttt{\textbackslash ref} which might spoil kerning. % Perhaps one day this needs redoing.} % \changes{v1.1l}{2019/08/22}{Commanded moved from \texttt{varioref.sty}} +% \changes{v1.1p}{2022/04/12}{Macro reimplemented with a starred version}% % \begin{macrocode} -\DeclareRobustCommand\Ref[1]{\protected@edef\@tempa{\ref{#1}}% - \expandafter\MakeUppercase\@tempa} +\def\@kernel@Ref#1{\protected@edef\@tempa{\@kernel@ref{#1}}% + \expandafter\MakeUppercase\@tempa} +\def\@kernel@sRef#1{\protected@edef\@tempa{\@kernel@sref{#1}}% + \expandafter\MakeUppercase\@tempa} +\NewDocumentCommand\Ref{s} + {\IfBooleanTF{#1}{\@kernel@sRef}{\@kernel@Ref}} % \end{macrocode} % \end{macro} % @@ -385,6 +432,18 @@ % \begin{macrocode} %</2ekernel|latexrelease> %<latexrelease>\EndIncludeInRelease +%<latexrelease>\IncludeInRelease{2020/10/01}% +%<latexrelease> {\Ref}{Add starred version}% +%<latexrelease>\def\@currentcounter{} +%<latexrelease>\def\refstepcounter#1{\stepcounter{#1}% +%<latexrelease> \edef\@currentcounter{#1}% +%<latexrelease> \protected@edef\@currentlabel +%<latexrelease> {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}% +%<latexrelease>} +%<latexrelease>\def\labelformat#1{\expandafter\def\csname p@#1\endcsname##1} +%<latexrelease>\DeclareRobustCommand\Ref[1]{\protected@edef\@tempa{\ref{#1}}% +%<latexrelease> \expandafter\MakeUppercase\@tempa} +%<latexrelease>\EndIncludeInRelease %<latexrelease>\IncludeInRelease{2019/10/01}% %<latexrelease> {\refstepcounter}{Add \labelformat and \Ref}% %<latexrelease>\let\@currentcounter\@undefined diff --git a/macros/latex-dev/base/makeindx.pdf b/macros/latex-dev/base/makeindx.pdf Binary files differindex 82ecf21cf9..7a04fa6783 100644 --- a/macros/latex-dev/base/makeindx.pdf +++ b/macros/latex-dev/base/makeindx.pdf diff --git a/macros/latex-dev/base/manifest.txt b/macros/latex-dev/base/manifest.txt index b671200a3a..daebefee06 100644 --- a/macros/latex-dev/base/manifest.txt +++ b/macros/latex-dev/base/manifest.txt @@ -140,6 +140,7 @@ % ltshipout.dtx -- Hook management for \shipout % ltcmdhooks.dtx -- Hook management (generic) for commands % ltpara.dtx -- Hook management for paragraphs +% ltmarks.dtx -- Mark management % % Standard Classes: % ----------------- diff --git a/macros/latex-dev/base/modguide.pdf b/macros/latex-dev/base/modguide.pdf Binary files differindex 884f6e754d..3e6161a4c3 100644 --- a/macros/latex-dev/base/modguide.pdf +++ b/macros/latex-dev/base/modguide.pdf diff --git a/macros/latex-dev/base/nfssfont.pdf b/macros/latex-dev/base/nfssfont.pdf Binary files differindex edcf7dc43f..9c74cc6472 100644 --- a/macros/latex-dev/base/nfssfont.pdf +++ b/macros/latex-dev/base/nfssfont.pdf diff --git a/macros/latex-dev/base/proc.pdf b/macros/latex-dev/base/proc.pdf Binary files differindex 927dd76514..72bd4c5865 100644 --- a/macros/latex-dev/base/proc.pdf +++ b/macros/latex-dev/base/proc.pdf diff --git a/macros/latex-dev/base/slides.dtx b/macros/latex-dev/base/slides.dtx index 06a4326277..5ea9e58d9c 100644 --- a/macros/latex-dev/base/slides.dtx +++ b/macros/latex-dev/base/slides.dtx @@ -53,7 +53,7 @@ %<*driver> \ProvidesFile{slides.drv} %</driver> - [2021/10/04 v2.4b + [2022/05/18 v2.4b %<+class> Standard LaTeX document class] %<+cmd> SLiTeX definitions] % \end{macrocode} @@ -2348,8 +2348,9 @@ COLOR LAYER\\[.75in]% % any output when the |@visible| switch is false. % % \changes{v2.2j}{1994/03/11}{Corrected \cs{@oval}, like previous +% change to the \LaTeX{} format.} % \changes{v2.4a}{2016/03/29}{Initialize in \cs{@oval}tests added for -% latex/4452} change to the \LaTeX{} format.} +% latex/4452} % \begin{macrocode} \def\line(#1,#2)#3{\if@visible\@xarg #1\relax \@yarg #2\relax \@linelen #3\unitlength diff --git a/macros/latex-dev/base/slides.pdf b/macros/latex-dev/base/slides.pdf Binary files differindex 0b519f6511..d1e921e5cd 100644 --- a/macros/latex-dev/base/slides.pdf +++ b/macros/latex-dev/base/slides.pdf diff --git a/macros/latex-dev/base/slifonts.pdf b/macros/latex-dev/base/slifonts.pdf Binary files differindex 76dd3c9655..d5ea0aca29 100644 --- a/macros/latex-dev/base/slifonts.pdf +++ b/macros/latex-dev/base/slifonts.pdf diff --git a/macros/latex-dev/base/source2e.pdf b/macros/latex-dev/base/source2e.pdf Binary files differindex 88211e8807..e51b3db92d 100644 --- a/macros/latex-dev/base/source2e.pdf +++ b/macros/latex-dev/base/source2e.pdf diff --git a/macros/latex-dev/base/source2e.tex b/macros/latex-dev/base/source2e.tex index 9eea9ddd0f..797304e8d6 100644 --- a/macros/latex-dev/base/source2e.tex +++ b/macros/latex-dev/base/source2e.tex @@ -324,6 +324,8 @@ page_precedence "rnaA" \DocInclude{ltbibl} % Bibliography + \DocInclude{ltmarks} % Output routine marks management (L3 module) + \DocInclude{ltpage} % \pagestyle \raggedbottom \sloppy \DocInclude{ltclass} % Package & Class interface diff --git a/macros/latex-dev/base/source2edoc.cls b/macros/latex-dev/base/source2edoc.cls index b17c4c52b1..f0f1479cac 100644 --- a/macros/latex-dev/base/source2edoc.cls +++ b/macros/latex-dev/base/source2edoc.cls @@ -2,7 +2,7 @@ % This class is buggy and needs fixing \ProvidesClass{source2edoc} - [2021/01/14 v0.2b Quick hack to typeset source2.tex + [2022/04/03 v0.2c Quick hack to typeset source2.tex (not usable for anything else and buggy -- will vanish again)!] @@ -171,7 +171,10 @@ t\or u\or v\or w\or x\or y\or z\or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or - X\or Y\or Z\else\@ctrerr\fi} + X\or Y\or Z\or + aa\or bb\or cc\or % we are getting definitely too many modules + dd% + \else\@ctrerr\fi} \def\docincludeaux{% \def\thepart{\aalph{part}}\def\filesep{\thepart-}% \let\filekey\@gobble @@ -295,6 +298,11 @@ Bug reports can be opened (category \texttt{#1}) at\\% \fi}% \endgroup% + +% don't run tocs when they are in some module files +\AddToHook{cmd/tableofcontents/after}{\global\let\tableofcontents\relax} + + \InputIfFileExists{ltxdoc.cfg} {\typeout{*************************************^^J% * Local config file ltxdoc.cfg used^^J% @@ -302,6 +310,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% {} + \errorstopmode \batchmode diff --git a/macros/latex-dev/base/syntonly.pdf b/macros/latex-dev/base/syntonly.pdf Binary files differindex 7298566aea..1cf31029c8 100644 --- a/macros/latex-dev/base/syntonly.pdf +++ b/macros/latex-dev/base/syntonly.pdf diff --git a/macros/latex-dev/base/tlc2.pdf b/macros/latex-dev/base/tlc2.pdf Binary files differindex f4d49885f2..0faf4c0f54 100644 --- a/macros/latex-dev/base/tlc2.pdf +++ b/macros/latex-dev/base/tlc2.pdf diff --git a/macros/latex-dev/base/tulm.pdf b/macros/latex-dev/base/tulm.pdf Binary files differindex 929194014a..d5747c76c3 100644 --- a/macros/latex-dev/base/tulm.pdf +++ b/macros/latex-dev/base/tulm.pdf diff --git a/macros/latex-dev/base/usrguide.pdf b/macros/latex-dev/base/usrguide.pdf Binary files differindex 5975d1567f..c1296a0a8a 100644 --- a/macros/latex-dev/base/usrguide.pdf +++ b/macros/latex-dev/base/usrguide.pdf diff --git a/macros/latex-dev/base/usrguide3.pdf b/macros/latex-dev/base/usrguide3.pdf Binary files differindex a15d3c431b..4a2033b353 100644 --- a/macros/latex-dev/base/usrguide3.pdf +++ b/macros/latex-dev/base/usrguide3.pdf diff --git a/macros/latex-dev/base/utf8ienc.dtx b/macros/latex-dev/base/utf8ienc.dtx index 8789dd35ef..c6ec89872e 100644 --- a/macros/latex-dev/base/utf8ienc.dtx +++ b/macros/latex-dev/base/utf8ienc.dtx @@ -216,7 +216,7 @@ %<+ts1> \ProvidesFile{ts1enc.dfu} %<+x2> \ProvidesFile{x2enc.dfu} %<+all> \ProvidesFile{utf8enc.dfu} -%<-utf8-2018> [2022/02/13 v1.3a UTF-8 support] +%<-utf8-2018> [2022/05/08 v1.3b UTF-8 support] % \end{macrocode} % % \begin{macrocode} @@ -1820,8 +1820,14 @@ %<all,ts1>\DeclareUnicodeCharacter{2191}{\textuparrow} %<all,ts1>\DeclareUnicodeCharacter{2192}{\textrightarrow} %<all,ts1>\DeclareUnicodeCharacter{2193}{\textdownarrow} +% \end{macrocode} +% \changes{v1.3b}{2022/05/08}{Declare Unicode codepoints U+3008/U+3009 to +% better support normalized documents} +% \begin{macrocode} %<all,x2,ts1,t2c,t2b,t2a>\DeclareUnicodeCharacter{2329}{\textlangle} +%<all,x2,ts1,t2c,t2b,t2a>\DeclareUnicodeCharacter{3008}{\textlangle} %<all,x2,ts1,t2c,t2b,t2a>\DeclareUnicodeCharacter{232A}{\textrangle} +%<all,x2,ts1,t2c,t2b,t2a>\DeclareUnicodeCharacter{3009}{\textrangle} %<all,ts1>\DeclareUnicodeCharacter{2422}{\textblank} %<all,x2,t2c,t2b,t2a,t1,utf8>\DeclareUnicodeCharacter{2423}{\textvisiblespace} %<all,ts1>\DeclareUnicodeCharacter{25E6}{\textopenbullet} diff --git a/macros/latex-dev/base/utf8ienc.pdf b/macros/latex-dev/base/utf8ienc.pdf Binary files differindex 8f58daf638..dbda75aaf2 100644 --- a/macros/latex-dev/base/utf8ienc.pdf +++ b/macros/latex-dev/base/utf8ienc.pdf diff --git a/macros/latex-dev/base/webcomp.pdf b/macros/latex-dev/base/webcomp.pdf Binary files differindex e8bd3d23b1..3f6529458c 100644 --- a/macros/latex-dev/base/webcomp.pdf +++ b/macros/latex-dev/base/webcomp.pdf diff --git a/macros/latex-dev/required/amsmath/README.md b/macros/latex-dev/required/amsmath/README.md index 2568576a49..0dddec034d 100644 --- a/macros/latex-dev/required/amsmath/README.md +++ b/macros/latex-dev/required/amsmath/README.md @@ -1,7 +1,7 @@ The amsmath bundle for LaTeX ============================ -Release 2022-06-01 pre-release 2 +Release 2022-06-01 pre-release 4 Overview -------- diff --git a/macros/latex-dev/required/amsmath/amsbsy.pdf b/macros/latex-dev/required/amsmath/amsbsy.pdf Binary files differindex 2e7b3dadbc..231925b13b 100644 --- a/macros/latex-dev/required/amsmath/amsbsy.pdf +++ b/macros/latex-dev/required/amsmath/amsbsy.pdf diff --git a/macros/latex-dev/required/amsmath/amscd.pdf b/macros/latex-dev/required/amsmath/amscd.pdf Binary files differindex 6d76336aaa..1a0305353d 100644 --- a/macros/latex-dev/required/amsmath/amscd.pdf +++ b/macros/latex-dev/required/amsmath/amscd.pdf diff --git a/macros/latex-dev/required/amsmath/amsgen.pdf b/macros/latex-dev/required/amsmath/amsgen.pdf Binary files differindex 1cf78ad292..1b86685a45 100644 --- a/macros/latex-dev/required/amsmath/amsgen.pdf +++ b/macros/latex-dev/required/amsmath/amsgen.pdf diff --git a/macros/latex-dev/required/amsmath/amsldoc.pdf b/macros/latex-dev/required/amsmath/amsldoc.pdf Binary files differindex 68b317117c..72a49e32ee 100644 --- a/macros/latex-dev/required/amsmath/amsldoc.pdf +++ b/macros/latex-dev/required/amsmath/amsldoc.pdf diff --git a/macros/latex-dev/required/amsmath/amsmath.dtx b/macros/latex-dev/required/amsmath/amsmath.dtx index 52509f9544..34d17b65f0 100644 --- a/macros/latex-dev/required/amsmath/amsmath.dtx +++ b/macros/latex-dev/required/amsmath/amsmath.dtx @@ -86,7 +86,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \end{macrocode} % % \begin{macrocode} -\ProvidesPackage{amsmath}[2022/02/03 v2.17m AMS math features] +\ProvidesPackage{amsmath}[2022/04/08 v2.17n AMS math features] % \end{macrocode} % % \section{Catcode defenses} @@ -615,7 +615,8 @@ Foreign command \@backslashchar#1;\MessageBreak % abbreviations for some commonly needed mathstyle overrides. To % conserve csnames we avoid making \cn{dfrac} and \cn{tfrac} robust % (\cn{genfrac} is itself robust). -% \changes{v2.17i}{2020/09/23}{added \cs{Ustack} for luatex (moved patch from lualatex-math)} +% \changes{v2.17i}{2020/09/23}{added \cs{Ustack} for luatex (moved patch from lualatex-math)} +% \changes{v2.17n}{2022/04/08}{Make fraction commands robust (gh/123)} % \begin{macrocode} % \ifx\directlua\@undefined @@ -623,8 +624,8 @@ Foreign command \@backslashchar#1;\MessageBreak \else \DeclareRobustCommand{\frac}[2]{{\Ustack{\begingroup#1\endgroup\@@over#2}}} \fi -\newcommand{\dfrac}{\genfrac{}{}{}0} -\newcommand{\tfrac}{\genfrac{}{}{}1} +\DeclareRobustCommand{\dfrac}{\genfrac{}{}{}0} +\DeclareRobustCommand{\tfrac}{\genfrac{}{}{}1} % \end{macrocode} % The \cn{binom} command for binomial notation works like \cn{frac} % and has similar variants. Note that we do not use \cs{z@} in @@ -632,10 +633,11 @@ Foreign command \@backslashchar#1;\MessageBreak % like \cn{binom}, and so the \cs{z@} with the potentially % problematic \qc{\@} character would become visible when writing one % of those commands to a \fn{.toc} file. +% \changes{v2.17n}{2022/04/08}{Make binom commands robust (gh/123)} % \begin{macrocode} \DeclareRobustCommand{\binom}{\genfrac()\z@{}} -\newcommand{\dbinom}{\genfrac(){0pt}0} -\newcommand{\tbinom}{\genfrac(){0pt}1} +\DeclareRobustCommand{\dbinom}{\genfrac(){0pt}0} +\DeclareRobustCommand{\tbinom}{\genfrac(){0pt}1} % \end{macrocode} % % \begin{macro}{\genfrac} @@ -938,8 +940,9 @@ Foreign command \@backslashchar#1;\MessageBreak % an equation or piece of an equation. (Not including the equation % number.) This isn't trivial for end-users to do it properly % with \cs{fbox} so we provide a command for them. +% \changes{v2.17n}{2022/04/08}{Make \cs{boxed} command robust (gh/123)} % \begin{macrocode} -\newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} +\DeclareRobustCommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} % \end{macrocode} % \end{macro} % @@ -980,8 +983,9 @@ Foreign command \@backslashchar#1;\MessageBreak % small space on the left, larger space on the right. The \qc{\:} % character by itself is treated as a \cs{mathrel} i.e. large, equal % spacing on both sides. +% \changes{v2.17n}{2022/04/08}{Make \cs{colon} command robust (gh/123)} % \begin{macrocode} -\renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript +\DeclareRobustCommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript \mkern-\thinmuskip{:}\mskip6muplus1mu\relax} % \end{macrocode} % \end{macro} @@ -1386,10 +1390,10 @@ Foreign command \@backslashchar#1;\MessageBreak {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}% {{\cdotp}\mkern1mu{\cdotp}\mkern1mu{\cdotp}}} % -\ams@newcommand{\iint}{\DOTSI\protect\MultiIntegral{2}} -\ams@newcommand{\iiint}{\DOTSI\protect\MultiIntegral{3}} -\ams@newcommand{\iiiint}{\DOTSI\protect\MultiIntegral{4}} -\newcommand{\idotsint}{\DOTSI\protect\MultiIntegral{0}} +\ams@newcommand{\iint}{\DOTSI\MultiIntegral{2}} +\ams@newcommand{\iiint}{\DOTSI\MultiIntegral{3}} +\ams@newcommand{\iiiint}{\DOTSI\MultiIntegral{4}} +\newcommand{\idotsint}{\DOTSI\MultiIntegral{0}} % \end{macrocode} % \end{macro} % \end{macro} @@ -1403,8 +1407,9 @@ Foreign command \@backslashchar#1;\MessageBreak % the left-hand space a bit to make the subscript visually centered. % % \verb'#1' is the multiplicity. +% \changes{v2.17n}{2022/04/08}{Make \cs{MultiIntegral} command robust (gh/123)} % \begin{macrocode} -\newcommand{\MultiIntegral}[1]{% +\DeclareRobustCommand{\MultiIntegral}[1]{% \edef\ints@c{\noexpand\intop \ifnum#1=\z@\noexpand\intdots@\else\noexpand\intkern@\fi \ifnum#1>\tw@\noexpand\intop\noexpand\intkern@\fi @@ -1582,11 +1587,12 @@ Foreign command \@backslashchar#1;\MessageBreak % the \latex/ kernel; the macro |\n@space| is then superfluous (since % it is only used once) and should be removed to avoid wasting hash % table space unnecessarily. +% \changes{v2.17n}{2022/04/08}{Make biggg commands robust (gh/123)} % \begin{macrocode} -\renewcommand{\big}{\bBigg@\@ne} -\renewcommand{\Big}{\bBigg@{1.5}} -\renewcommand{\bigg}{\bBigg@\tw@} -\renewcommand{\Bigg}{\bBigg@{2.5}} +\DeclareRobustCommand{\big}{\bBigg@\@ne} +\DeclareRobustCommand{\Big}{\bBigg@{1.5}} +\DeclareRobustCommand{\bigg}{\bBigg@\tw@} +\DeclareRobustCommand{\Bigg}{\bBigg@{2.5}} % \end{macrocode} % \end{macro} % \end{macro} @@ -1666,6 +1672,17 @@ Foreign command \@backslashchar#1;\MessageBreak {\mathop{\kern\z@#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@ \hbox{\,\normalfont....}\vss}}}} % \end{macrocode} +% +% We make the commands robust only at the end of the preamble as +% \pkg{amsmath} interacts with \pkg{stix} (which should also move +% to robust commands). +% \changes{v2.17n}{2022/04/08}{Make dddot commands robust (gh/123)} +% \begin{macrocode} +\AtBeginDocument{% + \MakeRobust\dddot + \MakeRobust\ddddot + } +% \end{macrocode} % \end{macro} % \end{macro} % @@ -2087,14 +2104,16 @@ Foreign command \@backslashchar#1;\MessageBreak % \begin{macro}{\mod} % The commands \cn{bmod}, \cn{pmod}, \cn{pod}, \cn{mod} aren't % currently robust. [mjd, 1994/09/05] +% Now they are +% \changes{v2.17n}{2022/04/08}{Make mod commands robust (gh/123)} % \begin{macrocode} -\renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin +\DeclareRobustCommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin {\operator@font mod}\penalty900 \mkern5mu\nonscript\mskip-\medmuskip} -\newcommand{\pod}[1]{\allowbreak +\DeclareRobustCommand{\pod}[1]{\allowbreak \if@display\mkern18mu\else\mkern8mu\fi(#1)} -\renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}} -\newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu +\DeclareRobustCommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}} +\DeclareRobustCommand{\mod}[1]{\allowbreak\if@display\mkern18mu \else\mkern12mu\fi{\operator@font mod}\,\,#1} % \end{macrocode} % \end{macro} @@ -2109,8 +2128,9 @@ Foreign command \@backslashchar#1;\MessageBreak % fraction rules to line up. The \cs{strut} keeps the numerator of % a subsidiary cfrac from coming too close to the fraction rule above % it. +% \changes{v2.17n}{2022/04/08}{Make \cs{cfrac} command robust (gh/123)} % \begin{macrocode} -\newcommand{\cfrac}[3][c]{{\displaystyle\frac{% +\DeclareRobustCommand{\cfrac}[3][c]{{\displaystyle\frac{% \strut\ifx r#1\hfill\fi#2\ifx l#1\hfill\fi}{#3}}% \kern-\nulldelimiterspace} % \end{macrocode} @@ -2123,13 +2143,15 @@ Foreign command \@backslashchar#1;\MessageBreak % naturally accept limits. \cs{binrel@@} uses information collected % by \cs{binrel@} to make the resulting construction be of type % mathrel or mathbin if the base symbol is either of those types. +% \changes{v2.17n}{2022/04/08}{Make \cs{overset}, \cs{underset} and +% \cs{overunderset} commands robust (gh/123)} % \begin{macrocode} -\newcommand{\overset}[2]{\binrel@{#2}% +\DeclareRobustCommand{\overset}[2]{\binrel@{#2}% \binrel@@{\mathop{\kern\z@#2}\limits^{#1}}} % \end{macrocode} % % \begin{macrocode} -\newcommand{\underset}[2]{\binrel@{#2}% +\DeclareRobustCommand{\underset}[2]{\binrel@{#2}% \binrel@@{\mathop{\kern\z@#2}\limits_{#1}}} % \end{macrocode} % \end{macro} @@ -2141,7 +2163,7 @@ Foreign command \@backslashchar#1;\MessageBreak % something that is sometimes needed. % \changes{v2.17c}{2019/04/01}{New command \cs{overunderset}} % \begin{macrocode} -\newcommand{\overunderset}[3]{\binrel@{#3}% +\DeclareRobustCommand{\overunderset}[3]{\binrel@{#3}% \binrel@@{\mathop{\kern\z@#3}\limits^{#1}_{#2}}} % \end{macrocode} % \end{macro} @@ -2157,8 +2179,9 @@ Foreign command \@backslashchar#1;\MessageBreak % have to read and measure the top and bottom limits and use % mathchoice to always get the right mathstyle for each piece, % etc., etc. +% \changes{v2.17n}{2022/04/08}{Make \cs{sideset} command robust (gh/123)} % \begin{macrocode} -\newcommand{\sideset}[3]{% +\DeclareRobustCommand{\sideset}[3]{% \@mathmeasure\z@\displaystyle{#3}% % \end{macrocode} % Use a global box assignment here since the depth override is @@ -2182,9 +2205,10 @@ Foreign command \@backslashchar#1;\MessageBreak % denoting the part of the formula to be smashed. % \changes{v2.17b}{2018/12/01}{Start LR-mode for \cs{smash} % if necessary (github/49)} +% \changes{v2.17n}{2022/04/08}{Make \cs{smash} command robust (gh/123)} % \begin{macrocode} \ifx\leavevmode@ifvmode\@undefined -\renewcommand{\smash}[1][tb]{% +\DeclareRobustCommand{\smash}[1][tb]{% \def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}% \edef\finsm@sh{\csname mb@#1\endcsname\z@\z@\box\z@}% \ifmmode \@xp\mathpalette\@xp\mathsm@sh @@ -2192,7 +2216,7 @@ Foreign command \@backslashchar#1;\MessageBreak \fi } \else -\renewcommand{\smash}[1][tb]{% +\DeclareRobustCommand{\smash}[1][tb]{% \def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}% \edef\finsm@sh{\csname mb@#1\endcsname\z@\z@ \leavevmode@ifvmode\box\z@}% \ifmmode \@xp\mathpalette\@xp\mathsm@sh @@ -2240,9 +2264,10 @@ Foreign command \@backslashchar#1;\MessageBreak % % \begin{macro}{\relbar} % \begin{macro}{\Relbar} +% \changes{v2.17n}{2022/04/08}{Make commands robust (gh/123)} % \begin{macrocode} -\ams@def\relbar{\mathrel{\mathpalette\mathsm@sh\std@minus}} -\ams@def\Relbar{\mathrel\std@equal} +\ams@DeclareRobustCommand\relbar{\mathrel{\mathpalette\mathsm@sh\std@minus}} +\ams@DeclareRobustCommand\Relbar{\mathrel\std@equal} % \end{macrocode} % \end{macro} % \end{macro} @@ -2272,6 +2297,17 @@ Foreign command \@backslashchar#1;\MessageBreak \ams@newcommand{\overleftrightarrow}{% \mathpalette{\overarrow@\leftrightarrowfill@}} % \end{macrocode} +% Again we delay making commands robut for \pkg{stix}. +% \changes{v2.17n}{2022/04/08}{Make commands robust (gh/123)} +% \begin{macrocode} +\AtBeginDocument{% + \expandafter\let\csname overleftarrow \endcsname\@undefined + \expandafter\let\csname overrightarrow \endcsname\@undefined + \MakeRobust\overrightarrow + \MakeRobust\overleftarrow + \MakeRobust\overleftrightarrow + } +% \end{macrocode} % % \begin{macrocode} \def\underarrow@#1#2#3{% @@ -2285,8 +2321,19 @@ Foreign command \@backslashchar#1;\MessageBreak \mathpalette{\underarrow@\leftrightarrowfill@}} % \end{macrocode} % +% +% \changes{v2.17n}{2022/04/08}{Make commands robust (gh/123)} +% \begin{macrocode} +\AtBeginDocument{% + \MakeRobust\underrightarrow + \MakeRobust\underleftarrow + \MakeRobust\underleftrightarrow + } +% \end{macrocode} +% +% \changes{v2.17n}{2022/04/08}{Make commands robust (gh/123)} % \begin{macrocode} -%\newcommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}} +%\DeclareRobustCommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}} \def\ext@arrow#1#2#3#4#5#6#7{% \mathrel{\mathop{% % \end{macrocode} @@ -2315,8 +2362,8 @@ Foreign command \@backslashchar#1;\MessageBreak % sub/superscripts. These commands are robust because they take an % optional argument. % \begin{macrocode} -\newcommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}} -\newcommand{\xleftarrow}[2][]{\ext@arrow 3095\leftarrowfill@{#1}{#2}} +\DeclareRobustCommand{\xrightarrow}[2][]{\ext@arrow 0359\rightarrowfill@{#1}{#2}} +\DeclareRobustCommand{\xleftarrow}[2][]{\ext@arrow 3095\leftarrowfill@{#1}{#2}} % \end{macrocode} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -2406,8 +2453,9 @@ Foreign command \@backslashchar#1;\MessageBreak % \begin{macro}{\substack} % The \cn{substack} command is just an abbreviation for the % most common use of \env{subarray}. +% \changes{v2.17n}{2022/04/08}{Make command robust (gh/123)} % \begin{macrocode} -\newcommand{\substack}[1]{\subarray{c}#1\endsubarray} +\DeclareRobustCommand{\substack}[1]{\subarray{c}#1\endsubarray} % \end{macrocode} % \end{macro} % @@ -2630,8 +2678,9 @@ ill-advised in LaTeX.% % numbered within sections. The \LaTeX{} kernel contains a similar command % \cs{counterwithin} (with a slightly extended syntax) that can be used % as a drop-in replacement for \cs{numberwithin}. +% \changes{v2.17n}{2022/04/08}{Make command robust (gh/123)} % \begin{macrocode} -\newcommand{\numberwithin}[3][\arabic]{% +\DeclareRobustCommand{\numberwithin}[3][\arabic]{% \@ifundefined{c@#2}{\@nocounterr{#2}}{% \@ifundefined{c@#3}{\@nocnterr{#3}}{% \@addtoreset{#2}{#3}% @@ -2645,8 +2694,9 @@ ill-advised in LaTeX.% % To make references to equation numbers easier, we provide % \cn{eqref}. We almost don't need \cn{textup}, except that % \cs{tagform@} doesn't supply the italic correction. +% \changes{v2.17n}{2022/04/08}{Make command robust (gh/123)} % \begin{macrocode} -\newcommand{\eqref}[1]{\textup{\tagform@{\ref{#1}}}} +\DeclareRobustCommand{\eqref}[1]{\textup{\tagform@{\ref{#1}}}} % \end{macrocode} % \end{macro} % @@ -2685,8 +2735,9 @@ ill-advised in LaTeX.% % The \cn{allowdisplaybreaks} command. Since this is intended for use % outside displayed formulas (typically in the preamble), it does not % need to use \cs{new@ifnextchar}. +% \changes{v2.17n}{2022/04/08}{Make command robust (gh/123)} % \begin{macrocode} -\newcommand{\allowdisplaybreaks}[1][4]{% +\DeclareRobustCommand{\allowdisplaybreaks}[1][4]{% \interdisplaylinepenalty\getdsp@pen{#1}\relax } % \end{macrocode} @@ -2709,8 +2760,9 @@ ill-advised in LaTeX.% % \begin{macro}{\dspbrk@context} % \begin{macro}{\nogood@displaybreak} % For breaks in a certain row of a alignment. +% \changes{v2.17n}{2022/04/08}{Make command robust (gh/123)} % \begin{macrocode} -\newcommand{\displaybreak}{\new@ifnextchar[\dspbrk@{\dspbrk@[4]}} +\DeclareRobustCommand{\displaybreak}{\new@ifnextchar[\dspbrk@{\dspbrk@[4]}} \chardef\dspbrk@context=\sixt@@n % \end{macrocode} % diff --git a/macros/latex-dev/required/amsmath/amsmath.pdf b/macros/latex-dev/required/amsmath/amsmath.pdf Binary files differindex 5aab00bfb1..49aea5acf2 100644 --- a/macros/latex-dev/required/amsmath/amsmath.pdf +++ b/macros/latex-dev/required/amsmath/amsmath.pdf diff --git a/macros/latex-dev/required/amsmath/amsopn.dtx b/macros/latex-dev/required/amsmath/amsopn.dtx index 22801e8cf1..110a5fa8be 100644 --- a/macros/latex-dev/required/amsmath/amsopn.dtx +++ b/macros/latex-dev/required/amsmath/amsopn.dtx @@ -58,7 +58,7 @@ Bug reports can be opened (category \texttt{#1}) at\\% % \begin{macrocode} \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX) [1994/12/01]% LaTeX date must December 1994 or later -\ProvidesPackage{amsopn}[2022/01/20 v2.03 operator names] +\ProvidesPackage{amsopn}[2022/04/08 v2.04 operator names] % \end{macrocode} % % What \cs{nolimits@} does is keep a \cn{limits} typed by the user @@ -151,41 +151,42 @@ Bug reports can be opened (category \texttt{#1}) at\\% \@onlypreamble\@declmathop % \end{macrocode} % +% \changes{v2.04}{2022/04/08}{Make operators \cs{protected} (gh/123)} % \begin{macrocode} -\def\arccos{\qopname\relax o{arccos}} -\def\arcsin{\qopname\relax o{arcsin}} -\def\arctan{\qopname\relax o{arctan}} -\def\arg{\qopname\relax o{arg}} -\def\cos{\qopname\relax o{cos}} -\def\cosh{\qopname\relax o{cosh}} -\def\cot{\qopname\relax o{cot}} -\def\coth{\qopname\relax o{coth}} -\def\csc{\qopname\relax o{csc}} -\def\deg{\qopname\relax o{deg}} -\def\det{\qopname\relax m{det}} -\def\dim{\qopname\relax o{dim}} -\def\exp{\qopname\relax o{exp}} -\def\gcd{\qopname\relax m{gcd}} -\def\hom{\qopname\relax o{hom}} -\def\inf{\qopname\relax m{inf}} -\def\injlim{\qopname\relax m{inj\,lim}} -\def\ker{\qopname\relax o{ker}} -\def\lg{\qopname\relax o{lg}} -\def\lim{\qopname\relax m{lim}} -\def\liminf{\qopname\relax m{lim\,inf}} -\def\limsup{\qopname\relax m{lim\,sup}} -\def\ln{\qopname\relax o{ln}} -\def\log{\qopname\relax o{log}} -\def\max{\qopname\relax m{max}} -\def\min{\qopname\relax m{min}} -\def\Pr{\qopname\relax m{Pr}} -\def\projlim{\qopname\relax m{proj\,lim}} -\def\sec{\qopname\relax o{sec}} -\def\sin{\qopname\relax o{sin}} -\def\sinh{\qopname\relax o{sinh}} -\def\sup{\qopname\relax m{sup}} -\def\tan{\qopname\relax o{tan}} -\def\tanh{\qopname\relax o{tanh}} +\protected\def\arccos{\qopname\relax o{arccos}} +\protected\def\arcsin{\qopname\relax o{arcsin}} +\protected\def\arctan{\qopname\relax o{arctan}} +\protected\def\arg{\qopname\relax o{arg}} +\protected\def\cos{\qopname\relax o{cos}} +\protected\def\cosh{\qopname\relax o{cosh}} +\protected\def\cot{\qopname\relax o{cot}} +\protected\def\coth{\qopname\relax o{coth}} +\protected\def\csc{\qopname\relax o{csc}} +\protected\def\deg{\qopname\relax o{deg}} +\protected\def\det{\qopname\relax m{det}} +\protected\def\dim{\qopname\relax o{dim}} +\protected\def\exp{\qopname\relax o{exp}} +\protected\def\gcd{\qopname\relax m{gcd}} +\protected\def\hom{\qopname\relax o{hom}} +\protected\def\inf{\qopname\relax m{inf}} +\protected\def\injlim{\qopname\relax m{inj\,lim}} +\protected\def\ker{\qopname\relax o{ker}} +\protected\def\lg{\qopname\relax o{lg}} +\protected\def\lim{\qopname\relax m{lim}} +\protected\def\liminf{\qopname\relax m{lim\,inf}} +\protected\def\limsup{\qopname\relax m{lim\,sup}} +\protected\def\ln{\qopname\relax o{ln}} +\protected\def\log{\qopname\relax o{log}} +\protected\def\max{\qopname\relax m{max}} +\protected\def\min{\qopname\relax m{min}} +\protected\def\Pr{\qopname\relax m{Pr}} +\protected\def\projlim{\qopname\relax m{proj\,lim}} +\protected\def\sec{\qopname\relax o{sec}} +\protected\def\sin{\qopname\relax o{sin}} +\protected\def\sinh{\qopname\relax o{sinh}} +\protected\def\sup{\qopname\relax m{sup}} +\protected\def\tan{\qopname\relax o{tan}} +\protected\def\tanh{\qopname\relax o{tanh}} % \end{macrocode} % % \begin{macro}{\operator@font} @@ -226,23 +227,24 @@ Bug reports can be opened (category \texttt{#1}) at\\% % vertical spacing may not be optimal in script and scriptscript % sizes. Unfortunately \tex/ provides no easy way to do math mode % vertical spacing that varies with current math style like mu units. +% \changes{v2.04}{2022/04/08}{Make operators \cs{protected} (gh/123)} % \begin{macrocode} -\def\varlim@#1#2{% +\protected\def\varlim@#1#2{% \vtop{\m@th\ialign{##\cr \hfil$#1\operator@font lim$\hfil\cr \noalign{\nointerlineskip\kern1.5\ex@}#2\cr \noalign{\nointerlineskip\kern-\ex@}\cr}}% } -\def\varinjlim{% +\protected\def\varinjlim{% \mathop{\mathpalette\varlim@{\rightarrowfill@\textstyle}}\nmlimits@ } -\def\varprojlim{% +\protected\def\varprojlim{% \mathop{\mathpalette\varlim@{\leftarrowfill@\textstyle}}\nmlimits@ } -\def\varliminf{\mathop{\mathpalette\varliminf@{}}\nmlimits@} +\protected\def\varliminf{\mathop{\mathpalette\varliminf@{}}\nmlimits@} \def\varliminf@#1{\@@underline{\vrule\@depth.2\ex@\@width\z@ \hbox{$#1\m@th\operator@font lim$}}} -\def\varlimsup{\mathop{\mathpalette\varlimsup@{}}\nmlimits@} +\protected\def\varlimsup{\mathop{\mathpalette\varlimsup@{}}\nmlimits@} \def\varlimsup@#1{\@@overline{\hbox{$#1\m@th\operator@font lim$}}} % \end{macrocode} % diff --git a/macros/latex-dev/required/amsmath/amsopn.pdf b/macros/latex-dev/required/amsmath/amsopn.pdf Binary files differindex d6781e3209..02c57ac29d 100644 --- a/macros/latex-dev/required/amsmath/amsopn.pdf +++ b/macros/latex-dev/required/amsmath/amsopn.pdf diff --git a/macros/latex-dev/required/amsmath/amstext.pdf b/macros/latex-dev/required/amsmath/amstext.pdf Binary files differindex 1a49d88d88..07e4bbf504 100644 --- a/macros/latex-dev/required/amsmath/amstext.pdf +++ b/macros/latex-dev/required/amsmath/amstext.pdf diff --git a/macros/latex-dev/required/amsmath/amsxtra.pdf b/macros/latex-dev/required/amsmath/amsxtra.pdf Binary files differindex aa02d6929f..9d9742ba96 100644 --- a/macros/latex-dev/required/amsmath/amsxtra.pdf +++ b/macros/latex-dev/required/amsmath/amsxtra.pdf diff --git a/macros/latex-dev/required/amsmath/changes.txt b/macros/latex-dev/required/amsmath/changes.txt index 95e291d744..388d658572 100644 --- a/macros/latex-dev/required/amsmath/changes.txt +++ b/macros/latex-dev/required/amsmath/changes.txt @@ -1,3 +1,12 @@ +2022-04-08 Frank Mittelbach <Frank.Mittelbach@latex-project.org> + + * amsmath.dtx: + Make various math commands robust to match the LaTeX kernel (gh/123) + + * amsopn.dtx: + Make various operators \protected (gh/123) + + 2022-02-03 Frank Mittelbach <Frank.Mittelbach@latex-project.org> * amsmath.dtx (subsection{The \env{multline} environment}): diff --git a/macros/latex-dev/required/amsmath/subeqn.pdf b/macros/latex-dev/required/amsmath/subeqn.pdf Binary files differindex 25deff1253..bfc8dc8cf1 100644 --- a/macros/latex-dev/required/amsmath/subeqn.pdf +++ b/macros/latex-dev/required/amsmath/subeqn.pdf diff --git a/macros/latex-dev/required/amsmath/technote.pdf b/macros/latex-dev/required/amsmath/technote.pdf Binary files differindex 8e12a5296b..801a18437d 100644 --- a/macros/latex-dev/required/amsmath/technote.pdf +++ b/macros/latex-dev/required/amsmath/technote.pdf diff --git a/macros/latex-dev/required/amsmath/testmath.pdf b/macros/latex-dev/required/amsmath/testmath.pdf Binary files differindex 9332b2032f..72ca2233a0 100644 --- a/macros/latex-dev/required/amsmath/testmath.pdf +++ b/macros/latex-dev/required/amsmath/testmath.pdf diff --git a/macros/latex-dev/required/graphics/README.md b/macros/latex-dev/required/graphics/README.md index 939930605f..87b37ba52a 100644 --- a/macros/latex-dev/required/graphics/README.md +++ b/macros/latex-dev/required/graphics/README.md @@ -1,7 +1,7 @@ The LaTeX `graphics` bundle =========================== -Release 2022-06-01 pre-release 2 +Release 2022-06-01 pre-release 4 Overview -------- diff --git a/macros/latex-dev/required/graphics/color.pdf b/macros/latex-dev/required/graphics/color.pdf Binary files differindex ebf13b6cb9..54e74b4c83 100644 --- a/macros/latex-dev/required/graphics/color.pdf +++ b/macros/latex-dev/required/graphics/color.pdf diff --git a/macros/latex-dev/required/graphics/drivers.pdf b/macros/latex-dev/required/graphics/drivers.pdf Binary files differindex 4d06da1f61..0da38d5353 100644 --- a/macros/latex-dev/required/graphics/drivers.pdf +++ b/macros/latex-dev/required/graphics/drivers.pdf diff --git a/macros/latex-dev/required/graphics/epsfig.pdf b/macros/latex-dev/required/graphics/epsfig.pdf Binary files differindex 3ee5d92b01..b7566a0cfd 100644 --- a/macros/latex-dev/required/graphics/epsfig.pdf +++ b/macros/latex-dev/required/graphics/epsfig.pdf diff --git a/macros/latex-dev/required/graphics/graphics.pdf b/macros/latex-dev/required/graphics/graphics.pdf Binary files differindex 39927a75eb..588da08f43 100644 --- a/macros/latex-dev/required/graphics/graphics.pdf +++ b/macros/latex-dev/required/graphics/graphics.pdf diff --git a/macros/latex-dev/required/graphics/graphicx.pdf b/macros/latex-dev/required/graphics/graphicx.pdf Binary files differindex 0a39aa56ce..ed275b948b 100644 --- a/macros/latex-dev/required/graphics/graphicx.pdf +++ b/macros/latex-dev/required/graphics/graphicx.pdf diff --git a/macros/latex-dev/required/graphics/grfguide.pdf b/macros/latex-dev/required/graphics/grfguide.pdf Binary files differindex a0c0914ae2..e1d0938213 100644 --- a/macros/latex-dev/required/graphics/grfguide.pdf +++ b/macros/latex-dev/required/graphics/grfguide.pdf diff --git a/macros/latex-dev/required/graphics/keyval.pdf b/macros/latex-dev/required/graphics/keyval.pdf Binary files differindex c95033c86d..b000287672 100644 --- a/macros/latex-dev/required/graphics/keyval.pdf +++ b/macros/latex-dev/required/graphics/keyval.pdf diff --git a/macros/latex-dev/required/graphics/lscape.pdf b/macros/latex-dev/required/graphics/lscape.pdf Binary files differindex 51c7be6e47..77b72c1140 100644 --- a/macros/latex-dev/required/graphics/lscape.pdf +++ b/macros/latex-dev/required/graphics/lscape.pdf diff --git a/macros/latex-dev/required/graphics/mathcolor.pdf b/macros/latex-dev/required/graphics/mathcolor.pdf Binary files differindex b4646281e4..b7dd7b4f50 100644 --- a/macros/latex-dev/required/graphics/mathcolor.pdf +++ b/macros/latex-dev/required/graphics/mathcolor.pdf diff --git a/macros/latex-dev/required/graphics/rotating.pdf b/macros/latex-dev/required/graphics/rotating.pdf Binary files differindex 802e0b4716..f906fd65f1 100644 --- a/macros/latex-dev/required/graphics/rotating.pdf +++ b/macros/latex-dev/required/graphics/rotating.pdf diff --git a/macros/latex-dev/required/graphics/rotex.pdf b/macros/latex-dev/required/graphics/rotex.pdf Binary files differindex acd205bc79..d48a18bf6f 100644 --- a/macros/latex-dev/required/graphics/rotex.pdf +++ b/macros/latex-dev/required/graphics/rotex.pdf diff --git a/macros/latex-dev/required/graphics/trig.pdf b/macros/latex-dev/required/graphics/trig.pdf Binary files differindex 6f0312bf7a..79480e2d93 100644 --- a/macros/latex-dev/required/graphics/trig.pdf +++ b/macros/latex-dev/required/graphics/trig.pdf diff --git a/macros/latex-dev/required/latex-lab/README.md b/macros/latex-dev/required/latex-lab/README.md index 39f7f74d69..410292cda5 100644 --- a/macros/latex-dev/required/latex-lab/README.md +++ b/macros/latex-dev/required/latex-lab/README.md @@ -1,6 +1,6 @@ # LaTeX laboratory -Release 2022-06-01 pre-release 2 +Release 2022-06-01 pre-release 4 ## Overview diff --git a/macros/latex-dev/required/latex-lab/changes.txt b/macros/latex-dev/required/latex-lab/changes.txt index e146c5a0fb..912a45343d 100644 --- a/macros/latex-dev/required/latex-lab/changes.txt +++ b/macros/latex-dev/required/latex-lab/changes.txt @@ -1,3 +1,8 @@ +2022-14-04 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + + * documentmeta-support.dtx: + add key A-4 for first steps to support pdf/A-4 + 2022-03-08 Joseph Wright <Joseph.Wright@latex-project.org> * latex-lab-prototype.dtx diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf b/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf Binary files differindex 0f698d8080..63b7f66e42 100644 --- a/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf +++ b/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf b/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf Binary files differindex b2eeed8d7e..e62ba6d7f7 100644 --- a/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf +++ b/macros/latex-dev/required/latex-lab/documentmetadata-support-doc.pdf diff --git a/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx b/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx index 7501de151f..23053a484a 100644 --- a/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx +++ b/macros/latex-dev/required/latex-lab/documentmetadata-support.dtx @@ -18,8 +18,8 @@ % for those people who are interested or want to report an issue. % % \begin{macrocode} -\def\documentmetadatasupportversion{1.0a} -\def\documentmetadatasupportdate{2022-01-12} +\def\documentmetadatasupportversion{1.0b} +\def\documentmetadatasupportdate{2022-14-04} % \end{macrocode} % % @@ -108,13 +108,14 @@ % e.g., \texttt{lang=de-DE}. If not given the default value used is |en-US|. % % \item[\texttt{pdfstandard}] Choice key to set the pdf standard. -% Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b| and |A-3u| are accepted as +% Currently |A-1b|, |A-2a|, |A-2b|, |A-2u|, |A-3a|, |A-3b|, |A-3u| and |A-4| are accepted as % values. The casing is irrelevant, |a-1b| works too. % The underlying code to ensure the requirements (as far as they % can be ensured) is still incomplete, but a color profile is included and the % \texttt{/OutputIntent} is set. The |u| variants for example do not force unicode, % but they will pass the information to hyperref and hyperxmp. The |a| variants -% do \emph{not} enforce (or even test) a tagged pdf yet. +% do \emph{not} enforce (or even test) a tagged pdf yet. The |A-4| support is +% currently incomplete. % More information can be found in the documentation % of \pkg{l3pdfmeta}. % @@ -304,7 +305,7 @@ \keys_set:nn {document / metadata} {_pdfstandard=\str_uppercase:n{#1}} } ,_pdfstandard .choices:nn = - {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U} + {A-1B,A-2A,A-2B,A-2U,A-3A,A-3B,A-3U,A-4} { \prop_if_exist:cT { g__pdfmeta_standard_pdf/#1_prop } { diff --git a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf Binary files differindex 8d905d055b..23d39d4d50 100644 --- a/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf +++ b/macros/latex-dev/required/latex-lab/latex-lab-footnotes.pdf diff --git a/macros/latex-dev/required/latex-lab/latex-lab-new-or.pdf b/macros/latex-dev/required/latex-lab/latex-lab-new-or.pdf Binary files differindex 3d7c9318a1..86df806743 100644 --- a/macros/latex-dev/required/latex-lab/latex-lab-new-or.pdf +++ b/macros/latex-dev/required/latex-lab/latex-lab-new-or.pdf diff --git a/macros/latex-dev/required/latex-lab/latex-lab-prototype.pdf b/macros/latex-dev/required/latex-lab/latex-lab-prototype.pdf Binary files differindex 06e1e123d6..f3a07f31c0 100644 --- a/macros/latex-dev/required/latex-lab/latex-lab-prototype.pdf +++ b/macros/latex-dev/required/latex-lab/latex-lab-prototype.pdf diff --git a/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf b/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf Binary files differindex 4aa0d75725..a90d2c5a50 100644 --- a/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf +++ b/macros/latex-dev/required/latex-lab/latex-lab-testphase.pdf diff --git a/macros/latex-dev/required/tools/README.md b/macros/latex-dev/required/tools/README.md index ab2f88188c..0f6be397a2 100644 --- a/macros/latex-dev/required/tools/README.md +++ b/macros/latex-dev/required/tools/README.md @@ -1,7 +1,7 @@ The LaTeX `tools` bundle ======================== -Release 2022-06-01 pre-release 3 +Release 2022-06-01 pre-release 4 Overview -------- diff --git a/macros/latex-dev/required/tools/afterpage.pdf b/macros/latex-dev/required/tools/afterpage.pdf Binary files differindex 2a62543a5f..46ac616872 100644 --- a/macros/latex-dev/required/tools/afterpage.pdf +++ b/macros/latex-dev/required/tools/afterpage.pdf diff --git a/macros/latex-dev/required/tools/array.pdf b/macros/latex-dev/required/tools/array.pdf Binary files differindex 1464eeed55..92ea1e496e 100644 --- a/macros/latex-dev/required/tools/array.pdf +++ b/macros/latex-dev/required/tools/array.pdf diff --git a/macros/latex-dev/required/tools/bm.pdf b/macros/latex-dev/required/tools/bm.pdf Binary files differindex d69a2ff80a..a1ffd6171c 100644 --- a/macros/latex-dev/required/tools/bm.pdf +++ b/macros/latex-dev/required/tools/bm.pdf diff --git a/macros/latex-dev/required/tools/calc.pdf b/macros/latex-dev/required/tools/calc.pdf Binary files differindex 1b268e31ab..8f121cd064 100644 --- a/macros/latex-dev/required/tools/calc.pdf +++ b/macros/latex-dev/required/tools/calc.pdf diff --git a/macros/latex-dev/required/tools/changes.txt b/macros/latex-dev/required/tools/changes.txt index db7a495a91..51e0858aeb 100644 --- a/macros/latex-dev/required/tools/changes.txt +++ b/macros/latex-dev/required/tools/changes.txt @@ -5,6 +5,11 @@ completeness or accuracy and it contains some references to files that are not part of the distribution. ======================================================================= +2022-04-12 Ulrike Fischer <Ulrike.Fischer@latex-project.org> + + * showkeys.dtx: Adapt to starred references, update varioref support. + Added rollback to 2014-10-28 + 2022-01-05 David Carlisle <David.Carlisle@latex-project.org> * bm.dtx: Guard \nolimits@ for gh issue 744 diff --git a/macros/latex-dev/required/tools/dcolumn.pdf b/macros/latex-dev/required/tools/dcolumn.pdf Binary files differindex b27ae7d9c1..864f050d31 100644 --- a/macros/latex-dev/required/tools/dcolumn.pdf +++ b/macros/latex-dev/required/tools/dcolumn.pdf diff --git a/macros/latex-dev/required/tools/delarray.pdf b/macros/latex-dev/required/tools/delarray.pdf Binary files differindex c104cbde52..b3f277fe16 100644 --- a/macros/latex-dev/required/tools/delarray.pdf +++ b/macros/latex-dev/required/tools/delarray.pdf diff --git a/macros/latex-dev/required/tools/enumerate.pdf b/macros/latex-dev/required/tools/enumerate.pdf Binary files differindex 4c8e557245..f79d7c950f 100644 --- a/macros/latex-dev/required/tools/enumerate.pdf +++ b/macros/latex-dev/required/tools/enumerate.pdf diff --git a/macros/latex-dev/required/tools/fileerr.pdf b/macros/latex-dev/required/tools/fileerr.pdf Binary files differindex 9b5f652c8a..859f1b0a3b 100644 --- a/macros/latex-dev/required/tools/fileerr.pdf +++ b/macros/latex-dev/required/tools/fileerr.pdf diff --git a/macros/latex-dev/required/tools/fontsmpl.pdf b/macros/latex-dev/required/tools/fontsmpl.pdf Binary files differindex 7748fabbd8..05af2c2bb3 100644 --- a/macros/latex-dev/required/tools/fontsmpl.pdf +++ b/macros/latex-dev/required/tools/fontsmpl.pdf diff --git a/macros/latex-dev/required/tools/ftnright.pdf b/macros/latex-dev/required/tools/ftnright.pdf Binary files differindex 696be32fd8..080cf87812 100644 --- a/macros/latex-dev/required/tools/ftnright.pdf +++ b/macros/latex-dev/required/tools/ftnright.pdf diff --git a/macros/latex-dev/required/tools/hhline.pdf b/macros/latex-dev/required/tools/hhline.pdf Binary files differindex b5a6e71e1d..db2d46c3ad 100644 --- a/macros/latex-dev/required/tools/hhline.pdf +++ b/macros/latex-dev/required/tools/hhline.pdf diff --git a/macros/latex-dev/required/tools/indentfirst.pdf b/macros/latex-dev/required/tools/indentfirst.pdf Binary files differindex a9e20d6244..cc56f0b0b8 100644 --- a/macros/latex-dev/required/tools/indentfirst.pdf +++ b/macros/latex-dev/required/tools/indentfirst.pdf diff --git a/macros/latex-dev/required/tools/layout.pdf b/macros/latex-dev/required/tools/layout.pdf Binary files differindex 3fe02fe514..1086a3afca 100644 --- a/macros/latex-dev/required/tools/layout.pdf +++ b/macros/latex-dev/required/tools/layout.pdf diff --git a/macros/latex-dev/required/tools/longtable.pdf b/macros/latex-dev/required/tools/longtable.pdf Binary files differindex 2b265b2073..3d7911a5c1 100644 --- a/macros/latex-dev/required/tools/longtable.pdf +++ b/macros/latex-dev/required/tools/longtable.pdf diff --git a/macros/latex-dev/required/tools/multicol.pdf b/macros/latex-dev/required/tools/multicol.pdf Binary files differindex 5b5cc8fa6f..257aa6b678 100644 --- a/macros/latex-dev/required/tools/multicol.pdf +++ b/macros/latex-dev/required/tools/multicol.pdf diff --git a/macros/latex-dev/required/tools/rawfonts.pdf b/macros/latex-dev/required/tools/rawfonts.pdf Binary files differindex 92be34bcb7..c16565aef7 100644 --- a/macros/latex-dev/required/tools/rawfonts.pdf +++ b/macros/latex-dev/required/tools/rawfonts.pdf diff --git a/macros/latex-dev/required/tools/shellesc.pdf b/macros/latex-dev/required/tools/shellesc.pdf Binary files differindex 14db60194a..db90b7d5aa 100644 --- a/macros/latex-dev/required/tools/shellesc.pdf +++ b/macros/latex-dev/required/tools/shellesc.pdf diff --git a/macros/latex-dev/required/tools/showkeys-2014-10-28.sty b/macros/latex-dev/required/tools/showkeys-2014-10-28.sty new file mode 100644 index 0000000000..b4d7b19028 --- /dev/null +++ b/macros/latex-dev/required/tools/showkeys-2014-10-28.sty @@ -0,0 +1,272 @@ +%% +%% This is file `showkeys.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% showkeys.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% The source is maintained by the LaTeX Project team and bug +%% reports for it can be opened at https://latex-project.org/bugs/ +%% (but please observe conditions on bug reports sent to that address!) +%% +%% +%% Copyright (C) 1993-2021 +%% The LaTeX Project and any individual authors listed elsewhere +%% in this file. +%% +%% This file was generated from file(s) of the Standard LaTeX `Tools Bundle'. +%% -------------------------------------------------------------------------- +%% +%% It may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This file may only be distributed together with a copy of the LaTeX +%% `Tools Bundle'. You may however distribute the LaTeX `Tools Bundle' +%% without such generated files. +%% +%% The list of all files belonging to the LaTeX `Tools Bundle' is +%% given in the file `manifest.txt'. +%% +%% File: showkeys.dtx Copyright (C) 1992-1997 David Carlisle +%% File: showkeys.dtx Copyright (C) 2006-2019 David Carlisle, LaTeX Project +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{showkeys} + [2014/10/28 v3.17 Show cite and label keys (DPC, MH)] +\DeclareOption{notref}{\let\SK@ref\@empty} +\DeclareOption{notcite}{\let\SK@cite\@empty} +\let\SK@refcolor\relax +\let\SK@labelcolor\relax +\DeclareOption{color}{\AtEndOfPackage{% + \RequirePackage{color}% + \definecolor{refkey}{gray}{.75}% + \definecolor{labelkey}{gray}{.75}% + \def\SK@refcolor{\color{refkey}}% + \def\SK@labelcolor{\color{labelkey}}}} +\DeclareOption{final}{% + \providecommand*\showkeyslabelformat[1]{}% + \endinput} +\DeclareOption{draft}{} +\ProcessOptions +\let\SK@label\label +\let\SK@bibitem\@bibitem +\let\SK@lbibitem\@lbibitem +\def\label#1{% + \@bsphack + \SK@\SK@@label{#1}% + \begingroup + \SK@label{#1}% + \endgroup + \@esphack} +\def\@bibitem#1{% + \SK@bibitem{#1}\SK@\SK@@label{#1}\ignorespaces} +\def\@lbibitem[#1]#2{% + \SK@lbibitem[{#1}]{#2}\SK@\SK@@label{#2}\ignorespaces} +\def\SK@#1#2{% + \protected@edef\@tempa{#2}% + \expandafter#1\meaning\@tempa\SK@} +\providecommand*\showkeyslabelformat[1]{% + \fbox{\normalfont\small\ttfamily#1}} +\def\SK@@label#1>#2\SK@{% + \gdef\SK@lab{\smash{\SK@labelcolor\showkeyslabelformat{#2}}}% + \ifvmode + \if@inlabel + \global\setbox\@labels\hbox{% + \llap{\SK@lab\SK@lab@relax + \kern\@totalleftmargin\kern\marginparsep}% + \box\@labels}% + \else + \dimen@\prevdepth + \nointerlineskip + \ifinner + \skip@\lastskip\unskip + \advance\skip@\lastskip\unskip + \setbox\z@\lastbox + \ifvoid\z@ + \llap{\SK@lab\SK@lab@relax\kern\marginparsep}% + \else + \hbox{\box\z@\rlap{\kern\marginparsep\SK@labx}}% + \fi + \vskip\skip@ + \else + \llap{\SK@lab\SK@lab@relax\kern\marginparsep}% + \fi + \prevdepth\dimen@ + \fi + \else + \csname SK@\@currenvir\endcsname + \ifSK@equation\else + \ifmmode + \SK@labx + \else + \ifinner + \rlap\SK@lab + \else + \vadjust{\llap{\SK@lab\kern\marginparsep}}% + \fi + \SK@lab@relax + \fi + \fi + \fi} +\AtBeginDocument{% + \let\SK@eqnnum\@eqnnum + \@ifpackageloaded{amsmath}{% + \let\SK@tagform@\tagform@ + \let\SK@maketag@@@\maketag@@@ + \iftagsleft@ + \def\tagform@#1{% + \ifx\df@label\@empty + \SK@lab@relax + \else + \expandafter\SK@@label\meaning\df@label\SK@ + \fi + \llap{\SK@lab\kern\marginparsep}% + \SK@lab@relax\SK@tagform@{#1}}% + \def\maketag@@@#1{% + \ifx\df@label\@empty + \SK@lab@relax + \else + \expandafter\SK@@label\meaning\df@label\SK@ + \fi + \llap{\SK@lab\kern\marginparsep}\SK@lab@relax + \SK@maketag@@@{#1}% + }% + \def\@eqnnum{% + \llap{\SK@lab\kern\displaywidth\kern\marginparsep}% + \SK@lab@relax\SK@eqnnum}% + \else + \def\tagform@#1{% + \ifx\df@label\@empty + \SK@lab@relax + \else + \expandafter\SK@@label\meaning\df@label\SK@ + \fi + \SK@tagform@{#1}% + \rlap{\kern\marginparsep\SK@lab}\SK@lab@relax}% + \def\maketag@@@#1{% + \ifx\df@label\@empty + \SK@lab@relax + \else + \expandafter\SK@@label\meaning\df@label\SK@ + \fi + \SK@maketag@@@{#1}% + \rlap{\kern\marginparsep\SK@lab}\SK@lab@relax + }% + \def\@eqnnum{\SK@eqnnum\rlap{\kern\marginparsep\SK@lab}% + \SK@lab@relax}% + \fi + }% + {% + \@ifundefined{ver@leqno.clo}{% + \def\@eqnnum{\SK@eqnnum\rlap{\kern\marginparsep\SK@lab}% + \SK@lab@relax}% + }{% + \def\@eqnnum{% + \llap{\SK@lab\kern\displaywidth\kern\marginparsep}% + \SK@lab@relax\SK@eqnnum}% + }% + }% +} +\def\SK@labx{\rlap\SK@lab\global\let\SK@lab\relax} +\def\SK@lab@relax{\global\let\SK@lab\relax}\SK@lab@relax +\newif\ifSK@equation +\let\SK@equation\SK@equationtrue +\let\SK@eqnarray\SK@equationtrue +\toks@\expandafter{\eqnarray} +\edef\eqnarray{\let\noexpand\tagform@\noexpand\SK@tagform@\the\toks@} +\let\SK@align\SK@equationtrue +\let\SK@alignat\SK@equationtrue +\let\SK@xalignat\SK@equationtrue +\let\SK@xxalignat\SK@equationtrue +\let\SK@gather\SK@equationtrue +\let\SK@multline\SK@equationtrue +\let\SK@flalign\SK@equationtrue +\expandafter\let\csname SK@align*\endcsname\SK@equationtrue +\expandafter\let\csname SK@alignat*\endcsname\SK@equationtrue +\expandafter\let\csname SK@flalign*\endcsname\SK@equationtrue +\expandafter\let\csname SK@gather*\endcsname\SK@equationtrue +\expandafter\let\csname SK@multline*\endcsname\SK@equationtrue +\expandafter\let\csname SK@equation*\endcsname\SK@equationtrue +\def\SK@def#1{% + \edef\@tempa{\expandafter\@gobble\string#1}% + \@ifundefined{\@tempa\space}% + {\expandafter\let\csname SK@\@tempa\endcsname#1}% + {\expandafter\let\csname SK@\@tempa\expandafter\endcsname + \csname\@tempa\space\endcsname}% + \expandafter\def\expandafter#1\expandafter{% + \expandafter\protect\csname\@tempa\space\endcsname}% + \expandafter\def\csname\@tempa\space\endcsname} +\ifx\SK@ref\@empty +\AtBeginDocument{% + \@ifpackageloaded{varioref}{% + \SK@def\@@vpageref#1[#2]#3{{% + \let\label\SK@label + \SK@@@vpageref{#1}[{#2}]{#3}}}% + \def\vr@f#1{% + \leavevmode\unskip\vref@space + \ref{#1}% + {\let\label\SK@label + \vpageref[\unskip]{#1}}}% + }{}} +\else +\AtBeginDocument{% + \SK@def\ref#1{\SK@\SK@@ref{#1}\SK@ref{#1}}% + \SK@def\pageref#1{\SK@\SK@@ref{#1}\SK@pageref{#1}}% + \@ifpackageloaded{varioref}{% + \SK@def\@@vpageref#1[#2]#3{{% + \let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref + \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}% + \def\vr@f#1{% + \leavevmode\unskip\vref@space + \ref{#1}% + \let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref + \vpageref[\unskip]{#1}}% + }{}} +\fi +\ifx\SK@cite\@empty +\AtBeginDocument{% + \ifx\HAR@checkdef\@undefined\else + \expandafter\let\expandafter + \SK@HAR@bi\csname\string\harvarditem\endcsname + \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{% + \SK@HAR@bi[{#1}]{#2}{#3}{#4}\SK@\SK@@label{#4}}% + \fi} +\else +\AtBeginDocument{% + \ifx\HAR@checkdef\@undefined + \ifx\citen\@undefined + \SK@def\@citex[#1]#2{\SK@citex[{#1}]{#2}}% + \else + \SK@def\citen#1{\SK@\SK@@ref{#1}\SK@citen{#1}}% + \fi + \SK@def\citeauthor#1{\SK@\SK@@ref{#1}\SK@citeauthor{#1}}% + \SK@def\citefullauthor#1{\SK@\SK@@ref{#1}\SK@citefullauthor{#1}}% + \SK@def\citeyear#1{\SK@\SK@@ref{#1}\SK@citeyear{#1}}% + \else + \SK@def\HAR@checkdef#1#2{% + \expandafter\SK@\expandafter\SK@@ref\expandafter{#1}% + \SK@HAR@checkdef{#1}{#2}}% + \expandafter\let\expandafter + \SK@HAR@bi\csname\string\harvarditem\endcsname + \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{% + \SK@HAR@bi[{#1}]{#2}{#3}{#4}\SK@\SK@@label{#4}}% + \fi} +\def\SK@citex[#1]#2{% + \SK@\SK@@ref{#2}\SK@@citex[{#1}]{#2}} +\fi +\def\SK@@ref#1>#2\SK@{% + \leavevmode\vbox to\z@{{% + \vss + \SK@refcolor + \rlap{\vrule\raise .75em% + \hbox{\underbar{\normalfont\footnotesize\ttfamily#2}}}}}} +\endinput +%% +%% End of file `showkeys.sty'. diff --git a/macros/latex-dev/required/tools/showkeys.dtx b/macros/latex-dev/required/tools/showkeys.dtx index 959b5c62ec..3aed90d304 100644 --- a/macros/latex-dev/required/tools/showkeys.dtx +++ b/macros/latex-dev/required/tools/showkeys.dtx @@ -28,11 +28,18 @@ \ProvidesFile{showkeys.dtx} %</dtx> %<package>\NeedsTeXFormat{LaTeX2e} +%<package> +%<package>\providecommand\DeclareRelease[3]{} +%<package>\providecommand\DeclareCurrentRelease[2]{} +%<package> +%<package>\DeclareRelease{}{2014-10-28}{showkeys-2014-10-28.sty} +%<package>\DeclareCurrentRelease{}{2022-06-01} +%<package> %<package>\ProvidesPackage{showkeys} %<driver> \ProvidesFile{showkeys.drv} % \fi % \ProvidesFile{showkeys.dtx} - [2014/10/28 v3.17 Show cite and label keys (DPC, MH)] + [2022/04/12 v3.18 Show cite and label keys (DPC, MH)] % % \iffalse %<*driver> @@ -70,7 +77,8 @@ % {Support harvard, varioref and natbib packages,} % \changes{v3.02}{1995/03/17} % {Support new AMS files} -% +% \changes{v3.18}{2022/04/12} +% {Support starred references} % \section{Introduction}\label{sec:intro} % % |showkeys.sty| modifies the |\label|, |\ref|, |\pageref|, |\cite|, and @@ -749,18 +757,10 @@ % \changes{v3.13}{2006/01/09}{Updated varioref support, for latex/3373} % \changes{v3.15}{2006/06/19} % {Prevent loss of brackets} +% \changes{v3.18}{2022/04/12} +% {update varioref support: it no longer uses label, so no patch +% needed if notref is used.} % \begin{macrocode} -\AtBeginDocument{% - \@ifpackageloaded{varioref}{% - \SK@def\@@vpageref#1[#2]#3{{% - \let\label\SK@label - \SK@@@vpageref{#1}[{#2}]{#3}}}% - \def\vr@f#1{% - \leavevmode\unskip\vref@space - \ref{#1}% - {\let\label\SK@label - \vpageref[\unskip]{#1}}}% - }{}} \else % \end{macrocode} % @@ -775,22 +775,26 @@ % {Make redefinition conditional on notref option} % \changes{v3.15}{2006/06/19} % {Prevent loss of brackets} +% \changes{v3.18}{2022/04/12} +% {support new kernel commands with starred versions} +% \changes{v3.18}{2022/04/12} +% {update varioref support: it no longer uses label} % \begin{macrocode} \AtBeginDocument{% - \SK@def\ref#1{\SK@\SK@@ref{#1}\SK@ref{#1}}% - \SK@def\pageref#1{\SK@\SK@@ref{#1}\SK@pageref{#1}}% + \let\@kernel@ref@\@kernel@ref + \let\@kernel@sref@\@kernel@sref + \SK@def\@kernel@ref#1{\SK@\SK@@ref{#1}\SK@@kernel@ref{#1}}% + \SK@def\@kernel@sref#1{\SK@\SK@@ref{#1}\SK@@kernel@sref{#1}}% + \SK@def\@kernel@pageref#1{\SK@\SK@@ref{#1}\SK@@kernel@pageref{#1}}% + \SK@def\@kernel@spageref#1{\SK@\SK@@ref{#1}\SK@@kernel@spageref{#1}}% + \SK@def\@kernel@Ref#1{{\let\@kernel@ref\@kernel@ref@\SK@\SK@@ref{#1}\SK@@kernel@Ref{#1}}}% + \SK@def\@kernel@sRef#1{\let\@kernel@sref\@kernel@sref@\SK@\SK@@ref{#1}\SK@@kernel@sRef{#1}}% % \end{macrocode} % varioref support. % \begin{macrocode} \@ifpackageloaded{varioref}{% \SK@def\@@vpageref#1[#2]#3{{% - \let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref - \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}% - \def\vr@f#1{% - \leavevmode\unskip\vref@space - \ref{#1}% - \let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref - \vpageref[\unskip]{#1}}% + \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref{#1}[{#2}]{#3}}}%% }{}} % \end{macrocode} % diff --git a/macros/latex-dev/required/tools/showkeys.pdf b/macros/latex-dev/required/tools/showkeys.pdf Binary files differindex b7e96c8387..824c58478a 100644 --- a/macros/latex-dev/required/tools/showkeys.pdf +++ b/macros/latex-dev/required/tools/showkeys.pdf diff --git a/macros/latex-dev/required/tools/somedefs.pdf b/macros/latex-dev/required/tools/somedefs.pdf Binary files differindex a810649ff5..5b535f0346 100644 --- a/macros/latex-dev/required/tools/somedefs.pdf +++ b/macros/latex-dev/required/tools/somedefs.pdf diff --git a/macros/latex-dev/required/tools/tabularx.pdf b/macros/latex-dev/required/tools/tabularx.pdf Binary files differindex 56f30d5d1e..773fc85fff 100644 --- a/macros/latex-dev/required/tools/tabularx.pdf +++ b/macros/latex-dev/required/tools/tabularx.pdf diff --git a/macros/latex-dev/required/tools/theorem.pdf b/macros/latex-dev/required/tools/theorem.pdf Binary files differindex 28b67d7788..5bc34f8f33 100644 --- a/macros/latex-dev/required/tools/theorem.pdf +++ b/macros/latex-dev/required/tools/theorem.pdf diff --git a/macros/latex-dev/required/tools/tools-overview.pdf b/macros/latex-dev/required/tools/tools-overview.pdf Binary files differindex 12bb07c349..3d6ef83028 100644 --- a/macros/latex-dev/required/tools/tools-overview.pdf +++ b/macros/latex-dev/required/tools/tools-overview.pdf diff --git a/macros/latex-dev/required/tools/trace.pdf b/macros/latex-dev/required/tools/trace.pdf Binary files differindex 1add25be43..8b1dd48292 100644 --- a/macros/latex-dev/required/tools/trace.pdf +++ b/macros/latex-dev/required/tools/trace.pdf diff --git a/macros/latex-dev/required/tools/varioref.pdf b/macros/latex-dev/required/tools/varioref.pdf Binary files differindex 952b8bc5a4..6d56738350 100644 --- a/macros/latex-dev/required/tools/varioref.pdf +++ b/macros/latex-dev/required/tools/varioref.pdf diff --git a/macros/latex-dev/required/tools/verbatim.pdf b/macros/latex-dev/required/tools/verbatim.pdf Binary files differindex d366ab214c..d5b09faa98 100644 --- a/macros/latex-dev/required/tools/verbatim.pdf +++ b/macros/latex-dev/required/tools/verbatim.pdf diff --git a/macros/latex-dev/required/tools/xr.pdf b/macros/latex-dev/required/tools/xr.pdf Binary files differindex 62f993eab9..27b741303f 100644 --- a/macros/latex-dev/required/tools/xr.pdf +++ b/macros/latex-dev/required/tools/xr.pdf diff --git a/macros/latex-dev/required/tools/xspace.pdf b/macros/latex-dev/required/tools/xspace.pdf Binary files differindex bfb3a44214..623bcf3573 100644 --- a/macros/latex-dev/required/tools/xspace.pdf +++ b/macros/latex-dev/required/tools/xspace.pdf diff --git a/macros/latex/contrib/hvextern/Changes b/macros/latex/contrib/hvextern/Changes index 964577b7fa..c83eea6c1f 100644 --- a/macros/latex/contrib/hvextern/Changes +++ b/macros/latex/contrib/hvextern/Changes @@ -1,5 +1,9 @@ hvextern.sty ---------------- +v 0.25 2022-05-19 - added framesep keyword + - added keywords for vertical space + - added keyword textOptions for reading text output + - use \hv@marginpar instead of \marginpar/\marginnote v 0.24 2022-05-11 - fix introduced bug for \hv@rm - added tcolorbox support for \runExtCmd . added keywords pagesep and mpsep diff --git a/macros/latex/contrib/hvextern/doc/hvextern.pdf b/macros/latex/contrib/hvextern/doc/hvextern.pdf Binary files differindex 60f1d77645..b472862835 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.pdf +++ b/macros/latex/contrib/hvextern/doc/hvextern.pdf diff --git a/macros/latex/contrib/hvextern/doc/hvextern.tex b/macros/latex/contrib/hvextern/doc/hvextern.tex index ecc62a121f..a170457a7d 100644 --- a/macros/latex/contrib/hvextern/doc/hvextern.tex +++ b/macros/latex/contrib/hvextern/doc/hvextern.tex @@ -23,12 +23,12 @@ \begin{document} \title{Writing, running and including the output of external documents -from within a main \LaTeX\ document~--v. \hvexternFileversion} -\author{Herbert Voß\thanks{herbert@dante.de}} +from within a main\newline \LaTeX\ document~--v. \hvexternFileversion} +\author{Herbert Voß \url{herbert@dante.de}} \maketitle \tableofcontents -\newpage +%\newpage \setkeys{hv}{moveToExampleDir,ExampleDir=Examples,showFilename,verbose} \section{Syntax} @@ -37,6 +37,9 @@ from within a main \LaTeX\ document~--v. \hvexternFileversion} \usepackage{hvextern} \end{verbatim} +\addtocontents{toc}{\protect\enlargethispage{2ex}} + + \begin{sloppypar} This package allows to write external \MP, \TeX, \ConTeXt, \LaTeX, \LuaTeX, \LuaLaTeX, \XeTeX, \XeLaTeX, Lua, Perl, Java and/or Python source code, which will then be run via \texttt{shell escape} to create a PDF oder text output to include @@ -144,7 +147,6 @@ The \ttIndex{png} image is created on the fly with the following arguments of \ \begin{Verbatim} \begin{externalDocument}[ compiler=python3, - showFilename, code, ext=py, docType=py, @@ -171,7 +173,6 @@ catagory, which is done internally by the package. The complete definition of th \begin{Verbatim} \begin{externalDocument}[ compiler=python3, - showFilename, code, ext=py, force=false, @@ -225,7 +226,6 @@ line in the above code shows how it can be done with Python. compiler=python3, progpath=/usr/local/bin/, force=false, - showFilename, runs=1, code, ext=py, @@ -269,11 +269,9 @@ image.save(imageName+".png", "PNG") - - \begin{externalDocument}[grfOptions={width=0.95\linewidth}, compiler=xelatex,code,mpwidth=0.6\linewidth, - crop,cleanup,force=false,usefancyvrb=false,ext=tex]{voss} + crop,cleanup,force=false,usefancyvrb=false,ext=tex,showFilename=false]{voss} \documentclass{article} %StartVisiblePreamble \usepackage{tikz} @@ -298,6 +296,7 @@ image.save(imageName+".png", "PNG") \end{externalDocument} + \section{Setting marker in the source} The marker for the code ranges which should be listed depend to the used programming language: @@ -379,9 +378,10 @@ runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex} \begin{externalDocument}[ grfOptions={width=0.30\linewidth}, pages={1,3,5}, + pagesep=2pt, frame, runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}, - showFilename, + , verbose, force=false, cleanup={log,aux,toc,bbl,blg}, @@ -412,6 +412,9 @@ Sort with xindex \verb|-l DE --config AU| \end{externalDocument} + + + The following \Java-program creates the Mandelbrot set as png image. The valid setting for the environment \Lenv{externalDocument} is: @@ -489,6 +492,8 @@ public class Main { %$ + + \subsection{Grafik options} \begin{verbatim} \define@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}} @@ -524,6 +529,10 @@ the follwing example. \end{externalDocument} + +\newpage%%%%%%%%%%% + + \subsection{Listings options} \begin{verbatim} @@ -563,6 +572,8 @@ to \Lcs{VerbatimInput}. The following example uses \end{document} \end{externalDocument} + + \subsection{Background color} There are different colors for the preamble and body listing: the backgrund and frame color. @@ -644,78 +655,24 @@ If a source needs more than running the defined compiler, it must be defined by The type of the source code can be different to the compiler, e.g. source \Lkeyval{latex}, but compiler \Lkeyval{lualatex}. - -\subsection{Output as floating object with caption and label} - -By default the images are not inserted as a float. This can be changed by -the keyword \Lkeyword{float}, a caption and a label are optional. The float type is always -\Lenv{figure}. - -\begin{verbatim} -\define@boolkey{hv}[hv@extern@]{float}[true]{} -\define@key{hv}{caption}[]{\def\hv@extern@caption{#1}} -\define@key{hv}{label}[]{\def\hv@extern@label{#1}} -\end{verbatim} - -The image Figure~\ref{img:cox} shows an example for a floting object. - -\begin{externalDocument}[ - grfOptions={width=\linewidth}, - lstOptions={fontsize=\small,fontfamily=tt}, -% lstOptions={basicstyle=\small\ttfamily}, - compiler=lualatex, - BGpreamble=red!10, BOpreamble=red, - BGbody=blue!8, BObody=blue, - code, -% mpwidth=0.6\linewidth, - crop, - cleanup, - force=false, - usefancyvrb, - float, - caption={An example for Coxeter images}, - label=img:cox, - docType=latex]{voss} -\RequirePackage{pdfmanagement-testphase} -\DeclareDocumentMetadata{} -\documentclass{article} -%StartVisiblePreamble -\usepackage{pst-coxeterp} -%StopVisiblePreamble -\pagestyle{empty} -\begin{document} -\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=2]\end{pspicture} -% -\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=3]\end{pspicture} -% -\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=5]\end{pspicture} -% -\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=7]\end{pspicture} -% -% ------------------------------------ -% Only some text to show the pagebreak -% ------------------------------------ -\end{document} -\end{externalDocument} - - - - \subsection{Output more than one page} The pages which should be printed can be defined by \begin{verbatim} \define@key{hv}{pages}[1]{\def\hv@extern@pages{#1}} +\define@key{hv}{pagesep}[1em]{\hv@extern@pagesep=#1} \define@boolkey{hv}[hv@extern@]{frame}[true]{} \end{verbatim} With \Lkeyword{frame} the pages can be framed (internally by \Lcs{fbox}). It is leaved to the user to choose the correct image width for the pages. +The separation between the pages is defined by the length \Lkeyword{pagesep}. The following example uses: \begin{verbatim} pages={1,2,3}, + pagesep=2pt, grfOptions={width=0.3\linewidth}, compiler=lualatex, runs=2, % for the TOC frame, @@ -723,6 +680,7 @@ The following example uses: \begin{externalDocument}[ pages={1,2,3}, + pagesep=2pt, grfOptions={width=0.3\linewidth}, % lstOptions={fontsize=\small,fontfamily=tt}, compiler=lualatex, runs=2, @@ -732,7 +690,7 @@ The following example uses: % mpwidth=0.6\linewidth, % crop, cleanup, - force=false, + force=true, frame, % usefancyvrb, % float, @@ -757,6 +715,61 @@ The following example uses: + +\subsection{Output as floating object with caption and label} + +By default the images are not inserted as a float. This can be changed by +the keyword \Lkeyword{float}, a caption and a label are optional. The float type is always +\Lenv{figure}. + +\begin{verbatim} +\define@boolkey{hv}[hv@extern@]{float}[true]{} +\define@key{hv}{floatsetting}[]{\def\hv@extern@floatsetting{#1}} +\define@key{hv}{caption}[]{\def\hv@extern@caption{#1}} +\define@key{hv}{label}[]{\def\hv@extern@label{#1}} +\end{verbatim} + +The image Figure~\ref{img:cox} shows an example for a floating object, which uses the floatsetting \verb|!htb|, +which is the default. Using a caption and a label are optional. + +\begin{externalDocument}[ + grfOptions={width=\linewidth}, + lstOptions={fontsize=\small,fontfamily=tt}, +% lstOptions={basicstyle=\small\ttfamily}, + compiler=lualatex, + BGpreamble=red!10, BOpreamble=red, + BGbody=blue!8, BObody=blue, + code, +% mpwidth=0.6\linewidth, + crop, + cleanup, + force=true, + usefancyvrb, + float, + floatsetting=!ht, + caption={An example for Coxeter images}, + label=img:cox, + docType=latex]{voss} +\RequirePackage{pdfmanagement-testphase} +\DeclareDocumentMetadata{} +\documentclass{article} +%StartVisiblePreamble +\usepackage{pst-coxeterp} +%StopVisiblePreamble +\pagestyle{empty} +\begin{document} +\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=2]\end{pspicture} +\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=3]\end{pspicture} +\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=5]\end{pspicture} +\begin{pspicture}(-1,-1)(1,1)\Simplex[dimension=7]\end{pspicture} +\end{document} +\end{externalDocument} + + + +%\clearpage%%%%%%%%%%%%%%%%% + + \subsection{Cropping the PDF} Instead of using the \Index{documentclass} \Lclass{standalone}, which already crops the created PDF, one can use the optional argument \Lkeyword{crop}. @@ -774,6 +787,7 @@ The follwoing example was created with \begin{verbatim} pages={1,2,3}, + pagesep=2pt, grfOptions={width=0.3\linewidth}, compiler=lualatex, runs=2, % for the TOC frame, @@ -782,6 +796,7 @@ The follwoing example was created with \begin{externalDocument}[ pages={1,2,3}, + pagesep=2pt, grfOptions={width=0.3\linewidth}, % lstOptions={fontsize=\small,fontfamily=tt}, compiler=lualatex, runs=2, @@ -838,17 +853,18 @@ or \Lkeyval{b}. %\define@key{hv}{align}[\centering]{\def\hv@extern@align{#1}} %\end{verbatim} -\subsubsection{the default} - +%\textbf{the default} +% \begin{verbatim} - align=\centering, + align=\centering, % default \end{verbatim} - +% \begin{externalDocument}[ compiler=lualatex, runs=2, BGpreamble=red!10, BOpreamble=red, BGbody=blue!8, BObody=blue, code, + showFilename=false, crop, cleanup, force=false, @@ -860,7 +876,7 @@ or \Lkeyval{b}. \end{document} \end{externalDocument} -\subsubsection{Left aligned} +%\textbf{Left aligned} \begin{verbatim} align=\raggedright, @@ -871,6 +887,7 @@ or \Lkeyval{b}. compiler=lualatex, runs=2, BGpreamble=red!10, BOpreamble=red, BGbody=blue!8, BObody=blue, + showFilename=false, code, crop, cleanup, @@ -883,7 +900,7 @@ or \Lkeyval{b}. \end{document} \end{externalDocument} -\subsubsection{Right aligned} +%\textbf{Right aligned} \begin{verbatim} align=\raggedleft, @@ -896,6 +913,7 @@ or \Lkeyval{b}. BGpreamble=red!10, BOpreamble=red, BGbody=blue!8, BObody=blue, code, + showFilename=false, crop, cleanup, force=false, @@ -910,9 +928,9 @@ or \Lkeyval{b}. %Now the same for side by side output. -\subsubsection{the default -- side by side} +%\textbf{the default -- side by side} \begin{verbatim} - align=\centering, mpwidth=0.5\linewidth, + align=\centering, mpwidth=0.5\linewidth, % default for side by side \end{verbatim} \begin{externalDocument}[ @@ -921,6 +939,7 @@ or \Lkeyval{b}. BGbody=blue!8, BObody=blue, code, crop, + showFilename=false, cleanup, force=false, mpwidth=0.5\linewidth, @@ -932,7 +951,7 @@ or \Lkeyval{b}. \end{document} \end{externalDocument} -\subsubsection{Left aligned -- side by side} +%\textbf{Left aligned -- side by side} \begin{verbatim} align=\raggedright, mpwidth=0.5\linewidth, @@ -944,6 +963,7 @@ or \Lkeyval{b}. BGpreamble=red!10, BOpreamble=red, BGbody=blue!8, BObody=blue, code, + showFilename=false, crop, cleanup, force=false, @@ -956,7 +976,7 @@ or \Lkeyval{b}. \end{document} \end{externalDocument} -\subsubsection{Right aligned -- side by side} +%\textbf{Right aligned -- side by side} \begin{verbatim} align=\raggedleft, mpwidth=0.5\linewidth, @@ -969,6 +989,7 @@ or \Lkeyval{b}. BGpreamble=red!10, BOpreamble=red, BGbody=blue!8, BObody=blue, code, + showFilename=false, crop, cleanup, force=false, @@ -981,20 +1002,27 @@ or \Lkeyval{b}. \end{document} \end{externalDocument} + + + \subsection{Inline images} By default code and image are own paragraphs. With the optional argument \Lkeyword{inline} the created image can be part of the \Index{current line}. This may make sense, if you need characters which are not part of your current font. \begin{verbatim} -\define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse} +\define@boolkey{hv}[hv@extern@]{inline}[true]{% + \hv@extern@codefalse + \hv@extern@showFilenamefalse} \end{verbatim} -With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code} is automatically set to false. The +With the setting \LKeyset{inline=true} the optional keyword \Lkeyword{code} +is automatically set to false. The next Chinese characters \begin{externalDocument}[ compiler=xelatex, inline, runs=2, grfOptions={height=8pt}, - crop, cropmargin=0, cleanup, force=false, docType=latex]{voss}% + crop, cropmargin=0, + cleanup, force=false, docType=latex]{voss}% \documentclass{ctexart} \pagestyle{empty} \begin{document} @@ -1006,8 +1034,8 @@ are inserted as \Index{inline image} without showing the code. The complete code \begin{Verbatim} -With \Lkeyset{inline} the optional argument \Lkeyword{code} is automatically set to false. The -next Chinese characters +With \Lkeyset{inline} the optional argument \Lkeyword{code} is +automatically set to false. The next Chinese characters \begin{externalDocument}[ compiler=xelatex, inline, runs=2, grfOptions={height=8pt}, crop, cropmargin=0, cleanup, force=false, docType=latex]{voss} @@ -1017,7 +1045,8 @@ next Chinese characters 美好的一天 \end{document} \end{externalDocument} -are inserted as inline image without showing the code. The complete code looks like: +are inserted as inline image without showing the code. The complete +code looks like: \end{Verbatim} @@ -1049,7 +1078,7 @@ sorted digits of the number $A$: $495=954-459$. \begin{externalDocument}[ compiler=perl, force=false, docType=pl, ext=pl, includegraphic=false, - code, mpwidth=0.6\linewidth]{voss} + code, mpwidth=0.6\linewidth, showFilename=false]{voss} #!/usr/bin/perl # # Herbert Voss 2005-05-31 @@ -1103,7 +1132,8 @@ outFile = io.open(shortFN..".txt","w+") -- open external file \begin{externalDocument}[ - compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false, code, usefancyvrb=false]{voss} + compiler=lua, force=false, docType=lua, ext=lua, includegraphic=false, + code, usefancyvrb=false,textOptions={basicstyle=\ttfamily\footnotesize}]{voss} #!/usr/bin/env lua local filename = arg[0] local shortFN = filename:match("(.+)%..+") @@ -1181,6 +1211,7 @@ The following examples uses xindexOptions={-l DE --config AU}, mpwidth=0.6\linewidth, usefancyvrb=false, + showFilename=false, docType=latex]{voss} \documentclass[paper=a6,DIV=18,parskip=half-]{screxa} \pagestyle{empty} @@ -1228,6 +1259,7 @@ runsequence={lualatex,biber,{xindex -l de -c AU},lualatex,lualatex} \begin{externalDocument}[ grfOptions={width=0.30\linewidth}, pages={1,3,5}, + pagesep=2pt, frame, runsequence={lualatex,biber,xindex -l de -c AU,lualatex,lualatex}, showFilename, @@ -1382,6 +1414,26 @@ it makes no difference using the optional argument \Lkeyword{usefancyvrb} or not \end{externalDocument} +%\clearpage + + +\subsection{Vertical space} + +\begin{verbatim} +\define@key{hv}{aboveskip}[\medskipamount]{\setlength\hv@extern@aboveskip{#1}} +\define@key{hv}{belowpreambleskip}[\smallskipamount]{\setlength\hv@extern@belowpreambleskip{#1}} +\define@key{hv}{belowbodyskip}[\smallskipamount]{\setlength\hv@extern@belowbodyskip{#1}} +\define@key{hv}{belowskip}[\medskipamount]{\setlength\hv@extern@belowskip{#1}} +\end{verbatim} + +\begin{description} +\item[\Lkeyword{aboveskip}] Vertical space \emph{before} the environment \Lenv{externalDocument} or + the command \Lcs{runExtCmd} (default \Lcs{medskipamount}) +\item[\Lkeyword{belowpreambleskip}] Vertical space between preamble and body (default \Lcs{smallskipamount}) +\item[\Lkeyword{belowbodyskip}] Vertical space between body and output (default \Lcs{smallskipamount}) +\item[\Lkeyword{belowskip}] Vertical space \emph{after} the environment \Lenv{externalDocument} or + the command \Lcs{runExtCmd} (default \Lcs{medskipamount}) +\end{description} \section{Supported engines} \subsection{\MP\ example} @@ -1525,6 +1577,7 @@ This is the start of the introduction. \begin{externalDocument}[ grfOptions={width=0.3\linewidth}, pages={1,2,3}, + pagesep=2pt, frame, verbose=false, compiler=context, @@ -1596,6 +1649,7 @@ already exists, there is no need to create it with the next run again and again. \item[\Lkeyword{ExamplesDir}] move all examples into a directory \item[\Lkeyset{tclbox=false}] Can be used if there are some negative interactions between package \Lpack{listings} and package \Lpack{tcolorbox}. +\item[\Lkeyword{framesep}] Value for \Lcs{fbox} if keyword \texttt{frame} is used. \item[\Lkeyword{mpsep}] Distance between code and output (default 1\,em). \item[\Lkeyword{pagesep}] Distance between pages for multipage output (default 1\,em). \item[\Lkeyword{eps}] create an eps from the pdf (historical). diff --git a/macros/latex/contrib/hvextern/latex/hvextern.sty b/macros/latex/contrib/hvextern/latex/hvextern.sty index 2f7fb9d6ff..0b6eafa6c6 100644 --- a/macros/latex/contrib/hvextern/latex/hvextern.sty +++ b/macros/latex/contrib/hvextern/latex/hvextern.sty @@ -11,10 +11,11 @@ %% and version 1.3c or later is part of all distributions of LaTeX %% version 2005/12/01 or later. -\def\hvexternFileversion{0.24} -\ProvidesFile{hvextern}[2022/05/11 v\hvexternFileversion: package for running external documents (HV)] +\def\hvexternFileversion{0.25} +\ProvidesFile{hvextern}[2022/05/19 v\hvexternFileversion: package for running external documents (HV)] -\RequirePackage{shellesc,xkeyval,graphicx,marginnote,fancyvrb,tikz,listings,ifplatform} +\RequirePackage{shellesc,xkeyval,graphicx} +\RequirePackage{fancyvrb,tikz,listings,ifplatform} \RequirePackage{tcolorbox,xparse} \tcbuselibrary{skins,breakable} @@ -30,8 +31,15 @@ \newcounter{@@@runs} \newsavebox\hv@extern@box \newlength\hv@LineWidth +\newlength\hv@TextWidth \newlength\hv@extern@pagesep \newlength\hv@extern@mpsep +\newlength\hv@extern@framesep +\newlength\hv@extern@aboveskip +\newlength\hv@extern@belowpreambleskip +\newlength\hv@extern@belowbodyskip +\newlength\hv@extern@belowskip + \AtBeginDocument{\setlength\hv@LineWidth{\dimexpr\linewidth-2\fboxsep-2\fboxrule}} \newlength\hv@extern@mpwidth \setlength\hv@extern@mpwidth{\z@} @@ -40,11 +48,18 @@ \define@key{hv}{runs}[1]{\setcounter{hv@extern@runs}{#1}} \define@key{hv}{grfOptions}[]{\def\hv@extern@grfOptions{#1}} \define@key{hv}{lstOptions}[]{\def\hv@extern@lstOptions{#1}} +\define@key{hv}{textOptions}[]{\def\hv@extern@textOptions{#1}} \define@key{hv}{BGpreamble}[black!12]{\def\hv@extern@BGpreamble{#1}} \define@key{hv}{BGbody}[black!8]{\def\hv@extern@BGbody{#1}} \define@key{hv}{BOpreamble}[black!12]{\def\hv@extern@BOpreamble{#1}} \define@key{hv}{BObody}[black!8]{\def\hv@extern@BObody{#1}} \define@key{hv}{docType}[latex]{\def\hv@extern@docType{#1}} +%\define@choicekey*+{hv}{docType}[\val\nr]{latex,mp,tex,py,pl,lua,java,context,sh}[latex]{% +% \hv@typeout{>>>> ´doc type \nr}% +% \def\hv@extern@docType{\val}% +%}{\PackageWarning{hvextern}{erroneous input (#1) for docType ignored. Using latex.}% +% \def\hv@extern@docType{latex}% +% } \define@key{hv}{caption}[]{\def\hv@extern@caption{#1}} \define@key{hv}{label}[]{\def\hv@extern@label{#1}} \define@key{hv}{pages}[1]{\def\hv@extern@pages{#1}} @@ -65,10 +80,11 @@ \define@boolkey{hv}[hv@extern@]{xindex}[true]{} \define@key{hv}{xindexOptions}[]{\def\hv@extern@xindexOptions{#1}} \define@boolkey{hv}[hv@extern@]{includegraphic}[true]{} -\define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse} +\define@boolkey{hv}[hv@extern@]{inline}[true]{\hv@extern@codefalse\hv@extern@showFilenamefalse} \define@boolkey{hv}[hv@extern@]{frame}[true]{} +\define@key{hv}{framesep}[\the\fboxsep]{\setlength\hv@extern@framesep{#1}} \define@boolkey{hv}[hv@extern@]{float}[true]{} -%\define@boolkey{hv}[hv@extern@]{cleanup}[true]{} +\define@key{hv}{floatsetting}[]{\def\hv@extern@floatsetting{#1}} \define@key{hv}{cleanup}[{aux,log}]{\def\hv@extern@cleanup{#1}}% \define@boolkey{hv}[hv@extern@]{moveToExampleDir}[true]{} \define@key{hv}{align}[\centering]{\def\hv@extern@align{#1}} @@ -82,7 +98,6 @@ \define@boolkey{hv}[hv@extern@]{eps}[true]{} \define@boolkey{hv}[hv@extern@]{verbose}[true]{} \def\hv@typeout#1{\ifhv@extern@verbose\typeout{#1}\fi} - %\define@key{hv}{compiler}[pdflatex]{\def\hv@extern@compiler{#1}} \define@choicekey*+{hv}{compiler}[\val\nr]{mpost,tex,latex,luatex,python3,perl,lua,java,% xetex,pdflatex,lualatex,xelatex,context,sh,texlua}[pdflatex]{% @@ -93,6 +108,10 @@ \def\hv@extern@compiler{pdflatex}% \def\hv@extern@compilerNo{9}% } +\define@key{hv}{aboveskip}[\medskipamount]{\setlength\hv@extern@aboveskip{#1}} +\define@key{hv}{belowpreambleskip}[\smallskipamount]{\setlength\hv@extern@belowpreambleskip{#1}} +\define@key{hv}{belowbodyskip}[\smallskipamount]{\setlength\hv@extern@belowbodyskip{#1}} +\define@key{hv}{belowskip}[\medskipamount]{\setlength\hv@extern@belowskip{#1}} \def\ResetKeys{% \setkeys{hv}{% @@ -105,6 +124,7 @@ tcbox=true,% use tcolorbox grfOptions={},% Optionen der einzubindenden Grafik lstOptions={},% Optionen für das Listing + textOptions={},% Options for text output BGpreamble=black!12,% Backgroundcolor for preamble BGbody=black!8,% Backgroundcolor for body BOpreamble=black!12,% Bodercolor for preamble @@ -118,7 +138,9 @@ xindexOptions={},% options for xindex force=false,% Compiler, auch wenn PDF existiert? frame=false,% keinen Rahmen um Abbildung + framesep=\the\fboxsep,% float=false,% nicht als Gleitumgebung + floatsetting=!htb,% placement caption=,% keine Caption label=,% kein Label pages=1,% welche Seiten auszugeben sind @@ -129,11 +151,16 @@ ExampleDir=Examples,% Unterverzeichnis für Beispiele align=\centering,% Ausgabe zentrieren mpwidth=0pt,% no minipage + mpsep=1em,% sep between two minipages mpvalign=t,% if side by side output the vertical alignment usefancyvrb=false,% use VerbatimInput instead of listings progpath={}, cropmargin=2,% 2pb margin eps=false,% create an eps output? + aboveskip=\medskipamount,% space above everything + belowpreambleskip=\smallskipamount,% space below preamble + belowbodyskip=\smallskipamount,% space below body + belowskip=\medskipamount,% space below everything }% } @@ -167,10 +194,14 @@ \lstset{belowskip=0pt,aboveskip=0pt}% global \tcbset{breakable,left=2pt,right=2pt,top=2pt,bottom=2pt,boxsep=0pt} +\def\hv@marginpar#1{% + \makebox[\dimexpr\hv@TextWidth+\marginparsep-1ex][r]{\makebox(0,0){\rotatebox[origin=lb]{90}{#1}}}% +} + \newcommand\PreambleVerbatim[2][]{% \hv@typeout{Running PreambleVerbatim with #1, #2}% \ifhv@extern@tcbox - \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}% + \begin{tcolorbox}[before skip=0pt,after skip=0pt]\VerbatimInput[#1]{#2}\end{tcolorbox}% \else \VerbatimInput[#1]{#2} \fi} @@ -178,7 +209,7 @@ \newcommand\BodyVerbatim[2][]{% \hv@typeout{Running BodyVerbatim with #1, #2}% \ifhv@extern@tcbox - \begin{tcolorbox}\VerbatimInput[#1]{#2}\end{tcolorbox}% + \begin{tcolorbox}[before skip=0pt,after skip=0pt]\VerbatimInput[#1]{#2}\end{tcolorbox}% \else \VerbatimInput[#1]{#2} \fi} @@ -186,17 +217,19 @@ \newcommand\PreambleListing[2][]{% \hv@typeout{Running PreambleListing with #1, #2}% \ifhv@extern@tcbox - \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}% + \begin{tcolorbox}[before skip=0pt,after skip=0pt%,top=-2pt + ]\expandafter\lstinputlisting\expandafter[#1,aboveskip=0pt,belowskip=0pt]{#2}\end{tcolorbox}% \else - \expandafter\lstinputlisting\expandafter[#1]{#2}% + \expandafter\lstinputlisting\expandafter[#1,aboveskip=0pt,belowskip=0pt]{#2}% \fi} \newcommand\BodyListing[2][]{% \hv@typeout{Running BodyListing with #1, #2}% \ifhv@extern@tcbox - \begin{tcolorbox}[top=-2pt]\expandafter\lstinputlisting\expandafter[#1]{#2}\end{tcolorbox}% + \begin{tcolorbox}[before skip=0pt,after skip=0pt,%top=-2pt + ]\expandafter\lstinputlisting\expandafter[#1,aboveskip=0pt,belowskip=0pt]{#2}\end{tcolorbox}% \else - \expandafter\lstinputlisting\expandafter[#1]{#2}% + \expandafter\lstinputlisting\expandafter[#1,aboveskip=0pt,belowskip=0pt]{#2}% \fi} \newcounter{hv@example@counter} @@ -382,20 +415,26 @@ \fi \fi% end force \ifhv@extern@code%-------------- Code Part - \hv@typeout{>>>>Starting Code part ...}% - \par\noindent + \hv@typeout{>>>>Starting Code part with preamble ...}% \begingroup - \ifdim\hv@extern@mpwidth>\z@ \minipage[\hv@extern@mpvalign]{\hv@extern@mpwidth}\vspace{0pt}\fi - \ifhv@extern@usefancyvrb + \hv@TextWidth=\textwidth + \ifdim\hv@extern@mpwidth>\z@ + \noindent + \minipage[\hv@extern@mpvalign]{\hv@extern@mpwidth} + \vspace{0pt}% + \else + \vspace{\hv@extern@aboveskip}\noindent + \fi + \ifhv@extern@usefancyvrb \@nameuse{\hv@extern@docType @initPreambleFancy}% \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% % we need lstinputlisting, because \VerbatimInput doesn't work in a box \savebox\hv@extern@box{\expandafter\lstinputlisting\expandafter[\@@@temp]{\hvExternDateiname\hv@extern@ext}}% -% \savebox\hv@extern@box{\VerbatimInput{\hvExternDateiname\hv@extern@ext}}% \ifdim\wd\hv@extern@box > \z@\relax \expandafter\fvset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% \PreambleVerbatim{\hvExternDateiname\hv@extern@ext}% + \vspace{\hv@extern@belowpreambleskip}% \fi \else \edef\@@@temp{\@nameuse{\hv@extern@docType @initPreamble}}% @@ -404,30 +443,35 @@ \expandafter\lstset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGpreamble,colframe=\hv@extern@BOpreamble}% \PreambleListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% + \vspace{\hv@extern@belowpreambleskip}% \fi \fi \ifhv@extern@showFilename - \marginnote{\rotatebox{90}{\hvExternDateiname\hv@extern@ext}}%[-15mm]% + \hv@typeout{>>>> Set filename in the margin!}% + \noindent + \hv@marginpar{\hvExternDateiname\hv@extern@ext}% \fi % + \hv@typeout{>>>>Starting Code body ...}%} \ifhv@extern@usefancyvrb \@nameuse{\hv@extern@docType @initTextFancy}% \expandafter\fvset\expandafter{\hv@extern@lstOptions}% \tcbset{colback=\hv@extern@BGbody,colframe=\hv@extern@BObody}% \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hvExternDateiname\hv@extern@ext}% - \else + \else \expandafter\lstset\expandafter{\hv@extern@lstOptions}% \edef\@@@temp{\@nameuse{\hv@extern@docType @initText}}% \tcbset{colback=\hv@extern@BGbody,colframe=\hv@extern@BObody}% \BodyListing[\@@@temp]{\hvExternDateiname\hv@extern@ext}% - \fi - \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi - \endgroup + \fi + \ifdim\hv@extern@mpwidth > \z@\relax \endminipage\fi + \endgroup \fi % end code part \ifhv@extern@code\else % only if no code \ifhv@extern@showFilename \hv@typeout{>>>> Set filename in the margin!}% - \marginnote{\rotatebox{90}{\hvExternDateiname}}% + \noindent + \hv@marginpar{\hvExternDateiname\hv@extern@ext}% \fi \fi \ifhv@extern@moveToExampleDir @@ -442,31 +486,37 @@ \else \ifhv@extern@float \hv@typeout{>>>> Floating environment}% - \begin{figure}[!htb] + \expandafter\figure\expandafter[\hv@extern@floatsetting] \else \hv@typeout{>>>> No floating environment}% + \vspace{\hv@extern@belowbodyskip} \ifdim\hv@extern@mpwidth>\z@ \hfill\minipage[\hv@extern@mpvalign]{\dimexpr\linewidth-\hv@extern@mpwidth-1em\relax}\vspace{0pt}% \else - \par\noindent\begingroup + \vspace{\hv@extern@belowbodyskip}\noindent + \begingroup \fi \fi \hv@extern@align \hv@typeout{>>>> Input image \hv@extern@ExamplesDir\hvExternDateiname}% \ifhv@extern@frame + \begingroup + \fboxsep=\hv@extern@framesep \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% - \fbox{\expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]{\hv@extern@ExamplesDir\hvExternDateiname}}% - \hspace{\hv@extern@pagesep}}\hspace*{-\hv@extern@pagesep}% + \fbox{\expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]% + {\hv@extern@ExamplesDir\hvExternDateiname}}\hspace{\hv@extern@pagesep}}% + \hspace*{-\hv@extern@pagesep}% + \endgroup \else \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% \expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]% - {\hv@extern@ExamplesDir\hvExternDateiname}% - \hspace{\hv@extern@pagesep}}\hspace*{-\hv@extern@pagesep}% + {\hv@extern@ExamplesDir\hvExternDateiname}\hspace{\hv@extern@pagesep}}% + \hspace*{-\hv@extern@pagesep}% \fi \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi \ifhv@extern@float - \end{figure}% + \endfigure \else \ifdim\hv@extern@mpwidth>\z@ \endminipage\else\par\endgroup\fi \fi @@ -474,28 +524,26 @@ \else% no graphic, only text \ifdim\hv@extern@mpwidth>\z@ \hfill\minipage[t]{\dimexpr\linewidth-\hv@extern@mpwidth-\hv@extern@mpsep\relax}\vspace{0pt} - \noindent \ifhv@extern@usefancyvrb - \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% + \expandafter\VerbatimInput\expandafter[\hv@extern@textOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% \else - \expandafter\BodyListing\expandafter[\hv@extern@lstOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% + \expandafter\lstinputlisting\expandafter[\hv@extern@textOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% \fi \endminipage \else + \vspace{\hv@extern@belowbodyskip} \noindent \ifhv@extern@usefancyvrb - \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% + \expandafter\VerbatimInput\expandafter[\hv@extern@textOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% \else - \expandafter\BodyListing\expandafter[\hv@extern@lstOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% + \expandafter\lstinputlisting\expandafter[\hv@extern@textOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt}% \fi \fi \fi \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup + \vspace{\hv@extern@belowskip}% } -\stepcounter{hv@example@counter}% - - \newcommand\runExtCmd[3][]{% \begingroup \setkeys{hv}{code=false,includegraphic=false,#1}% @@ -514,7 +562,7 @@ \else \ifhv@extern@float \hv@typeout{>>>> Floating environment}% - \begin{figure}[!htb] + \expandafter\figure\expandafter[\hv@extern@floatsetting] \else \hv@typeout{>>>> No floating environment}% \par\noindent\begingroup @@ -522,9 +570,12 @@ \hv@extern@align \hv@typeout{>>>> Input image \hv@extern@ExamplesDir\hvExternDateiname}% \ifhv@extern@frame + \begingroup + \fboxsep=\hv@extern@framesep \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% \fbox{\expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]{\hv@extern@ExamplesDir\hvExternDateiname}}% \hspace{5pt}}\hspace*{-5pt}% + \endgroup \else \expandafter\@for\expandafter\next\expandafter:\expandafter=\hv@extern@pages\do{% \expandafter\includegraphics\expandafter[\hv@extern@grfOptions,page=\next]% @@ -534,7 +585,7 @@ \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi \ifhv@extern@float - \end{figure}% + \endfigure \else \ifdim\hv@extern@mpwidth>\z@ \endminipage\else\par\endgroup\fi \fi @@ -542,7 +593,7 @@ \else% no graphic, only text \ifhv@extern@float \hv@typeout{>>>> Floating environment}% - \begin{figure}[!htb] + \expandafter\figure\expandafter[!htb] \ifhv@extern@usefancyvrb \expandafter\BodyVerbatim\expandafter[\hv@extern@lstOptions]{\hv@extern@ExamplesDir\hvExternDateiname.txt} \else @@ -550,7 +601,7 @@ \fi \ifx\hv@extern@caption\@empty\else\caption{\hv@extern@caption}\fi \ifx\hv@extern@label\@empty\else\label{\hv@extern@label}\fi - \end{figure} + \endfigure \else \noindent \ifhv@extern@usefancyvrb @@ -563,6 +614,9 @@ \ifhv@extern@force\expandafter\run@hv@extern@cleanup\expandafter{\hv@extern@cleanup}\fi% cleanup \endgroup } + +\stepcounter{hv@example@counter}% + % %% \endinput |