texlive[65400] Master: luamaths (missed a few days ago)

commits+karl at tug.org commits+karl at tug.org
Fri Dec 30 00:10:32 CET 2022


Revision: 65400
          http://tug.org/svn/texlive?view=revision&revision=65400
Author:   karl
Date:     2022-12-30 00:10:32 +0100 (Fri, 30 Dec 2022)
Log Message:
-----------
luamaths (missed a few days ago)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/lualatex/luamaths/
    trunk/Master/texmf-dist/doc/lualatex/luamaths/README.txt
    trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.bib
    trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf
    trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.tex
    trunk/Master/texmf-dist/tex/lualatex/luamaths/
    trunk/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty
    trunk/Master/tlpkg/tlpsrc/luamaths.tlpsrc

Added: trunk/Master/texmf-dist/doc/lualatex/luamaths/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamaths/README.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamaths/README.txt	2022-12-29 23:10:32 UTC (rev 65400)
@@ -0,0 +1,18 @@
+# Introduction
+The luamaths package is developed to perform standard mathematical operations inside LaTeX documents using Lua. 
+It provides an easy way to perform standard mathematical operations. 
+There is no particular environment in the package for performing mathematical operations. 
+The package commands can be used in any environment (including the mathematics environment). 
+
+
+# License
+The luamaths package is released under the LaTeX Project Public License v1.3c or later. 
+The complete license text is available at http://www.latex-project.org/lppl.txt. 
+It is developed in Lua. 
+Lua is available as a certified open-source software. 
+Its license is simple and liberal, which is compatible with GPL.
+
+#Installation and Inclusion
+The installation of luamaths package is similar to plain latex package, where the .sty file is in LATEXdirectory of texmf tree. 
+The package can be included with \usepackage{luamaths} command in the preamble of the LaTeX document. 
+The TeX file is to be compiled using the LuaLaTeX engine. 


Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamaths/README.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.bib
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.bib	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.bib	2022-12-29 23:10:32 UTC (rev 65400)
@@ -0,0 +1,39 @@
+\begin{filecontents}{luamodtbl.bib}
+
+ at online{online.luaorg,
+  title = {Lua Programming Language},
+  url = {https://www.lua.org/manual/5.4},
+ note = {visited on 2022-03-26}
+}
+ at online{online.tex,
+  title = {TeX Language},
+  url = {https://www.cs.mcgill.ca/~rwest/wikispeedia/wpcd/wp/t/TeX.htm},
+  note = {visited on 2022-03-26}
+}
+ at online{online.texscript,
+  title = {TEX and Scripting Languages},
+  year = 2022,
+  url = {https://tug.org/TUGboat/tb25-1/richter.pdf},
+note = {visited on 2022-01-01}
+}
+ at online{online.luacode,
+  title = {luacode package},
+  year = 2012,
+  url = {https://mirror.kku.ac.th/CTAN/macros/luatex/latex/luacode/luacode.pdf},
+  note = {visited on 2022-03-10}
+}
+ at online{online.luatex,
+  title = {luatex Package},
+  url = {https://ctan.org/pkg/luatex?lang=en},
+  note = {visited on 2022-01-22}
+}
+ at online{online.pgf,
+  title = {pgf Package},
+  url = {https://ctan.org/pkg/pgf?lang=en},
+note = {visited on 2021-01-10}
+}
+ at online{online.xparse,
+  title = {xparse Package},
+  url = {https://ctan.org/pkg/xparse?lang=en},
+  note = {visited on 2021-03-10}
+}


Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.bib
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf	2022-12-29 23:04:53 UTC (rev 65399)
+++ trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf	2022-12-29 23:10:32 UTC (rev 65400)

Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.tex	2022-12-29 23:10:32 UTC (rev 65400)
@@ -0,0 +1,325 @@
+\documentclass{article}
+\usepackage{listings,color,booktabs,longtable,array,hyperref,multicol}
+\usepackage[ left=1in, right=1in]{geometry}
+\hypersetup{colorlinks,urlcolor=blue}
+\lstset{frame=none,
+	language=[LaTeX]{TeX},
+  aboveskip=3mm,
+  belowskip=3mm,
+  showstringspaces=false,
+  columns=flexible,
+  basicstyle={\ttfamily},
+  numbers=none,
+  numberstyle=\tiny\color{gray},
+  stringstyle=\color{mauve},
+  breaklines=true,
+  breakatwhitespace=true,
+  tabsize=1
+}
+\usepackage[backend=bibtex]{biblatex}
+\addbibresource{luamaths}
+\begin{document}
+\title{The luamaths Package in LaTeX}
+\author{Chetan Shirore and Dr. Ajit Kumar}
+\maketitle
+\section{Introduction}\label{section:introduction}
+The \verb|luamaths| package is developed to perform standard mathematical operations inside LaTeX documents using Lua. It provides an easy way to perform standard mathematical operations. There is no particular environment in the package for performing mathematical operations. The package commands can be used in any environment (including the mathematics environment). It is written in Lua, and tex file is to be compiled with LuaLatex engine. The time required for operations 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 is useful to perform standard operations (addition, subtraction, multiplication, division, powers, roots etc.) in tex file itself. The package supports the nesting of commands for multiple operations. It can be modified or extended by writing custom Lua programs.
+
+The Lua \cite{online.luaorg} programming language is a scripting language that can be embedded across platforms. With\verb|LuaTeX| \cite{online.luatex}  and\verb|luacode| \cite{online.luacode} packages, it is possible to use Lua in LaTeX. The TeX  \cite{online.tex} or LaTeX has scope for programming \cite{online.texscript}. However, with the weird internals of TeX, there are several limitations, especially for performing calculations on numbers in LaTeX documents. There are packages like \emph{pgf} \cite{online.pgf} and  \emph{xparse}  \cite{online.xparse} in LaTeX which provides some programming capabilities inside LaTeX documents. However, such packages do not provide the complete programming structure that Lua programming languages provide. The \verb|luacode| \cite{online.luacode}  package is used in its development apart from the \verb|luacode| package. There is no need to install Lua on users system as TeX distributions (TeXLive or MikTeX) come bundled with LuaLaTeX. The package can be modified or extended by writing custom Lua programs.
+
+
+\section{Installation and License}
+
+The installation of \verb|luamaths| package is similar to plain latex package, where the \texttt{.sty} file is in \LaTeX directory of texmf tree. The package can be included with \verb|\usepackage{luamaths}| command in the preamble of the LaTeX document. The TeX file is to be compiled using the LuaLaTeX engine.
+
+
+The \verb|luamaths| package is released under the LaTeX Project Public License v1.3c or later. The complete license text is available at \url{http://www.latex-project.org/lppl.txt}. It is developed in Lua.  Lua is available as a certified open-source software. Its license is simple and liberal, which is compatible with GPL.
+
+\section{Commands in the luamaths package}
+Table \ref{tbl:opluamaths} lists operations in the \verb|luamaths| package.
+\begin{center}
+\begin{longtable}{llm{6cm}}
+\toprule
+\multicolumn{1}{c}{\textcolor{blue}{Function}} & \multicolumn{1}{l}{\textcolor{blue}{Command Format}} & \multicolumn{1}{c}{\textcolor{blue}{Description}}  \\
+\toprule
+\begin{lstlisting}
+\mathOp
+\end{lstlisting} &
+\begin{lstlisting}
+\mathOp{expression}
+\end{lstlisting} & Evaluates mathematical expression. For example, \lstinline|\mathop{2+3}| will evaluate to 5. It supports usual operations like\lstinline| -, *,  \, ^ | etcetera, apart from the standard functions. \\
+\midrule
+\begin{lstlisting}
+\mathAbs
+\end{lstlisting} &
+\begin{lstlisting}
+\mathAbs{number}
+\end{lstlisting} & Gives the absolute value of a real number.\\
+\midrule
+\begin{lstlisting}
+\mathAcos
+\end{lstlisting} &
+\begin{lstlisting}
+\mathAcos{number}
+\end{lstlisting} & Gives the arc cosine of a real number in radians.\\
+\midrule
+\begin{lstlisting}
+\mathAsin
+\end{lstlisting} &
+\begin{lstlisting}
+\mathAsin{number}
+\end{lstlisting} & Gives the arc sine of a real number in radians.\\
+\midrule
+\begin{lstlisting}
+\mathAtan
+\end{lstlisting} &
+\begin{lstlisting}
+\mathAtan{number}
+\end{lstlisting} & Gives the arc tangent of a real number in radians.\\
+\midrule
+\begin{lstlisting}
+\mathCeil
+\end{lstlisting} &
+\begin{lstlisting}
+\mathCeil{number}
+\end{lstlisting} & Gives the smallest integer greater than or equal to a real number.\\
+\midrule
+\begin{lstlisting}
+\mathCos
+\end{lstlisting} &
+\begin{lstlisting}
+\mathCos{number}
+\end{lstlisting} & Gives the cosine of a real number.Here the number is in radians.\\
+\midrule
+\begin{lstlisting}
+\mathExp
+\end{lstlisting} &
+\begin{lstlisting}
+\mathExp{x}
+\end{lstlisting} & Calculates \(\mathrm{e}^x \). Here \(\mathrm{e} \) is the Euler number.\\
+\midrule
+\begin{lstlisting}
+\mathFloor
+\end{lstlisting} &
+\begin{lstlisting}
+\mathFloor{number}
+\end{lstlisting} & Gives the smallest integer less than or equal to a real number.\\
+\midrule
+\begin{lstlisting}
+\mathInf
+\end{lstlisting} & \begin{lstlisting}
+\mathInf
+\end{lstlisting} & The infinity.\\
+\midrule
+\begin{lstlisting}
+\mathLog
+\end{lstlisting} &
+\begin{lstlisting}
+\mathLog{x}
+\end{lstlisting} & Calculates \(\log x \). Here the logarithm is to the natural base \(\mathrm{e} \).\\
+\midrule
+\begin{lstlisting}
+\mathMax
+\end{lstlisting} &
+\begin{lstlisting}
+\mathMax\end{lstlisting}\{\(x_1,x_2,\ldots,x_n\)\}
+ & Gives the maximum of numbers \(x_1,x_2,\ldots,x_n\).\\
+\midrule
+\begin{lstlisting}
+\mathMin
+\end{lstlisting} &
+\begin{lstlisting}
+\mathMin\end{lstlisting}\{\(x_1,x_2,\ldots,x_n\)\}
+ & Gives the minimum of numbers \(x_1,x_2,\ldots,x_n\).\\
+\midrule
+\begin{lstlisting}
+\mathPi
+\end{lstlisting} &
+\begin{lstlisting}
+\mathPi
+\end{lstlisting} & Gives the numeric value of the constant \(\pi \). \\
+\midrule
+\begin{lstlisting}
+\mathRad
+\end{lstlisting} &
+\begin{lstlisting}
+\mathRad{degree}
+\end{lstlisting} & Converts degrees into radians. \\
+\midrule
+\begin{lstlisting}
+\mathRandom
+\end{lstlisting} & \begin{lstlisting}
+\mathRandom
+\end{lstlisting} & Generates a random number between \(0 \) and \(1 \). \\
+\midrule
+\begin{lstlisting}
+\mathRound
+\end{lstlisting} &
+\begin{lstlisting}
+\mathRound{number}{digits}
+\end{lstlisting} & It rounds off a real number to a specified number of digits. \\
+\midrule
+\begin{lstlisting}
+\mathSin
+\end{lstlisting} &
+\begin{lstlisting}
+\mathSin{number}
+\end{lstlisting} & Gives the sine of a real number. Here the number is in radians.\\
+\midrule
+\begin{lstlisting}
+\mathSqrt
+\end{lstlisting} &
+\begin{lstlisting}
+\mathSqrt{number}
+\end{lstlisting} & Gives the non-negative square root of a non-negative real number.\\
+\midrule
+\begin{lstlisting}
+\mathTan
+\end{lstlisting} &
+\begin{lstlisting}
+\mathTan{number}
+\end{lstlisting} & Gives the tangent of a real number. Here the number is in radians.\\
+\bottomrule
+\caption{Operations in the luamaths package}
+\label{tbl:opluamaths}
+\end{longtable}
+\end{center}
+Numbers can also be entered in scientific notation. For example, the number \(1860000\) can be entered as \(1.86e6\), and the number \(0.000186\) can be entered as \(1.86e-4\).
+\subsection{Illustrations of commands in the luamaths package}
+Table \ref{tbl:illluamaths} illustrates operations in the \verb|luamaths| package with examples.
+\begin{center}
+\begin{longtable}{lc}
+\toprule
+\multicolumn{1}{c}{\textcolor{blue}{LaTeX input}} &\multicolumn{1}{c}{\textcolor{blue}{Output}}  \\
+\toprule
+\begin{lstlisting}
+\mathOp{(3+3)^4-4}
+\end{lstlisting} & \(1292.0\)\\
+\midrule
+\begin{lstlisting}
+\mathAbs{-6.96}
+\end{lstlisting} & \(6.96\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathFloor{-6.9}
+\end{lstlisting} & \(-7\) \\
+\midrule
+
+\begin{lstlisting}
+\mathFloor{9.9}
+\end{lstlisting} & \(9\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathCeil{-9.9}
+\end{lstlisting} &  \(-9\) \\
+\midrule
+
+\begin{lstlisting}
+\mathCeil{6.3}
+\end{lstlisting} &\(7\)\\
+\midrule
+
+\begin{lstlisting}
+\mathRound{9.678884}{3}
+\end{lstlisting} & \(9.679\)\\
+\midrule
+
+\begin{lstlisting}
+\mathMax{20,30,100}
+\end{lstlisting} &\(100\) \\
+\midrule
+
+\begin{lstlisting}
+\mathMin{20,30,100}
+\end{lstlisting} &\(20\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathPi
+\end{lstlisting} & \(3.1415926535898\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathRound{\mathPi}{6}
+\end{lstlisting} & \(3.141593\)\\
+\midrule
+
+\begin{lstlisting}
+\mathInf
+\end{lstlisting} & \(Inf\)\\
+\midrule
+
+\begin{lstlisting}
+\mathOp{\mathInf/2}
+\end{lstlisting} &\(Inf\) \\
+\midrule
+
+\begin{lstlisting}
+\mathSqrt{9}
+\end{lstlisting} & \(3.0\)\\
+\midrule
+
+\begin{lstlisting}
+\mathLog{2}
+\end{lstlisting} & \(0.69314718055995\)\\
+\midrule
+
+\begin{lstlisting}
+\mathExp{3}
+\end{lstlisting} & \(20.085536923188\) \\
+\midrule
+
+\begin{lstlisting}
+\mathRad{1800}
+\end{lstlisting} & \(31.415926535898\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathSin{0}
+\end{lstlisting} &\(0.0\)\\
+\midrule
+
+\begin{lstlisting}
+\mathCos{0}
+\end{lstlisting} & \(1.0\)\\
+\midrule
+
+
+\begin{lstlisting}
+\mathTan{0}
+\end{lstlisting} & \(0.0\)\\
+\midrule
+
+\begin{lstlisting}
+\mathAsin{0}
+\end{lstlisting} & \(0.0\)\\
+\midrule
+
+\begin{lstlisting}
+\mathAcos{0}
+\end{lstlisting} & \(1.5707963267949\)\\
+\midrule
+
+\begin{lstlisting}
+\mathAtan{0}
+\end{lstlisting} & \(0.0\)\\
+\midrule
+
+\begin{lstlisting}
+\mathRound{\mathOp{9+\mathSin{4}}}{6}
+\end{lstlisting} & \(8.243198\)\\
+\midrule
+\caption{Illustrations of commands in the luamaths package}
+\label{tbl:illluamaths}
+\end{longtable}
+\end{center}
+
+\printbibliography
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/lualatex/luamaths/luamaths.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty	2022-12-29 23:10:32 UTC (rev 65400)
@@ -0,0 +1,41 @@
+% luaset package
+% version 1.0
+% Authors: Chetan Shirore and Ajit Kumar
+% Licensed under LaTeX Project Public License v1.3c or later. The complete license text is available at http://www.latex-project.org/lppl.txt.
+
+\ProvidesPackage{luaset}[1.0]
+\RequirePackage{xkeyval}
+\RequirePackage{amsmath}
+\RequirePackage{luacode}
+\begin{luacode*}
+function mathop(...)
+inf = math.huge
+return ...
+end
+
+function mathround(num, numDecimalPlaces)
+  local mult = 10^(numDecimalPlaces or 0)
+  return math.floor(num * mult + 0.5) / mult
+end
+\end{luacode*}
+\newcommand\mathOp[1]{\directlua{tex.sprint(tostring(mathop(#1)))}}
+\newcommand\mathAbs[1]{\directlua{tex.sprint(math.abs(#1))}}
+\newcommand\mathAcos[1]{\directlua{tex.sprint(math.acos(#1))}}
+\newcommand\mathAsin[1]{\directlua{tex.sprint(math.asin(#1))}}
+\newcommand\mathAtan[1]{\directlua{tex.sprint(math.atan(#1))}}
+\newcommand\mathCeil[1]{\directlua{tex.sprint(math.ceil(#1))}}
+\newcommand\mathCos[1]{\directlua{tex.sprint(math.cos(#1))}}
+\newcommand\mathExp[1]{\directlua{tex.sprint(math.exp(#1))}}
+\newcommand\mathFloor[1]{\directlua{tex.sprint(math.floor(#1))}}
+\newcommand\mathHuge{\directlua{tex.sprint(math.huge)}}
+\newcommand\mathLog[1]{\directlua{tex.sprint(math.log(#1))}}
+\newcommand\mathMax[1]{\directlua{tex.sprint(math.max(#1))}}
+\newcommand\mathMin[1]{\directlua{tex.sprint(math.min(#1))}}
+\newcommand\mathPi{\directlua{tex.sprint(math.pi)}}
+\newcommand\mathRandom[1]{\directlua{tex.sprint(math.random(#1))}}
+\newcommand\mathSin[1]{\directlua{tex.sprint(tostring(math.sin(#1)))}}
+\newcommand\mathSqrt[1]{\directlua{tex.sprint(math.sqrt(#1))}}
+\newcommand\mathTan[1]{\directlua{tex.sprint(math.tan(#1))}}
+\newcommand\mathRad[1]{\directlua{tex.sprint(math.rad(#1))}}
+\newcommand\mathRound[2]{\directlua{tex.sprint(mathround(#1,#2))}}
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-12-29 23:04:53 UTC (rev 65399)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-12-29 23:10:32 UTC (rev 65400)
@@ -511,7 +511,7 @@
     luafindfont luagcd luahyphenrules
     luaimageembed luaindex luainputenc luaintro luakeys
     lualatex-doc lualatex-doc-de
-    lualatex-math lualatex-truncate lualibs luamathalign
+    lualatex-math lualatex-truncate lualibs luamathalign luamaths
     luamesh luamodulartables luamplib luaoptions luaotfload
     luapackageloader luaprogtable luapstricks
     luaquotes luarandom

Modified: trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc	2022-12-29 23:04:53 UTC (rev 65399)
+++ trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc	2022-12-29 23:10:32 UTC (rev 65400)
@@ -52,6 +52,7 @@
 depend lualatex-truncate
 depend lualibs
 depend luamathalign
+depend luamaths
 depend luamodulartables
 depend luamplib
 depend luaoptions

Added: trunk/Master/tlpkg/tlpsrc/luamaths.tlpsrc
===================================================================


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