texlive[65396] Master: luagcd (29dec22)

commits+karl at tug.org commits+karl at tug.org
Thu Dec 29 23:04:39 CET 2022


Revision: 65396
          http://tug.org/svn/texlive?view=revision&revision=65396
Author:   karl
Date:     2022-12-29 23:04:39 +0100 (Thu, 29 Dec 2022)
Log Message:
-----------
luagcd (29dec22)

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

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

Added: trunk/Master/texmf-dist/doc/lualatex/luagcd/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luagcd/README.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luagcd/README.txt	2022-12-29 22:04:39 UTC (rev 65396)
@@ -0,0 +1,20 @@
+# Introduction
+Using Lua, the luagcd package is developed to find the greatest common divisor (gcd) of integers in LaTeX.
+The package provides commands to obtain step-by-step computation of gcd of two integers by using the Euclidean algorithm. 
+In addition, the package has the command to express gcd of two integers as a linear combination. 
+The Bezout’s Identity can be verified for any two integers using commands in the package. 
+No particular environment is required for the use of commands in the package. 
+It is written in Lua, and the TeX file has to be compiled with the LuaLaTeX engine.
+
+
+# License
+The luagcd 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 luagcd package is similar to plain latex package, where the .sty file is in LATEXdirectory of texmf tree. 
+The package can be included with \usepackage{luagcd} command in the preamble of the LaTeX document. 
+The TeX file is to be compiled using the LuaLaTeX engine. 
\ No newline at end of file


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

Index: trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.pdf	2022-12-29 22:04:10 UTC (rev 65395)
+++ trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.pdf	2022-12-29 22:04:39 UTC (rev 65396)

Property changes on: trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.tex	2022-12-29 22:04:39 UTC (rev 65396)
@@ -0,0 +1,155 @@
+\documentclass{article}
+\usepackage{listings,color,booktabs,longtable,array,hyperref,multicol,framed}
+\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}
+\begin{document}
+\title{The luagcd Package in LaTeX}
+\author{Chetan Shirore and Dr. Ajit Kumar}
+\maketitle
+\section{Introduction}\label{section:introduction}
+Using Lua, the \verb|luagcd| package is developed to find the \textbf{greatest common divisor (gcd)} of integers in LaTeX. It provides an easy way to find gcd of two or more integers inside LaTeX documents. The package provides commands to obtain step-by-step computation of gcd of two integers by using Euclidean algorithm. In addition, the package has the command to express gcd of two integers as a linear combination. The Bezout’s Identity can be verified for any two integers using commands in the package. No particular environment is required for the use of commands in the package. It is written in Lua, and the TeX file has to be compiled with the LuaLaTeX engine.
+
+In order to find the gcd of two integers, \(a\) and \(b\), the package uses a repeated division algorithm. This technique is basically based on the fact \(\gcd(a,b)=\gcd(a,b-\lambda a)\), where \(\lambda\) is an integer. This technique to find the gcd of integers is called as Euclidean algorithm. For finding gcd of more than two numbers, the associativity of the gcd operation is used.
+\[\gcd(\gcd(a,b),c)=\gcd(a,b,c)\]
+This associativity of the gcd operation allows the recursion of functions to find the gcd of more than two integers. The recursion technique (where the function calls itself) in Lua is effectively used in the package for finding the gcd of integers. The package also makes use of the following result.
+ \[\gcd\{a,b\}=\gcd\{|a|,b\}=\gcd\{a,|b|\}=\gcd\{|a|,|b|\} \]
+ 
+ Algorithms in the package convert non-zero integers to positive integers, and then the Euclidean algorithm is used to find their gcd. If the gcd of \(a\) and \(b\) is \(d\)  and it is expressed as a linear combination \(ax+by=d\), then we have
+ \[ax+by=d \iff (-a)(-x)+by = d \iff ax+(-b)(-y) = d \iff (-a)(-x)+(-b)(-y) = d \]
+
+So in order to find a solution of \((-a)(-x)+by = d\), \( ax+(-b)(-y) = d\) or \((-a)(-x)+(-b)(-y) = d\)  it suffices to find a solution of \(ax+by=d \). This fact is used in an algorithm of the package to express the gcd of two integers as their linear combination.
+
+\section{Installation and License}
+
+The installation of \verb|luagcd| 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{luagcd}| command in the preamble of the LaTeX document. The TeX file is to be compiled using the LuaLaTeX engine.
+
+The \verb|luagcd| 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 luagcd package}
+Table \ref{tbl:luagcd} lists operations in the \verb|luagcd| package.
+\begin{longtable}{m{4cm}m{5cm}m{4cm}}
+\toprule
+\multicolumn{1}{l}{\textcolor{blue}{Command}} & \multicolumn{1}{l}{\textcolor{blue}{Syntax}} & \multicolumn{1}{l}{\textcolor{blue}{Description}}  \\
+\toprule
+\begin{lstlisting}
+\luagcd
+\end{lstlisting} &
+\begin{lstlisting}
+\luagcd{x_1, x_2, ..., x_n}
+\end{lstlisting} & Gives gcd of integers \(x_1,x_2,x_3,\ldots,x_n\).\\
+\midrule
+\begin{lstlisting}
+\luagcdwithsteps
+\end{lstlisting} &
+\begin{lstlisting}
+\luagcdwithsteps{a}{b}
+\end{lstlisting} & Gives the gcd of two integers, \(a\) and \(b\), in a step-by-step manner by repeated application of the Euclidean algorithm. \\
+\midrule
+\begin{lstlisting}
+\luagcdlincomb
+\end{lstlisting} &
+\begin{lstlisting}
+\luagcdlincomb{a}{b}
+\end{lstlisting} & Gives the gcd of two integers \(a\) and \(b\) and expresses it as a linear combination of two integers \(a\) and \(b\).  \\
+\midrule
+\begin{lstlisting}
+\luagcdlincombwithsteps
+\end{lstlisting} &
+\begin{lstlisting}
+\luagcdlincombwithsteps{a}{b}
+\end{lstlisting} & Expresses  the gcd of two integers \(a\) and \(b\) as their linear combination in a step-by-step manner. \\ \\
+\bottomrule
+
+\caption{Operations in the luagcd package}
+\label{tbl:luagcd}
+\end{longtable}
+
+
+
+\section{Examples and usage}
+The command \verb|\luagcd{20,30,60,70}| outputs to \fbox{10}.  \\
+The command \verb|\luagcdwithsteps{-20}{-6008}| outputs the following.\\
+\begin{framed}
+\noindent Step 1: Apply the division algorithm to 6008 and 20.\\
+$6008 = 20(300) + 8$\\
+Step 2: Apply the division algorithm to 20 and 8.\\
+$20 = 8(2) + 4$\\
+Step 3: Apply the division algorithm to 8 and 4.\\
+$8 = 4(2) +  0$ \\
+The gcd of -20 and -6008 is the last non-zero remainder and it is 4.
+\end{framed}
+
+The command \verb|\luagcdwithsteps{-20}{-6008}| outputs  the following LaTeX code.
+\begin{lstlisting}
+Step 1: Apply the division algorithm to 6008 and 20.\\
+$6008 = 20(300) + 8$\\
+Step 2: Apply the division algorithm to 20 and 8.\\
+$20 = 8(2) + 4$\\
+Step 3: Apply the division algorithm to 8 and 4.\\
+$8 = 4(2) +  0$ \\
+The gcd of -20 and -6008 is the last non-zero remainder and it is 4.
+\end{lstlisting}
+
+The command \verb|\luagcdlincomb{10011}{210}| outputs the following.
+
+\begin{framed} \noindent The gcd of 10011 and 210 is 3 and the equation $-10011x + 210y = 3$ 
+and has a solution $(x,y) =  (3,-143)$.\end{framed}
+
+The command \verb|\luagcdlincombwithsteps{-10011}{210}| outputs  the following.
+ 
+\begin{framed}
+\noindent Step 1:10011 is written as a linear combination of 10011 and 210.\\
+$10011 = (1)(10011) + (0)(210)$\\
+Step 2:210 is written as a linear combination of 10011 and 210.\\
+$210 = (0)(10011) + (1)(210)$\\
+Step 3: The equation in Step 2 is multiplied  by 47 and 
+subtracted from  the equation in Step 1.\\
+$141 = (1)(10011) + (-47)(210)$\\
+Step 4: The equation in Step 3 is multiplied  by 1 and
+ subtracted from  the equation in Step 2.\\
+$69 = (-1)(10011) + (48)(210)$\\
+Step 5: The equation in Step 4 is multiplied  by 2 and 
+subtracted from  the equation in Step 3.\\
+$3 = (3)(10011) + (-143)(210)$\\
+The gcd of -10011 and 210 is 3 and the equation $-10011x + 210y = 3$ 
+and has a solution $(x,y) =  (-3,-143)$.
+\end{framed}
+
+The command \verb|\luagcdlincombwithsteps{-10011}{210}| outputs  the following LaTeX code.
+\begin{lstlisting}
+Step 1:10011 is written as a linear combination of 10011 and 210.\\
+$10011 = (1)(10011) + (0)(210)$\\
+Step 2:210 is written as a linear combination of 10011 and 210.\\
+$210 = (0)(10011) + (1)(210)$\\
+Step 3: The equation in Step 2 is multiplied  by 47 and 
+subtracted from  the equation in Step 1.\\
+$141 = (1)(10011) + (-47)(210)$\\
+Step 4: The equation in Step 3 is multiplied  by 1 and
+ subtracted from  the equation in Step 2.\\
+$69 = (-1)(10011) + (48)(210)$\\
+Step 5: The equation in Step 4 is multiplied  by 2 and 
+subtracted from  the equation in Step 3.\\
+$3 = (3)(10011) + (-143)(210)$\\
+The gcd of -10011 and 210 is 3 and the equation $-10011x + 210y = 3$ 
+and has a solution $(x,y) =  (-3,-143)$.
+\end{lstlisting}
+
+
+
+\printbibliography
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/lualatex/luagcd/luagcd.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/lualatex/luagcd/luagcd.sty	2022-12-29 22:04:39 UTC (rev 65396)
@@ -0,0 +1,356 @@
+% luagcd package
+% version 1.0
+% 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{luagcd}[1.0]
+\RequirePackage{luacode}
+\begin{luacode*}
+function findgcd2(a,b)
+   a = math.abs(a)
+   b = math.abs(b)
+   if b ~= 0 then
+      return findgcd2(b, a % b)
+   else
+      return a
+   end
+end
+
+function findgcd(...)
+   local tbl = table.pack(...)
+   if #(tbl) > 2 then
+      local rem = table.remove(tbl,1)
+      return findgcd (rem, findgcd( table.unpack(tbl) ) )
+   else
+      u,v = table.unpack(tbl)
+      return math.floor(findgcd2(u,v))
+   end
+end
+
+function inputcheck ( ... )
+   local tbl = table.pack(...)
+   for _, v in ipairs(tbl) do
+      if type(v) ~= 'number' then
+         error('Only numbers are expected.')
+         return
+      elseif v~= math.floor(v) then
+         error('Error: Only integers are expected.')
+         return
+      end
+   end
+end
+
+function luagcd(...)
+   inputcheck(...)
+   return findgcd(...)
+
+end
+
+function stepbystepgcd(a,b,sep)
+   if type(a) ~= 'number' or type(b) ~= 'number' then
+      error('Only numbers are expected.')
+      return
+   elseif a~= math.floor(a) or b~= math.floor(b) then
+      error('Error: Only integers are expected.')
+      return
+   end
+   local val1,val2 = a,b
+   a,b = math.max(math.abs(a),math.abs(b)),
+   math.min(math.abs(a),math.abs(b))
+   p,q = math.max(math.abs(a),math.abs(b)),
+   math.min(math.abs(a),math.abs(b))
+   if b==0 then 
+return 
+	("The gcd of " .. val1 .." and " .. val2 ..  " is " .. a .. '.' )
+end
+   local tbl ={}
+   local k = 0
+   local sep = sep or 'Step '
+   local stepcnt = 0
+   while b~=0 do
+      x=a
+      y=b
+      t = b
+      b = a % b
+      a = t
+      k=k+1
+      stepcnt = stepcnt + 1
+      if b ~=0 then
+         d = x // y
+         tbl[k] = sep .. stepcnt ..
+			": Apply the division algorithm to " .. x .." and " .. y .."."
+         k=k+1
+         tbl[k] = "$".. x.." = ".. t .."("
+         .. d ..") + ".. b .."$"
+      else
+         tbl[k] = sep .. stepcnt ..
+			": Apply the division algorithm to " .. x .." and " .. y .."."
+         k=k+1
+         tbl[k] ="$".. x.." = "..t.."("
+         .. (x // y)..") +  ".. b .."$"
+      end
+   end
+   local str = table.concat(tbl,"\\\\")
+   if stepcnt==1 then
+      return str  .. " \\\\" .. "The gcd of ".. val1 .." and " .. val2..
+      " is " ..t.. "."
+
+   else
+      return str  .. " \\\\" .. "The gcd of ".. val1 .." and " .. val2 ..
+      " is the last non-zero remainder and it is " ..t.. "."
+   end
+end
+
+function lincombgcd (a,b)
+   local val1,val2 = a,b
+   if type(a) ~= 'number' or type(b) ~= 'number' then
+      error('Only numbers are expected.')
+      return
+   elseif a~= math.floor(a) or b~= math.floor(b) then
+      error('Error: Only integers are expected.')
+      return
+   end
+
+   local x,y=math.max(math.abs(a),math.abs(b)),
+   math.min(math.abs(a),math.abs(b))
+
+   local a,b=math.max(math.abs(a),math.abs(b)),
+   math.min(math.abs(a),math.abs(b))
+
+   if x == 0 and y == 0 then
+      return 
+("The gcd of $0$ and $0$  is clearly a linear combination of $0$ and $0$.")
+   elseif y == 0 then
+      return ("The gcd of " .. val1 .." and " .. val2 ..
+      " is $" .. x .. "$" .. " and  $" ..  x .." = 1 "
+      .."(".. x .. ")".." + 0(0)$.")
+   end
+
+   if x % y == 0 then
+      return ("The gcd of " .. val1 .." and " .. val2 ..
+      " is $" .. y .. "$" .. " and  one number is a multiple of other.")
+   end
+
+   local e_1 = 1
+   local e_2 = 0
+   local e_3 = 0
+   local f_1 = 0
+   local f_2 = 1
+   local f_3 = 0
+
+   while (a > 0 and b > 0) do
+      if (a > b) then
+         q = a // b
+         r = a % b
+
+         if r > 0 then
+            e_3 = e_1 - (q * e_2)
+            e_1 = e_2
+            e_2 = e_3
+            f_3 = f_1 - (q * f_2)
+            f_1 = f_2
+            f_2 = f_3
+            gcd = r
+         end
+         a = a % b
+      else do
+         q = b // a
+         r = b % a
+         if r > 0 then
+            e_3 = e_1 - (q * e_2)
+            e_1 = e_2
+            e_2 = e_3
+            f_3 = f_1 - (q * f_2)
+            f_1 = f_2
+            f_2 = f_3
+            gcd = r
+         end
+         b = b % a
+      end
+   end
+end
+
+if math.abs(val1) >= math.abs(val2) then
+   coeff1,coeff2 = val1, val2
+   if val1 < 0 and val2 < 0 then
+      e_3,f_3 = -e_3,-f_3
+   elseif val1 > 0 and val2 < 0 then
+      f_3 = -f_3
+   elseif val1 < 0 and val2 > 0 then
+      e_3 = -e_3
+   end
+else
+   coeff1,coeff2 = val2,val1
+   if val1 < 0 and val2 < 0 then
+      e_3,f_3 = -e_3,-f_3
+   elseif val1 > 0 and val2 < 0 then
+      e_3 = -e_3
+   elseif val1 < 0 and val2 > 0 then
+      f_3 = -f_3
+   end
+end
+
+if coeff2 <0 then
+   op = ""
+else
+   op = " + "
+end
+
+return ("The gcd of " .. val1 .." and " .. val2 .. " is " .. gcd ..
+" and the equation $" .. coeff1 .."x" .. op ..  coeff2 .."y = "
+..gcd ..  "$ has a solution $(x,y) =  (" .. e_3 .. "," .. f_3 ..")$.")
+end
+
+function lincombgcdstepbystep (a,b)
+local val1,val2 = a,b
+if type(a) ~= 'number' or type(b) ~= 'number' then
+  error('Only numbers are expected.') 
+  return
+  elseif a~= math.floor(a) or b~= math.floor(b) then
+   error('Error: Only integers are expected.')
+   return
+  end
+
+local x,y=math.max(math.abs(a),math.abs(b)),
+math.min(math.abs(a),math.abs(b))
+
+local a,b=math.max(math.abs(a),math.abs(b)),
+math.min(math.abs(a),math.abs(b))
+
+if x == 0 and y == 0 then
+ return 
+("The gcd of $0$ and $0$  is clearly a linear combination of $0$ and $0$.")
+elseif y == 0 then
+  return ("The gcd of " .. val1 .." and " .. val2 ..
+   " is $" .. x .. "$" .. " and  $" ..  x .." = 1 " 
+    .."(".. x .. ")".." + 0(0)$.")
+end 
+
+if x % y == 0 then 
+ return ("The gcd of " .. val1 .." and " .. val2 ..
+   " is $" .. y .. "$" .. " and  one number is a multiple of other.")
+end
+
+local e_1 = 1
+local e_2 = 0
+local e_3 = 0
+local f_1 = 0
+local f_2 = 1
+local f_3 = 0
+local sep = "Step "
+local stcnt = 2
+local cnt = 4
+
+local tbl ={}
+tbl[1] = "Step 1:" .. x .. " is written as a linear combination of "
+.. x .. " and " .. y .. "."
+tbl[2] = "$".. x .. " = (" .. "1" .. ")" .. "(" .. x .. ") + " 
+.. "(" .. "0" .. ")" .. "(" .. y .. ")$" 
+
+tbl[3] = "Step 2:" .. y .. " is written as a linear combination of "
+.. x .. " and " .. y .. "."
+tbl[4] = "$".. y .. " = (" .. "0" .. ")".. "(" .. x .. ") + "
+.. "(" .. "1" .. ")" .. "(" .. y .. ")$"
+
+
+
+while (a > 0 and b > 0) do
+    if (a > b) then
+        q = a // b
+        r = a % b
+
+        if r > 0 then
+            e_3 = e_1 - (q * e_2)
+            e_1 = e_2
+            e_2 = e_3
+            f_3 = f_1 - (q * f_2)
+            f_1 = f_2
+            f_2 = f_3
+          
+          cnt = cnt + 1
+          stcnt = stcnt + 1
+           
+          tbl[cnt] = sep..stcnt ..": ".."The equation in Step "  
+			..(stcnt-1).. " is multiplied  by " .. q .. 
+			" and subtracted from  the equation in Step " 
+			..(stcnt-2) .. "."
+          cnt = cnt +1
+          
+          tbl[cnt] = "$".. r .. " = (" .. e_3 .. ")" .. "(" .. x .. ") + " 
+           .. "(" .. f_3 .. ")" .. "(" .. y .. ")$"
+           gcd = r
+        end
+        a = a % b 
+     else do
+       q = b // a
+       r = b % a
+        if r > 0 then
+            e_3 = e_1 - (q * e_2)
+            e_1 = e_2
+            e_2 = e_3
+            f_3 = f_1 - (q * f_2)
+            f_1 = f_2
+            f_2 = f_3
+          cnt = cnt +1
+          stcnt = stcnt + 1
+          tbl[cnt] = sep..( stcnt) ..": ".."The equation in Step "  
+			..(stcnt-1).. " is multiplied  by " .. q .. 
+			" and subtracted from  the equation in Step " 
+			..(stcnt-2) .. "."
+          cnt = cnt +1
+          tbl[cnt] = "$" .. r .. " = (" .. e_3 .. ")" .. "(" .. x .. ") + "
+          .. "(" .. f_3 .. ")" .. "(" .. y .. ")$"
+          gcd = r
+       end
+        b = b % a
+    end
+end
+end
+
+if math.abs(val1) >= math.abs(val2) then
+coeff1,coeff2 = val1, val2
+  if val1 < 0 and val2 < 0 then
+  e_3,f_3 = -e_3,-f_3
+  elseif val1 > 0 and val2 < 0 then
+  f_3 = -f_3
+  elseif val1 < 0 and val2 > 0 then
+  e_3 = -e_3
+  end
+else
+coeff1,coeff2 = val2,val1
+  if val1 < 0 and val2 < 0 then
+  e_3,f_3 = -e_3,-f_3
+  elseif val1 > 0 and val2 < 0 then
+  e_3 = -e_3
+  elseif val1 < 0 and val2 > 0 then
+  f_3 = -f_3
+  end
+end
+
+if coeff2 <0 then
+  op = ""
+else
+  op = " + "
+end
+
+tbl[cnt+1] = "The gcd of " .. val1 .." and " .. val2 .. " is " .. gcd ..
+" and the equation $" .. coeff1 .."x" .. op ..  coeff2 .."y = "
+..gcd ..  "$  has a solution $(x,y) =  (" .. e_3 .. "," .. f_3 ..")$."
+return table.concat(tbl,"\\\\")
+
+end
+
+\end{luacode*}
+
+\newcommand\luagcd[1]{\directlua{tex.sprint(luagcd(#1))}}
+
+\newcommand\luagcdwithsteps[2]
+{\directlua{tex.sprint(stepbystepgcd(#1,#2))}}
+
+\newcommand\luagcdlincomb[2]
+{\directlua{tex.sprint(lincombgcd(#1,#2))}}
+
+\newcommand\luagcdlincombwithsteps[2]
+{\directlua{tex.sprint(lincombgcdstepbystep(#1,#2))}}
+
+\endinput


Property changes on: trunk/Master/texmf-dist/tex/lualatex/luagcd/luagcd.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 22:04:10 UTC (rev 65395)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2022-12-29 22:04:39 UTC (rev 65396)
@@ -508,7 +508,7 @@
     lua-alt-getopt lua-check-hyphen lua-physical lua-typo lua-uca lua-ul
     lua-uni-algos lua-visual-debug lua-widow-control luaaddplot
     luabibentry luabidi luacas luacensor luacode luacolor luacomplex
-    luafindfont luahyphenrules
+    luafindfont luagcd luahyphenrules
     luaimageembed luaindex luainputenc luaintro luakeys
     lualatex-doc lualatex-doc-de
     lualatex-math lualatex-truncate lualibs luamathalign

Modified: trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc	2022-12-29 22:04:10 UTC (rev 65395)
+++ trunk/Master/tlpkg/tlpsrc/collection-luatex.tlpsrc	2022-12-29 22:04:39 UTC (rev 65396)
@@ -40,6 +40,7 @@
 depend luacode
 depend luacolor
 depend luacomplex
+depend luagcd
 depend luahyphenrules
 depend luaimageembed
 depend luaindex

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


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