summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/luasseq
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-01-11 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2023-01-11 03:01:35 +0000
commitc1c19023b4b1d43cb874f84df5102b485853e672 (patch)
tree33fc2ba7b333a542ce25eeeb9167ee078dc12ac3 /macros/luatex/latex/luasseq
parentdecba0e4470fd7bfe288f98ee709553fc13014b8 (diff)
CTAN sync 202301110301
Diffstat (limited to 'macros/luatex/latex/luasseq')
-rw-r--r--macros/luatex/latex/luasseq/README7
-rw-r--r--macros/luatex/latex/luasseq/luasseq.dtx36
-rw-r--r--macros/luatex/latex/luasseq/luasseq.lua26
-rw-r--r--macros/luatex/latex/luasseq/luasseq.pdfbin224059 -> 149438 bytes
4 files changed, 49 insertions, 20 deletions
diff --git a/macros/luatex/latex/luasseq/README b/macros/luatex/latex/luasseq/README
index b6cb5d9204..4fab64cb27 100644
--- a/macros/luatex/latex/luasseq/README
+++ b/macros/luatex/latex/luasseq/README
@@ -1,6 +1,11 @@
-Version 2015-07-16 contains compatibility fixed for lualatex bundled with TeXLive 2014.
+Version 2023-01-10 bug fixed and compatibility update for Lua language version 5.3+ (LuaTeX 1.15).
+
+Luasseq is a latex package for typesetting spectral sequences, a diagrammatic representation of a mathematical structure from homological algebra.
+
+Author: Tilman Bauer (tilman@alum.mit.edu)
Required for use: luasseq.lua and luasseq.sty
To get luasseq.sty: lualatex luasseq.ins (requires luasseq.dtx)
To get the documentation luasseq.pdf: lualatex luasseq.dtx
+
diff --git a/macros/luatex/latex/luasseq/luasseq.dtx b/macros/luatex/latex/luasseq/luasseq.dtx
index 349ee9f9df..bee8c95120 100644
--- a/macros/luatex/latex/luasseq/luasseq.dtx
+++ b/macros/luatex/latex/luasseq/luasseq.dtx
@@ -3,7 +3,20 @@
% ^^A to produce the package file luasseq.sty.
% ^^A Then LaTeX this file to produce the documentation of the luasseq package.
% ^^A
-% ^^A (c) 2003-2010 Tilman Bauer. Freely distributable under the LaTeX Project Public License (LPPL)
+% ^^A This work may be distributed and/or modified under the
+% ^^A onditions of the LaTeX Project Public License, either version 1.3
+% ^^A of this license or (at your option) any later version.
+% ^^A The latest version of this license is in
+% ^^A http://www.latex-project.org/lppl.txt
+% ^^A and version 1.3 or later is part of all distributions of LaTeX
+% ^^A version 2005/12/01 or later.
+%
+% ^^A This work has the LPPL maintenance status `maintained'.
+%
+% ^^A The Current Maintainer of this work is Tilman Bauer.
+%
+% ^^A This work consists of the files luasseq.dtx, luasseq.ins, and luasseq.lua
+% ^^A and the derived files luasseq.sty and luasseq.pdf
% ^^A
% \ifthenelse{0=1}{
%<*never>
@@ -28,11 +41,13 @@
% \changes{v1.06}{August 1, 2005}{sseqxstep=0 will now suppress printing of horizontal label; similarly sseqystep=0 and vertical labels}
% \changes{v2.0a}{July 16, 2007}{Completely recoded the graphics for using pgf instead of xyPic. Many new features. Consult the manual.}
% \changes{v2.0}{April 9, 2009}{bug fix with arrows leaving the chart}
+% \changes{v2.2}{November 13, 2015}{compatibility fixes; new prefix system}
+% \changes{v2023/01/10}{January 10, 2023}{compatibility fixes for current Lua version; bug fixes}
% \ifthenelse{0=1}{
%<*package>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luasseq}[2010/11/06 ver 2.1]
+\ProvidesPackage{luasseq}[2023/01/10]
\RequirePackage{ifthen,calc,pifont}
\RequirePackage{pgf}[2006/01/01]
@@ -57,7 +72,7 @@
%
% \title{Typesetting spectral sequences in \LaTeX\ with luasseq.sty}
% \author{Tilman Bauer\footnote{tilman@alum.mit.edu}}
-% \date{November 6, 2010}
+% \date{January 10, 2023}
%
% \MakeShortVerb{\|}
%
@@ -341,16 +356,19 @@
% \fi
%
% \DescribeMacro{\ssprefix}
-% Often the mechanism provided by |\ssname|/|\ssgoto| is not flexible enough to deal with repeated code. In that case, |\ssprefix{|\meta{prefix}|}| defines a ``multiplier'' for all names that follow; i.e. a |\ssname{|\meta{name}|}| after such a command will really define a name \meta{prefix} \meta{name} (with a space in between, so that the order is irrelevant). However, since |\ssgoto| also observes the prefix, |\ssgoto{|\meta{name}|}| will still work. |\ssprefix| commands can be iterated; the prefices are then concatenated.
+% \DescribeMacro{\ssbeginprefixcontext}
+% \DescribeMacro{\ssendprefixcontext}
+% \DescribeMacro{\ssresetprefix}
+% Often the mechanism provided by |\ssname|/|\ssgoto| is not flexible enough to deal with repeated code. In that case, the prefix system can be used. |sseq| maintains a \emph{current prefix}, which is an unordered list of strings that is added to any name specified in |\ssname| or |\ssgoto|. For instance, if the current prefix is |a b|, then |\ssname{c}| will name the current element |a b c| (the order is irrelevant).
%
-% \iffalse
-\newcommand{\ssprefix}[1]{\directlua0{sseq_prefix("#1")}}
-% \fi
+% To define a prefix, you first start a \emph{prefix context} with the command |\ssbeginprefixcontext|. After that, |\ssprefix{|\meta{name}|}| will add \meta{name} to the current prefix. |\ssprefix| can be issued repeatedly to add to the current prefix. After issuing |\ssendprefixcontext|, the prefix that was in effect at |\ssbeginprefixcontext| will be restored. (If no prefix was defined before, this will be the empty prefix.) |\ssbeginprefixcontext| and |\ssendprefixcontext| can be nested and provide a stack behavior.
%
-% \DescribeMacro{\ssresetprefix}
-% This command resets the prefix defined by (a sequence of) |\ssprefix| to the empty prefix.
+% There is an older behavior that still works for compatibility reasons. In the older system, the commands |\ssbeginprefixcontext| and |\ssendprefixcontext| are not used; instead, |\ssresetprefix| will reset the current prefix to the empty prefix. |\ssresetprefix| does not work in the new prefix system and will emit an error message. The two methods cannot be mixed.
%
% \iffalse
+\newcommand{\ssprefix}[1]{\directlua0{sseq_prefix("#1")}}
+\newcommand{\ssbeginprefixcontext}{\directlua0{sseq_begin_prefix_context()}}
+\newcommand{\ssendprefixcontext}{\directlua0{sseq_end_prefix_context()}}
\newcommand{\ssresetprefix}{\directlua0{sseq_reset_prefix()}}
% \fi
%
diff --git a/macros/luatex/latex/luasseq/luasseq.lua b/macros/luatex/latex/luasseq/luasseq.lua
index 79082efce7..f0a34cd56b 100644
--- a/macros/luatex/latex/luasseq/luasseq.lua
+++ b/macros/luatex/latex/luasseq/luasseq.lua
@@ -347,7 +347,7 @@ function sseq_drop_object(x,y,shape,pathusage,content,col)
obj.wd,obj.ht = 262144,262144
obj.radius = 370727
else
- obj.cmd = "\\pgfsetstrokecolor{%s}\\pgfsetfillcolor{white}"..string.format("\\pgfnode{%s}{center}{\\color{%%s}\\ensuremath{%s}}{}{\\pgfusepath{fill,%s}}",obj.nodetype,obj.code,pathusage)
+ obj.cmd = "\\pgfsetstrokecolor{%s}\\pgfsetfillcolor{white}\\pgfsetshapeinnerxsep{1pt}\\pgfsetshapeinnerysep{1pt}"..string.format("\\pgfnode{%s}{center}{\\color{%%s}\\ensuremath{%s}}{}{\\pgfusepath{fill,%s}}",obj.nodetype,obj.code,pathusage)
tex.print (string.format("\\setbox%d=\\hbox{\\pgfinterruptpicture\\ensuremath{%s}\\endpgfinterruptpicture}",sseqboxno,obj.code))
tex.print("\\directlua0{sseq_register_size()}")
end
@@ -679,22 +679,22 @@ function sseq_correct_line_end(obj,fromx,fromy,curving)
if obj.nodetype == "circle" then
dist = math.sqrt(dirx*dirx + diry*diry)
- return posx - obj.radius*(dirx)/dist,
- posy - obj.radius*(diry)/dist
+ return math.floor(posx - obj.radius*(dirx)/dist),
+ math.floor(posy - obj.radius*(diry)/dist)
else
deltax = dirx/diry*obj.ht/2 -- no problem with infinity in LUA
deltay = diry/dirx*obj.wd/2
if(math.abs(deltax) <= obj.wd/2) then -- boundary point on one of the horizontal lines
if fromy > posy then
- return posx + deltax, posy + obj.ht/2
+ return math.floor(posx + deltax), math.floor(posy + obj.ht/2)
else
- return posx - deltax, posy - obj.ht/2
+ return math.floor(posx - deltax), math.floor(posy - obj.ht/2)
end
else
if fromx > posx then
- return posx + obj.wd/2, posy + deltay
+ return math.floor(posx + obj.wd/2), math.floor(posy + deltay)
else
- return posx - obj.wd/2, posy - deltay
+ return math.floor(posx - obj.wd/2), math.floor(posy - deltay)
end
end
end
@@ -775,16 +775,20 @@ function sseq_dump_connection(conn)
if fromobj then -- we have to be more careful where it ends
fromx,fromy = sseq_correct_line_end(fromobj,tox,toy,conn.curving)
+ else
+ fromx,fromy = math.floor(fromx),math.floor(fromy)
end
if toobj then
tox,toy = sseq_correct_line_end(toobj,fromx,fromy,conn.curving and -conn.curving)
+ else
+ tox,toy = math.floor(tox),math.floor(toy)
end
if conn.curving then
- ctrlx = tox/2+fromx/2-conn.curving*(toy-fromy)
- ctrly = toy/2+fromy/2+conn.curving*(tox-fromx)
+ ctrlx = math.floor(tox/2+fromx/2-conn.curving*(toy-fromy))
+ ctrly = math.floor(toy/2+fromy/2+conn.curving*(tox-fromx))
end
-
+
if conn.arrowfrom or conn.arrowto or conn.curving then -- got to use slow code
tex.print("\\pgfsetdash{"..conn.dashing.."}{0pt}")
tex.print("\\pgfsetstrokecolor{"..conn.color.."}")
@@ -815,6 +819,7 @@ function sseq_dump_connection(conn)
if (fromx and fromy) then
if (tox and toy) then
tex.print(string.format("\\pgfsys@moveto{%dsp}{%dsp}",fromx,fromy))
+
tex.print(string.format("\\pgfsys@lineto{%dsp}{%dsp}",tox,toy))
tex.print("\\pgfsys@stroke")
end
@@ -878,6 +883,7 @@ function sseq_dump_code()
end
-- objects
tex.print("\\color{white}") -- background fill color
+ tex.print("\\pgfsetdash{}{0pt}") -- reset dashing
for x,ylist in pairs(sseqobject) do
for y,olist in pairs(ylist) do
for z,obj in ipairs(olist) do
diff --git a/macros/luatex/latex/luasseq/luasseq.pdf b/macros/luatex/latex/luasseq/luasseq.pdf
index 6e487fcde6..6ec110e375 100644
--- a/macros/luatex/latex/luasseq/luasseq.pdf
+++ b/macros/luatex/latex/luasseq/luasseq.pdf
Binary files differ