texlive[65833] Master/texmf-dist: luacomplex (14feb23)
commits+karl at tug.org
commits+karl at tug.org
Tue Feb 14 21:41:07 CET 2023
Revision: 65833
http://tug.org/svn/texlive?view=revision&revision=65833
Author: karl
Date: 2023-02-14 21:41:07 +0100 (Tue, 14 Feb 2023)
Log Message:
-----------
luacomplex (14feb23)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.pdf
trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.tex
trunk/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty
Modified: trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.tex 2023-02-14 20:40:51 UTC (rev 65832)
+++ trunk/Master/texmf-dist/doc/lualatex/luacomplex/luacomplex.tex 2023-02-14 20:41:07 UTC (rev 65833)
@@ -20,7 +20,7 @@
\usepackage[backend=bibtex]{biblatex}
\begin{document}
\title{The luacomplex Package in LaTeX}
-\author{Chetan Shirore and Dr. Ajit Kumar}
+\author{Chetan Shirore and Ajit Kumar}
\maketitle
\section{Introduction}\label{section:introduction}
The \verb|luacomplex| package is developed to define complex numbers and perform basic arithmetic on complex numbers in LaTeX. It also loads the \texttt{luamaths} package. It provides an easy way to define complex numbers and perform operations on complex numbers. The package has no particular environment for performing operations on complex numbers. The package commands can be used in any environment (including the mathematics environment). It is written in Lua, and the tex file is to be compiled with the LuaLatex engine. The time required for operations on complex numbers is not an issue while compiling with LuaLaTeX. There is no need to install Lua on the users' system as tex distributions (TeXLive or MikTeX) come bundled with LuaLaTeX. It may also save users' efforts to copy complex numbers from other software (which may not be in latex-compatible format) and to use them in a tex file.
@@ -145,6 +145,7 @@
\label{tbl:luacomplex}
\end{longtable}
+The package has a command \verb|\imgUnit| which provides typesetting for the imaginary unit. Its default value is \(i\). It can be redefined. For example, one can redefine it as \verb|\renewcommand{\imgUnit}{\mathrm{i}}| or as \verb|\renewcommand{\imgUnit}{j}}|.
\section{Examples and Usage}
Modified: trunk/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty 2023-02-14 20:40:51 UTC (rev 65832)
+++ trunk/Master/texmf-dist/tex/lualatex/luacomplex/luacomplex.sty 2023-02-14 20:41:07 UTC (rev 65833)
@@ -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 @@
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 @@
}%
}
+\newcommand{\imgUnit}{i}
\endinput
\ No newline at end of file
More information about the tex-live-commits
mailing list.