summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-07-04 20:28:44 +0000
committerKarl Berry <karl@freefriends.org>2024-07-04 20:28:44 +0000
commit3899d4e526165b116f9a21d8e52f33e3011b46ce (patch)
treed804a4517e8e9857b7587c0316a52a227723879c /Master
parent09685736164d3e686f2b6805ea4559a132efca9d (diff)
longmath (4jul24)
git-svn-id: svn://tug.org/texlive/trunk@71709 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/lualatex/longmath/README6
-rw-r--r--Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls4
-rw-r--r--Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua2
-rw-r--r--Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdfbin175384 -> 165236 bytes
-rw-r--r--Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex68
-rw-r--r--Master/texmf-dist/tex/lualatex/longmath/longmath.lua13
-rw-r--r--Master/texmf-dist/tex/lualatex/longmath/longmath.sty11
7 files changed, 44 insertions, 60 deletions
diff --git a/Master/texmf-dist/doc/lualatex/longmath/README b/Master/texmf-dist/doc/lualatex/longmath/README
index da1e5228912..5699c68b84c 100644
--- a/Master/texmf-dist/doc/lualatex/longmath/README
+++ b/Master/texmf-dist/doc/lualatex/longmath/README
@@ -23,16 +23,12 @@ 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.
-
(c) 2024 Hans-Jürgen Matschull [ hjm.tex@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
diff --git a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls
index 04ce8b2e3d7..6ff03fc0948 100644
--- a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls
+++ b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.cls
@@ -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}}
diff --git a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua
index e334cc2e573..56da1ef4d06 100644
--- a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua
+++ b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.lua
@@ -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
--
diff --git a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf
index 2d82bd0a3f8..84093de4363 100644
--- a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf
+++ b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex
index 8e64064d87e..516e1d22cf8 100644
--- a/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex
+++ b/Master/texmf-dist/doc/lualatex/longmath/longmath-doc.tex
@@ -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 @@ or across the whole document.
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 @@ critics and suggestions.
\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@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 @@ critics and suggestions.
\lineskip 2pt plus 1pt
\lineskiplimit 2pt
-\newpage
+\newpage
\section{Delimiters}
\label{delims}
@@ -142,6 +138,8 @@ The \p{longmath} package provides ``long'' versions of the "\left" and "\right"
\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,61 +665,51 @@ If the nesting level exceeds the number of sample pairs provided, the outermost
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.
-\begin{code}
- $$ \lleft* 2 + \lleft( 1 + \lleft* 3
- + \lleft* 2 + \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* $$
-\end{exec}
-A pair that is not in the collection is ignored and the counting continues at the next level.
+And here two levels are skipped.
\begin{code}
- $$ \lleft* 4 + \lleft* 3 + \lleft\uparrow 0
- + \lleft* 2 + \lleft* 1 + A \rright* + B \rright*
- + C \rright\downarrow + 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* 4 + \lleft* 3 + \lleft\uparrow 0
- + \lleft* 2 + \lleft* 1 + A \rright* + B \rright*
- + C \rright\downarrow + 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}
-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.
+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 * \frac{ n+1 }{ n^2 } \rright * ^2
+ \lleft * \frac{ n }{ \lleft * n - 1 \rright *^2 } %%%
@@ -743,7 +731,7 @@ If the outer brackets are aligned, both become second level brackets.
+ \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 @@ To make this look a bit nicer, you can add some extra space to the width of the
$$ \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] $$
diff --git a/Master/texmf-dist/tex/lualatex/longmath/longmath.lua b/Master/texmf-dist/tex/lualatex/longmath/longmath.lua
index 56c64c8cdb1..05524096cac 100644
--- a/Master/texmf-dist/tex/lualatex/longmath/longmath.lua
+++ b/Master/texmf-dist/tex/lualatex/longmath/longmath.lua
@@ -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 @@ local function set_delim( head, level, ht, dp )
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
diff --git a/Master/texmf-dist/tex/lualatex/longmath/longmath.sty b/Master/texmf-dist/tex/lualatex/longmath/longmath.sty
index 2b4848db3c0..47a99ce8fa5 100644
--- a/Master/texmf-dist/tex/lualatex/longmath/longmath.sty
+++ b/Master/texmf-dist/tex/lualatex/longmath/longmath.sty
@@ -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@info{\mathstyle} \special{\longmath@comm}
\longmath@type\bgroup \longmath@left . \aftergroup\egroup \aftergroup\endgroup
\begingroup \setattribute\longmath@info{\ifnum \longmath@yscale < 1 \longmath@xscale \else \longmath@yscale \fi}
- \hbox to -\nulldelimiterspace{} \endgroup
- \longmath@right }
+ \hbox{} \endgroup \longmath@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@extra is non-zero, Lua will stack the lines of the paragraph.
\def\longmath@end{$\egroup
\ifdim \wd\longmath@box < \dimexpr \longmath@width + \longmath@extra \relax