summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/luamaths
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-12-29 23:10:32 +0000
committerKarl Berry <karl@freefriends.org>2022-12-29 23:10:32 +0000
commit095e264c301f3116b1873190041262cd8cb85d74 (patch)
tree4578da5e4250832c12328f55d22fa66fe12621e1 /Master/texmf-dist/tex/lualatex/luamaths
parentfb9529f5945c966f5cecc99c572b3079a265a805 (diff)
luamaths (missed a few days ago)
git-svn-id: svn://tug.org/texlive/trunk@65400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/luamaths')
-rw-r--r--Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty41
1 files changed, 41 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty b/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty
new file mode 100644
index 00000000000..c3bc4d51e07
--- /dev/null
+++ b/Master/texmf-dist/tex/lualatex/luamaths/luamaths.sty
@@ -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