summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-07-12 03:00:52 +0000
committerNorbert Preining <norbert@preining.info>2022-07-12 03:00:52 +0000
commit4d0c22ee19d3a09c266eadd4daf7d5064aff1b06 (patch)
treef57c394e8b540859eaf5d8546cedda96c8d3da0e /macros
parentf38fd211142e080f2d76c320225eb1c75889aae6 (diff)
CTAN sync 202207120300
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.pdfbin67703 -> 67715 bytes
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem-doc.tex2
-rw-r--r--macros/latex/contrib/create-theorem/create-theorem.sty77
-rw-r--r--macros/latex/contrib/lt3rawobjects/lt3rawobjects.dtx532
-rw-r--r--macros/latex/contrib/lt3rawobjects/lt3rawobjects.pdfbin375187 -> 538300 bytes
-rw-r--r--macros/latex/contrib/lwarp/README.txt2
-rw-r--r--macros/latex/contrib/lwarp/lwarp.dtx17
-rw-r--r--macros/latex/contrib/lwarp/lwarp.pdfbin3190117 -> 3190904 bytes
-rwxr-xr-xmacros/latex/contrib/lwarp/lwarpmk.lua4
-rw-r--r--macros/latex/contrib/zref-vario/CHANGELOG.md11
-rw-r--r--macros/latex/contrib/zref-vario/zref-vario-code.pdfbin570457 -> 618882 bytes
-rw-r--r--macros/latex/contrib/zref-vario/zref-vario.dtx70
-rw-r--r--macros/latex/contrib/zref-vario/zref-vario.pdfbin143334 -> 146033 bytes
-rw-r--r--macros/latex/contrib/zref-vario/zref-vario.tex62
-rw-r--r--macros/luatex/latex/luamesh/README9
-rw-r--r--macros/luatex/latex/luamesh/doc/biblio.bib54
-rw-r--r--macros/luatex/latex/luamesh/doc/dum.tex6
-rw-r--r--macros/luatex/latex/luamesh/doc/luamesh-doc.listing84
-rw-r--r--macros/luatex/latex/luamesh/doc/luamesh-doc.pdfbin173181 -> 197905 bytes
-rw-r--r--macros/luatex/latex/luamesh/doc/luamesh-doc.tex152
-rw-r--r--macros/luatex/latex/luamesh/doc/luameshdoc.cls7
-rw-r--r--macros/luatex/latex/luamesh/metapost/luamesh.mp22
-rw-r--r--macros/luatex/latex/luamesh/scripts/luamesh-tex.lua233
-rw-r--r--macros/luatex/latex/luamesh/tex/luamesh.sty176
24 files changed, 1102 insertions, 418 deletions
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
index cf67812782..ff58a811b7 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.pdf
Binary files differ
diff --git a/macros/latex/contrib/create-theorem/create-theorem-doc.tex b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
index b281023f6d..76807f91d3 100644
--- a/macros/latex/contrib/create-theorem/create-theorem-doc.tex
+++ b/macros/latex/contrib/create-theorem/create-theorem-doc.tex
@@ -97,7 +97,7 @@
\begin{document}
-\def\PackageVersion{2022/07/01}
+\def\PackageVersion{2022/07/11}
\title{\createtheorempackage{}\\\smallskip\itshape Initializing theorem-like environments with multilingual support}
\author{Jinwen XU}
diff --git a/macros/latex/contrib/create-theorem/create-theorem.sty b/macros/latex/contrib/create-theorem/create-theorem.sty
index be073edded..fb9ecdc551 100644
--- a/macros/latex/contrib/create-theorem/create-theorem.sty
+++ b/macros/latex/contrib/create-theorem/create-theorem.sty
@@ -12,7 +12,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesExplPackage
{create-theorem}
- {2022/07/01} {}
+ {2022/07/11} {}
{Initializing theorem-like environments with multilingual support}
\keys_define:nn { create-theorem }
@@ -214,10 +214,10 @@
% It is assumed that when #3 is empty, so is #5
\tl_if_blank:eTF { #3 }
{
- \tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } }
- \tl_gset:cn { g_crthm_core_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \skip_horizontal:n { -.75ex } }
- \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } }
- \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \crefthemark { \skip_horizontal:n { -.75ex } } }
+ \tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { }
+ \tl_gset:cn { g_crthm_core_name_ #7 ref_article_plural_ #1 _ #2 _tl } { }
+ \tl_gset:cn { g_crthm_name_ #7 ref_article_singular_ #1 _ #2 _tl } { \nobreak \crefthemark { \skip_horizontal:n { -.75ex } } \nobreak }
+ \tl_gset:cn { g_crthm_name_ #7 ref_article_plural_ #1 _ #2 _tl } { \nobreak \crefthemark { \skip_horizontal:n { -.75ex } } \nobreak }
}
{
\tl_gset:cn { g_crthm_core_name_ #7 ref_article_singular_ #1 _ #2 _tl } { #3 }
@@ -231,8 +231,21 @@
\tl_new:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl }
}
- \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #4 } }
- \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #6 } }
+ \tl_if_blank:eTF { #4 }
+ {
+ \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \nobreak \skip_horizontal:n { -.25ex } \nobreak }
+ }
+ {
+ \tl_gset:cn { g_crthm_name_ #7 ref_singular_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #4 } }
+ }
+
+ \tl_if_blank:eTF { #6 }
+ {
+ \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \nobreak \skip_horizontal:n { -.25ex } \nobreak }
+ }
+ {
+ \tl_gset:cn { g_crthm_name_ #7 ref_plural_ #1 _ #2 _tl } { \tl_use:c { g_crthm_style_ #7 refname_ #1 _ #2 _tl } { #6 } }
+ }
\bool_if:NTF \l__crthm_regionalref_bool
{% "regionalref" mode
@@ -613,10 +626,10 @@
% Uncomment the lines below if you wish to use the definite article of the first environment
% \bool_if:NT \l_tmpa_bool
% {
- \tl_gset:cn { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_singular_ ####1 _ ##1 _tl } }
- \tl_gset:cn { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_cref_article_plural_ ####1 _ ##1 _tl } }
- \tl_gset:cn { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_singular_ ####1 _ ##1 _tl } }
- \tl_gset:cn { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } { \tl_use:c { g_crthm_core_name_Cref_article_plural_ ####1 _ ##1 _tl } }
+ \tl_gset_eq:cc { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } { g_crthm_core_name_cref_article_singular_ ####1 _ ##1 _tl }
+ \tl_gset_eq:cc { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } { g_crthm_core_name_cref_article_plural_ ####1 _ ##1 _tl }
+ \tl_gset_eq:cc { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } { g_crthm_core_name_Cref_article_singular_ ####1 _ ##1 _tl }
+ \tl_gset_eq:cc { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } { g_crthm_core_name_Cref_article_plural_ ####1 _ ##1 _tl }
% \bool_set_false:N \l_tmpa_bool
% }
\seq_gput_right:cn { g_crthm_name_heading_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_heading_ ####1 _ ##1 _tl } }
@@ -625,25 +638,45 @@
\seq_gput_right:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_Cref_singular_ ####1 _ ##1 _tl } }
\seq_gput_right:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \tl_use:c { g_crthm_name_Cref_plural_ ####1 _ ##1 _tl } }
% set the numbering style to be the same as the last environment
- \tl_gset:cn { g_crthm_number_style_ #1 _tl } { \tl_use:c { g_crthm_number_style_ ####1 _tl } }
+ \tl_gset_eq:cc { g_crthm_number_style_ #1 _tl } { g_crthm_number_style_ ####1 _tl }
}
% set heading name for the combined environment
\tl_gset:cn { g_crthm_name_heading_ #1 _ ##1 _tl } { \seq_use:cn { g_crthm_name_heading_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
% set crefname for the combined environment
- \__crthm_set_name_crefname:nnn { #1 } { ##1 }
+ \tl_if_empty:cTF { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl }
{
- [ \tl_use:c { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } ]
- { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
- [ \tl_use:c { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } ]
- { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ \__crthm_set_name_crefname:nnn { #1 } { ##1 }
+ {
+ { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ }
+ }
+ {
+ \__crthm_set_name_crefname:nnn { #1 } { ##1 }
+ {
+ [ \tl_use:c { g_crthm_saved_name_cref_article_singular_ #1 _ ##1 _tl } ]
+ { \seq_use:cn { g_crthm_name_cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ [ \tl_use:c { g_crthm_saved_name_cref_article_plural_ #1 _ ##1 _tl } ]
+ { \seq_use:cn { g_crthm_name_cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ }
}
% set Crefname for the combined environment
- \__crthm_set_name_Crefname:nnn { #1 } { ##1 }
+ \tl_if_empty:cTF { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl }
+ {
+ \__crthm_set_name_Crefname:nnn { #1 } { ##1 }
+ {
+ { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ }
+ }
{
- [ \tl_use:c { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } ]
- { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
- [ \tl_use:c { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } ]
- { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ \__crthm_set_name_Crefname:nnn { #1 } { ##1 }
+ {
+ [ \tl_use:c { g_crthm_saved_name_Cref_article_singular_ #1 _ ##1 _tl } ]
+ { \seq_use:cn { g_crthm_name_Cref_singular_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ [ \tl_use:c { g_crthm_saved_name_Cref_article_plural_ #1 _ ##1 _tl } ]
+ { \seq_use:cn { g_crthm_name_Cref_plural_ #1 _ ##1 _seq } { \g_crthm_combined_name_sep_tl } }
+ }
}
}
}
diff --git a/macros/latex/contrib/lt3rawobjects/lt3rawobjects.dtx b/macros/latex/contrib/lt3rawobjects/lt3rawobjects.dtx
index 54559ca295..db1a24be3f 100644
--- a/macros/latex/contrib/lt3rawobjects/lt3rawobjects.dtx
+++ b/macros/latex/contrib/lt3rawobjects/lt3rawobjects.dtx
@@ -22,33 +22,37 @@
%
% \iffalse
%<*driver>
-\ProvidesFile{lt3rawobjects.dtx}[2022/06/30 1.0.2 Objects and proxies in LaTeX3]
+\ProvidesFile{lt3rawobjects.dtx}[2022/07/11 1.1.1 Objects and proxies in LaTeX3]
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\RequirePackage{expl3}[2022-04-10]
-%<package>\ProvidesExplPackage{lt3rawobjects}{2022/06/30}{ 1.0.2 }{Objects and proxies in LaTeX3}
+%<package>\ProvidesExplPackage{lt3rawobjects}{2022/07/11}{ 1.1.1 }{Objects and proxies in LaTeX3}
%<*driver>
\documentclass[full]{l3doc}
\usepackage{lt3rawobjects}
+\usepackage{xparse}
\begin{document}
\DocInput{lt3rawobjects.dtx}
\end{document}
%</driver>
% \fi
%
-%\newcommand{\thpkg}{\pkg{lt3rawobjects}}
+% \NewDocumentCommand{\thpkg}{}{\pkg{lt3rawobjects}}
+% \NewDocumentCommand{\thvsn}{}{1.1.1}
+% \NewDocumentCommand{\thdta}{}{2022/07/11}
+% \NewDocumentCommand{\fromV}{ m }{{\ttfamily From: #1}}
%
-%\title{The \pkg{lt3rawobjects} package}
-%\author{Paolo De Donato}
-% \date{Released 2022/06/30 Version 1.0.2}
+% \title{The \pkg{lt3rawobjects} package}
+% \author{Paolo De Donato}
+% \date{Released \thdta\ Version \thvsn}
%
-%\maketitle
+% \maketitle
%
-%\tableofcontents
+% \tableofcontents
%
-%\begin{documentation}
+% \begin{documentation}
%
-%\section{Introduction}
+% \section{Introduction}
% First to all notice that \thpkg\ means ``raw object(s)'', indeed \thpkg\ introduces a new mechanism to create objects like the well known C structures. The functions exported by this package are quite low level, and many important mechanisms like member protection and name resolution aren't already defined and should be introduced by intermediate packages.
%
% \section{To do}
@@ -61,17 +65,17 @@
% \section{Objects and proxies}
% Usually an object in programming languages can be seen as a collection of variables (organized in different ways depending on the chosen language) treated as part of a single entity. Also in \thpkg\ objects are collections of variables, called member variables, which can be retrieved from a string representing that object. Such string is the \emph{address} of the object and act like the address of a structure in C.
%
-% An address is composed of two parts, the \emph{module} in which variables are created and an \emph{identifier} that identify uniquely the object inside its module. It's up to the caller that two different objects have different identifiers. The address of an object can be obtained with the \cs{object_address} function. Identifiers and module names should not contain numbers, \verb|#| and \verb|_| characters in order to avoid conflicts with automatically generated addresses.
+% An address is composed of two parts, the \emph{module} in which variables are created and an \emph{identifier} that identify uniquely the object inside its module. It's up to the caller that two different objects have different identifiers. The address of an object can be obtained with the \cs{object_address} function. Identifiers and module names should not contain numbers, |#| and |_| characters in order to avoid conflicts with automatically generated addresses.
%
% In C each object/structure has a \emph{type} that tells the compiler how each object should be organized and instantiated in the memory. So if you need to create objects with the same structure you should first create a new \verb|struct| entity and then create object with such type.
%
% In \thpkg\ objects are created from an existing object with a particular structure that holds all the needed informations to organize their variables. Such objects that can be used to instantiate new objects are calles \emph{proxies} and the proxy object used to instantiate an object is its \emph{generator}. In order to create new objects with a specified proxy you can use the \cs{object_create} functions.
%
-% Since proxies are themself objects we need a proxy to instantiate user defined proxies, you can use the \verb|proxy| object in the \verb|lt3rawobjects| module to create you own proxy, which address is held by the \cs{c_proxy_address_str} variable. Proxies must be created from the \verb|proxy| object otherwise they won't be recognized as proxies. Instead of using \cs{object_create} to create proxies you can directly use the function \cs{proxy_create}.
+% Since proxies are themself objects we need a proxy to instantiate user defined proxies, you can use the |proxy| object in the |rawobjects| module to create you own proxy, which address is held by the \cs{c_proxy_address_str} variable. Proxies must be created from the |proxy| object otherwise they won't be recognized as proxies. Instead of using \cs{object_create} to create proxies you can directly use the function \cs{proxy_create}.
%
% Once you've created you proxy object you should specify its member variables that will be created in each object initialized with such proxy. You can add a variable specification with the \cs{proxy_push_member} function. Once you've added all yor variables specifications you can use your proxy to create objects. You should never modify a proxy once you've used it to create at least one object, since these modifications won't be updated on already created objects, leading to hidden errors in subsequential code.
%
-% When you create a new variable specification with the \cs{proxy_push_member} you can notice the presence of \meta{type} parameter. It represents the type of such variable and can be a standard type (like \verb|tl|, \verb|str|, \verb|int|, \verb|seq|, ...) or user defined types if the following functions are defined:
+% When you create a new variable specification with the \cs{proxy_push_member} you can notice the presence of \meta{type} parameter. It represents the type of such variable and can be a standard type (like |tl|, |str|, |int|, |seq|, ...) or user defined types if the following functions are defined:
%
% \begin{description}
% \item[] \cs{\meta{type}_new:N} and \verb|c| variant;
@@ -88,13 +92,37 @@
% \end{itemize}
% In a local/global/public/private object every member variable is declared local/global/public/private. Address of a member variable can be obtained with the \cs{object_member_adr} function, and you can instantiate new members that haven't been specified in its generator with the function \cs{object_new_member}. members created in this way aren't described by generator proxy, so its type can't be deduced and should be always specified in functions like \cs{object_member_adr} or \cs{object_member_use}.
%
-%\section{Library functions}
+% \section{Constants}
+% This feature is available only from version 1.1 of \thpkg. There're two different kinds of constants you can define on a object:
+% \begin{enumerate}
+% \item \emph{near constants} are constants defined directly inside the associated object;
+% \item \emph{remote constants} are constants that are defined instead on the generator proxy and so every object generated with that proxy can access the constant.
+% \end{enumerate}
+% Currently it's possible to define only public constants, if you need private constants use member variables instead.
+%
+% Notice that all near constants declared on a proxy are automatically remote constants for every generated object, but remote constants for a proxy aren't directly accessible by generated objects.
+%
+% You can retrieve the address of a near constant with the \cs{object_nconst_adr} function and of a remote constant with \cs{object_rconst_adr}.
+%
+% \section{Library functions}
+% \subsection{Base object functions}
%
% \begin{function}[EXP]{\object_address:nn}
% \begin{syntax}
-% \cs{object_address:nn} \marg{module} \marg{id}
+% \cs{object_address:nn} \Arg{module} \Arg{id}
% \end{syntax}
-% Expands to the object address.
+% Composes the address of object in module \meta{module} with identifier \meta{id} and places it in the input stream. Notice that \meta{module} and \meta{id} are converted to strings before composing them in the address, so they shouldn't contain any command inside. If you want to execute its content you should use a new variant, for example |V|, |f| or |e| variants.
+%
+% \fromV{1.0}
+% \end{function}
+%
+% \begin{function}{\object_address_set:Nnn, \object_address_gset:Nnn}
+% \begin{syntax}
+% \cs{object_address_set:nn} \meta{str var} \Arg{module} \Arg{id}
+% \end{syntax}
+% Stores the adress of selected object inside the string variable \meta{str var}.
+%
+% \fromV{1.1}
% \end{function}
%
% \begin{function}[pTF]{\object_if_exist:n, \object_if_exist:V}
@@ -102,7 +130,9 @@
% \cs{object_if_exist_p:n} \marg{address}
% \cs{object_if_exist:nTF} \marg{address} \marg{true code} \marg{false code}
% \end{syntax}
-% Tests if exists an object at the specified address.
+% Tests if an object was instantiated at the specified address.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[EXP]{\object_get_module:n, \object_get_module:V, \object_get_proxy_adr:n, \object_get_proxy_adr:V}
@@ -110,7 +140,9 @@
% \cs{object_get_module:n} \marg{address}
% \cs{object_get_proxy_adr:n} \marg{address}
% \end{syntax}
-% Get the module and the generator proxy of specified object.
+% Get the object module and its generator.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[pTF]{\object_if_local:n, \object_if_global:n, \object_if_local:V, \object_if_global:V}
@@ -119,22 +151,30 @@
% \cs{object_if_local:nTF} \marg{address} \marg{true code} \marg{false code}
% \end{syntax}
% Tests if the object is local or global.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[pTF]{\object_if_public:n, \object_if_private:n, \object_if_public:V, \object_if_private:V}
% \begin{syntax}
-% \cs{object_if_local_p:n} \marg{address}
-% \cs{object_if_local:nTF} \marg{address} \marg{true code} \marg{false code}
+% \cs{object_if_public_p:n} \marg{address}
+% \cs{object_if_public:nTF} \marg{address} \marg{true code} \marg{false code}
% \end{syntax}
% Tests if the object is public or private.
+%
+% \fromV{1.0}
% \end{function}
%
+% \subsection{Operating with member variables and constants}
+%
% \begin{function}[EXP]{\object_member_adr:nnn, \object_member_adr:Vnn, \object_member_adr:nnv, \object_member_adr:nn, \object_member_adr:Vn}
% \begin{syntax}
% \cs{object_member_adr:nnn} \marg{address} \marg{member name} \marg{member type}
% \cs{object_member_adr:nn} \marg{address} \marg{member name}
% \end{syntax}
% Fully expands to the address of specified member variable. If type is not specified it'll be retrieved from the generator proxy, but only if member is specified in the generator.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[EXP]{\object_member_type:nn, \object_member_type:Vn}
@@ -142,6 +182,8 @@
% \cs{object_member_type:nn} \marg{address} \marg{member name}
% \end{syntax}
% Fully expands to the type of member \meta{member name}. Use this function only with member variables specified in the generator proxy, not with other member variables.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}{\object_new_member:nnn, \object_new_member:Vnn, \object_new_member:nnv}
@@ -149,6 +191,8 @@
% \cs{object_new_member:nnn} \marg{address} \marg{member name} \marg{member type}
% \end{syntax}
% Creates a new member variable with specified name and type. You can't retrieve the type of these variables with \cs{object_member_type} functions.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[EXP]{\object_member_use:nnn, \object_member_use:Vnn, \object_member_use:nnv, \object_member_use:nn, \object_member_use:Vn}
@@ -157,6 +201,8 @@
% \cs{object_member_use:nn} \marg{address} \marg{member name}
% \end{syntax}
% Uses the specified member variable.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}[EXP]{\object_member_set_eq:nnnN, \object_member_set_eq:nnvN, \object_member_set_eq:VnnN, \object_member_set_eq:nnnc, \object_member_set_eq:Vnnc, \object_member_set_eq:nnN, \object_member_set_eq:VnN, \object_member_set_eq:nnc, \object_member_set_eq:Vnc}
@@ -165,18 +211,77 @@
% \cs{object_member_set_eq:nnN} \marg{address} \marg{member name} \meta{variable}
% \end{syntax}
% Sets the value of specified member equal to the value of \meta{variable}.
+%
+% \fromV{1.0}
+% \end{function}
+%
+% \begin{function}[EXP]{\object_nconst_adr:nnn, \object_nconst_adr:Vnn, \object_nconst_adr:vnn, \object_rconst_adr:nnn, \object_rconst_adr:Vnn}
+% \begin{syntax}
+% \cs{object_nconst_adr:nnn} \Arg{address} \Arg{member name} \Arg{member type}
+% \end{syntax}
+% Fully expands to the address of specified near/remote constant.
+%
+% \fromV{1.1}
+% \end{function}
+%
+% \begin{function}[EXP]{\object_nconst_use:nnn, \object_nconst_use:Vnn, \object_rconst_use:nnn, \object_rconst_use:Vnn}
+% \begin{syntax}
+% \cs{object_nconst_use:nnn} \Arg{address} \Arg{member name} \Arg{member type}
+% \end{syntax}
+% Uses the specified near/remote constant.
+%
+% \fromV{1.1}
+% \end{function}
+%
+% \subsection{Constant creation}
+% Unlike normal variables, constants in \LaTeX3 are created in different ways depending on the specified type. So we dedicate a new section only to collect some of these fuinctions readapted for near constants (remote constants are simply near constants created on the generator proxy).
+%
+% \begin{function}{\object_newconst_tl:nnn, \object_newconst_tl:Vnn, \object_newconst_str:nnn, \object_newconst_str:Vnn, \object_newconst_int:nnn, \object_newconst_int:Vnn, \object_newconst_clist:nnn, \object_newconst_clist:Vnn, \object_newconst_dim:nnn, \object_newconst_dim:Vnn, \object_newconst_skip:nnn, \object_newconst_skip:Vnn, \object_newconst_fp:nnn, \object_newconst_fp:Vnn}
+% \begin{syntax}
+% \cs{object_newconst_\meta{type}:nnn} \Arg{address} \Arg{constant name} \Arg{value}
+% \end{syntax}
+% Creates a constant variable with type \meta{type} and sets its value to \meta{value}.
+%
+% \fromV{1.1}
+% \end{function}
+%
+% \begin{function}{\object_newconst_seq_from_clist:nnn, \object_newconst_seq_from_clist:Vnn}
+% \begin{syntax}
+% \cs{object_newconst_seq_from_clist:nnn} \Arg{address} \Arg{constant name} \Arg{comma-list}
+% \end{syntax}
+% Creates a |seq| constant which is set to contain all the items in \meta{comma-list}.
+%
+% \fromV{1.1}
% \end{function}
%
+% \begin{function}{\object_newconst_prop_from_keyval:nnn, \object_newconst_prop_from_keyval:Vnn}
+% \begin{syntax}
+% \cs{object_newconst_prop_from_keyval:nnn} \Arg{address} \Arg{constant name}
+% \{
+% \meta{key} = \meta{value}, ...
+% \}
+% \end{syntax}
+% Creates a |prop| constant which is set to contain all the specified key-value pairs.
+%
+% \fromV{1.1}
+% \end{function}
+%
+% \subsection{Proxy utilities and object creation}
+%
% \begin{function}[pTF]{\object_if_proxy:n, \object_if_proxy:V}
% \begin{syntax}
% \cs{object_if_proxy_p:n} \marg{address}
% \cs{object_if_proxy:nTF} \marg{address} \marg{true code} \marg{false code}
% \end{syntax}
% Test if the specified object is a proxy object.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{variable}{\c_proxy_address_str}
-% The address of the \verb|proxy| object in the \verb|lt3rawobjects| module.
+% The address of the |proxy| object in the |rawobjects| module.
+%
+% \fromV{1.0}
% \end{variable}
%
% \begin{function}{\object_create:nnnNN, \object_create:VnnNN}
@@ -184,14 +289,20 @@
% \cs{object_create:nnnNN} \marg{proxy address} \marg{module} \marg{id} \meta{scope} \meta{visibility}
% \end{syntax}
% Creates an object by using the proxy at \meta{proxy address} and the specified parameters.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{variable}{\c_object_local_str, \c_object_global_str}
% Possible values for \meta{scope} parameter.
+%
+% \fromV{1.0}
% \end{variable}
%
% \begin{variable}{\c_object_public_str, \c_object_private_str}
% Possible values for \meta{visibility} parameter.
+%
+% \fromV{1.0}
% \end{variable}
%
% \begin{function}{\object_create_set:NnnnNN, \object_create_set:NVnnNN, \object_create_gset:NnnnNN, \object_create_gset:NVnnNN}
@@ -199,6 +310,17 @@
% \cs{object_create_set:NnnnNN} \meta{str var} \marg{proxy address} \marg{module} \marg{id} \meta{scope} \meta{visibility}
% \end{syntax}
% Creates an object and sets its fully expanded address inside \meta{str var}.
+%
+% \fromV{1.0}
+% \end{function}
+%
+% \begin{function}{\object_allocate_incr:NNnnNN, \object_allocate_incr:NNVnNN, \object_gallocate_incr:NNnnNN, \object_gallocate_incr:NNVnNN, \object_allocate_gincr:NNnnNN, \object_allocate_gincr:NNVnNN, \object_gallocate_gincr:NNnnNN, \object_gallocate_gincr:NNVnNN}
+% \begin{syntax}
+% \cs{object_allocate_incr:NNnnNN} \meta{str var} \meta{int var} \Arg{proxy address} \Arg{module} \meta{scope} \meta{visibility}
+% \end{syntax}
+% Build a new object address with module \meta{module} and an identifier generated from \meta{proxy address} and the integer contained inside \meta{int var}, then increments \meta{int var}. This is very useful when you need to create a lot of objects, each of them on a different address. the |_incr| version increases \meta{int var} locally whereas |_gincr| does it globally.
+%
+% \fromV{1.1}
% \end{function}
%
% \begin{function}{\proxy_create:nnN, \proxy_create_set:NnnN, \proxy_create_gset:NnnN}
@@ -207,6 +329,8 @@
% \cs{proxy_create_set:NnnN} \meta{str var} \marg{module} \marg{id} \meta{visibility}
% \end{syntax}
% Creates a global proxy object.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}{\proxy_push_member:nnn, \proxy_push_member:Vnn}
@@ -214,6 +338,8 @@
% \cs{proxy_push_member:nnn} \marg{proxy address} \marg{ member name } \marg{ member type }
% \end{syntax}
% Updates a proxy object with a new member specification, so that every subsequential object created with this proxy will have a member variable with the specified name and type that can be retrieved with \cs{object_member_type} functions.
+%
+% \fromV{1.0}
% \end{function}
%
% \begin{function}{\object_assign:nn, \object_assign:Vn, \object_assign:nV, \object_assign:VV}
@@ -221,6 +347,8 @@
% \cs{object_assign:nn} \marg{to address} \marg{from address}
% \end{syntax}
% Assigns the content of each variable of object at \meta{from address} to each correspective variable in \meta{to address}. Both the objects should be created with the same proxy object and only variables listed in the proxy are assigned.
+%
+% \fromV{1.0}
% \end{function}
%
% \section{Examples}
@@ -248,9 +376,7 @@
% \object_member_use:Vn \l_myobj_str { myvar }
% \end{verbatim}
%
-% Output:
-%
-% \ExplSyntaxOn
+% Output: \ExplSyntaxOn
% \str_new:N \l_myproxy_str
% \proxy_create_set:NnnN \l_myproxy_str { example }{ myproxy }
% \c_object_public_str
@@ -266,6 +392,68 @@
% \object_member_use:Vn \l_myobj_str { myvar }
% \ExplSyntaxOff
%
+% If you don't want to specify an object identifier you can also do
+%
+% \begin{verbatim}
+% \int_new:N \l_intc_int
+% \object_allocate_incr:NNVnNN \l_myobj_str \l_intc_int \l_myproxy_str
+% { example } \c_object_local_str \c_object_public_str
+% \tl_set:cn
+% {
+% \object_member_adr:Vn \l_myobj_str { myvar }
+% }
+% { \c_dollar_str{} ~ dollar ~ \c_dollar_str{} }
+% \object_member_use:Vn \l_myobj_str { myvar }
+% \end{verbatim}
+%
+% Output: \ExplSyntaxOn
+% \int_new:N \l_intc_int
+% \object_allocate_incr:NNVnNN \l_myobj_str \l_intc_int \l_myproxy_str
+% { example } \c_object_local_str \c_object_public_str
+% \tl_set:cn
+% {
+% \object_member_adr:Vn \l_myobj_str { myvar }
+% }
+% { \c_dollar_str{} ~ dollar ~ \c_dollar_str{} }
+% \object_member_use:Vn \l_myobj_str { myvar }
+% \ExplSyntaxOff
+%
+% \section{Templated proxies}
+% At the current time there isn't a standardized approach to templated proxies. One problem of standardized templated proxies is how to define struct addresses for every kind of argument (token lists, strings, integer expressions, non expandable arguments, ...).
+%
+% Even if there isn't currently a function to define every kind of templated proxy you can anyway define your templated proxy with your custom parameters. You simply need to define at least two functions:
+% \begin{itemize}
+% \item an expandable macro that, given all the needed arguments, fully expands to the address of your templated proxy. This address can be obtained by calling \cs{object_address} \marg{module} \marg{id} where \meta{id} starts with the name of your templated proxy and is followed by a composition of specified arguments;
+% \item a not expandable macro that tests if the templated proxy with specified arguments is instantiated and, if not, instantiate it with different calls to \cs{proxy_create} and \cs{proxy_push_member}.
+% \end{itemize}
+%
+% In order to apply these concepts we'll provide a simple implementation of a linked list with a template parameter representing the type of variable that holds our data. A linked list is simply a sequence of nodes where each node contains your data and a pointer to the next node. For the moment we 'll show a possiple implementation of a template proxy class for such |node| objects.
+%
+% First to all we define an expandable macro that fully expands to our node name:
+% \begin{verbatim}
+% \cs_new:Nn \node_address:n
+% {
+% \object_address:nn { linklist }{ node - #1 }
+% }
+% \end{verbatim}
+% where the |#1| argument is simply a string representing the type of data held by our linked list (for example |tl|, |str|, |int|, ...). Next we need a functions that instantiate our proxy address if it doesn't exist:
+% \begin{verbatim}
+% \cs_new_protected:Nn \node_instantiate:n
+% {
+% \object_if_exist:nF {\node_address:n { #1 } }
+% {
+% \proxy_create:nnN { linklist }{ node - #1 }
+% \c_object_public_str
+% \proxy_push_member:nnn {\node_address:n { #1 } }
+% { next }{ str }
+% \proxy_push_member:nnn {\node_address:n { #1 } }
+% { data }{ #1 }
+% }
+% }
+% \end{verbatim}
+% As you can see when \cs{node_instantiate} is called it first test if the proxy object exists. If not then it creates a new proxy with that name and populates it with the specifications of two members: a |next| member variable of type |str| that points to the next node, and a |data| member of the specified type that holds your data.
+%
+% Clearly you can define new functions to work with such nodes, for example to test if the next node exists or not, to add and remove a node, search inside a linked list, ...
%
%
%\end{documentation}
@@ -278,7 +466,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<@@=objpriv>
+%<@@=rawobjects>
% \end{macrocode}
%
%
@@ -303,6 +491,21 @@
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\object_address_set:Nnn, \object_address_gset:Nnn}
+% Saves the address of an object into a string variable
+% \begin{macrocode}
+
+\cs_new_protected:Nn \object_address_set:Nnn {
+ \str_set:Nn #1 { #2 _ #3 }
+}
+
+\cs_new_protected:Nn \object_address_gset:Nnn {
+ \str_gset:Nn #1 { #2 _ #3 }
+}
+
+% \end{macrocode}
+%\end{macro}
+%
% \begin{macrocode}
\cs_new:Nn \@@_object_modvar:n{
c __ #1 _ MODULE _ str
@@ -372,13 +575,14 @@
% \begin{macrocode}
\prg_new_conditional:Nnn \object_if_local:n {p, T, F, TF}
{
- \str_if_eq:cNTF { \@@_object_scovar:n {#1} } \c_object_local_str
- {
- \prg_return_true:
- }
- {
- \prg_return_false:
- }
+ \str_if_eq:cNTF { \@@_object_scovar:n {#1} }
+ \c_object_local_str
+ {
+ \prg_return_true:
+ }
+ {
+ \prg_return_false:
+ }
}
\prg_new_conditional:Nnn \object_if_global:n {p, T, F, TF}
@@ -425,7 +629,7 @@
% \end{macrocode}
%\end{macro}
%
-%You can retrieve the address of a member variable with the following function:
+%
%\begin{macro}{\object_member_adr:nnn, \object_member_adr:nn}
%Get the address of a member variable
% \begin{macrocode}
@@ -491,7 +695,7 @@
%
% \begin{macrocode}
-\msg_new:nnnn { lt3rawobjects }{ scoperr }{ Nonstandard ~ scope }
+\msg_new:nnnn { rawobjects }{ scoperr }{ Nonstandard ~ scope }
{
Operation ~ not ~ permitted ~ on ~ object ~ #1 ~
~ since ~ it ~ wasn't ~ declared ~ local ~ or ~ global
@@ -504,7 +708,7 @@
\object_if_local_p:n { #1 } || \object_if_global_p:n { #1 }
}
{
- \msg_error:nnx { lt3rawobjects }{ scoperr }{ #1 }
+ \msg_error:nnx { rawobjects }{ scoperr }{ #1 }
}
}
@@ -587,12 +791,150 @@
% \end{macrocode}
%\end{macro}
%
+%\begin{macro}{\object_nconst_adr:nnn, \object_rconst_adr:nnn}
+% Get the address of a near/remote constant.
+% \begin{macrocode}
+
+\cs_new:Nn \object_nconst_adr:nnn
+ {
+ c _ #1 \tl_to_str:n { _ CONST _ #2 _ #3 }
+ }
+
+\cs_generate_variant:Nn \object_member_adr:nnn { Vnn, vnn }
+
+\cs_new:Nn \object_rconst_adr:nnn
+ {
+ \object_nconst_adr:vnn { \@@_object_pxyvar:n { #1 } }
+ { #2 }{ #3 }
+ }
+
+\cs_generate_variant:Nn \object_member_adr:nnn { Vnn }
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\object_nconst_use:nnn, \object_rconst_use:nnn}
+% Uses a near/remote constant.
+% \begin{macrocode}
+
+\cs_new:Nn \object_nconst_use:nnn
+ {
+ \cs_if_exist_use:cT { #3 _ use:c }
+ {
+ { \object_nconst_adr:nnn { #1 }{ #2 }{ #3 } }
+ }
+ }
+
+\cs_new:Nn \object_rconst_use:nnn
+ {
+ \cs_if_exist_use:cT { #3 _ use:c }
+ {
+ { \object_rconst_adr:nnn { #1 }{ #2 }{ #3 } }
+ }
+ }
+
+\cs_generate_variant:Nn \object_nconst_use:nnn { Vnn }
+\cs_generate_variant:Nn \object_rconst_use:nnn { Vnn }
+
+% \end{macrocode}
+%\end{macro}
+%
+%
+% \begin{macro}{\object_newconst_tl:nnn, \object_newconst_str:nnn, \object_newconst_int:nnn, \object_newconst_clist:nnn, \object_newconst_dim:nnn, \object_newconst_skip:nnn, \object_newconst_fp:nnn}
+% Create constants
+% \begin{macrocode}
+
+\cs_new_protected:Nn \@@_const_create:nnnn
+ {
+ \use:c { #1 _ const:cn }
+ {
+ \object_nconst_adr:nnn { #2 }{ #3 }{ #1 }
+ }
+ { #4 }
+ }
+
+\cs_new_protected:Nn \object_newconst_tl:nnn
+ {
+ \@@_const_create:nnnn { tl }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_str:nnn
+ {
+ \@@_const_create:nnnn { str }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_int:nnn
+ {
+ \@@_const_create:nnnn { int }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_clist:nnn
+ {
+ \@@_const_create:nnnn { clist }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_dim:nnn
+ {
+ \@@_const_create:nnnn { dim }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_skip:nnn
+ {
+ \@@_const_create:nnnn { skip }{ #1 }{ #2 }{ #3 }
+ }
+\cs_new_protected:Nn \object_newconst_fp:nnn
+ {
+ \@@_const_create:nnnn { fp }{ #1 }{ #2 }{ #3 }
+ }
+
+\cs_generate_variant:Nn \object_newconst_tl:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_str:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_int:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_clist:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_dim:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_skip:nnn { Vnn }
+\cs_generate_variant:Nn \object_newconst_fp:nnn { Vnn }
+
+% \end{macrocode}
+%\end{macro}
+%
+% \begin{macro}{\object_newconst_seq_from_clist:nnn}
+% Creates a |seq| constant.
+% \begin{macrocode}
+
+\cs_new_protected:Nn \object_newconst_seq_from_clist:nnn
+ {
+ \seq_const_from_clist:cn
+ {
+ \object_nconst_adr:nnn { #1 }{ #2 }{ seq }
+ }
+ { #3 }
+ }
+
+\cs_generate_variant:Nn \object_newconst_seq_from_clist:nnn { Vnn }
+
+% \end{macrocode}
+%\end{macro}
+%
+% \begin{macro}{\object_newconst_prop_from_keyval:nnn}
+% Creates a |prop| constant.
+% \begin{macrocode}
+
+\cs_new_protected:Nn \object_newconst_prop_from_keyval:nnn
+ {
+ \prop_const_from_keyval:cn
+ {
+ \object_nconst_adr:nnn { #1 }{ #2 }{ prop }
+ }
+ { #3 }
+ }
+
+\cs_generate_variant:Nn \object_newconst_prop_from_keyval:nnn { Vnn }
+
+% \end{macrocode}
+%\end{macro}
+%
+%
%
%\begin{variable}{\c_proxy_address_str}
%The address of the \verb|proxy| object.
% \begin{macrocode}
\str_const:Nx \c_proxy_address_str
- { \object_address:nn { lt3rawobjects }{ proxy } }
+ { \object_address:nn { rawobjects }{ proxy } }
% \end{macrocode}
%\end{variable}
%
@@ -600,7 +942,7 @@
% Source of \verb|proxy| object
% \begin{macrocode}
\str_const:cn { \@@_object_modvar:V \c_proxy_address_str }
- { lt3rawobjects }
+ { rawobjects }
\str_const:cV { \@@_object_pxyvar:V \c_proxy_address_str }
\c_proxy_address_str
\str_const:cV { \@@_object_scovar:V \c_proxy_address_str }
@@ -629,13 +971,14 @@
\prg_new_conditional:Nnn \object_if_proxy:n {p, T, F, TF}
{
- \str_if_eq:cNTF { \@@_object_pxyvar:n { #1 } } \c_proxy_address_str
- {
- \prg_return_true:
- }
- {
- \prg_return_false:
- }
+ \str_if_eq:cNTF { \@@_object_pxyvar:n { #1 } }
+ \c_proxy_address_str
+ {
+ \prg_return_true:
+ }
+ {
+ \prg_return_false:
+ }
}
% \end{macrocode}
@@ -647,7 +990,7 @@
\msg_new:nnn { aa }{ mess }{ #1 }
-\msg_new:nnnn { lt3rawobjects }{ notproxy }{ Fake ~ proxy }
+\msg_new:nnnn { rawobjects }{ notproxy }{ Fake ~ proxy }
{
Object ~ #1 ~ is ~ not ~ a ~ proxy.
}
@@ -656,7 +999,7 @@
{
\object_if_proxy:nF { #1 }
{
- \msg_error:nnn { lt3rawobjects }{ notproxy }{ #1 }
+ \msg_error:nnn { rawobjects }{ notproxy }{ #1 }
}
}
@@ -707,6 +1050,72 @@
% \end{macrocode}
%\end{macro}
%
+% \begin{macro}{\object_allocate_incr:NNnnNN, \object_gallocate_incr:NNnnNN, \object_allocate_gincr:NNnnNN, \object_gallocate_gincr:NNnnNN}
+% Create an address and use it to instantiate an object
+% \begin{macrocode}
+
+\cs_new:Nn \@@_combine:nn
+ {
+ anon . #2 . #1
+ }
+
+\cs_generate_variant:Nn \@@_combine:nn { Vn }
+
+\cs_new_protected:Nn \object_allocate_incr:NNnnNN
+ {
+ \object_create_set:NnnnNN #1 { #3 }{ #4 }
+ {
+ \@@_combine:Vn #2 { #3 }
+ }
+ #5 #6
+
+ \int_incr:N #2
+ }
+
+\cs_new_protected:Nn \object_gallocate_incr:NNnnNN
+ {
+ \object_create_gset:NnnnNN #1 { #3 }{ #4 }
+ {
+ \@@_combine:Vn #2 { #3 }
+ }
+ #5 #6
+
+ \int_incr:N #2
+ }
+
+\cs_generate_variant:Nn \object_allocate_incr:NNnnNN { NNVnNN }
+
+\cs_generate_variant:Nn \object_gallocate_incr:NNnnNN { NNVnNN }
+
+\cs_new_protected:Nn \object_allocate_gincr:NNnnNN
+ {
+ \object_create_set:NnnnNN #1 { #3 }{ #4 }
+ {
+ \@@_combine:Vn #2 { #3 }
+ }
+ #5 #6
+
+ \int_gincr:N #2
+ }
+
+\cs_new_protected:Nn \object_gallocate_gincr:NNnnNN
+ {
+ \object_create_gset:NnnnNN #1 { #3 }{ #4 }
+ {
+ \@@_combine:Vn #2 { #3 }
+ }
+ #5 #6
+
+ \int_gincr:N #2
+ }
+
+\cs_generate_variant:Nn \object_allocate_gincr:NNnnNN { NNVnNN }
+
+\cs_generate_variant:Nn \object_gallocate_gincr:NNnnNN { NNVnNN }
+
+% \end{macrocode}
+% \end{macro}
+%
%\begin{macro}{\proxy_create:nnN, \proxy_create_set:NnnN, \proxy_create_gset:NnnN}
%Creates a new proxy object
% \begin{macrocode}
@@ -781,6 +1190,37 @@
% \end{macrocode}
%\end{macro}
%
+% A simple forward list proxy
+% \begin{macrocode}
+
+\cs_new_protected:Nn \rawobjects_fwl_inst:n
+ {
+ \object_if_exist:nF
+ {
+ \object_address:nn { rawobjects }{ fwl ! #1 }
+ }
+ {
+ \proxy_create:nnN { rawobjects }{ fwl ! #1 } \c_object_private_str
+ \proxy_push_member
+ {
+ \object_address:nn { rawobjects }{ fwl ! #1 }
+ }
+ { next }{ str }
+ }
+ }
+
+\cs_new_protected:Nn \rawobjects_fwl_newnode:nnnNN
+ {
+ \rawobjects_fwl_inst:n { #1 }
+ \object_create:nnnNN
+ {
+ \object_address:nn { rawobjects }{ fwl ! #1 }
+ }
+ { #2 }{ #3 } #4 #5
+ }
+
+% \end{macrocode}
+%
% \begin{macrocode}
%</package>
% \end{macrocode}
diff --git a/macros/latex/contrib/lt3rawobjects/lt3rawobjects.pdf b/macros/latex/contrib/lt3rawobjects/lt3rawobjects.pdf
index 32d278124c..68a0e03071 100644
--- a/macros/latex/contrib/lt3rawobjects/lt3rawobjects.pdf
+++ b/macros/latex/contrib/lt3rawobjects/lt3rawobjects.pdf
Binary files differ
diff --git a/macros/latex/contrib/lwarp/README.txt b/macros/latex/contrib/lwarp/README.txt
index b7f9c22586..426359a403 100644
--- a/macros/latex/contrib/lwarp/README.txt
+++ b/macros/latex/contrib/lwarp/README.txt
@@ -1,5 +1,5 @@
-LaTeX lwarp package v0.906 README.txt
+LaTeX lwarp package v0.907 README.txt
Files included are:
diff --git a/macros/latex/contrib/lwarp/lwarp.dtx b/macros/latex/contrib/lwarp/lwarp.dtx
index 87eb2b4f55..6df598436e 100644
--- a/macros/latex/contrib/lwarp/lwarp.dtx
+++ b/macros/latex/contrib/lwarp/lwarp.dtx
@@ -16,7 +16,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{lwarp}
-%<package> [2022/06/23 v0.906 Allows LaTeX to directly produce HTML5 output.]
+%<package> [2022/07/11 v0.907 Allows LaTeX to directly produce HTML5 output.]
%
%<*driver>
\documentclass{ltxdoc}
@@ -3280,7 +3280,7 @@ This boolean may be tested by the user for later use.
%<*package>
% \fi
%
-% \CheckSum{55578}
+% \CheckSum{55579}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -3431,6 +3431,7 @@ This boolean may be tested by the user for later use.
% \changes{v0.904a}{2022/03/16}{Fixed missing \pkg{common-mathjax-siunitx}.}
% \changes{v0.905}{2022/03/22}{\ 2022/03/22}
% \changes{v0.906}{2022/06/23}{\ 2022/06/23}
+% \changes{v0.907}{2022/07/11}{\ 2022/07/11}
@@ -3664,6 +3665,11 @@ This boolean may be tested by the user for later use.
% see the end of the Change History on page \pageref{sec:changesend}.
%
% \begin{description}
+% \item[v0.907:] Bug fix.
+% \begin{itemize}
+% \item Fixed \SVG\ images for \brand{Windows}.
+% \end{itemize}
+% \needspace{2\baselineskip}
% \item[v0.906:] Screen readers
% \begin{itemize}
% \item For each \env{tabular}, add a hidden \HTML\ header cell to
@@ -20635,6 +20641,7 @@ page_compositor "."
% \changes{v0.51}{2018/03/16}{\filenm{lwarp_one_limage.txt}: \prog{pdftocairo} \optn{-noshrink} added.}
% \changes{v0.66}{2019/01/30}{\filenm{lwarp_one_limage.txt}: Image directory and prefix.}
% \changes{v0.906}{2022/05/02}{\filenm{lwarp_one_limage.txt}: Added \prog{pdfcrop} \optn{margin}.}
+% \changes{v0.907}{2022/07/11}{\filenm{lwarp_one_limage.txt}: Fixed \brand{Windows} images.}
%
% ^^A *lwarp_one_limage.txt
%
@@ -20647,7 +20654,7 @@ page_compositor "."
\LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent\LWRpercent d.pdf%
}
\immediate\write\LWR@quickfile{%
- pdfcrop --hires --margin \"0 1 0 0\"
+ pdfcrop --hires --margins \LWRopquote0 1 0 0\LWRopquote\space %
\LWR@ImagesDirectory\OSPathSymbol lateximagetemp-\LWRpercent 1.pdf %
\LWR@ImagesDirectory\OSPathSymbol\LWRpercent 3.pdf%
}
@@ -21061,7 +21068,7 @@ MathJax = {
-- Copyright 2016-2022 Brian Dunn
-printversion = "v0.906"
+printversion = "v0.907"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -21595,7 +21602,7 @@ executecheckerror (
imagesdirectory .. dirslash .."lateximagetemp-%d" .. ".pdf" ..
seqname ..
-- Crop the image:
- "pdfcrop --hires --margin \"0 1 0 0\" " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
+ "pdfcrop --hires --margins \"0 1 0 0\" " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
lwimgpage .. ".pdf " ..
imagesdirectory .. dirslash .. lwimgname .. ".pdf" ..
seqname ..
diff --git a/macros/latex/contrib/lwarp/lwarp.pdf b/macros/latex/contrib/lwarp/lwarp.pdf
index f283ec702a..8c2f29c575 100644
--- a/macros/latex/contrib/lwarp/lwarp.pdf
+++ b/macros/latex/contrib/lwarp/lwarp.pdf
Binary files differ
diff --git a/macros/latex/contrib/lwarp/lwarpmk.lua b/macros/latex/contrib/lwarp/lwarpmk.lua
index f123b2e205..9ebaffa7a8 100755
--- a/macros/latex/contrib/lwarp/lwarpmk.lua
+++ b/macros/latex/contrib/lwarp/lwarpmk.lua
@@ -2,7 +2,7 @@
-- Copyright 2016-2022 Brian Dunn
-printversion = "v0.906"
+printversion = "v0.907"
requiredconfversion = "2" -- also at *lwarpmk.conf
function printhelp ()
@@ -515,7 +515,7 @@ executecheckerror (
imagesdirectory .. dirslash .."lateximagetemp-%d" .. ".pdf" ..
seqname ..
-- Crop the image:
- "pdfcrop --hires --margin \"0 1 0 0\" " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
+ "pdfcrop --hires --margins \"0 1 0 0\" " .. imagesdirectory .. dirslash .. "lateximagetemp-" ..
lwimgpage .. ".pdf " ..
imagesdirectory .. dirslash .. lwimgname .. ".pdf" ..
seqname ..
diff --git a/macros/latex/contrib/zref-vario/CHANGELOG.md b/macros/latex/contrib/zref-vario/CHANGELOG.md
index c539ec3cb1..18e60b2c09 100644
--- a/macros/latex/contrib/zref-vario/CHANGELOG.md
+++ b/macros/latex/contrib/zref-vario/CHANGELOG.md
@@ -1,6 +1,15 @@
# Changelog
-## [Unreleased](https://github.com/gusbrs/zref-vario/compare/v0.1.4...HEAD)
+## [Unreleased](https://github.com/gusbrs/zref-vario/compare/v0.1.5...HEAD)
+
+## [v0.1.5](https://github.com/gusbrs/zref-vario/compare/v0.1.4...v0.1.5) (2022-07-08)
+
+### Added
+- `\zvsetup` for package options settings.
+- `pageprop` option to set the reference property used for page comparisons.
+ This option lifts `varioref`'s restriction of depending on the arabic page
+ numbering to distinguish between nearby and far away references. See the
+ user manual for details.
## [v0.1.4](https://github.com/gusbrs/zref-vario/compare/v0.1.3-alpha...v0.1.4) (2022-04-24)
diff --git a/macros/latex/contrib/zref-vario/zref-vario-code.pdf b/macros/latex/contrib/zref-vario/zref-vario-code.pdf
index 15511b8705..7c9387cdcf 100644
--- a/macros/latex/contrib/zref-vario/zref-vario-code.pdf
+++ b/macros/latex/contrib/zref-vario/zref-vario-code.pdf
Binary files differ
diff --git a/macros/latex/contrib/zref-vario/zref-vario.dtx b/macros/latex/contrib/zref-vario/zref-vario.dtx
index c9db0a0f8a..81d9dec5d1 100644
--- a/macros/latex/contrib/zref-vario/zref-vario.dtx
+++ b/macros/latex/contrib/zref-vario/zref-vario.dtx
@@ -128,7 +128,7 @@
%
% Identify the package.
% \begin{macrocode}
-\ProvidesExplPackage {zref-vario} {2022-04-24} {0.1.4}
+\ProvidesExplPackage {zref-vario} {2022-07-08} {0.1.5}
{Extended LaTeX page cross-references with varioref and zref-clever}
% \end{macrocode}
%
@@ -146,7 +146,69 @@
% \end{macrocode}
%
%
-% \section{Customization}
+% \section{Options}
+%
+% \subsection*{\cs{zvsetup}}
+%
+%
+% \begin{macro}[int]{\zvsetup}
+% Provide \cs{zvsetup}.
+% \begin{syntax}
+% \cs{zvsetup}\marg{options}
+% \end{syntax}
+% \begin{macrocode}
+\NewDocumentCommand \zvsetup { m }
+ { \keys_set:nn { zref-vario/setup } {#1} }
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \subsection*{\opt{pageprop}}
+%
+% \begin{macrocode}
+\tl_new:N \l_@@_pageprop_tl
+\keys_define:nn { zref-vario/setup }
+ {
+ pageprop .code:n =
+ {
+ \zref@ifpropundefined {#1}
+ { \msg_warning:nnn { zref-vario } { pageprop-not-declared } {#1} }
+ {
+ \zref@iflistcontainsprop { \ZREF@mainlist } {#1}
+ { \tl_set:Nn \l_@@_pageprop_tl {#1} }
+ { \msg_warning:nnn { zref-vario } { pageprop-not-in-main } {#1} }
+ }
+ } ,
+ pageprop .value_required:n = true ,
+ pageprop .initial:n = { page } ,
+ }
+\AddToHook { begindocument }
+ {
+ \keys_define:nn { zref-vario/setup }
+ {
+ pageprop .code:n =
+ {
+ \msg_warning:nnn { zref-vario }
+ { option-preamble-only } { pageprop }
+ }
+ }
+ }
+\msg_new:nnn { zref-vario } { option-preamble-only }
+ { Option~'#1'~only~available~in~the~preamble~\msg_line_context:. }
+\msg_new:nnn { zref-vario } { pageprop-not-declared }
+ {
+ Property~'#1'~not~declared~\msg_line_context:.~
+ Using~default~'page'~property.
+ }
+\msg_new:nnn { zref-vario } { pageprop-not-in-main }
+ {
+ Property~'#1'~not~in~main~list~\msg_line_context:.~
+ Using~default~'page'~property.
+ }
+% \end{macrocode}
+%
+%
+% \section{Reference format}
%
% Provide some functions to define options names in a standard form.
%
@@ -616,7 +678,7 @@
\cs_new_protected:Npn \@@_vref_pagenum:Nn #1#2
{
\exp_args:NNNo \exp_args:NNo \cs_set_nopar:Npn #1
- { \zref@extractdefault {#2} { page } { ?? } }
+ { \zref@extractdefault {#2} { \l_@@_pageprop_tl } { ?? } }
}
\cs_new_protected:Npn \@@_vrefpagenum:Nn #1#2
{
@@ -624,7 +686,7 @@
\@@_vref_pagenum:Nn #1 {#2}
}
\cs_new_protected:Npn \@@_vref_label:n #1
- { \zref@labelbyprops {#1} { page } }
+ { \zref@labelbyprops {#1} { \l_@@_pageprop_tl } }
% \end{macrocode}
% \end{macro}
%
diff --git a/macros/latex/contrib/zref-vario/zref-vario.pdf b/macros/latex/contrib/zref-vario/zref-vario.pdf
index 6e72662072..e53bd0d300 100644
--- a/macros/latex/contrib/zref-vario/zref-vario.pdf
+++ b/macros/latex/contrib/zref-vario/zref-vario.pdf
Binary files differ
diff --git a/macros/latex/contrib/zref-vario/zref-vario.tex b/macros/latex/contrib/zref-vario/zref-vario.tex
index 08da926111..572ff4fe6f 100644
--- a/macros/latex/contrib/zref-vario/zref-vario.tex
+++ b/macros/latex/contrib/zref-vario/zref-vario.tex
@@ -61,6 +61,14 @@
\NewDocumentCommand\opt{m}{\texttt{#1}}
+% Temporary workaround for 'l3doc' bug.
+% https://github.com/latex3/latex3/issues/1111
+% FIXME Remove when fixed upstream.
+\NewDocElement[
+ macrolike = false ,
+ printtype = \textit{opt.} ,
+]{Option}{optiondesc}
+
\lstdefinestyle{code}{
language=[LaTeX]TeX,
% moretexcs={
@@ -142,7 +150,44 @@ packages, prominently with \pkg{hyperref}, you may wish to load it explicitly
to ensure its load order requirements are met.
-\section{User interface}
+\section{Package options}
+
+Package options can be set by means of \cs{zvsetup}.
+
+\begin{function}{\zvsetup}
+ \begin{syntax}
+ \cs{zvsetpup}\marg{options}
+ \end{syntax}
+\end{function}
+
+Available options are:
+
+\bigskip{}
+
+\DescribeOption{pageprop} %
+\pkg{varioref} uses the \texttt{page} field of the standard label to check
+whether a reference and its label are on the same page, nearby, or far away.
+And has no real alternative data to use for the purpose. Possibly for this
+reason, the basic mechanism of page comparison in \pkg{varioref} is restricted
+to arabic numbered pages. Any other page numbering scheme results in
+\pkg{varioref} making no distinction between one or many pages off. But with
+\pkg{zref} it is trivial to detach the printed representation of the reference
+and the data used to make page comparisons. And that's what the
+\opt{pageprop} option allows to control. It receives a \pkg{zref} property as
+value to be used by \pkg{zref-vario} to make page comparisons, and defaults to
+the \texttt{page} property, which corresponds to the usual \pkg{varioref}
+behavior. The property must be defined and be included in \pkg{zref}'s main
+list at the time the setting is performed. The natural intended use case of
+this option is the \texttt{abspage} property provided by the
+\pkg{zref-abspage} module, which already handles these two requirements.
+Thus, loading this module and setting \opt{pageprop} to \texttt{abspage} gives
+us page comparisons independent of the page numbering scheme, which works in
+the front matter with roman numbering, across front and main matter
+boundaries, etc. In sum, regardless of whether the page numbering is arabic
+or anything else.
+
+
+\section{Reference commands}
\begin{function}{\zvref}
\begin{syntax}
@@ -203,13 +248,16 @@ does what it says: passes the options along to the underlying call(s) to
but does not eliminate the limitations which arise from the underlying
problem.}
-Besides these options, two other are provided corresponding to
-\pkg{varioref}'s commands' optional arguments: \opt{vcurrent} (the first
-optional argument) and \opt{vother} (the second optional argument). Of
-course, these are only available when the underlying \pkg{varioref} command
-supports them.
+\DescribeOption{vcurrent} %
+\DescribeOption{vother} %
+Besides \cs{zcref}'s options, mentioned above, two other ones are provided for
+\pkg{zref-vario}'s reference commands, corresponding to \pkg{varioref}'s
+commands optional arguments: \opt{vcurrent} (the first optional argument) and
+\opt{vother} (the second optional argument). Of course, these are only
+available when the underlying \pkg{varioref} command supports them.
+
-\section{Customization}
+\section{Reference format}
\begin{function}{\zvLanguageSetup}
\begin{syntax}
diff --git a/macros/luatex/latex/luamesh/README b/macros/luatex/latex/luamesh/README
index 926aaf6afd..a2169fe803 100644
--- a/macros/luatex/latex/luamesh/README
+++ b/macros/luatex/latex/luamesh/README
@@ -1,6 +1,6 @@
-*- coding: utf-8 -*-
luamesh package by Maxime Chupin
-Version 0.6 dated 2020/06/06
+Version 0.7 dated 2022/07/08
The LuaLaTeX package luamesh allows to compute and draw 2D Delaunay triangulation.
The algorithm is written with lua, and depending on the choice of the “engine”,
@@ -22,8 +22,6 @@ FILES :
README
animation-crop.pdf
biblio.bib
-dum.bbl
-dum.tex
fond.mp
fond.pdf
luameshdoc.cls
@@ -43,6 +41,9 @@ luamesh-tex.lua
===== Files for LuaLaTeX =====
luamesh.sty
+
+===== File for MetaPost
+luamesh.mp
==================
-The archive luamesh-v0-6.zip contains all the files to insert into your texmf.
+The archive luamesh-v0-7.zip contains all the files to insert into your texmf.
diff --git a/macros/luatex/latex/luamesh/doc/biblio.bib b/macros/luatex/latex/luamesh/doc/biblio.bib
index 4d7ab75ef2..bf836cc55a 100644
--- a/macros/luatex/latex/luamesh/doc/biblio.bib
+++ b/macros/luatex/latex/luamesh/doc/biblio.bib
@@ -35,32 +35,36 @@
Pages = {848},
Url = {http://dx.doi.org/10.1002/9780470611166}
}
-
-@Manual{luamplib,
- Title = {luamplib – Use LuaTeX's built-in METAPOST interpreter},
- Author = {Hagen, Hans and Hoekwater, Taco and Roux, Élie and Pégourié-Gonnard, Manuel and Gesang, Philipp and Kim, Dohyun},
- Note = {v. 2.11.3},
- Year = {2016},
-
- Owner = {chupin},
- Timestamp = {2016.11.28}
+@manual{luamplib,
+title = {The Luamplib package},
+subtitle = {Use Lua\TeX{}’s built-in MetaPost interpreter},
+author = {Gesang, Philipp and Hagen, Hans and Roux, Élie and Kim, Dohyun and Hoekwater, Taco and Pégourié-Gonnard, Manuel},
+url = {https://ctan.org/pkg/luamplib},
+urldate = {2022-07-11},
+date = {2022-01-12},
+version = {2.23.0},
}
-@Manual{animate,
- Title = {The animate Package},
- Author = {Grahn, Alexander},
- Note = {},
- Year = {2016},
+
+@manual{animate,
+title = {The Animate package},
+subtitle = {Create PDF and SVG animations from graphics files and inline graphics},
+author = {Grahn, Alexander},
+url = {https://ctan.org/pkg/animate},
+urldate = {2022-07-11},
+date = {2022-02-21},
+version = {},
}
@Manual{tikz,
- Title = {pgf – Create PostScript and PDF graphics in TeX},
- Author = {Tantau, Till and Feuersänger, Christian},
- Note = {v. 3.0.1a},
- Year = {2015},
-
+title = {The Pgf package},
+subtitle = {Create PostScript and PDF graphics in \TeX},
+author = {Menke, Henri and {The PGF/TikZ Team} and Feuersänger, Christian and Tantau, Till},
+ Year = {2022},
+ url = {https://ctan.org/pkg/pgf},
Owner = {chupin},
- Timestamp = {2016.11.28}
+ Timestamp = {2022-07-11},
+ version = {3.1.9a},
}
@Manual{gmsh,
Title = {Gmsh Reference Manual},
@@ -90,3 +94,13 @@
Mrnumber = {619577},
Url = {http://dx.doi.org/10.1093/comjnl/24.2.167}
}
+
+@manual{tkzeuclide,
+title = {The Tkz-euclide package},
+subtitle = {Tools for drawing Euclidean geometry},
+author = {Matthes, Alain},
+url = {http://altermundus.fr},
+urldate = {2022-07-11},
+date = {2022-02-25},
+version = {4.051b},
+}
diff --git a/macros/luatex/latex/luamesh/doc/dum.tex b/macros/luatex/latex/luamesh/doc/dum.tex
deleted file mode 100644
index 19753f3926..0000000000
--- a/macros/luatex/latex/luamesh/doc/dum.tex
+++ /dev/null
@@ -1,6 +0,0 @@
-\documentclass{article}
-\begin{document}
-\nocite{*}
-\bibliography{biblio}
-\bibliographystyle{plain}
-\end{document} \ No newline at end of file
diff --git a/macros/luatex/latex/luamesh/doc/luamesh-doc.listing b/macros/luatex/latex/luamesh/doc/luamesh-doc.listing
deleted file mode 100644
index e2c890627d..0000000000
--- a/macros/luatex/latex/luamesh/doc/luamesh-doc.listing
+++ /dev/null
@@ -1,84 +0,0 @@
- \documentclass{article}
- %% lualatex compilation
- \usepackage[margin=2.5cm]{geometry}
- \usepackage{luamesh}
- \usepackage{fontspec}
- \usepackage{multido}
- \pagestyle{empty}
- \def\drawPath{draw (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle withcolor 0.99white;}
- \def\clipPath{clip currentpicture to (-2,-2)*u--(8,-2)*u--(8,6)*u--(-2,6)*u--cycle;}
- \begin{document}
- \drawPointsMeshinc[mode=ext, bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- }
- \newpage\buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{meshInit.txt}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- }
- \multido{\ii=5+1}{4}{%
- \newpage\meshAddPointBWinc[mode=ext,step=badtriangles,colorNew
- =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
- show,colorBbox = blue!20]{mesh.txt}{\ii}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- } \newpage
- \meshAddPointBWinc[mode=ext,step=cavity,colorNew
- =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
- show,colorBbox = blue!20]{mesh.txt}{\ii}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- } \newpage
- \meshAddPointBWinc[mode=ext,step=newtriangles,colorNew
- =green!20!red,colorBack=red!10,colorCircle = blue,bbox =
- show,colorBbox = blue!20]{mesh.txt}{\ii}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- }
- }
- \newpage
- \buildMeshBWinc[mode=ext,bbox = show,colorBbox = blue!20,print=points]{mesh.txt}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- }
- \newpage
- \buildMeshBWinc[mode=ext,print=points]{mesh.txt}%
- {%
- beginfig(0);
- \drawPath
- }%
- {%
- \clipPath
- endfig;
- }
-\end{document}
diff --git a/macros/luatex/latex/luamesh/doc/luamesh-doc.pdf b/macros/luatex/latex/luamesh/doc/luamesh-doc.pdf
index 0d66dbf557..e444731ad3 100644
--- a/macros/luatex/latex/luamesh/doc/luamesh-doc.pdf
+++ b/macros/luatex/latex/luamesh/doc/luamesh-doc.pdf
Binary files differ
diff --git a/macros/luatex/latex/luamesh/doc/luamesh-doc.tex b/macros/luatex/latex/luamesh/doc/luamesh-doc.tex
index 07b6125f0f..25481872b4 100644
--- a/macros/luatex/latex/luamesh/doc/luamesh-doc.tex
+++ b/macros/luatex/latex/luamesh/doc/luamesh-doc.tex
@@ -18,6 +18,7 @@
\author{Maxime Chupin \email{notezik@gmail.com}}
\date{\today}
+\addbibresource{biblio.bib}
\definecolor{darkred}{rgb}{0.8,0.1,0.1}
@@ -137,7 +138,7 @@
\lstset{moredelim=*[s][\color{red}\rmfamily\itshape]{<}{>}}
\lstset{moredelim=*[s][\color{blue}\rmfamily\itshape]{<<}{>>}}
-\usepackage[colorlinks=true]{hyperref}
+
\begin{document}
%% === Page de garde ===================================================
\thispagestyle{empty}
@@ -167,7 +168,7 @@
}
\vfill
\begin{center}
- Version 0.6, 2020, June, 6th \\
+ Version 0.7, 2022, July, 8th \\
\url{https://plmlab.math.cnrs.fr/mchupin/luamesh}
\end{center}
%% == Page de garde ====================================================
@@ -186,14 +187,18 @@
set of points, or a particular step of the algorithm.
\end{abstract}
-I would like to thank Jean-Michel Sarlat, who hosts the development
-with a git project on the \Verb+melusine+ machine:
+I would like to thank Jean-Michel Sarlat, who hosts first the development
+with a git project on the \Verb+melusine+ machine. Now the project is hosted
+here :
\begin{center}
- \url{https://melusine.eu.org/syracuse/G/delaunay/}
+ \url{https://plmlab.math.cnrs.fr/mchupin/luamesh}
\end{center}
I would also like to thank the first user, an intensive
\emph{test} user, and a very kind English corrector: Nicole Spillane.
+For the references of the algorithm, see~\cite{Bowyer,Watson} and a reference about
+mesh is~\cite{Frey}.
+
\tableofcontents
@@ -206,10 +211,6 @@ your distribution.
\url{https://www.ctan.org/pkg/luamesh}
\end{center}
-Of course, you can just put the two files \Verb+luamesh.lua+ and
-\Verb+luamesh.sty+ in the working directory but this is not
-recommended.
-
\subsection{With \TeX live and Linux or Mac OSX}
@@ -225,12 +226,15 @@ Then place the files in the correct directories. The
\begin{center}
\Verb+~/texmf/tex/latex/luamesh/+
\end{center}
-and the \Verb+luamesh.lua+, the \Verb+luamesh-tex.lua+ and the
+the \Verb+luamesh.lua+, the \Verb+luamesh-tex.lua+ and the
\Verb-luamesh-polygon.lua+ files must be in directory:
\begin{center}
\Verb+~/texmf/scripts/luamesh/+
\end{center}
-
+and the \Verb+luamesh.mp+ file must be in directory:
+\begin{center}
+ \Verb+~/texmf/metapost/luamesh/+
+\end{center}
Once you have done this, \luamesh can be included in your document
with
\begin{latexcode}
@@ -262,9 +266,9 @@ This package is built upon two main existing packages that one used to
draw the
triangulations :
\begin{enumerate}
-\item \Verb+luamplib+ to use MetaPost via the \luatex library
+\item \Verb+luamplib+ to use MetaPost~\cite{luamplib} via the \luatex library
\Verb+mplib+;
-\item \Verb+tikz+.
+\item \Verb+tikz+~\cite{tikz}.
\end{enumerate}
We will see how to choose between these two \emph{drawing engines}.
Moreover, the following packages are necessary:
@@ -285,7 +289,7 @@ dimensional triangulations (or meshes).
\commande|\buildMeshBW[«options»]{«list of points» or «file name»}|\medskip
This macro produces the Delaunay triangulation (using the Bowyer and
-Watson algorithm) of the given \meta{list of points}. The list of
+Watson algorithm, \cite[Bowyer]) of the given \meta{list of points}. The list of
points must be given in the following way :
\begin{center}
\verb+(x1,y1);(x2,y2);(x3,y3);...;(xn,yn)+
@@ -339,6 +343,9 @@ xn yn
the scale at which the picture is drawn (the same for both
axes). It must contain the unit of length (cm,
pt, etc.).
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
To illustrate the options, let us show you an example. We consider a
@@ -362,6 +369,7 @@ file \Verb+mesh.txt+:
print = points,
meshpoint = x,
scale = 1.3cm,
+ thickness = 1pt
]{mesh.txt}
\end{Exemple}
@@ -541,6 +549,16 @@ ignored.
the scale at which the picture is drawn (the same for both
axis). It must contain the unit of length (cm,
pt, etc.).
+ \item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines for the mesh. It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessNew = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines for the polygon and the \emph{new} elements. It
+ must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessCircle = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the circles. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example of customizing the drawing. First, recall that
@@ -568,7 +586,11 @@ We draw the addition of the 6th point. The 7th line will be ignored.
colorBbox = black!20,
bbox = show,
scale=1.4cm,
- step=badtriangles]
+ step=badtriangles,
+ thickness=0.2pt,
+ thicknessCircle=1pt,
+ thicknessNew=3pt % useless because this step
+ ]
{mesh.txt}{6}
\end{Exemple}
@@ -653,6 +675,12 @@ xn yn
allows to specify the mode of generation of the grid points. The
value \Verb+rect+ produces a simple rectangular grid, and the value
\Verb+pertub+ randomly perturbs the rectangular grid.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh. It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessPolygon = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the polygon. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example of customizing the drawing.
@@ -665,7 +693,9 @@ Here is an example of customizing the drawing.
scale=4cm,
step=mesh,
print=points,
- gridpoints=perturb]
+ gridpoints=perturb,
+ thickness=0.5pt,
+ thicknessPolygon=1pt]
{(0,0);(1,0);(1,0.5);(0,0.5);(-0.20,0.35);(-0.25,0.25);(-0.20,0.15)}
\end{Exemple}
@@ -675,7 +705,8 @@ Here is an example of customizing the drawing.
The three macros presented in the above sections have complementary
macros, with the suffix \Verb+inc+ that allow the user to add code
(MetaPost or \Verb+tikz+, depending of the drawing engine) before and
-after the code generated by \luamesh.
+after the code generated by \luamesh. These commands have the same options as
+the non \emph{inc} one.
The three macros are:\medskip
@@ -775,7 +806,8 @@ color = red,
colorBbox = blue!30,
print = points,
meshpoint = x,
-scale=0.8cm
+scale=0.8cm,
+thickness = 1.4pt
]{(0.3,0.3);(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}%
{% code before
beginfig(0);
@@ -876,7 +908,8 @@ code given by \meta{code
colorBbox = blue!30,
print = points,
meshpoint = x,
- scale=0.8cm
+ scale=0.8cm,
+ thickness=1pt
]{(0.3,0.3);(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5)}%
{% code before
}
@@ -887,7 +920,7 @@ code given by \meta{code
\section{Voronoï Diagrams}
-Another interesting feature of b Delaunay triangulation is that its
+Another interesting feature of the Delaunay triangulation is that its
\emph{dual} is the so-called Voronoï diagram. More precisely, for a
finite set of
points $\{p_{1},\ldots, p_{n}\}$ in the Euclidean plane, the Voronoï
@@ -936,11 +969,11 @@ xn yn
triangulation. By default, these points are removed at the end of
the algorithm.
\item[color = \meta{value} (default: black):] The color of the
- drawing.
+ drawing of the Delaunay mesh.
\item[colorBbox = \meta{value} (default: black):] The color of the
drawing for the elements (points and triangles) belonging to the
bounding box.
-\item[colorVoronoi = \meta{value} (default: black):] The color of the
+\item[colorVoronoi = \meta{value} (default: red):] The color of the
drawing for the elements (points and polygons) belonging to the
Voronoï diagram.
\item[print = none (default) \textme{or} points:] To label the
@@ -970,17 +1003,28 @@ xn yn
allows to draw the Delaunay triangulation in dashed lines.
\item[styleVoronoi = none (default) \textme{or} dashed:] This option
allows to draw the Voronoï edges in dashed lines.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh (if plotted). It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessVoronoi = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the Voronoï diagram. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
\begin{Exemple}
- \buildVoronoiBW[tikz,delaunay=show,styleDelaunay=dashed]
+ \buildVoronoiBW[tikz,
+ delaunay=show,
+ styleDelaunay=dashed,
+ thickness = 1pt,
+ thicknessVoronoi=2pt]
{(0.3,0.3);(1.5,1);(4,0);(4.5,2.5);(1.81,2.14);(2.5,0.5);(2.8,1.5);(0.1,2);(1.5,-0.3)}
\end{Exemple}
\subsection{The \emph{inc} variant}
Once again, a variant of the macros is available allowing the user to
-add code before and after the code produced by \luamesh. We refer to
+add code before and after the code produced by \luamesh (with the same options
+as the non \emph{inc} command). We refer to
section~\ref{sec:inc} because it works the same way.
Let us note that:
@@ -1001,7 +1045,7 @@ available (see~\ref{sec:mpcolor}): \Verb+\luameshmpcolorVoronoi+.
\section{With Gmsh}
-Gmsh is an open source efficient software that produces meshes. The
+Gmsh~\cite{gmsh} is an open source efficient software that produces meshes. The
exporting format is the \emph{MSH ASCII file format} and can be easily
read by a Lua program. \luamesh provides the user with dedicated
macros to read and draw meshes coming from a Gmsh exportation.\bigskip
@@ -1045,10 +1089,13 @@ There are several options to customize the drawing.
the scale at which the picture is drawn (the same for both
axes). It must contain the unit of length (cm,
pt, etc.).
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
Here is an example:
\begin{Exemple}
- \drawGmsh[scale=2cm,print=points, color=blue!30]{maillage.msh}
+ \drawGmsh[scale=2cm,print=points, color=blue!30,thickness=0.8pt]{maillage.msh}
\end{Exemple}
\subsection{Gmsh and Voronoï Diagrams}
@@ -1069,8 +1116,8 @@ Voronoï diagram. This is done by the following macro:\bigskip
There are several options to customize the drawing.
\begin{optionsenum}
\item[color = \meta{value} (default: black):] The color of the
- drawing.
-\item[colorVoronoi = \meta{value} (default: black):] The color of the
+ drawing of the Delaunay mesh.
+\item[colorVoronoi = \meta{value} (default: red):] The color of the
drawing for the elements (points and polygons) belonging to the
Voronoï diagram.
\item[print = none (default) \textme{or} points:] To label the vertices of the
@@ -1100,16 +1147,28 @@ There are several options to customize the drawing.
allows to draw the Delaunay triangulation in dashed lines.
\item[styleVoronoi = none (default) \textme{or} dashed] This option
allows to draw the Voronoï edges in dashed lines.
+\item[thickness = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the mesh (if plotted). It must contain the unit of length (cm,
+ pt, etc.).
+\item[thicknessVoronoi = \meta{value} (default: 0.4pt):] The thickness option defines
+ the thickness of the lines of the Voronoï diagram. It must contain the unit of length (cm,
+ pt, etc.).
\end{optionsenum}
\begin{Exemple}
- \gmshVoronoi[tikz,scale=3cm, delaunay=show,styleVoronoi=dashed]{maillagev4.msh}
+ \gmshVoronoi[tikz,
+ scale=4cm,
+ delaunay=show,
+ styleVoronoi=dashed,
+ thickness=0.4pt,
+ thicknessVoronoi=2pt
+ ]{maillagev4.msh}
\end{Exemple}
\subsection{The \emph{inc} variants}
-Once again, there exist \emph{inc} variant macros:\bigskip
+Once again, there exist \emph{inc} variant macros (with the same options):\bigskip
\commande|\drawGmshinc[«options»]{«file name»}{«code before»}{«code after»}|\medskip
@@ -1118,13 +1177,38 @@ Once again, there exist \emph{inc} variant macros:\bigskip
We refer to the previous sections for explanations.
+\section{\texttt{mplibcode} environments}
+
+All the \Verb+mplibcode+ environments produced by this package use instance
+mechanism provided by the \Verb+luamplib+ package~\cite{luamplib}. The name of
+the instance is \verb+luamesh+.
+
+\subsection{A MetaPost package}
+
+This package comes with a \Verb+luamesh.mp+ file. This file provide for the
+moment only one macro to draw circumscribed circles of three points. All of the
+\Verb+luamesh+ instances of \Verb+mplibcode+ environments include the MetaPost
+\Verb+luamesh.mp+ package.
+\bigskip
+
+\commande|circumcircle(«pair1»,«pair2»,«pair3»)|\medskip
+
+This macro returns a \Verb+path+: the circumscribed circle passing by the three
+argument \Verb+pair+s.\footnote{For the tikz users, we refer to
+ \texttt{tkz-euclide}~\cite{tkzeuclide} package that provides a large number of tools including
+ on to draw circumscribed circles.}
+
+\begin{Exemple}
+\buildVoronoiBWinc{(0, 0);(6,0);(2,4);(1.5,2);(2.,0.5);(3,2.6);(3.5,1);(5,3.);(0.3,3.2)}{beginfig(0);}{draw circumcircle(MeshPoints1,MeshPoints2,MeshPoints3);endfig;}
+\end{Exemple}
+
\section{Gallery}
\subsection{With Animate}
-If you use \emph{Adobe Acrobat reader}, you can easily produce an
+If you use \emph{Adobe Acrobat reader} or \emph{Okular}, you can easily produce an
animation of the Bowyer and Watson algorithm with the package
-\Verb+animate+.
+\Verb+animate+~\cite{animate}.
For example, the following code (in a file name \Verb+animation.tex+):
\begin{latexcode}
@@ -1225,6 +1309,8 @@ using the \Verb+animate+ package.
\section{History}
\begin{itemize}
+\item July, 2022, v~0.7, adding of thickness options, creation of the MetaPost
+ package, and improvement of the documentation.
\item June, 6th, 2020, v 0.6, correction of bug produced by the
deleted \Verb+\mplibcolor+ function of \Verb+luamplib+ package.
\item June, 6th, 2020, v 0.6, add support of version 4 of the
@@ -1232,7 +1318,7 @@ using the \Verb+animate+ package.
\end{itemize}
-\input{dum.bbl}
+\printbibliography
\end{document}
diff --git a/macros/luatex/latex/luamesh/doc/luameshdoc.cls b/macros/luatex/latex/luamesh/doc/luameshdoc.cls
index c8d507d329..c7ec2ee3e1 100644
--- a/macros/luatex/latex/luamesh/doc/luameshdoc.cls
+++ b/macros/luatex/latex/luamesh/doc/luameshdoc.cls
@@ -1,4 +1,4 @@
-% copy of the private class for lualatex-doc, lltxdoc.sty. 2017 version.
+% copy of the private class for lualatex-doc, lltxdoc.sty. 2017 version.
% see lualatex-doc.tex for copying conditions
% Manuel Pégourié-Gonnard
@@ -8,8 +8,11 @@
\RequirePackage{luamesh}
\RequirePackage{fontspec}
\RequirePackage{metalogo, xspace, ifmtarg, xargs, fancyvrb}
-\RequirePackage[french,english]{babel}
+\RequirePackage[backend=biber,sorting=ynt]{biblatex}
+\RequirePackage[english]{babel}
+
\RequirePackage[colorlinks=true]{hyperref}
+
%\RequirePackage{bookmark}
\defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
diff --git a/macros/luatex/latex/luamesh/metapost/luamesh.mp b/macros/luatex/latex/luamesh/metapost/luamesh.mp
new file mode 100644
index 0000000000..4e6d3e09e2
--- /dev/null
+++ b/macros/luatex/latex/luamesh/metapost/luamesh.mp
@@ -0,0 +1,22 @@
+% metapost library for the lualatex package luamesh
+%
+vardef circumcircle(expr M,N,P)=
+ % Compute center and radius of the circoncircle of the triangle M N P
+ save a,b,c,circle,rad,center,x,y;
+ path circle;
+ pair center;
+ numeric a,b,c,x[],y[];
+ x1 := xpart M;
+ y1 := ypart M;
+ x2 := xpart N;
+ y2 := ypart N;
+ x3 := xpart P;
+ y3 := ypart P;
+ 2*x1*a+2*y1*b+c=-(x1**2+y1**2);
+ 2*x2*a+2*y2*b+c=-(x2**2+y2**2);
+ 2*x3*a+2*y3*b+c=-(x3**2+y3**2);
+ center := (-a,-b);
+ rad := sqrt(a**2+b**2-c**2);
+ circle := fullcircle scaled (2.0*rad) shifted center;
+ circle
+enddef
diff --git a/macros/luatex/latex/luamesh/scripts/luamesh-tex.lua b/macros/luatex/latex/luamesh/scripts/luamesh-tex.lua
index 34755092ed..2f94b2545b 100644
--- a/macros/luatex/latex/luamesh/scripts/luamesh-tex.lua
+++ b/macros/luatex/latex/luamesh/scripts/luamesh-tex.lua
@@ -4,7 +4,7 @@
-- AUTHOR: Maxime Chupin
-----------------------------------------------------------------------
-- trace Voronoi with MP
-function traceVoronoiMP(listPoints, triangulation,listVoronoi, points, tri,styleD,styleV)
+function traceVoronoiMP(listPoints, triangulation,listVoronoi, points, tri,styleD,styleV,thickness,thicknessVoronoi)
if(styleD == "dashed") then
sDelaunay = "dashed evenly"
else
@@ -31,16 +31,21 @@ function traceVoronoiMP(listPoints, triangulation,listVoronoi, points, tri,style
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle "..sDelaunay.." withcolor \\luameshmpcolorBbox;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y
+ ..")*u--("..PointJ.x..",".. PointJ.y
+ ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle"..sDelaunay.." withcolor \\luameshmpcolorBbox withpen pencircle scaled "..thickness..";"
else
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle "..sDelaunay.." withcolor \\luameshmpcolor;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y
+ ..")*u--("..PointJ.x..",".. PointJ.y
+ ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle"..sDelaunay.." withcolor \\luameshmpcolor withpen pencircle scaled "..thickness..";"
end
end
end
for i=1,#listVoronoi do
PointI = listCircumC[listVoronoi[i][1]]
PointJ = listCircumC[listVoronoi[i][2]]
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u "..sVoronoi.." withcolor \\luameshmpcolorVoronoi;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y
+ ..")*u--("..PointJ.x..",".. PointJ.y ..")*u "..sVoronoi.." withcolor \\luameshmpcolorVoronoi withpen pencircle scaled "..thicknessVoronoi..";"
end
if(points=="points") then
j=1
@@ -75,7 +80,7 @@ end
-- trace Voronoi with TikZ
-function traceVoronoiTikZ(listPoints, triangulation,listVoronoi, points, tri,color,colorBbox,colorVoronoi,styleD,styleV)
+function traceVoronoiTikZ(listPoints, triangulation,listVoronoi, points, tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
if(styleD == "dashed") then
sDelaunay = ",dashed"
else
@@ -100,16 +105,16 @@ function traceVoronoiTikZ(listPoints, triangulation,listVoronoi, points, tri,col
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox..sDelaunay.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..colorBbox..sDelaunay..",line width="..thickness..",rounded corners=0.4pt] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
else
- output = output .. "\\draw[color="..color..sDelaunay.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..color..sDelaunay..",line width="..thickness..",rounded corners=0.4pt] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
end
end
for i=1,#listVoronoi do
PointI = listCircumC[listVoronoi[i][1]]
PointJ = listCircumC[listVoronoi[i][2]]
- output = output .. "\\draw[color="..colorVoronoi..sVoronoi.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..");"
+ output = output .. "\\draw[color="..colorVoronoi..sVoronoi..",line width="..thicknessVoronoi..",rounded corners=0.4pt] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..");"
end
if(points=="points") then
j=1
@@ -144,43 +149,43 @@ end
-- buildVoronoi with MP
-function buildVoronoiMPBW(chaine,mode,points,bbox,scale,tri,styleD,styleV)
+function buildVoronoiMPBW(chaine,mode,points,bbox,scale,tri,styleD,styleV,thickness,thicknessVoronoi)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV,thickness,thicknessVoronoi)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
-- buildVoronoi with TikZ
-function buildVoronoiTikZBW(chaine,mode,points,bbox,scale,tri,color,colorBbox,colorVoronoi,styleD,styleV)
+function buildVoronoiTikZBW(chaine,mode,points,bbox,scale,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV)
+ output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" .. output .."\\end{tikzpicture}" tex.sprint(output)
end
-- buildVoronoi with MP
-function buildVoronoiMPBWinc(chaine,beginning, ending,mode,points,bbox,scale,tri,styleD,styleV)
+function buildVoronoiMPBWinc(chaine,beginning, ending,mode,points,bbox,scale,tri,styleD,styleV,thickness,thicknessVoronoi)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV)
- output = "\\leavevmode\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV,thickness,thicknessVoronoi)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
-- buildVoronoi with TikZ
-function buildVoronoiTikZBWinc(chaine,beginning, ending,mode,points,bbox,scale,tri,color,colorBbox,colorVoronoi)
+function buildVoronoiTikZBWinc(chaine,beginning, ending,mode,points,bbox,scale,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
local listPoints = buildList(chaine, mode,styleD,styleV)
local triangulation = BowyerWatson(listPoints,bbox)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV)
+ output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" ..beginning.. output..ending .."\\end{tikzpicture}"
tex.sprint(output)
end
@@ -188,7 +193,7 @@ end
-- trace a triangulation with TikZ
-function traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
+function traceMeshTikZ(listPoints, triangulation,points,color,colorBbox,thickness)
output = ""
for i=1,#listPoints do
output = output .. "\\coordinate (MeshPoints".. i .. ") at (" .. listPoints[i].x .. "," .. listPoints[i].y .. ");"
@@ -198,19 +203,19 @@ function traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..colorBbox..",line width="..thickness..",rounded corners=0.4pt] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
else
- output = output .. "\\draw[color="..color.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..color..",line width="..thickness..",rounded corners=0.4pt] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
end
if(points=="points") then
j=1
for i=1,#listPoints do
if(listPoints[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox.."] (" .. listPoints[i].x ..",".. listPoints[i].y .. ") node {$\\bullet$} node[anchor=north east] {$\\MeshPoint^*_{" .. j .. "}$};"
+ output = output .. "\\draw[color="..colorBbox..",line width="..thickness..",rounded corners=0.4pt] (" .. listPoints[i].x ..",".. listPoints[i].y .. ") node {$\\bullet$} node[anchor=north east] {$\\MeshPoint^*_{" .. j .. "}$};"
j=j+1
else
- output = output .. "\\draw[color="..color.."] (" .. listPoints[i].x ..",".. listPoints[i].y .. ") node {$\\bullet$} node[anchor=north east] {$\\MeshPoint_{" .. i .. "}$};"
+ output = output .. "\\draw[color="..color..",line width="..thickness..",rounded corners=0.4pt] (" .. listPoints[i].x ..",".. listPoints[i].y .. ") node {$\\bullet$} node[anchor=north east] {$\\MeshPoint_{" .. i .. "}$};"
end
end
end
@@ -230,7 +235,7 @@ end
-- trace a triangulation with MP
-function traceMeshMP(listPoints, triangulation,points)
+function traceMeshMP(listPoints, triangulation,points,thickness)
output = "";
output = output .. " pair MeshPoints[];"
for i=1,#listPoints do
@@ -241,9 +246,13 @@ function traceMeshMP(listPoints, triangulation,points)
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y
+ ..")*u--("..PointJ.x..",".. PointJ.y
+ ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox withpen pencircle scaled "..thickness..";"
else
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y
+ ..")*u--("..PointJ.x..",".. PointJ.y
+ ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor withpen pencircle scaled "..thickness..";"
end
end
if(points=="points") then
@@ -273,37 +282,37 @@ end
-- buildMesh with MP
-function buildMeshMPBW(chaine,mode,points,bbox,scale)
+function buildMeshMPBW(chaine,mode,points,bbox,scale,thickness)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
- output = traceMeshMP(listPoints, triangulation,points)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = traceMeshMP(listPoints, triangulation,points,thickness)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
-- buildMesh with MP include code
-function buildMeshMPBWinc(chaine,beginning, ending,mode,points,bbox,scale)
+function buildMeshMPBWinc(chaine,beginning, ending,mode,points,bbox,scale,thickness)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
- output = traceMeshMP(listPoints, triangulation,points)
- output = "\\leavevmode\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = traceMeshMP(listPoints, triangulation,points,thickness)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
-- buildMesh with TikZ
-function buildMeshTikZBW(chaine,mode,points,bbox,scale,color,colorBbox)
+function buildMeshTikZBW(chaine,mode,points,bbox,scale,color,colorBbox,thickness)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
- output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
+ output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox,thickness)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" .. output .."\\end{tikzpicture}"
tex.sprint(output)
end
-- buildMesh with TikZ
-function buildMeshTikZBWinc(chaine,beginning, ending,mode,points,bbox,scale,color,colorBbox)
+function buildMeshTikZBWinc(chaine,beginning, ending,mode,points,bbox,scale,color,colorBbox,thickness)
local listPoints = buildList(chaine, mode)
local triangulation = BowyerWatson(listPoints,bbox)
- output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
+ output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox,thickness)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" ..beginning.. output..ending .."\\end{tikzpicture}"
tex.sprint(output)
end
@@ -373,7 +382,7 @@ function printPointsMP(chaine,mode,points,bbox,scale)
listPoints = buildBoundingBox(listPoints)
end
output = tracePointsMP(listPoints,points)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
@@ -385,7 +394,7 @@ function printPointsMPinc(chaine,beginning, ending, mode,points,bbox,scale)
listPoints = buildBoundingBox(listPoints)
end
output = tracePointsMP(listPoints,points)
- output = "\\leavevmode\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
@@ -422,7 +431,8 @@ end
--
-function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, colorCircle,colorBbox)
+function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew,
+ colorCircle,colorBbox,thickness,thicknessCircle,thicknessAdd)
output = ""
-- build the triangulation
local triangulation = BowyerWatson(listPoints,bbox)
@@ -437,9 +447,9 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..colorBbox..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
else
- output = output .. "\\draw[color="..color.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..color..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
end
-- draw and fill the bad triangle
@@ -447,7 +457,7 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointI = listPoints[triangulation[badTriangles[i]][1]]
PointJ = listPoints[triangulation[badTriangles[i]][2]]
PointK = listPoints[triangulation[badTriangles[i]][3]]
- output = output .. "\\draw[fill="..colorBack.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[fill="..colorBack..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
-- draw the circoncircle
for i=1,#badTriangles do
@@ -455,7 +465,7 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointJ = listPoints[triangulation[badTriangles[i]][2]]
PointK = listPoints[triangulation[badTriangles[i]][3]]
center, radius = circoncircle(PointI, PointJ, PointK)
- output = output .. "\\draw[dashed, color="..colorCircle.."] ("..center.x .. "," .. center.y .. ") circle ("..radius ..");"
+ output = output .. "\\draw[dashed, color="..colorCircle..",line width="..thicknessCircle.."] ("..center.x .. "," .. center.y .. ") circle ("..radius ..");"
end
-- mark the points
j=1
@@ -482,9 +492,9 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..colorBbox..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
else
- output = output .. "\\draw[color="..color.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..color..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
end
-- fill and draw the cavity
@@ -493,7 +503,7 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointI = listPoints[polyNew[i]]
path = path .. "(".. PointI.x ..",".. PointI.y ..")--"
end
- output = output .. "\\draw[color="..colorNew..",fill ="..colorBack..", thick] " .. path .. "cycle;"
+ output = output .. "\\draw[color="..colorNew..",fill ="..colorBack..",line width="..thicknessAdd.."] " .. path .. "cycle;"
-- mark the points of the mesh
j=1
for i=1,#listPoints do
@@ -519,9 +529,9 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "\\draw[color="..colorBbox.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..colorBbox..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
else
- output = output .. "\\draw[color="..color.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
+ output = output .. "\\draw[color="..color..",line width="..thickness.."] (".. PointI.x ..",".. PointI.y ..")--("..PointJ.x..",".. PointJ.y ..")--("..PointK.x..",".. PointK.y ..")--cycle;"
end
end
-- fill and draw the cavity
@@ -530,12 +540,12 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
PointI = listPoints[polyNew[i]]
path = path .. "(".. PointI.x ..",".. PointI.y ..")--"
end
- output = output .. "\\draw[color="..colorNew..",fill ="..colorBack..", thick] " .. path .. "cycle;"
+ output = output .. "\\draw[color="..colorNew..",fill ="..colorBack..",line width="..1.1*thickWithoutPT.."pt] " .. path .. "cycle;"
-- draw the new triangles composed by the edges of the polygon and the added point
for i=1,#polygon do
- output = output .. "\\draw[color=TeXCluaMeshNewTikZ, thick]".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ") -- (" .. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y ..");"
- output = output .. "\\draw[color="..colorNew..", thick]".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ") -- (" .. P.x .. "," .. P.y ..");"
- output = output .. "\\draw[color="..colorNew..", thick]".."(".. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y .. ") -- (" .. P.x .. "," .. P.y ..");"
+ output = output .. "\\draw[color=TeXCluaMeshNewTikZ,line width="..thicknessAdd.."]".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ") -- (" .. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y ..");"
+ output = output .. "\\draw[color="..colorNew..",line width="..thicknessAdd.."]".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ") -- (" .. P.x .. "," .. P.y ..");"
+ output = output .. "\\draw[color="..colorNew..",line width="..thicknessAdd.."]".."(".. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y .. ") -- (" .. P.x .. "," .. P.y ..");"
end
-- mark points
j=1
@@ -553,7 +563,7 @@ function TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack, colorNew, co
return output
end
-function TeXaddOnePointMPBW(listPoints,P,step,bbox)
+function TeXaddOnePointMPBW(listPoints,P,step,bbox,thickness,thicknessCircle,thicknessAdd)
output = "";
output = output .. "pair MeshPoints[];"
-- build the triangulation
@@ -571,9 +581,9 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox withpen pencircle scaled"..thickness..";"
else
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor withpen pencircle scaled"..thickness..";"
end
end
-- draw and fill the bad triangle
@@ -581,8 +591,8 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
PointI = listPoints[triangulation[badTriangles[i]][1]]
PointJ = listPoints[triangulation[badTriangles[i]][2]]
PointK = listPoints[triangulation[badTriangles[i]][3]]
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor;"
output = output .. "fill (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBack;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor withpen pencircle scaled"..thickness..";"
end
-- draw the circoncircle
for i=1,#badTriangles do
@@ -590,7 +600,7 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
PointJ = listPoints[triangulation[badTriangles[i]][2]]
PointK = listPoints[triangulation[badTriangles[i]][3]]
center, radius = circoncircle(PointI, PointJ, PointK)
- output = output .. "draw fullcircle scaled ("..radius .."*2u) shifted ("..center.x .. "*u," .. center.y .. "*u) dashed evenly withcolor \\luameshmpcolorCircle;"
+ output = output .. "draw fullcircle scaled ("..radius .."*2u) shifted ("..center.x .. "*u," .. center.y .. "*u) dashed evenly withcolor \\luameshmpcolorCircle withpen pencircle scaled"..thicknessCircle..";"
end
-- mark the points
j=1
@@ -617,9 +627,9 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y..")*u--cycle withcolor \\luameshmpcolorBbox withpen pencircle scaled"..thickness..";"
else
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor withpen pencircle scaled"..thickness..";"
end
end
-- fill and draw the cavity
@@ -629,7 +639,7 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
path = path .. "(".. PointI.x ..",".. PointI.y ..")*u--"
end
output = output .. "fill " .. path .. "cycle withcolor \\luameshmpcolorBack;"
- output = output .. "draw " .. path .. "cycle withcolor \\luameshmpcolorNew withpen pencircle scaled 1pt;"
+ output = output .. "draw " .. path .. "cycle withcolor \\luameshmpcolorNew withpen pencircle scaled"..thicknessAdd..";"
-- mark the points of the mesh
j=1
for i=1,#listPoints do
@@ -655,9 +665,9 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
PointJ = listPoints[triangulation[i][2]]
PointK = listPoints[triangulation[i][3]]
if(triangulation[i].type == "bbox") then
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolorBbox withpen pencircle scaled"..thickness..";"
else
- output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor;"
+ output = output .. "draw (".. PointI.x ..",".. PointI.y ..")*u--("..PointJ.x..",".. PointJ.y ..")*u--("..PointK.x..",".. PointK.y ..")*u--cycle withcolor \\luameshmpcolor withpen pencircle scaled"..thickness..";"
end
end
-- fill the cavity
@@ -669,9 +679,9 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
output = output .. "fill " .. path .. "cycle withcolor \\luameshmpcolorBack;"
-- draw the new triangles composed by the edges of the polygon and the added point
for i=1,#polygon do
- output = output .. "draw".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ")*u -- (" .. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled 1pt;"
- output = output .. "draw".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ")*u -- (" .. P.x .. "," .. P.y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled 1pt;"
- output = output .. "draw".."(".. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y .. ")*u -- (" .. P.x .. "," .. P.y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled 1pt;"
+ output = output .. "draw".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ")*u -- (" .. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled"..thicknessAdd..";"
+ output = output .. "draw".."(".. listPoints[polygon[i][1]].x .. "," .. listPoints[polygon[i][1]].y .. ")*u -- (" .. P.x .. "," .. P.y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled"..thicknessAdd..";"
+ output = output .. "draw".."(".. listPoints[polygon[i][2]].x .. "," .. listPoints[polygon[i][2]].y .. ")*u -- (" .. P.x .. "," .. P.y ..")*u withcolor \\luameshmpcolorNew withpen pencircle scaled"..thicknessAdd..";"
end
-- mark points
j=1
@@ -690,7 +700,8 @@ function TeXaddOnePointMPBW(listPoints,P,step,bbox)
end
-function TeXOnePointTikZBW(chaine,point,step,scale,mode,bbox,color,colorBack,colorNew,colorCircle,colorBbox)
+function
+ TeXOnePointTikZBW(chaine,point,step,scale,mode,bbox,color,colorBack,colorNew,colorCircle,colorBbox,thickness,thicknessCircle,thicknessAdd)
local listPoints = {}
if(mode=="int") then
Sx,Sy=string.match(point,"%((.+),(.+)%)")
@@ -700,12 +711,12 @@ function TeXOnePointTikZBW(chaine,point,step,scale,mode,bbox,color,colorBack,col
-- point is a number
P, listPoints = buildListExt(chaine,tonumber(point))
end
- output = TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack,colorNew,colorCircle,colorBbox)
+ output = TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack,colorNew,colorCircle,colorBbox,thickness,thicknessCircle,thicknessAdd)
output = "\\noindent\\begin{tikzpicture}[x="..scale..",y="..scale.."]".. output .. "\\end{tikzpicture}"
tex.sprint(output)
end
-function TeXOnePointTikZBWinc(chaine,point,beginning, ending,step,scale,mode,bbox,color,colorBack,colorNew,colorCircle,colorBbox)
+function TeXOnePointTikZBWinc(chaine,point,beginning, ending,step,scale,mode,bbox,color,colorBack,colorNew,colorCircle,colorBbox,thickness,thicknessCircle,thicknessAdd)
local listPoints = {}
if(mode=="int") then
Sx,Sy=string.match(point,"%((.+),(.+)%)")
@@ -715,12 +726,12 @@ function TeXOnePointTikZBWinc(chaine,point,beginning, ending,step,scale,mode,bbo
-- point is a number
P, listPoints = buildListExt(chaine,tonumber(point))
end
- output = TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack,colorNew,colorCircle,colorBbox)
+ output = TeXaddOnePointTikZ(listPoints,P,step,bbox,color,colorBack,colorNew,colorCircle,colorBbox,thickness,thicknessCircle,thicknessAdd)
output = "\\noindent\\begin{tikzpicture}[x="..scale..",y="..scale.."]".. beginning..output ..ending.. "\\end{tikzpicture}"
tex.sprint(output)
end
-function TeXOnePointMPBW(chaine,point,step,scale,mode,bbox)
+function TeXOnePointMPBW(chaine,point,step,scale,mode,bbox,thickness,thicknessCircle,thicknessAdd)
local listPoints = {}
if(mode=="int") then
Sx,Sy=string.match(point,"%((.+),(.+)%)")
@@ -730,12 +741,12 @@ function TeXOnePointMPBW(chaine,point,step,scale,mode,bbox)
-- point is a number
P, listPoints = buildListExt(chaine,tonumber(point))
end
- output = TeXaddOnePointMPBW(listPoints,P,step,bbox)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale..";".. output .. "endfig;\\end{mplibcode}"
+ output = TeXaddOnePointMPBW(listPoints,P,step,bbox,thickness,thicknessCircle,thicknessAdd)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale..";".. output .. "endfig;\\end{mplibcode}"
tex.sprint(output)
end
-function TeXOnePointMPBWinc(chaine,point,beginning,ending,step,scale,mode,bbox)
+function TeXOnePointMPBWinc(chaine,point,beginning,ending,step,scale,mode,bbox,thickness,thicknessCircle,thicknessAdd)
local listPoints = {}
if(mode=="int") then
Sx,Sy=string.match(point,"%((.+),(.+)%)")
@@ -745,79 +756,79 @@ function TeXOnePointMPBWinc(chaine,point,beginning,ending,step,scale,mode,bbox)
-- point is a number
P, listPoints = buildListExt(chaine,tonumber(point))
end
- output = TeXaddOnePointMPBW(listPoints,P,step,bbox)
- output = "\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = TeXaddOnePointMPBW(listPoints,P,step,bbox,thickness,thicknessCircle,thicknessAdd)
+ output = "\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
-function drawGmshMP(file,points,scale)
+function drawGmshMP(file,points,scale,thickness)
local listPoints,triangulation = readGmsh(file)
- output = traceMeshMP(listPoints,triangulation,points)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = traceMeshMP(listPoints,triangulation,points,thickness)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
-function drawGmshMPinc(file,beginning,ending,points,scale)
+function drawGmshMPinc(file,beginning,ending,points,scale,thickness)
local listPoints,triangulation = readGmsh(file)
- output = traceMeshMP(listPoints,triangulation,points)
- output = "\\leavevmode\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = traceMeshMP(listPoints,triangulation,points,thickness)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
--
-function drawGmshTikZ(file,points,scale,color)
+function drawGmshTikZ(file,points,scale,color,thickness)
local listPoints,triangulation = readGmsh(file)
- output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
+ output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox,thickness)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" .. output .."\\end{tikzpicture}"
tex.sprint(output)
end
--
-function drawGmshTikZinc(file,beginning, ending,points,scale,color)
+function drawGmshTikZinc(file,beginning, ending,points,scale,color,thickness)
local listPoints,triangulation = readGmsh(file)
- output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox)
+ output = traceMeshTikZ(listPoints, triangulation,points,color,colorBbox,thickness)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" ..beginning.. output..ending .."\\end{tikzpicture}"
tex.sprint(output)
end
-- buildVoronoi with MP
-function gmshVoronoiMP(file,points,scale,tri,styleD,styleV)
+function gmshVoronoiMP(file,points,scale,tri,styleD,styleV,thickness,thicknessVoronoi)
local listPoints,triangulation = readGmsh(file)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV)
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV,thickness,thicknessVoronoi)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
-- buildVoronoi with TikZ
-function gmshVoronoiTikZ(file,points,scale,tri,color,colorVoronoi,styleD,styleV)
+function gmshVoronoiTikZ(file,points,scale,tri,color,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
local listPoints,triangulation = readGmsh(file)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV)
+ output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" .. output .."\\end{tikzpicture}" tex.sprint(output)
end
-- buildVoronoi with MP
-function gmshVoronoiMPinc(file,beginning, ending,points,scale,tri,styleD,styleV)
+function gmshVoronoiMPinc(file,beginning, ending,points,scale,tri,styleD,styleV,thickness,thicknessVoronoi)
local listPoints,triangulation = readGmsh(file)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV)
- output = "\\leavevmode\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = traceVoronoiMP(listPoints,triangulation,listVoronoi,points,tri,styleD,styleV,thickness,thicknessVoronoi)
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
-- buildVoronoi with TikZ
-function gmshVoronoiTikZinc(file,beginning, ending,points,scale,tri,color,colorVoronoi,styleD,styleV)
+function gmshVoronoiTikZinc(file,beginning, ending,points,scale,tri,color,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
local listPoints,triangulation = readGmsh(file)
local listVoronoi = buildVoronoi(listPoints, triangulation)
- output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV)
+ output = traceVoronoiTikZ(listPoints,triangulation,listVoronoi,points,tri,color,colorBbox,colorVoronoi,styleD,styleV,thickness,thicknessVoronoi)
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" ..beginning.. output..ending .."\\end{tikzpicture}"
tex.sprint(output)
end
@@ -852,12 +863,12 @@ function tracePolygonMP(polygon,points)
end
-function tracePolygonTikZ(polygon,points, colorPoly)
+function tracePolygonTikZ(polygon,points, colorPoly,polygonThickness)
output = "";
for i=1,#polygon do
output = output .. "\\coordinate (polygon".. i .. ") at (" .. polygon[i].x .. "," .. polygon[i].y .. ");"
end
- output = output .. "\\draw[color=".. colorPoly .. ", thick]"
+ output = output .. "\\draw[color=".. colorPoly .. ", ,line width="..polygonThickness.."]"
for i=1,#polygon do
output = output .. "(" .. polygon[i].x .. "," .. polygon[i].y .. ") -- "
end
@@ -878,7 +889,7 @@ end
function drawMeshPolygonMP(chaine,mode,h,step,
- points,scale,random)
+ points,scale,random,thickness,polygonThickness)
local polygon = buildList(chaine, mode)
polygon = addPointsPolygon(polygon,h)
local grid = buildGrid(polygon,h,random)
@@ -900,48 +911,48 @@ function drawMeshPolygonMP(chaine,mode,h,step,
if(step=="mesh") then
-- polygon + mesh
triangulation = BowyerWatson(listPoints,"none") -- no bbox
- output = traceMeshMP(listPoints,triangulation,points)
+ output = traceMeshMP(listPoints,triangulation,points,thickness)
output = output .. tracePolygonMP(polygon,points)
end
- output = "\\leavevmode\\begin{mplibcode}beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
+ output = "\\leavevmode\\begin{mplibcode}[luamesh]beginfig(0);u:="..scale.. ";" .. output .."endfig;\\end{mplibcode}"
tex.sprint(output)
end
function drawMeshPolygonTikZ(chaine,mode,h,step,
- points,scale,color,colorPoly,random)
+ points,scale,color,colorPoly,random,thickness,polygonThickness)
local polygon = buildList(chaine, mode)
polygon = addPointsPolygon(polygon,h)
local grid = buildGrid(polygon,h,random)
local listPoints = addGridPoints(polygon,grid,h)
if(step=="polygon") then
-- the polygon
- output = tracePolygonTikZ(polygon,points,colorPoly)
+ output = tracePolygonTikZ(polygon,points,colorPoly,polygonThickness)
end
if(step=="grid") then
-- polygon + grid
output = tracePointsTikZ(grid,points,color,"none") -- none for colorBbox
- output = output .. tracePolygonTikZ(polygon,points,colorPoly)
+ output = output .. tracePolygonTikZ(polygon,points,colorPoly,polygonThickness)
end
if(step=="points") then
-- polygon + only grid points inside the polygon
output = tracePointsTikZ(listPoints,points,color,"none")
- output = output .. tracePolygonTikZ(polygon,points,colorPoly)
+ output = output .. tracePolygonTikZ(polygon,points,colorPoly,polygonThickness)
end
if(step=="mesh") then
-- polygon + mesh
triangulation = BowyerWatson(listPoints,"none") -- no bbox
- output = traceMeshTikZ(listPoints,triangulation,points,color,"none")
- output = output .. tracePolygonTikZ(polygon,points,colorPoly)
+ output = traceMeshTikZ(listPoints,triangulation,points,color,"none",thickness)
+ output = output .. tracePolygonTikZ(polygon,points,colorPoly,polygonThickness)
end
output = "\\noindent\\begin{tikzpicture}[x=" .. scale .. ",y=" .. scale .."]" .. output .."\\end{tikzpicture}"
tex.sprint(output)
end
function drawMeshPolygonMPinc(chaine,beginning,ending,mode,h,step,
- points,scale,random)
+ points,scale,random,thickness,polygonThickness)
local polygon = buildList(chaine, mode)
polygon = addPointsPolygon(polygon,h)
local grid = buildGrid(polygon,h,random)
@@ -963,17 +974,17 @@ function drawMeshPolygonMPinc(chaine,beginning,ending,mode,h,step,
if(step=="mesh") then
-- polygon + mesh
triangulation = BowyerWatson(listPoints,"none") -- no bbox
- output = traceMeshMP(listPoints,triangulation,points)
+ output = traceMeshMP(listPoints,triangulation,points,thickness)
output = output .. tracePolygonMP(polygon,points)
end
- output = "\\begin{mplibcode}u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
+ output = "\\begin{mplibcode}[luamesh]u:="..scale..";"..beginning .. output .. ending .. "\\end{mplibcode}"
tex.sprint(output)
end
function drawMeshPolygonTikZinc(chaine,beginning,ending,mode,h,step,
- points,scale,color,colorPoly,random)
+ points,scale,color,colorPoly,random,thickness,polygonThickness)
local polygon = buildList(chaine, mode)
polygon = addPointsPolygon(polygon,h)
local grid = buildGrid(polygon,h,random)
@@ -995,7 +1006,7 @@ function drawMeshPolygonTikZinc(chaine,beginning,ending,mode,h,step,
if(step=="mesh") then
-- polygon + mesh
triangulation = BowyerWatson(listPoints,"none") -- no bbox
- output = traceMeshTikZ(listPoints,triangulation,points,color,"none")
+ output = traceMeshTikZ(listPoints,triangulation,points,color,"none",thickness)
output = output .. tracePolygonTikZ(polygon,points,colorPoly)
end
output = "\\noindent\\begin{tikzpicture}[x="..scale..",y="..scale.."]".. beginning..output ..ending.. "\\end{tikzpicture}"
diff --git a/macros/luatex/latex/luamesh/tex/luamesh.sty b/macros/luatex/latex/luamesh/tex/luamesh.sty
index d2024a1da8..6e2e2d7b7d 100644
--- a/macros/luatex/latex/luamesh/tex/luamesh.sty
+++ b/macros/luatex/latex/luamesh/tex/luamesh.sty
@@ -1,27 +1,19 @@
\NeedsTeXFormat{LaTeX2e}%
\def\PackageName{luamesh}%
-\def\fileversion{v0.6}%
-\def\filedate{2020/06/06}%
+\def\fileversion{v0.7}%
+\def\filedate{2022/07/08}%
\ProvidesPackage{luamesh}[\filedate\space\fileversion]%
%
% package to load
\RequirePackage{xkeyval,xcolor,ifthen}%
-%% one global option: mp or tikz
-%\newif\ifluameshmp%
-%\define@key{luamesh.sty}{mp}[]{\luameshmptrue}%
-%\define@key{luamesh.sty}{tikz}[]{\luameshmpfalse}%
-%
-%\RequirePackage{etoolbox} % pour robustifier les commandes
-%
-%
-%\ifluameshmp%
- \RequirePackage{luamplib}%
-%\else%
- \RequirePackage{tikz}%
-%\fi%
+\RequirePackage{luamplib}%
+\RequirePackage{tikz}%
+
%
% load the lua code
\directlua{require("luamesh.lua")}%
+% load metapost lib
+\everymplib[luamesh]{input luamesh;}
%
%%
% for tikz (default value)
@@ -73,8 +65,10 @@
\define@key{buildMeshInc}{color}[black]{\def\luameshval@bmi@color{#1}}%
%% the name of the color of drawing the bbox
\define@key{buildMeshInc}{colorBbox}[black]{\def\luameshval@bmi@colorbbox{#1}}%
+%% thickness of the drawing (default value of tikz)
+\define@key{buildMeshInc}{thickness}[0.4pt]{\def\luameshval@bm@thickness{#1}}%
%
-\presetkeys{buildMeshInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+\presetkeys{buildMeshInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox,thickness}{}%
%
\newcommand*{\buildMeshBWinc}[4][]{%
% #1 : optionnal arguments
@@ -86,13 +80,13 @@
\def\MeshPoint{\luameshval@bmi@meshpoint}%
\ifKV@buildMeshInc@tikz% if we are using tikz
\directlua{%
- buildMeshTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale","\luameshval@bmi@color","\luameshval@bmi@colorbbox")%
+ buildMeshTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale","\luameshval@bmi@color","\luameshval@bmi@colorbbox","\luameshval@bm@thickness")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@bmi@color}}%
\def\luameshmpcolorBbox{\mpcolor{\luameshval@bmi@colorbbox}}%
\directlua{%
- buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale")%
+ buildMeshMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bmi@mode","\luameshval@bmi@print","\luameshval@bmi@bbox","\luameshval@bmi@scale","\luameshval@bm@thickness")%
}%
%
\fi%
@@ -135,8 +129,10 @@
\define@key{buildMesh}{color}[black]{\def\luameshval@bm@color{#1}}%
%% the name of the color of drawing the bbox
\define@key{buildMesh}{colorBbox}[black]{\def\luameshval@bm@colorbbox{#1}}%
+%% thickness of the drawing (default value of tikz)
+\define@key{buildMesh}{thickness}[0.4pt]{\def\luameshval@bm@thickness{#1}}%
%
-\presetkeys{buildMesh}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}%
+\presetkeys{buildMesh}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox,thickness}{}%
%
\newcommand{\buildMeshBW}[2][]{%
% #1 : optionnal arguments
@@ -146,13 +142,13 @@
\def\MeshPoint{\luameshval@bm@meshpoint}%
\ifKV@buildMesh@tikz% if we are using tikz
\directlua{%
- buildMeshTikZBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale","\luameshval@bm@color","\luameshval@bm@colorbbox")%
+ buildMeshTikZBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale","\luameshval@bm@color","\luameshval@bm@colorbbox","\luameshval@bm@thickness")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@bm@color}}%
\def\luameshmpcolorBbox{\mpcolor{\luameshval@bm@colorbbox}}%
\directlua{%
- buildMeshMPBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale")%
+ buildMeshMPBW("#2","\luameshval@bm@mode","\luameshval@bm@print","\luameshval@bm@bbox","\luameshval@bm@scale","\luameshval@bm@thickness")%
}%
%
\fi%
@@ -222,7 +218,13 @@
%% the name of the color of drawing the bbox
\define@key{buildVoronoiInc}{colorBbox}[black]{\def\luameshval@bvi@colorbbox{#1}}%
%
-\presetkeys{buildVoronoiInc}{tikz=false,bbox=none,scale, meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none,styleVoronoi=none}{}%
+% thickness
+\define@key{buildVoronoiInc}{thickness}[0.4pt]{\def\luameshval@bvi@thickness{#1}}%
+%% voroni thickness
+\define@key{buildVoronoiInc}{thicknessVoronoi}[0.4pt]{\def\luameshval@bvi@thicknessVoronoi{#1}}%
+\presetkeys{buildVoronoiInc}{tikz=false,bbox=none,scale,
+ meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none,styleVoronoi=none,thickness,
+thicknessVoronoi}{}%
%
\newcommand*{\buildVoronoiBWinc}[4][]{%
% #1 : optionnal arguments
@@ -235,14 +237,14 @@
\def\CircumPoint{\luameshval@bvi@circumpoint}%
\ifKV@buildVoronoiInc@tikz% if we are using tikz
\directlua{%
- buildVoronoiTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@color","\luameshval@bvi@colorbbox","\luameshval@bvi@colorvoronoi","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")%
+ buildVoronoiTikZBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@color","\luameshval@bvi@colorbbox","\luameshval@bvi@colorvoronoi","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi","\luameshval@bvi@thickness","\luameshval@bvi@thicknessVoronoi")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@bvi@color}}%
\def\luameshmpcolorBbox{\mpcolor{\luameshval@bvi@colorbbox}}%
\def\luameshmpcolorVoronoi{\mpcolor{\luameshval@bvi@colorvoronoi}}%
\directlua{%
- buildVoronoiMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi")%
+ buildVoronoiMPBWinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@bvi@mode","\luameshval@bvi@print","\luameshval@bvi@bbox","\luameshval@bvi@scale","\luameshval@bvi@delaunay","\luameshval@bvi@styleDelaunay","\luameshval@bvi@styleVoronoi","\luameshval@bvi@thickness","\luameshval@bvi@thicknessVoronoi")%
}%
%
\fi%
@@ -311,9 +313,13 @@
\define@key{buildVoronoi}{colorVoronoi}[red]{\def\luameshval@bv@colorVoronoi{#1}}%
%% the name of the color of drawing the bbox
\define@key{buildVoronoi}{colorBbox}[black]{\def\luameshval@bv@colorbbox{#1}}%
+% thickness
+\define@key{buildVoronoi}{thickness}[0.4pt]{\def\luameshval@bv@thickness{#1}}%
+%% voroni thickness
+\define@key{buildVoronoi}{thicknessVoronoi}[0.4pt]{\def\luameshval@bv@thicknessVoronoi{#1}}%
%
\presetkeys{buildVoronoi}{tikz=false,bbox=none,scale,
- meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none, styleVoronoi=none}{}%
+ meshpoint,circumpoint,mode=int,print=none,color,colorVoronoi,colorBbox,delaunay=none,styleDelaunay=none, styleVoronoi=none,thickness,thicknessVoronoi}{}%
%
\newcommand{\buildVoronoiBW}[2][]{%
% #1 : optionnal arguments
@@ -324,14 +330,14 @@
\def\CircumPoint{\luameshval@bv@circumpoint}%
\ifKV@buildVoronoi@tikz% if we are using tikz
\directlua{%
- buildVoronoiTikZBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@color","\luameshval@bv@colorbbox","\luameshval@bv@colorVoronoi","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")%
+ buildVoronoiTikZBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@color","\luameshval@bv@colorbbox","\luameshval@bv@colorVoronoi","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi","\luameshval@bv@thickness","\luameshval@bv@thicknessVoronoi")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@bv@color}}%
\def\luameshmpcolorBbox{\mpcolor{\luameshval@bv@colorbbox}}%
\def\luameshmpcolorVoronoi{\mpcolor{\luameshval@bv@colorVoronoi}}%
\directlua{%
- buildVoronoiMPBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi")%
+ buildVoronoiMPBW("#2","\luameshval@bv@mode","\luameshval@bv@print","\luameshval@bv@bbox","\luameshval@bv@scale","\luameshval@bv@delaunay","\luameshval@bv@styleDelaunay","\luameshval@bv@styleVoronoi","\luameshval@bv@thickness","\luameshval@bv@thicknessVoronoi")%
}%
%
\fi%
@@ -507,7 +513,12 @@
\def\luameshval@ap@bbox{bbox}%
\fi%
}%
-\presetkeys{MeshAddOneBW}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox}{}%
+%% thickness for mesh and circle and new elements
+\define@key{MeshAddOneBW}{thickness}[0.4pt]{\def\luameshval@ap@thickness{#1}}%
+\define@key{MeshAddOneBW}{thicknessCircle}[0.4pt]{\def\luameshval@ap@thicknesscircle{#1}}%
+\define@key{MeshAddOneBW}{thicknessNew}[1pt]{\def\luameshval@ap@thicknessnew{#1}}%
+
+\presetkeys{MeshAddOneBW}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox,thickness,thicknessCircle,thicknessNew}{}%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\meshAddPointBW}[3][]{%
@@ -519,7 +530,7 @@
\def\NewPoint{\luameshval@ap@newpoint}%
\ifKV@MeshAddOneBW@tikz% if we are using tikz
\directlua{%
- TeXOnePointTikZBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")%
+ TeXOnePointTikZBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox","\luameshval@ap@thickness","\luameshval@ap@thicknesscircle","\luameshval@ap@thicknessnew")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@ap@color}}
@@ -528,7 +539,7 @@
\def\luameshmpcolorCircle{\mpcolor{\luameshval@ap@colorcircle}}
\def\luameshmpcolorBbox{\mpcolor{\luameshval@ap@colorbbox}}
\directlua{%
- TeXOnePointMPBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox")%
+ TeXOnePointMPBW("#2","#3","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@thickness","\luameshval@ap@thicknesscircle","\luameshval@ap@thicknessnew")%
}%
%
\fi%
@@ -563,6 +574,12 @@
%% the color of circoncircle
\define@key{MeshAddOneBWinc}{colorCircle}[green]{\def\luameshval@api@colorcircle{#1}}%
\define@key{MeshAddOneBWinc}{colorBbox}[black]{\def\luameshval@api@colorbbox{#1}}%
+%% thickness for mesh and circle and new elements
+\define@key{MeshAddOneBWinc}{thickness}[0.4pt]{\def\luameshval@api@thickness{#1}}%
+\define@key{MeshAddOneBWinc}{thicknessCircle}[0.4pt]{\def\luameshval@api@thicknesscircle{#1}}%
+\define@key{MeshAddOneBWinc}{thicknessNew}[1pt]{\def\luameshval@api@thicknessnew{#1}}%
+
+
%
%% a complete picture or some code of the engine
\define@choicekey*{MeshAddOneBWinc}{mode}[\val\nr]{int, ext}{%
@@ -579,7 +596,7 @@
\def\luameshval@api@bbox{bbox}%
\fi%
}%
-\presetkeys{MeshAddOneBWinc}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox}{}%
+\presetkeys{MeshAddOneBWinc}{tikz=false,scale, meshpoint,newpoint,color,colorBack,colorNew,colorCircle,step=badtriangles,mode=int,bbox=none,colorBbox,thickness,thicknessCircle,thicknessNew}{}%
%
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand*{\meshAddPointBWinc}[5][]{%
@@ -593,7 +610,7 @@
\def\NewPoint{\luameshval@api@newpoint}%
\ifKV@MeshAddOneBWinc@tikz% if we are using tikz
\directlua{%
- TeXOnePointTikZBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@ap@step","\luameshval@ap@scale","\luameshval@ap@mode","\luameshval@ap@bbox","\luameshval@ap@color","\luameshval@ap@colorback","\luameshval@ap@colornew","\luameshval@ap@colorcircle","\luameshval@ap@colorbbox")%
+ TeXOnePointTikZBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox","\luameshval@api@color","\luameshval@api@colorback","\luameshval@api@colornew","\luameshval@api@colorcircle","\luameshval@api@colorbbox","\luameshval@api@thickness","\luameshval@api@thicknesscircle","\luameshval@api@thicknessnew")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@api@color}}
@@ -602,7 +619,7 @@
\def\luameshmpcolorCircle{\mpcolor{\luameshval@api@colorcircle}}
\def\luameshmpcolorBbox{\mpcolor{\luameshval@api@colorbbox}}
\directlua{%
- TeXOnePointMPBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox")%
+ TeXOnePointMPBWinc("#2","#3","\luaescapestring{\unexpanded{#4}}","\luaescapestring{\unexpanded{#5}}","\luameshval@api@step","\luameshval@api@scale","\luameshval@api@mode","\luameshval@api@bbox","\luameshval@api@thickness","\luameshval@api@thicknesscircle","\luameshval@api@thicknessnew")%
}%
%
\fi%
@@ -613,21 +630,23 @@
%% before and after the generated code
\define@boolkey{drawGmshInc}{tikz}[true]{}%
%% the scale
-\define@key{drawGmshInc}{scale}[1cm]{\def\luameshvaldgi@scale{#1}}%
+\define@key{drawGmshInc}{scale}[1cm]{\def\luameshval@dgi@scale{#1}}%
%% print ponits ?
\define@choicekey*{drawGmshInc}{print}[\val\nr]{none, points}{%
\ifcase\nr\relax%
- \def\luameshvaldgi@print{none}%
+ \def\luameshval@dgi@print{none}%
\or%
- \def\luameshvaldgi@print{points}%
+ \def\luameshval@dgi@print{points}%
\fi%
}%
%% the name of the point
-\define@key{drawGmshInc}{meshpoint}[P]{\def\luameshvaldgi@meshpoint{#1}}%
+\define@key{drawGmshInc}{meshpoint}[P]{\def\luameshval@dgi@meshpoint{#1}}%
%% the name of the color of drawing
-\define@key{drawGmshInc}{color}[black]{\def\luameshvaldgi@color{#1}}%
+\define@key{drawGmshInc}{color}[black]{\def\luameshval@dgi@color{#1}}%
+%% thickness
+\define@key{drawGmshInc}{thickness}[0.4pt]{\def\luameshval@dgi@thickness{#1}}%
%
-\presetkeys{drawGmshInc}{tikz=false,scale, meshpoint,print=none,color}{}%
+\presetkeys{drawGmshInc}{tikz=false,scale, meshpoint,print=none,color,thickness}{}%
%
\newcommand*{\drawGmshinc}[4][]{%
% #1 : optionnal arguments
@@ -635,15 +654,15 @@
% #3 : the code to place before the generated one
% #4 : the code to place after the generated one
\setkeys{drawGmshInc}{#1} %
- \def\MeshPoint{\luameshvaldgi@meshpoint}%
+ \def\MeshPoint{\luameshval@dgi@meshpoint}%
\ifKV@drawGmshInc@tikz% if we are using tikz
\directlua{%
- drawGmshTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale","\luameshvaldgi@color")%
+ drawGmshTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@dgi@print","\luameshval@dgi@scale","\luameshval@dgi@color","\luameshval@dgi@thickness")%
}%
\else % we are using MP
- \def\luameshmpcolor{\mpcolor{\luameshvaldgi@color}}%
+ \def\luameshmpcolor{\mpcolor{\luameshval@dgi@color}}%
\directlua{%
- drawGmshMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshvaldgi@print","\luameshvaldgi@scale")%
+ drawGmshMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@dgi@print","\luameshval@dgi@scale","\luameshval@dgi@thickness")%
}%
%
\fi%
@@ -653,35 +672,37 @@
%% the code is complete and we don't have any callbacks
\define@boolkey{drawGmsh}{tikz}[true]{}%
%% the scale
-\define@key{drawGmsh}{scale}[1cm]{\def\luameshvaldg@scale{#1}}%
+\define@key{drawGmsh}{scale}[1cm]{\def\luameshval@dg@scale{#1}}%
%% print points
\define@choicekey*{drawGmsh}{print}[\val\nr]{none, points}{%
\ifcase\nr\relax%
- \def\luameshvaldg@print{none}%
+ \def\luameshval@dg@print{none}%
\or%
- \def\luameshvaldg@print{points}%
+ \def\luameshval@dg@print{points}%
\fi%
}%
%% the name of the point
-\define@key{drawGmsh}{meshpoint}[P]{\def\luameshvaldg@meshpoint{#1}}%
+\define@key{drawGmsh}{meshpoint}[P]{\def\luameshval@dg@meshpoint{#1}}%
%% the name of the color of drawing
-\define@key{drawGmsh}{color}[black]{\def\luameshvaldg@color{#1}}%
+\define@key{drawGmsh}{color}[black]{\def\luameshval@dg@color{#1}}%
+%% thickness
+\define@key{drawGmsh}{thickness}[0.4pt]{\def\luameshval@dg@thickness{#1}}%
%
-\presetkeys{drawGmsh}{tikz=false,scale, meshpoint,print=none,color}{}%
+\presetkeys{drawGmsh}{tikz=false,scale, meshpoint,print=none,color,thickness}{}%
%
\newcommand{\drawGmsh}[2][]{%
% #1 : optionnal arguments
% #2 : the gmsh file
\setkeys{drawGmsh}{#1} %
- \def\MeshPoint{\luameshvaldg@meshpoint}%
+ \def\MeshPoint{\luameshval@dg@meshpoint}%
\ifKV@drawGmsh@tikz% if we are using tikz
\directlua{%
- drawGmshTikZ("#2","\luameshvaldg@print","\luameshvaldg@scale","\luameshvaldg@color")%
+ drawGmshTikZ("#2","\luameshval@dg@print","\luameshval@dg@scale","\luameshval@dg@color","\luameshval@dg@thickness")%
}%
\else % we are using MP
- \def\luameshmpcolor{\mpcolor{\luameshvaldg@color}}%
+ \def\luameshmpcolor{\mpcolor{\luameshval@dg@color}}%
\directlua{%
- drawGmshMP("#2","\luameshvaldg@print","\luameshvaldg@scale")%
+ drawGmshMP("#2","\luameshval@dg@print","\luameshval@dg@scale","\luameshval@dg@thickness")%
}%
%
\fi%
@@ -732,6 +753,11 @@
\define@key{gmshVoronoiInc}{color}[black]{\def\luameshval@gvi@color{#1}}%
%% the name of the color of drawing Voronoi
\define@key{gmshVoronoiInc}{colorVoronoi}[red]{\def\luameshval@gvi@colorvoronoi{#1}}%
+%% thickness
+\define@key{gmshVoronoiInc}{thickness}[0.4pt]{\def\luameshval@gvi@thickness{#1}}%
+%% Voronoi thickness
+\define@key{gmshVoronoiInc}{thicknessVoronoi}[0.4pt]{\def\luameshval@gvi@thicknessVoronoi{#1}}%
+
%
\presetkeys{gmshVoronoiInc}{tikz=false,scale,
meshpoint,circumpoint,print=none,color,colorVoronoi,delaunay=none,styleVoronoi=none, styleDelaunay=none}{}%
@@ -746,13 +772,13 @@
\def\CircumPoint{\luameshval@gvi@circumpoint}%
\ifKV@gmshVoronoiInc@tikz% if we are using tikz
\directlua{%
- gmshVoronoiTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@color","\luameshval@gvi@colorvoronoi","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")%
+ gmshVoronoiTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@color","\luameshval@gvi@colorvoronoi","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi","\luameshval@gvi@thickness","\luameshval@gvi@thicknessVoronoi")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@gvi@color}}%
\def\luameshmpcolorVoronoi{\mpcolor{\luameshval@gvi@colorvoronoi}}%
\directlua{%
- gmshVoronoiMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi")%
+ gmshVoronoiMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@gvi@print","\luameshval@gvi@scale","\luameshval@gvi@delaunay","\luameshval@gvi@styleDelaunay","\luameshval@gvi@styleVoronoi","\luameshval@gvi@thickness","\luameshval@gvi@thicknessVoronoi")%
}%
%
\fi%
@@ -804,7 +830,12 @@
%% the name of the color of drawing Voronoi
\define@key{gmshVoronoi}{colorVoronoi}[red]{\def\luameshval@gv@colorVoronoi{#1}}%
%
-\presetkeys{gmshVoronoi}{tikz=false,scale, meshpoint,circumpoint,print=none,color,colorVoronoi,delaunay=none,styleVoronoi=none, styleDelaunay=none}{}%
+%% thickness
+\define@key{gmshVoronoi}{thickness}[0.4pt]{\def\luameshval@gv@thickness{#1}}%
+%% Voronoi thickness
+\define@key{gmshVoronoi}{thicknessVoronoi}[0.4pt]{\def\luameshval@gv@thicknessVoronoi{#1}}%
+%
+\presetkeys{gmshVoronoi}{tikz=false,scale, meshpoint,circumpoint,print=none,color,colorVoronoi,delaunay=none,styleVoronoi=none, styleDelaunay=none,thickness,thicknessVoronoi}{}%
%
\newcommand{\gmshVoronoi}[2][]{%
% #1 : optionnal arguments
@@ -814,13 +845,13 @@
\def\CircumPoint{\luameshval@gv@circumpoint}%
\ifKV@gmshVoronoi@tikz% if we are using tikz
\directlua{%
- gmshVoronoiTikZ("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@color","\luameshval@gv@colorVoronoi","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")%
+ gmshVoronoiTikZ("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@color","\luameshval@gv@colorVoronoi","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi","\luameshval@gv@thickness","\luameshval@gv@thicknessVoronoi")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@gv@color}}%
\def\luameshmpcolorVoronoi{\mpcolor{\luameshval@gv@colorVoronoi}}%
\directlua{%
- gmshVoronoiMP("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi")%
+ gmshVoronoiMP("#2","\luameshval@gv@print","\luameshval@gv@scale","\luameshval@gv@delaunay","\luameshval@gv@styleDelaunay","\luameshval@gv@styleVoronoi","\luameshval@gv@thickness","\luameshval@gv@thicknessVoronoi")%
}%
%
\fi%
@@ -879,11 +910,15 @@
%% the name of the color of drawing
\define@key{meshPolygon}{color}[black]{\def\luameshval@mp@color{#1}}%
-%% the name of the color of drawing Voronoi
+%% the name of the color for the polygon
\define@key{meshPolygon}{colorPolygon}[red]{\def\luameshval@mp@colorPolygon{#1}}%
+%% thickness
+\define@key{meshPolygon}{thickness}[0.4pt]{\def\luameshval@mp@thickness{#1}}%
+%% polygon thickness
+\define@key{meshPolygon}{thicknessPolygon}[0.4pt]{\def\luameshval@mp@polygonThickness{#1}}%
%% the name of the color of drawing the bbox
%
-\presetkeys{meshPolygon}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}%
+\presetkeys{meshPolygon}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect,thickness,thicknessPolygon}{}%
%
\newcommand{\meshPolygon}[2][]{%
% #1 : optionnal arguments
@@ -893,13 +928,13 @@
\def\MeshPoint{\luameshval@mp@meshpoint}%
\ifKV@meshPolygon@tikz% if we are using tikz
\directlua{%
- drawMeshPolygonTikZ("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@color","\luameshval@mp@colorPolygon","\luameshval@mp@gridpoints")%
+ drawMeshPolygonTikZ("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@color","\luameshval@mp@colorPolygon","\luameshval@mp@gridpoints","\luameshval@mp@thickness","\luameshval@mp@polygonThickness")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@mp@color}}%
\def\luameshmpcolorPoly{\mpcolor{\luameshval@mp@colorPolygon}}%
\directlua{%
- drawMeshPolygonMP("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@gridpoints")%
+ drawMeshPolygonMP("#2","\luameshval@mp@mode","\luameshval@mp@h","\luameshval@mp@step","\luameshval@mp@print","\luameshval@mp@scale","\luameshval@mp@gridpoints","\luameshval@mp@thickness","\luameshval@mp@polygonThickness")%
}%
%
\fi%
@@ -955,11 +990,14 @@
%% the name of the color of drawing
\define@key{meshPolygonInc}{color}[black]{\def\luameshval@mpi@color{#1}}%
-%% the name of the color of drawing Voronoi
+%% the name of the color for the polygon
\define@key{meshPolygonInc}{colorPolygon}[red]{\def\luameshval@mpi@colorPolygon{#1}}%
-%% the name of the color of drawing the bbox
-%
-\presetkeys{meshPolygonInc}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect}{}%
+%% thickness
+\define@key{meshPolygonInc}{thickness}[0.4pt]{\def\luameshval@mpi@thickness{#1}}%
+%% polygon thickness
+\define@key{meshPolygonInc}{polygonThickness}[0.4pt]{\def\luameshval@mpi@polygonThickness{#1}}%
+
+\presetkeys{meshPolygonInc}{tikz=false,scale,mode=int,step=mesh,print=none,color,colorPolygon,h,meshpoint,gridpoints=rect,thickness,polygonThickness}{}%
%
\newcommand{\meshPolygonInc}[4][]{%
% #1 : optionnal arguments
@@ -971,14 +1009,14 @@
\def\MeshPoint{\luameshval@mpi@meshpoint}%
\ifKV@meshPolygonInc@tikz% if we are using tikz
\directlua{%
- drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@color","\luameshval@mpi@colorPolygon","\luameshval@mpi@gridpoints")%
+ drawMeshPolygonTikZinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@color","\luameshval@mpi@colorPolygon","\luameshval@mpi@gridpoints","\luameshval@mpi@thickness","\luameshval@mpi@polygonThickness")%
}%
\else % we are using MP
\def\luameshmpcolor{\mpcolor{\luameshval@mpi@color}}%
\def\luameshmpcolorPoly{\mpcolor{\luameshval@mpi@colorPolygon}}%
\directlua{%
- drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@gridpoints")%
+ drawMeshPolygonMPinc("#2","\luaescapestring{\unexpanded{#3}}","\luaescapestring{\unexpanded{#4}}","\luameshval@mpi@mode","\luameshval@mpi@h","\luameshval@mpi@step","\luameshval@mpi@print","\luameshval@mpi@scale","\luameshval@mpi@gridpoints","\luameshval@mpi@thickness","\luameshval@mpi@polygonThickness")%
}%
%
\fi%
-}%
+}% \ No newline at end of file