summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-02-14 20:41:07 +0000
committerKarl Berry <karl@freefriends.org>2023-02-14 20:41:07 +0000
commit9b2e8688cfc8d5d22c7cc2fe7c0b689bdc4f33df (patch)
tree3fa92647dfff8e709a2540ca592b51811a902f83 /Master/texmf-dist/tex
parent38bd237038b48929721625a6dbe22ea3fa4e06e4 (diff)
luacomplex (14feb23)
git-svn-id: svn://tug.org/texlive/trunk@65833 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty16
1 files changed, 9 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty b/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty
index cbfe2aa0ed8..5ff32a61769 100644
--- a/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty
+++ b/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty
@@ -1,9 +1,9 @@
-% luatruthtable package
-% version 1.0
+% luacomplex package
+% version 1.2 Date: 14-Feb-2023
% Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt.
% Authors: Chetan Shirore and Ajit Kumar
-\ProvidesPackage{luacomplex}[1.0]
+\ProvidesPackage{luacomplex}[1.2]
\RequirePackage{xkeyval}
\RequirePackage{amsmath}
\RequirePackage{luacode}
@@ -78,15 +78,16 @@ setmetatable(_ENV, {__index = complex})
return ...
end
- function M.tostring (c)
+ function M.tostring (c,imgunit)
+ imgunit = "\\imgUnit"
if c.i ==0 then
return string.format("%g", c.r)
elseif c.i> 0 and c.i==1 then
- return string.format("%g+i", c.r)
+ return string.format("%g+"..imgunit, c.r)
elseif c.i> 0 and c.i~=1 then
- return string.format("%g+%gi", c.r, c.i)
+ return string.format("%g+%g"..imgunit, c.r, c.i)
else
- return string.format("%g%gi", c.r, c.i) --to avoid +-
+ return string.format("%g%g"..imgunit, c.r, c.i) --to avoid +-
end
end
@@ -157,4 +158,5 @@ setmetatable(_ENV, {__index = complex})
}%
}
+\newcommand{\imgUnit}{i}
\endinput \ No newline at end of file