From: Maxime Chupin (escudo) Date: Thu, 24 Nov 2016 22:19:41 +0000 (+0100) Subject: trace -> draw sur les macros LaTeX X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=commitdiff_plain;h=727795d8de3f933aee3189314a99644afbf7a370;p=delaunay.git trace -> draw sur les macros LaTeX --- diff --git a/doc/luamesh-doc.pdf b/doc/luamesh-doc.pdf index 41c87e3..7223947 100644 Binary files a/doc/luamesh-doc.pdf and b/doc/luamesh-doc.pdf differ diff --git a/doc/luamesh-doc.tex b/doc/luamesh-doc.tex index d68baa3..d2477b8 100644 --- a/doc/luamesh-doc.tex +++ b/doc/luamesh-doc.tex @@ -9,6 +9,10 @@ \documentclass{lltxdoc} \usepackage{tcolorbox} +\usepackage{xargs} +\usepackage{enumitem} + + \title{\Verb+luamesh+: compute and draw meshes with \lualatex} \author{Maxime Chupin \email{mc@melusine.eu.org}} \date{\today} @@ -19,7 +23,6 @@ }% ]{Vitem}} -\usepackage{xargs} \newcommand*\textme[1]{\color{black}{\rmfamily\textit{#1}}} \newcommand*\meta[1]{% % meta \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}} @@ -96,6 +99,10 @@ \newcommand\luamesh{\Verb+luamesh+\xspace} +\newenvironment{optionsenum}[1][] + {\begin{description}[font=\color{red}\ttfamily]} + {\end{description}} + \begin{document} \maketitle @@ -187,7 +194,7 @@ points must be given in the following way : \subsubsection{The Options} There are several options to customize the drawing. -\begin{description} +\begin{optionsenum} \item[\color{red}\texttt{mode = int (default) or ext}:] the mode option allow to use either the previously described set of point in the argument, or a file, containing, line by line (2 columns), the points. Such a @@ -199,7 +206,7 @@ x3 y3 ... xn yn \end{verbatim} -\end{description} +\end{optionsenum} \subsection{Draw the Set of Points} diff --git a/luamesh.sty b/luamesh.sty index 69d2ad8..5110cb3 100644 --- a/luamesh.sty +++ b/luamesh.sty @@ -155,12 +155,12 @@ }% % % -%%%%%%%%%%%%%%%%% the trace Points macro +%%%%%%%%%%%%%%%%% the draw Points macro %% plot the list of points given in argument % the engine -\define@boolkey{tracePoints}{tikz}[true]{}% +\define@boolkey{drawPoints}{tikz}[true]{}% %% show the bounding box for delaunay -\define@choicekey*{tracePoints}{bbox}[\val\nr]{none, show}{% +\define@choicekey*{drawPoints}{bbox}[\val\nr]{none, show}{% \ifcase\nr\relax% \def\luameshval@tp@bbox{none}% \or% @@ -168,9 +168,9 @@ \fi% }% %% the scale -\define@key{tracePoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}% +\define@key{drawPoints}{scale}[1cm]{\def\luameshval@tp@scale{#1}}% %% print points -\define@choicekey*{tracePoints}{print}[\val\nr]{none, points}{% +\define@choicekey*{drawPoints}{print}[\val\nr]{none, points}{% \ifcase\nr\relax% \def\luameshval@tp@print{none}% \or% @@ -178,9 +178,9 @@ \fi% }% %% the name of the point -\define@key{tracePoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}% +\define@key{drawPoints}{meshpoint}[P]{\def\luameshval@tp@meshpoint{#1}}% %% the mode for reading the points -\define@choicekey*{tracePoints}{mode}[\val\nr]{int, ext}{% +\define@choicekey*{drawPoints}{mode}[\val\nr]{int, ext}{% \ifcase\nr\relax% \def\luameshval@tp@mode{int}% \or% @@ -188,19 +188,19 @@ \fi% }% %% the name of the color of drawing -\define@key{tracePoints}{color}[black]{\def\luameshval@tp@color{#1}}% +\define@key{drawPoints}{color}[black]{\def\luameshval@tp@color{#1}}% %% the name of the color of drawing the bbox -\define@key{tracePoints}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}% +\define@key{drawPoints}{colorBbox}[black]{\def\luameshval@tp@colorbbox{#1}}% % -\presetkeys{tracePoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% +\presetkeys{drawPoints}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% % -\newcommand{\tracePointsMesh}[2][]{% +\newcommand{\drawPointsMesh}[2][]{% % #1 : optionnal arguments % #2 : the string containing the list of points % (x1,y1);(x2,y2);... or the name file containing the points - \setkeys{tracePoints}{#1} % + \setkeys{drawPoints}{#1} % \def\MeshPoint{\luameshval@tp@meshpoint}% - \ifKV@tracePoints@tikz% if we are using tikz + \ifKV@drawPoints@tikz% if we are using tikz \directlua{% printPointsTikZ("#2","\luameshval@tp@mode","\luameshval@tp@print","\luameshval@tp@bbox","\luameshval@tp@scale","\luameshval@tp@color","\luameshval@tp@colorbbox")% }% @@ -215,11 +215,11 @@ }% % -%%%%%%%%%%%%%%%% the trace Points macro inc with callbacks +%%%%%%%%%%%%%%%% the draw Points macro inc with callbacks %% engine of drawing -\define@boolkey{tracePointsInc}{tikz}[true]{}% +\define@boolkey{drawPointsInc}{tikz}[true]{}% %% show the bounding box for delaunay -\define@choicekey*{tracePointsInc}{bbox}[\val\nr]{none, show}{% +\define@choicekey*{drawPointsInc}{bbox}[\val\nr]{none, show}{% \ifcase\nr\relax% \def\luameshval@tpi@bbox{none}% \or% @@ -227,9 +227,9 @@ \fi% }% %% the scale -\define@key{tracePointsInc}{scale}[1cm]{\def\luameshval@tpi@scale{#1}}% +\define@key{drawPointsInc}{scale}[1cm]{\def\luameshval@tpi@scale{#1}}% %% print points -\define@choicekey*{tracePointsInc}{print}[\val\nr]{none, points}{% +\define@choicekey*{drawPointsInc}{print}[\val\nr]{none, points}{% \ifcase\nr\relax% \def\luameshval@tpi@print{none}% \or% @@ -237,9 +237,9 @@ \fi% }% %% the name of the point -\define@key{tracePointsInc}{meshpoint}[P]{\def\luameshval@tpi@meshpoint{#1}}% +\define@key{drawPointsInc}{meshpoint}[P]{\def\luameshval@tpi@meshpoint{#1}}% %% the mode for reading the points -\define@choicekey*{tracePointsInc}{mode}[\val\nr]{int, ext}{% +\define@choicekey*{drawPointsInc}{mode}[\val\nr]{int, ext}{% \ifcase\nr\relax% \def\luameshval@tpi@mode{int}% \or% @@ -249,22 +249,22 @@ % % color %% the name of the color of drawing -\define@key{tracePointsInc}{color}[black]{\def\luameshval@tpi@color{#1}}% +\define@key{drawPointsInc}{color}[black]{\def\luameshval@tpi@color{#1}}% %% the name of the color of drawing the bbox -\define@key{tracePointsInc}{colorBbox}[black]{\def\luameshval@tpi@colorbbox{#1}}% +\define@key{drawPointsInc}{colorBbox}[black]{\def\luameshval@tpi@colorbbox{#1}}% % -\presetkeys{tracePointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% +\presetkeys{drawPointsInc}{tikz=false,bbox=none,scale, meshpoint,mode=int,print=none,color,colorBbox}{}% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\newcommand*{\tracePointsMeshinc}[4][]{% +\newcommand*{\drawPointsMeshinc}[4][]{% % #1 : optionnal arguments % #2 : the string containing the list of points % (x1,y1);(x2,y2);... or the name file containing the points % #3 : the code to place before the generated one % #4 : the code to place after the generated one - \setkeys{tracePointsInc}{#1} % + \setkeys{drawPointsInc}{#1} % \def\MeshPoint{\luameshval@tpi@meshpoint}% - \ifKV@tracePointsInc@tikz% if we are using tikz + \ifKV@drawPointsInc@tikz% if we are using tikz \directlua{% buildMeshTikZ("#2","\luameshval@tpi@mode","\luameshval@tpi@print","\luameshval@tpi@bbox","full","\luameshval@tpi@sc%ale","\luameshval@tpi@color")% }% diff --git a/test/animation.pdf b/test/animation.pdf index 678c5c0..0804e6d 100644 Binary files a/test/animation.pdf and b/test/animation.pdf differ diff --git a/test/animation.tex b/test/animation.tex index aa5c29c..17ea062 100644 --- a/test/animation.tex +++ b/test/animation.tex @@ -11,7 +11,7 @@ \begin{document} -\tracePointsMeshinc[ +\drawPointsMeshinc[ mode=ext, bbox = show, colorBbox = blue!20, diff --git a/test/delaunay.tex b/test/delaunay.tex index adb9525..3229ba1 100644 --- a/test/delaunay.tex +++ b/test/delaunay.tex @@ -16,9 +16,9 @@ \buildMeshBW[mode=ext,bbox = show, color=red,colorBbox = blue]{mesh.txt} -\tracePointsMesh[mode=ext,bbox = show, color=red,print=points]{mesh.txt} +\drawPointsMesh[mode=ext,bbox = show, color=red,print=points]{mesh.txt} -\tracePointsMesh[mode=ext,bbox = show, color=red]{mesh.txt} +\drawPointsMesh[mode=ext,bbox = show, color=red]{mesh.txt} \buildMeshBWinc[mode=ext,bbox = show, color=red,colorBbox = blue]{mesh.txt}{% @@ -93,9 +93,9 @@ color=red]{(0,0);(3.5,3);(7,0);(7.5,5);(1.61,3.14);(3,1);(6,1.5)} \buildMeshBW[tikz,mode=ext, color=red]{mesh.txt} -\tracePointsMesh[tikz,mode=ext,bbox = show, +\drawPointsMesh[tikz,mode=ext,bbox = show, color=red,print=points]{mesh.txt} -\tracePointsMesh[tikz,mode=ext,bbox = show, color=red]{mesh.txt} +\drawPointsMesh[tikz,mode=ext,bbox = show, color=red]{mesh.txt} \buildMeshBWinc[tikz,mode=ext,bbox = show, colorBbox = blue]{mesh.txt}{% }%