summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-12-28 03:01:37 +0000
committerNorbert Preining <norbert@preining.info>2022-12-28 03:01:37 +0000
commitc593cd7fcc1d6af28601f82bf0354a13eca3ff93 (patch)
treea5dd863995adf7f9090c66b45a3aa95c31b54f4c /macros
parent9dfeafbb128537c1633d77071d8cc9b9f8c5a800 (diff)
CTAN sync 202212280301
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.pdfbin6061282 -> 6059957 bytes
-rw-r--r--macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.tex22
-rw-r--r--macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty3
-rw-r--r--macros/latex/contrib/maze/README.md37
-rw-r--r--macros/latex/contrib/maze/maze.pdfbin0 -> 79265 bytes
-rw-r--r--macros/latex/contrib/maze/maze.sty87
-rw-r--r--macros/latex/contrib/maze/maze.tex33
-rw-r--r--macros/latex/contrib/resmes/README.md9
-rw-r--r--macros/latex/contrib/resmes/resmes.dtx76
-rw-r--r--macros/latex/contrib/resmes/resmes.ins43
-rw-r--r--macros/latex/contrib/resmes/resmes.pdfbin0 -> 69170 bytes
-rw-r--r--macros/luatex/latex/luaset/README.txt19
-rw-r--r--macros/luatex/latex/luaset/luaset.pdfbin0 -> 134778 bytes
-rw-r--r--macros/luatex/latex/luaset/luaset.sty142
-rw-r--r--macros/luatex/latex/luaset/luaset.tex230
15 files changed, 689 insertions, 12 deletions
diff --git a/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.pdf b/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.pdf
index 7bcb945355..112248c583 100644
--- a/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.pdf
+++ b/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.tex b/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.tex
index 718997a14c..62fbeafdd0 100644
--- a/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.tex
+++ b/macros/latex/contrib/jeuxcartes/doc/JeuxCartes-doc.tex
@@ -52,8 +52,8 @@
\setlength{\parindent}{0pt}
\definecolor{LightGray}{gray}{0.9}
-\def\TPversion{0.2.0}
-\def\TPdate{26 Décembre 2022}
+\def\TPversion{0.2.1}
+\def\TPdate{27 Décembre 2022}
\usepackage[most]{tcolorbox}
\usepackage[outputdir=build]{minted}
@@ -185,12 +185,12 @@ Une commande pour des cartes en version \og miniatures \fg{} (individuelle, main
\part{Historique}
-{\small \bverb|v0.2.0|~:~~~~Modification du design des cartes (pdf pour Poker/Uno + png pour Tarot) + alternatives pour le Poker
+{\small \bverb|v0.2.1|~:~~~~Correction du nom d'une carte pokerv1...
-{\small \bverb|v0.1.5|~:~~~~Correction d'un bug dans les noms de fichiers de cartes Uno
+{\small \bverb|v0.2.0|~:~~~~Modification du design des cartes (pdf pour Poker/Uno + png pour Tarot) + alternatives pour le Poker
{\small \bverb|v0.1.4|~:~~~~Réduction de la taille des images \texttt{png}
-
+
{\small \bverb|v0.1.3|~:~~~~Ajout de cartes Uno (CC1.0 par AlexDer) + modification des commandes + rami
{\small \bverb|v0.1.2|~:~~~~Modification du nom (et de la source) des images de Tarot (CC0)
@@ -249,21 +249,21 @@ On peut citer par exemple :
\end{codeinfo}
\begin{codeattention}
-Les images utiles sont proposées en format \textsf{pdf} pour les cartes type \textsf{Poker} et \textsf{Uno} (obtenues grâce à des fichiers \textsf{svg} !), pour une qualité optimale et une taille réduite, et en format \textsf{png} pour les cartes Type \textsf{Tarot}, donc une solution de compilation adaptée au format \textsf{png} est nécessaire.
+Les images utiles sont proposées en format \textsf{pdf} pour les cartes type \textsf{Poker} et \textsf{Uno} (obtenues grâce à des fichiers \textsf{svg} !), pour une qualité optimale et une taille réduite, et en format \textsf{png} pour les cartes Type \textsf{Tarot}, donc une solution de compilation adaptée aux formats \textsf{pdf/png} est nécessaire.
\smallskip
-Les fichiers \textsf{eps} pour les cartes type \textsf{Tarot} ne sont pas intégrées dans le package, mais elles sont disponible sur le dépôt \textsf{github} \url{https://github.com/cpierquet/JeuxCartes}.
+Les fichiers \textsf{eps} ne sont pas intégrées dans le package, mais elles sont disponible sur le dépôt \textsf{github} \url{https://github.com/cpierquet/JeuxCartes}.
-%\smallskip
-%
-%La présente documentation a été, après compilation, compressée pour obtenir une taille plus petite, donc le rendu réel des cartes est peut-être légèrement dégradé sur ce document !
+\smallskip
+
+Pour une compilation avec \LaTeX{} (et la chaîne \textsf{dvi-ps-ps2pdf}), il faudra donc enregistrer (\textit{manuellement}) les images au format \textsf{eps} !
\end{codeattention}
\subsection{Chargement du package}
\begin{codetex}[listing only]
-%exemple de chargement pour une compilation en (pdf)latex
+%exemple de chargement pour une compilation en pdflatex
\documentclass[french]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
diff --git a/macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty b/macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty
index be879c1e06..c37e0334e6 100644
--- a/macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty
+++ b/macros/latex/contrib/jeuxcartes/tex/JeuxCartes.sty
@@ -7,7 +7,8 @@
% Uno v1 cards Image's Licence : MIT License https://eperezcosano.github.io/uno-part1/
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{JeuxCartes}[2022/12/26 v0.2.0 Jeux de cartes]
+\ProvidesPackage{JeuxCartes}[2022/12/27 v0.2.1 Jeux de cartes]
+% 0.2.1 Correction d'un bug avec une carte de poker...
% 0.2.0 Modification des images (en mode pdf !) + v3 Poker + réduction taille Tarot
% 0.1.7 Correction d'un bug avec les noms de Uno
% 0.1.5 Ajout v2 pour le Poker
diff --git a/macros/latex/contrib/maze/README.md b/macros/latex/contrib/maze/README.md
new file mode 100644
index 0000000000..c20c91c791
--- /dev/null
+++ b/macros/latex/contrib/maze/README.md
@@ -0,0 +1,37 @@
+The maze package
+=========
+
+The maze package can generate random square mazes of a specified size.
+
+Basic Usage
+-----------
+The package only provides a user command.
+
+ \maze {⟨size⟩}[⟨seed⟩]
+
+You can read the package manual for some explanations.
+
+Copyright and License
+---------------------
+
+ Copyright (C) 2022 by Sicheng Du <siddsc@foxmail.com>
+ -----------------------------------------------------------------
+
+ This work may be distributed and/or modified under the
+ conditions of the LaTeX Project Public License, either
+ version 1.3c of this license or (at your option) any later
+ version. This version of this license is in
+ http://www.latex-project.org/lppl/lppl-1-3c.txt
+ and the latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+ and version 1.3 or later is part of all distributions of
+ LaTeX version 2005/12/01 or later.
+
+ This work has the LPPL maintenance status "maintained".
+
+ The Current Maintainer of this work is Sicheng Du.
+
+ This package consists of the files maze.tex,
+ maze.pdf,
+ maze.sty and
+ README.md (this file). \ No newline at end of file
diff --git a/macros/latex/contrib/maze/maze.pdf b/macros/latex/contrib/maze/maze.pdf
new file mode 100644
index 0000000000..3f75e2a64d
--- /dev/null
+++ b/macros/latex/contrib/maze/maze.pdf
Binary files differ
diff --git a/macros/latex/contrib/maze/maze.sty b/macros/latex/contrib/maze/maze.sty
new file mode 100644
index 0000000000..4401fa6099
--- /dev/null
+++ b/macros/latex/contrib/maze/maze.sty
@@ -0,0 +1,87 @@
+% Copyright (C) 2022 by Sicheng Du <siddsc@foxmail.com>
+% This project is distributed under the LaTeX Project Public License, version 1.3c.
+%-------------------------%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{maze}[1.1]
+\ExplSyntaxOn
+\int_new:N\l_rand
+\int_new:N\l_old \int_new:N\l_new
+\dim_const:Nn\g_size{\linewidth}
+\newcommand{\m@ze}[2]{
+ \sys_gset_rand_seed:n{#2}
+ \let\g_map\undefined
+ \let\g_walls_v\undefined\let\g_walls_h\undefined
+ \intarray_new:Nn\g_map{#1*#1}
+ \intarray_new:Nn\g_walls_v{#1*(#1-1)}
+ \intarray_new:Nn\g_walls_h{#1*(#1-1)}
+ \int_step_inline:nn{#1*#1}{
+ \intarray_gset:Nnn\g_map{##1}{##1}
+ }
+ \int_step_inline:nn{#1*(#1-1)}{
+ \intarray_gset:Nnn\g_walls_v{##1}{1}
+ \intarray_gset:Nnn\g_walls_h{##1}{1}
+ }
+ \bool_do_until:nn{
+ \int_compare_p:nNn{\intarray_item:Nn\g_map{1}}
+ ={\intarray_item:Nn\g_map{#1*#1}}
+ }{
+ \int_set:Nn\l_rand{\int_rand:n{#1*(#1-1)}}
+ \int_compare:nNnTF{0}={\intarray_item:Nn\g_walls_v{\l_rand}}{}{
+ \int_compare:nNnTF{
+ \intarray_item:Nn\g_map{\l_rand+\int_div_truncate:nn{\l_rand-1}{#1-1}}
+ }={
+ \intarray_item:Nn\g_map{
+ 1+\l_rand+\int_div_truncate:nn{\l_rand-1}{#1-1}
+ }
+ }{}{
+ \int_set:Nn\l_new{
+ \intarray_item:Nn\g_map{1+\l_rand+\int_div_truncate:nn{\l_rand-1}{#1-1}}
+ }
+ \int_set:Nn\l_old{
+ \intarray_item:Nn\g_map{\l_rand+\int_div_truncate:nn{\l_rand-1}{#1-1}}
+ }
+ \intarray_gset:Nnn\g_walls_v{\l_rand}{0}
+ \int_step_inline:nn{#1*#1}{
+ \int_compare:nNnTF{\l_old}={\intarray_item:Nn\g_map{##1}}
+ {\intarray_gset:Nnn\g_map{##1}{\l_new}}{}
+ }
+ }
+ }
+ \int_set:Nn\l_rand{\int_rand:n{#1*(#1-1)}}
+ \int_compare:nNnTF{0}={\intarray_item:Nn\g_walls_h{\l_rand}}{}{
+ \int_compare:nNnTF{\intarray_item:Nn\g_map{\l_rand}}
+ ={\intarray_item:Nn\g_map{#1+\l_rand}}{}{
+ \int_set:Nn\l_new{\intarray_item:Nn\g_map{#1+\l_rand}}
+ \int_set:Nn\l_old{\intarray_item:Nn\g_map{\l_rand}}
+ \intarray_gset:Nnn\g_walls_h{\l_rand}{0}
+ \int_step_inline:nn{#1*#1}{
+ \int_compare:nNnTF{\l_old}={\intarray_item:Nn\g_map{##1}}
+ {\intarray_gset:Nnn\g_map{##1}{\l_new}}{}
+ }
+ }
+ }
+ }
+}
+\NewDocumentCommand\maze{mO{\c_sys_minute_int}}{
+ \m@ze{#1}{#2}
+ \setlength{\unitlength}{\fp_eval:n{.4/#1}\g_size}
+ \begin{picture}(\int_eval:n{#1+2},\int_eval:n{#1+2})(-1,-1)
+ \put(0,0){\line(0,1){#1}}\put(0,0){\line(1,0){#1}}
+ \put(#1,#1){\line(0,-1){#1}}\put(#1,#1){\line(-1,0){#1}}
+ \int_step_inline:nn{#1*(#1-1)}{
+ \int_compare:nNnTF{0}={\intarray_item:Nn\g_walls_h{##1}}{}{
+ \put(
+ \int_mod:nn{##1-1}{#1},
+ \int_eval:n{1+\int_div_truncate:nn{##1-1}{#1}}
+ ){\line(1,0){1}}
+ }
+ \int_compare:nNnTF{0}={\intarray_item:Nn\g_walls_v{##1}}{}{
+ \put(
+ \int_mod:nn{##1}{#1-1},
+ \int_div_truncate:nn{##1-1}{#1-1}
+ ){\line(0,1){1}}
+ }
+ }
+ \end{picture}
+}
+\ExplSyntaxOff \ No newline at end of file
diff --git a/macros/latex/contrib/maze/maze.tex b/macros/latex/contrib/maze/maze.tex
new file mode 100644
index 0000000000..0783535bfc
--- /dev/null
+++ b/macros/latex/contrib/maze/maze.tex
@@ -0,0 +1,33 @@
+\documentclass{ltxdoc}
+\title{The \textsf{maze} package\footnote{~~This project is distributed under the \LaTeX~Project Public License, version 1.3c.}}
+\usepackage{graphicx}
+\usepackage{fontspec}
+\setmainfont{Times New Roman}
+\usepackage[misc]{ifsym}
+\author{Sicheng Du\thanks{~~\Letter~~\href{mailto:siddsc@foxmail.com}{siddsc@foxmail.com}}}
+\date{\today~~~~v1.1}
+\usepackage[colorlinks,linkcolor=purple]{hyperref}
+\usepackage{maze}
+\begin{document}
+\maketitle
+The \textsf{maze} package can generate random square mazes of a specified size. You need to start from the bottom-left corner and reach the top-right corner to play it.
+\begin{macro}{\maze}
+\marg{size}\oarg{seed} is the syntax of the command that generates a maze. Thereinto
+\begin{description}
+\item[\marg{size}] controls the density of the walls inside the maze and directly influences its complexity. It must be a positive integer greater or equal to 2.
+
+To have the package produce a satisfactory outcome, it is recommended to input a number between 20 and 30 into \marg{text}. Over large numbers may cause \TeX~to exhaust its capacity and fail to produce anything.
+\item[\oarg{seed}] is an optional parameter that specifies the seed for random numbers. If it is omitted, the current time (minute) will be used as the seed instead.
+\end{description}\end{macro}
+
+As an example, the following can be created by \cs{maze{30}[4]} and \cs{maze{20}[6]} respectively.
+\begin{figure}[h]
+\begin{minipage}{.5\textwidth}
+\maze{30}[4]
+\end{minipage}\hfill
+\begin{minipage}{.5\textwidth}
+\maze{20}[6]
+\end{minipage}
+\end{figure}
+\eject
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/resmes/README.md b/macros/latex/contrib/resmes/README.md
new file mode 100644
index 0000000000..0847b2a1a5
--- /dev/null
+++ b/macros/latex/contrib/resmes/README.md
@@ -0,0 +1,9 @@
+# resmes
+Restriction of measure in LaTeX
+
+## Package usage
+Just put in your preamble
+
+ \usepackage{resmes}
+
+It provides command `\resmes` that prints measure restriction symbol.
diff --git a/macros/latex/contrib/resmes/resmes.dtx b/macros/latex/contrib/resmes/resmes.dtx
new file mode 100644
index 0000000000..7497320eaf
--- /dev/null
+++ b/macros/latex/contrib/resmes/resmes.dtx
@@ -0,0 +1,76 @@
+% \iffalse meta-comment
+%
+% resmes Restriction of measures symbol in LaTeX
+%
+% Copyright (c) 2022 Paolo
+%
+% Licensed under MIT (https://github.com/Loara/resmes/blob/main/LICENSE)
+%
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{resmes.dtx}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}
+%<package>\ProvidesPackage{resmes}[2022/12/27 v1.0 Restriction of measures symbol in LaTeX]
+%<package>\RequirePackage{xparse}
+%<package>\RequirePackage{tikz}
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{resmes}
+\begin{document}
+\DocInput{resmes.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+%\newcommand{\thpkg}{\texttt{resmes}}
+%
+%\title{\thpkg}
+%\author{Paolo De Donato}
+%\date{2022/21/27\ v1.0}
+%
+%\maketitle
+%
+% This package defines the |\resmes| command in order to print measure restriction symbol. For example in mathmode
+% \begin{verbatim}
+% \mu\resmes A
+% \end{verbatim}
+% expands as
+% \[
+% \mu\resmes A
+% \]
+%
+% This package works also in inline math mode ($\mu\resmes A$) and in subscript/superscript emvironments ($a^{\mu\resmes A}, b_{c^{\mu\resmes A}}$).
+%\StopEventually
+%
+%\section{Implementation}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% \begin{macrocode}
+
+\NewDocumentCommand{\ress@D}{}{
+ \tikz{\draw[thick, join=round, cap=round] (0.24, 0) -- (0,0) -- (0, 0.24);}}
+\NewDocumentCommand{\ress@T}{}{
+ \tikz{\draw[semithick, join=round, cap=round] (0.23, 0) -- (0,0) -- (0, 0.23);}}
+\NewDocumentCommand{\ress@S}{}{
+ \,\tikz{\draw[thin, join=round] (0.154, 0) -- (0,0) -- (0, 0.154);}}
+\NewDocumentCommand{\ress@SS}{}{
+ \tikz{\draw[very thin, join=round] (0.11, 0) -- (0,0) -- (0, 0.11);}}
+
+\NewDocumentCommand{\resmes}{}{
+ \mathchoice{\mathbin{\ress@D}}{\mathbin{\ress@T}}
+ {\mathbin{\ress@S}}{\mathbin{\ress@SS}}}
+
+% \end{macrocode}
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+%\Finale
+%
+%\PrintIndex
diff --git a/macros/latex/contrib/resmes/resmes.ins b/macros/latex/contrib/resmes/resmes.ins
new file mode 100644
index 0000000000..58950cc880
--- /dev/null
+++ b/macros/latex/contrib/resmes/resmes.ins
@@ -0,0 +1,43 @@
+%%
+%% resmes Restriction of measures symbol in LaTeX
+%%
+%% Copyright (c) 2022 Paolo
+%%
+%% Licensed under MIT (https://github.com/Loara/resmes/blob/main/LICENSE)
+%%
+
+\input l3docstrip.tex
+\keepsilent
+
+\usedir{tex/latex/resmes}
+
+\preamble
+
+This is a generated file.
+
+resmes Restriction of measures symbol in LaTeX
+
+Copyright (c) 2022 Paolo
+
+Licensed under MIT (https://github.com/Loara/resmes/blob/main/LICENSE)
+
+\endpreamble
+
+\askforoverwritefalse
+\generate{\file{resmes.sty}{\from{resmes.dtx}{package}}}
+
+\obeyspaces
+\Msg{:^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^)}
+\Msg{(*^.^*)}
+\Msg{*-* Hey dude, remember you have to move the following file *-*}
+\Msg{(*^.^*)}
+\Msg{resmes.sty}
+\Msg{(*^.^*)}
+\Msg{*-* into a directory searched by TeX!! *-*}
+\Msg{*-* To produce the documentation look it up on the Internet. *-*}
+\Msg{(*^.^*)}
+\Msg{*-* See ya! *-*}
+\Msg{(*^.^*)}
+\Msg{:^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^) :^)}
+
+\endbatchfile
diff --git a/macros/latex/contrib/resmes/resmes.pdf b/macros/latex/contrib/resmes/resmes.pdf
new file mode 100644
index 0000000000..ab9bb70f9e
--- /dev/null
+++ b/macros/latex/contrib/resmes/resmes.pdf
Binary files differ
diff --git a/macros/luatex/latex/luaset/README.txt b/macros/luatex/latex/luaset/README.txt
new file mode 100644
index 0000000000..ca7ffb3860
--- /dev/null
+++ b/macros/luatex/latex/luaset/README.txt
@@ -0,0 +1,19 @@
+# Introduction
+The luaset package is developed to define finite sets and perform operations on them inside LaTeX documents.
+There is no particular environment in the package for performing set 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 the LuaLatex engine.
+The time required for operations on sets is not an issue while compiling with the LuaLaTeX engine.
+There is no need to install Lua on the users' system as tex distributions (TeXLive or MikTeX) come bundled with LuaLaTeX.
+
+# License
+The luaset 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 luaset package is similar to plain latex package, where the .sty file is in LaTeX directory of texmf tree.
+The package can be included with \usepackage{luaset} 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
diff --git a/macros/luatex/latex/luaset/luaset.pdf b/macros/luatex/latex/luaset/luaset.pdf
new file mode 100644
index 0000000000..4e4545be84
--- /dev/null
+++ b/macros/luatex/latex/luaset/luaset.pdf
Binary files differ
diff --git a/macros/luatex/latex/luaset/luaset.sty b/macros/luatex/latex/luaset/luaset.sty
new file mode 100644
index 0000000000..2a4821d365
--- /dev/null
+++ b/macros/luatex/latex/luaset/luaset.sty
@@ -0,0 +1,142 @@
+% 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}
+\RequirePackage{luamaths}
+\begin{luacode*}
+sets = {}
+Set = {}
+local mt = {
+ __tostring = function(self)
+ return "\\{" .. table.concat(table.sortedkeys(self), ", ") .. "\\}"
+ end
+}
+
+function Set.new(str)
+ str = str or ""
+ local set = {}
+ for v in utilities.parsers.iterator(str) do
+ set[v] = true
+ end
+ return setmetatable(set, mt)
+end
+
+function Set.union (a, b)
+ local union = {}
+ for k in pairs(a) do union[k] = true end
+ for k in pairs(b) do union[k] = true end
+ return setmetatable(union, mt)
+ end
+
+function Set.intersection (a, b)
+ local intersection = {}
+ for k in pairs(a) do
+ intersection[k] = b[k]
+ end
+ return setmetatable(intersection, mt)
+ end
+
+function Set.difference (a, b)
+ local difference = {}
+ for k in pairs(a) do
+ if b[k]~= true then
+ difference[k] = true
+ end
+ end
+ setmetatable(difference, mt)
+ return difference
+ end
+
+function Set.cardinal (a)
+ local len = 0
+ for k in pairs(a) do
+ len = len + 1
+ end
+ return len
+ end
+
+function Set.subseteq(a, b)
+ for k in pairs(a) do
+ if not b[k] then return false end
+ end
+ return true
+ end
+
+function Set.subset (a, b)
+ return Set.subseteq(a, b) and not (Set.subseteq(b, a) )
+ end
+
+ function Set.equal (a, b)
+ return Set.subseteq(a, b) and (Set.subseteq(b, a) )
+ end
+
+
+function Set.belongsto (x, s)
+ if s[x] then
+ return true
+ else
+ return false
+ end
+ end
+
+\end{luacode*}
+
+\newcommand\luaSetNew[2]{%
+ \directlua{%
+ sets[\luastringN{#1}] = Set.new(\luastringN{#2})
+ }%
+}
+
+\newcommand\luaSetUnion[3]{%
+ \directlua{%
+ sets[\luastringN{#1}] = Set.union(sets[\luastringN{#2}],
+ sets[\luastringN{#3}])
+ }%
+}
+
+\newcommand\luaSetIntersection[3]{%
+ \directlua{%
+ sets[\luastringN{#1}] = Set.intersection(sets[\luastringN{#2}],
+ sets[\luastringN{#3}])
+ }%
+}
+
+\newcommand\luaSetDifference[3]{%
+ \directlua{%
+ sets[\luastringN{#1}] = Set.difference(sets[\luastringN{#2}],
+ sets[\luastringN{#3}])
+ }%
+}
+
+
+\newcommand\luaSetPrint[1]{%
+ \directlua{tex.sprint(tostring(sets[\luastringN{#1}]))}%
+}
+
+\newcommand\luaSetCardinal[1]{%
+ \directlua{tex.sprint(tostring(Set.cardinal(sets[\luastringN{#1}])))}%
+}
+
+\newcommand\luaSetSubseteq[2]{%
+ \directlua{tex.sprint(tostring(Set.subseteq(sets[\luastringN{#1}],sets[\luastringN{#2}])))}%
+}
+
+\newcommand\luaSetSubset[2]{%
+ \directlua{tex.sprint(tostring(Set.subset(sets[\luastringN{#1}],sets[\luastringN{#2}])))}%
+}
+
+\newcommand\luaSetEqual[2]{%
+ \directlua{tex.sprint(tostring(Set.equal(sets[\luastringN{#1}],sets[\luastringN{#2}])))}%
+}
+
+\newcommand\luaSetBelongsto[2]{%
+ \directlua{tex.sprint(tostring(Set.belongsto("#1",sets[\luastringN{#2}])))}%
+}
+
+\endinput
diff --git a/macros/luatex/latex/luaset/luaset.tex b/macros/luatex/latex/luaset/luaset.tex
new file mode 100644
index 0000000000..5a1a08534a
--- /dev/null
+++ b/macros/luatex/latex/luaset/luaset.tex
@@ -0,0 +1,230 @@
+\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 luaset Package in LaTeX}
+\author{Chetan Shirore and Dr. Ajit Kumar}
+\maketitle
+\section{Introduction}\label{section:introduction}
+The \verb|luaset| package is developed to define finite sets and perform operations on finite sets inside LaTeX documents. There is no particular environment in the package for performing set 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 the LuaLaTeX engine. The time required for performing set 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. The package is helps to perform set operations (union, intersection, difference, etcetera) in LaTeX documents. It may also save the users' efforts to copy sets from other software (which may not be in LaTeX compatible format) and to use them in a tex file. The package supports the nesting of commands for multiple operations.
+
+\section{Installation and License}
+
+The installation of the \verb|luaset| 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{luaset}| command in the preamble of the LaTeX document. The TeX file is to be compiled using the LuaLaTeX engine.
+
+The \verb|luaset| 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. Questions on \url{https://tex.stackexchange.com} inspired a small part of the development of this package. The content on this site is available under the \verb|CC BY-SA| license. It also loads the \verb|luamaths| package, which is available under the LaTeX Project Public License v1.3c or later. This package is loaded to use the standard mathematical functions and computations on real numbers while performing operations on sets.
+
+\subsection{Defining and Displaying Sets}
+A set can be defined by using the \verb|\luaSetNew| command.
+\begin{lstlisting}
+\luaSetNew{name}{set}
+\end{lstlisting}
+The following commands define sets \( A \) and \(B \).
+\begin{lstlisting}
+\luaSetNew{A}{a,b,c,10,d,10,a,30}
+\luaSetNew{B}{d,e,f,10,20}
+\end{lstlisting}
+The set can be displayed or printed by using the \verb|\luaSetPrint| command.
+\begin{lstlisting}
+\luaSetPrint{name of set}
+\end{lstlisting}
+ For example, the following commands
+ \begin{lstlisting}
+\(A = \luaSetPrint{A}\) \\
+\(B = \luaSetPrint{B}\)
+\end{lstlisting}
+output to
+\begin{framed}
+\noindent \(A = \{10, 30, a, b, c, d\}\) \\
+\(B = \{10, 20, d, e, f\}\)
+\end{framed}
+The standard mathematical functions can also be used.
+\subsection{Commands in the luaset package}
+Table \ref{tbl:opluaset} summarises commands in the \verb|luaset| package.
+\begin{center}
+\begin{longtable}{llm{5cm}}
+\toprule
+\multicolumn{1}{c}{\textcolor{blue}{Function}} & \multicolumn{1}{c}{\textcolor{blue}{Command Format}} & \multicolumn{1}{c}{\textcolor{blue}{Description}} \\
+\toprule
+\begin{lstlisting}
+\luaSetUnion
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetUnion{set}{set1}{set2}
+\end{lstlisting} & Defines the new set as a union of set1 and set2. \\
+\midrule
+\begin{lstlisting}
+\luaSetIntersection
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetIntersection{set}{set1}{set2}
+\end{lstlisting} & Defines the new set as an intersection of set1 and set2. \\
+\midrule
+\begin{lstlisting}
+\luaSetDifference
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetDifference{set}{set1}{set2}
+\end{lstlisting} & Defines the new set as a difference of set1 and set2. \\
+\midrule
+\begin{lstlisting}
+\luaSetCardinal
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetCardinal{set}
+\end{lstlisting} & Gives the cardinality of a set (number of elements). \\
+\midrule
+\begin{lstlisting}
+\luaSetBelongsto
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetBelongsto{element}{set}
+\end{lstlisting} & Returns true if an element is in a set; otherwise, it returns false.\\
+\midrule
+\begin{lstlisting}
+\luaSetSubseteq
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetSubseteq{set1}{set2}
+\end{lstlisting} & Returns true if set1 is a subset of set2; otherwise, it returns false. \\
+\midrule
+\begin{lstlisting}
+\luaSetSubset
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetSubset{set1}{set2}
+\end{lstlisting} & Returns true if set1 is a proper subset of set2; otherwise, it returns false. \\
+\midrule
+\begin{lstlisting}
+\luaSetEqual
+\end{lstlisting} &
+\begin{lstlisting}
+\luaSetEqual{set1}{set2}
+\end{lstlisting} & Returns true if set1 is equal to set2; otherwise, it returns false. \\
+\bottomrule
+\caption{Commands in the luaset package}
+\label{tbl:opluaset}
+\end{longtable}
+\end{center}
+\subsection{Examples and Usage}
+The latex document (Listing: \ref{code:illluaset}) uses various commands in the \verb|luaset| package.
+\begin{lstlisting}[label={code:illluaset}, caption={LaTeX document with luaset package}]
+\documentclass{article}
+\usepackage{luaset,parskip}
+\begin{document}
+\luaSetNew{A}{a,b,c,\mathCos{0},d,10,a,30}
+\luaSetNew{B}{d,e,f,10,20}
+\luaSetUnion{C}{A}{B}
+\luaSetIntersection{D}{A}{B}
+\luaSetDifference{E}{A}{B}
+\luaSetDifference{F}{B}{A}
+\(A = \luaSetPrint{A}\) % printing set A
+
+\(B = \luaSetPrint{B}\) % printing set B
+
+\(C = A \cup B = \luaSetPrint{C}\) % printing set C
+
+\(D = A\cap B = \luaSetPrint{D}\) % printing set D
+
+\(E = A-B = \luaSetPrint{E}\) % printing set E
+
+\(F = B-A = \luaSetPrint{F}\) % printing set F
+
+The Cardinality of set \(A\) is \luaSetCardinal{A}.
+
+It is \luaSetSubseteq{A}{B} that \(A \subseteq B \).
+
+It is \luaSetSubseteq{A}{C} that \(A \subseteq C \).
+
+It is \luaSetSubset{A}{B} that \(A \subset B \).
+
+It is \luaSetSubset{A}{C} that \(A \subset C \).
+
+\luaSetIntersection{G}{C}{A}
+
+\(G = C \cap A = \luaSetPrint{G}\) % printing set G
+
+It is \luaSetEqual{A}{B} that \(A=B \).
+
+It is \luaSetEqual{G}{A} that \(G=A \).
+
+It is \luaSetBelongsto{z}{A} that \(z \in A \).
+
+It is \luaSetBelongsto{10}{A} that \(10 \in A \).
+
+\luaSetNew{S}{a,10,b,x,y,z,100,200}
+
+\(S = \luaSetPrint{S}\) % printing set S
+
+
+\luaSetIntersection{H}{C}{S}
+\luaSetUnion{I}{D}{S}
+
+\(H = C \cap S = \luaSetPrint{H}\) % printing set H
+
+\(I = D \cup S = \luaSetPrint{I}\) % printing set I
+\end{document}
+\end{lstlisting}
+The latex document (Listing: \ref{code:illluaset}) generates the following output on the compilation.
+
+\begin{framed}
+
+\(A = \{10, 30, 1.0, a, b, c, d\}\) % printing set A
+
+\(B =\{10, 20, d, e, f\}\) % printing set B
+
+\(C = A \cup B = \{10, 20, 30, 1.0, a, b, c, d, e, f\}\) % printing set C
+
+\(D = A\cap B = \{10, d\}\) % printing set D
+
+\(E = A-B = \{30, 1.0, a, b, c\}\) % printing set E
+
+\(F = B-A = \{20, e, f\}\) % printing set F
+
+The Cardinality of set \(A\) is 7.
+
+It is false that \(A \subseteq B \).
+
+It is true that \(A \subseteq C \).
+
+It is false that \(A \subset B \).
+
+It is true that \(A \subset C \).
+
+\(G = C \cap A = \{10, 30, 1.0, a, b, c, d\}\) % printing set G
+
+It is false that \(A=B \).
+
+It is true that \(G=A \).
+
+It is false that \(z \in A \).
+
+It is true that \(10 \in A \).
+
+\(S = \{10, 100, 200, a, b, x, y, z\}\) % printing set S
+
+\(H = C \cap S = \{10, a, b\}\) % printing set H
+
+\(I = D \cup S = \{10, 100, 200, a, b, d, x, y, z\}\) % printing set I
+\end{framed}
+
+
+The luaset package can be modified or extended by adding custom Lua programs. Advanced users acquainted with Lua can do so.
+
+\end{document}