texlive[71709] Master/texmf-dist: longmath (4jul24)

commits+karl at tug.org commits+karl at tug.org
Thu Jul 4 22:28:45 CEST 2024


Revision: 71709
          https://tug.org/svn/texlive?view=revision&revision=71709
Author:   karl
Date:     2024-07-04 22:28:44 +0200 (Thu, 04 Jul 2024)
Log Message:
-----------
longmath (4jul24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/lualatex/longmath/README
    trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls
    trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua
    trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf
    trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex
    trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.lua
    trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.sty

Modified: trunk/Master/texmf-dist/doc/lualatex/longmath/README
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/longmath/README	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/doc/lualatex/longmath/README	2024-07-04 20:28:44 UTC (rev 71709)
@@ -23,16 +23,12 @@
 expressions to be placed inside a displayed equation and make TeX 
 do the line splitting and alignment. 
 
-This is the first and in parts still experimental version. If anyone 
-actually uses it, the author would be happy to receive bug reports, 
-critics and suggestions.
-
 (c) 2024 Hans-Jürgen Matschull  [ hjm.tex at matschull.net ]
 
 This work may be distributed and/or modified under the conditions 
 of the LaTeX Project Public License version 1.3 or later. 
 
-The following files belong to the longmath package version 0.1:
+The following files belong to the longmath package version 1.0:
 
 package and documentation: longmath.sty longmath.lua longmath-doc.pdf 
 

Modified: trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls	2024-07-04 20:28:44 UTC (rev 71709)
@@ -1,5 +1,5 @@
 %%
-%%  longmath-doc.cls is part of longmath version 0.1. 
+%%  longmath-doc.cls is part of longmath version 1.0. 
 %%
 %%  (c) 2024 Hans-Jürgen Matschull
 %%
@@ -18,7 +18,7 @@
 %%  see README for a list of files belonging to longmath.
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesClass{longmath-doc}[2024/03/25]
+\ProvidesClass{longmath-doc}[2024/07/04]
 \LoadClass[a4paper,10pt]{scrartcl}
 \RequirePackage{geometry}
 \geometry{hmargin=20mm,vmargin={20mm,30mm}}

Modified: trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua	2024-07-04 20:28:44 UTC (rev 71709)
@@ -1,5 +1,5 @@
 --
---  longmath-doc.lua is part of longmath version 0.1. 
+--  longmath-doc.lua is part of longmath version 1.0. 
 --
 --  (c) 2024 Hans-Jürgen Matschull
 --

Modified: trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex	2024-07-04 20:28:44 UTC (rev 71709)
@@ -1,5 +1,5 @@
 %%
-%%  longmath-doc.tex is part of longmath version 0.1. 
+%%  longmath-doc.tex is part of longmath version 1.0. 
 %%
 %%  (c) 2024 Hans-Jürgen Matschull
 %%
@@ -46,10 +46,6 @@
 A special environment is provided as well, which allows multi line
 expressions to be placed inside a displayed equation and make \TeX\ 
 do the line splitting and alignment. 
-
-This is the first and in parts still experimental version. If anyone 
-actually uses it, the author would be happy to receive bug reports, 
-critics and suggestions.
 }
 
 \newcommand{\icol}[1]{% inline column vector
@@ -116,10 +112,10 @@
    \node[color=yellow!85!black,rotate=-17,scale=1.8] at (-0.7,0) 
      {$\displaystyle \mathcal{L} = \begin{longmath}[t]{110mm+30mm} \lagrange \end{longmath}$};
    \node[txt,scale=1.8] at (0,7.2) {\Huge\textbf{\p{longmath}}};
-   \node[txt,scale=1.2] at (0,5.4) {\Large Documentation for Version 0.1};
+   \node[txt,scale=1.2] at (0,5.4) {\Large Documentation for Version 1.0};
    \node[txt,scale=1.2] at (0,4.0) {\large Hans-Jürgen Matschull};
    \node[txt,scale=1.2] at (0,3.3) {\texttt{hjm.tex at matschull.net}};
-   \node[txt,scale=1.2] at (0,1.7) {\texttt{2024/03/25}};
+   \node[txt,scale=1.2] at (0,1.7) {\texttt{2024/07/04}};
    \node[txt,scale=1.0] at (0,-3) {\begin{minipage}{130mm}\parskip 1.3ex \intro\end{minipage}};
 \end{tikzpicture}
 \end{center}
@@ -130,7 +126,7 @@
 \lineskip 2pt plus 1pt
 \lineskiplimit 2pt 
 
-\newpage 
+\newpage
 
 \section{Delimiters}
 \label{delims}
@@ -142,6 +138,8 @@
 \comm{"\rright" [°scale°] °delimiter°} marks the end of a delimiter group and inserts a closing °delimiter°. 
 
 The optional °scale° argument will be explained below. The °delimiter° can be anything that is also accepted by "\left" and "\right", including a dot representing an invisible or null delimiter, any character with a "\delcode", or an explicit "\delimiter" or "\Udelimiter". If you want to use the \p{longmath} package with existing documents, or just stick to the familiar notation, and provided that this does not cause conflicts with other packages manipulating the original primitives, it is even save to say "\let\left\lleft" and "\let\right\rright". 
+
+Here is a simple example. Of course, as \LaTeX\ authors, we should better use some math environment instead of "$$", but let's stick to them here just to save some space, and indicate that everything should work regardless of what environment we use.   
 \begin{code}
   The Sellmann-Yokuzi contribution to the 
   Johansson Entropy is given by    
@@ -667,62 +665,52 @@
     D + \frac{ \lleft* X + Y \rright* × Z }{ W }  
     \rright* · E \rright* · F \rright* · G \rright* $$
 \end{exec}
-If variable delimiters are mixed with explicit delimiters, there is an interaction between them. If you use one of the pairs from the collection, it is treated as if it was inserted automatically. Any enclosing bracket will be the next one from the collection. Let's define a larger collection to demonstrate this. 
+Automatic delimiters can be mixed with explicit delimiters. When the nesting level is determined, only the "*" delimiters are taken into account. To demonstrate this, let's choose a different collection and set a negative value for "\delimitershortfall". This makes the bracket size increase linearly with the nesting level.
   \autodelimiters{ < \lceil \lfloor [ \{ ( * ) \} ] \rfloor \rceil > } 
 \begin{code*}
-  \autodelimiters{ < \lceil \lfloor [ \{ ( * ) \} ] \rfloor \rceil > } 
+  \delimitershortfall -2pt
+  \autodelimiters{ < \lceil \lfloor [ \{ ( * ) \} ] \rfloor \rceil > }
 \end{code*}
-This is what we get with automatic brackets only. The numbers indicate the actually used level. A negative value for "\delimitershortfall" makes the bracket size increase linearly with the nesting level.
+This is what we get with automatic brackets only. The numbers indicate the actually used level.
 \begin{code}
-  \delimitershortfall -2pt
   $$ \lleft* 5 + \lleft* 4 + \lleft* 3 
    + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
    + C \rright* + D \rright* + E \rright* $$
 \end{code}
-\begin{exec}
+\begin{exec}\:
   \delimitershortfall -2pt
   $$ \lleft* 5 + \lleft* 4 + \lleft* 3 
    + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
    + C \rright* + D \rright* + E \rright* $$
 \end{exec}
-If we replace the second level by explicit square brackets, these are identified as the third level, and the counting continues from there. 
+If we replace the second level by explicit square brackets, the counting continues at the third level.
 \begin{code}
-  $$ \lleft* 6 + \lleft* 5 + \lleft* 4 
-   + \lleft[ 3 + \lleft* 1 + A \rright* + B \rright] 
+  $$ \lleft* 4 + \lleft* 3 + \lleft* 2
+   + \lleft[ 0 + \lleft* 1 + A \rright* + B \rright]
    + C \rright* + D \rright* + E \rright* $$
 \end{code}
 \begin{exec}\:
   \delimitershortfall -2pt
-  $$ \lleft* 6 + \lleft* 5 + \lleft* 4 
-   + \lleft[ 3 + \lleft* 1 + A \rright* + B \rright] 
+  $$ \lleft* 4 + \lleft* 3 + \lleft* 2
+   + \lleft[ 0 + \lleft* 1 + A \rright* + B \rright]
    + C \rright* + D \rright* + E \rright* $$
 \end{exec}
-And here the counting restarts further out. 
+And here two levels are skipped.
 \begin{code}
-  $$ \lleft* 2 + \lleft( 1 + \lleft* 3 
-   + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
-   + C \rright* + D \rright) + E \rright* $$
+  $$ \lleft* 3 + \lleft| 0 + \lleft* 2
+   + \lleft[ 0 + \lleft* 1 + A \rright* + B \rright]
+   + C \rright* + D \rright| + E \rright* $$
 \end{code}
 \begin{exec}\:
   \delimitershortfall -2pt
-  $$ \lleft* 2 + \lleft( 1 + \lleft* 3 
-   + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
-   + C \rright* + D \rright) + E \rright* $$
+  $$ \lleft* 3 + \lleft| 0 + \lleft* 2
+   + \lleft[ 0 + \lleft* 1 + A \rright* + B \rright]
+   + C \rright* + D \rright| + E \rright* $$
 \end{exec}
-A pair that is not in the collection is ignored and the counting continues at the next level. 
+In the first experimental version of this packages, there was an interaction between automatic and explicit brackets. This has been removed. It didn't work well with linked groups, and it caused problems with bracktes used for purposes other than grouping, like function arguments, binomial coeffiecients etc.
+
+If automatic delimiters are tagged and aligned, this also applies to the chosen delimiter from the collection. Here is a typical example. Without tagging, we get this.
 \begin{code}
-  $$ \lleft* 4 + \lleft* 3 + \lleft\uparrow 0 
-   + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
-   + C \rright\downarrow + D \rright* + E \rright* $$
-\end{code}
-\begin{exec}\:
-  \delimitershortfall -2pt
-  $$ \lleft* 4 + \lleft* 3 + \lleft\uparrow 0 
-   + \lleft* 2 + \lleft* 1 + A \rright* + B \rright* 
-   + C \rright\downarrow + D \rright* + E \rright* $$
-\end{exec}
-If variable delimiters are tagged and aligned, this also applies to the chosen delimiter from the collection. Here is a typical example. Without tagging, we get this. 
-\begin{code}
   $$ \lleft * \frac{ n+1 }{ n^2 } \rright * ^2 
      + \lleft * \frac{ n }{ \lleft * n - 1 \rright *^2 }    %%%
                   \rright * ^2 $$  
@@ -743,7 +731,7 @@
      + \lleft {qx} * \frac{ n }{ \lleft * n - 1 \rright *^2} 
                   \rright * ^2 $$  
 \end{exec}
-As a last challenge, let's consider the array from the previous section with a slight modification. If we replace all brackets with variable delimiters, but do not link the cells, we get this. 
+As a last challenge, let's consider the array from the previous section with a slight modification. If we replace all brackets with automatic delimiters, but do not link the cells, we get this.
 \begin{code}
   $$ \begin{array}{dsdsdsd}
        \lleft * Z & - & \sum_k A & × & 
@@ -882,7 +870,7 @@
   $$ \lleft[ \begin{longmath}[c]{0.33+0.07}
                \polyA   
              \end{longmath} \rright] = 
-     \lleft[ \begin{longmath}[c]{0.33+0.0.7}
+     \lleft[ \begin{longmath}[c]{0.33+0.07}
                \lleft( \polyB \rright) \cdot  %%%
                \lleft( \polyC \rright)
              \end{longmath} \rright] $$

Modified: trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.lua	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.lua	2024-07-04 20:28:44 UTC (rev 71709)
@@ -1,5 +1,5 @@
 --
---  longmath.lua is part of longmath version 0.1. 
+--  longmath.lua is part of longmath version 1.0. 
 --
 --  (c) 2024 Hans-Jürgen Matschull
 --
@@ -141,15 +141,16 @@
   if brks then brks = brks[type] end 
   if type and auto and brks then 
     delim_set( delim, brks[level] ) 
-  elseif type and brks then  
-    level = nil 
-    for l = 1, #brks do if delim_eq( brks[l], delim ) then level = l break end end
   else
     level = nil 
   end  
   local scale = node.get_attribute( hbox, attr_info ) 
-  hbox.height, hbox.depth = ht * scale // 1000, dp * scale // 1000  
-  if delim_eq( delim, delim_null ) then hbox.width = hbox.width * 2 end 
+  hbox.height, hbox.depth = ht * scale // 1000, dp * scale // 1000
+  if delim_eq( delim, delim_null ) then
+    hbox.width = -2 * tex.dimen.nulldelimiterspace 
+  else 
+    hbox.width = -tex.dimen.nulldelimiterspace   
+  end 
   return level 
 end
 

Modified: trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.sty	2024-07-04 20:28:34 UTC (rev 71708)
+++ trunk/Master/texmf-dist/tex/lualatex/longmath/longmath.sty	2024-07-04 20:28:44 UTC (rev 71709)
@@ -1,5 +1,5 @@
 %%
-%%  longmath.sty is part of longmath version 0.1. 
+%%  longmath.sty is part of longmath version 1.0. 
 %%
 %%  (c) 2024 Hans-Jürgen Matschull
 %%
@@ -18,7 +18,7 @@
 %%  see README for a list of files belonging to longmath.
 %%
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{longmath}[2024/03/25]
+\ProvidesPackage{longmath}[2024/07/04]
 
 \RequirePackage{luatexbase}
 
@@ -89,8 +89,7 @@
   \setattribute\longmath at info{\mathstyle} \special{\longmath at comm}
   \longmath at type\bgroup \longmath at left . \aftergroup\egroup \aftergroup\endgroup
   \begingroup \setattribute\longmath at info{\ifnum \longmath at yscale < 1 \longmath at xscale \else \longmath at yscale \fi}
-  \hbox to -\nulldelimiterspace{} \endgroup  
-  \longmath at right }
+  \hbox{} \endgroup \longmath at right }
 
 
 % magic number to identify the variable delimiter. 
@@ -174,13 +173,13 @@
 }
 
 % End of longmath environment.
-% If the width of the box is smaller than the requsted width, just use it as is. 
+% If the width of the box is smaller than the requested width, just use it as is. 
 % Otherwise, modify the requested width if the * version was used. 
 % Then \unhbox the content into a paragraph with the requested width.
 % \box0 and \box1 are used to adapt the baselineskip to the math style. 
 % \leftskip and \rightskip are set such that lines are centered but not justified. 
 % The glue is removed from the beginning of the first line with \hskip,
-% and from the end of the last line with \parfilskip. 
+%    and from the end of the last line with \parfilskip. 
 % If \longmath at extra is non-zero, Lua will stack the lines of the paragraph. 
 \def\longmath at end{$\egroup
   \ifdim \wd\longmath at box < \dimexpr \longmath at width + \longmath at extra \relax 



More information about the tex-live-commits mailing list.