texlive[68209] Master/texmf-dist: wordcloud (8sep23)

commits+karl at tug.org commits+karl at tug.org
Fri Sep 8 23:14:31 CEST 2023


Revision: 68209
          http://tug.org/svn/texlive?view=revision&revision=68209
Author:   karl
Date:     2023-09-08 23:14:31 +0200 (Fri, 08 Sep 2023)
Log Message:
-----------
wordcloud (8sep23)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/metapost/wordcloud/README.md
    trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.pdf
    trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.tex
    trunk/Master/texmf-dist/metapost/wordcloud/wordcloud.mp
    trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua
    trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty

Modified: trunk/Master/texmf-dist/doc/metapost/wordcloud/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/metapost/wordcloud/README.md	2023-09-08 21:14:19 UTC (rev 68208)
+++ trunk/Master/texmf-dist/doc/metapost/wordcloud/README.md	2023-09-08 21:14:31 UTC (rev 68209)
@@ -13,7 +13,7 @@
 
 ## Installation
 
-MPchess is on the [ctan](ctan.org) and can be installed via the package manager of your
+Wordcloud is on the [ctan](ctan.org) and can be installed via the package manager of your
 distribution [https://www.ctan.org/pkg/wordcloud](https://www.ctan.org/pkg/wordcloud).
 
 ### With TeX live under Linux or MacOS
@@ -34,7 +34,7 @@
 
 ### With MikTEX and Windows
 
-These two systems are unknown to the author of MPchess, so we refer to their
+These two systems are unknown to the author of Wordcloud, so we refer to their
 documentation to add local packages:
 [http://docs.miktex.org/manual/localadditions.html](http://docs.miktex.org/manual/localadditions.html)
 
@@ -54,4 +54,4 @@
 
 ## Licenses
 
-This projet is under LATEX Project Public License 1.3c. 
\ No newline at end of file
+This projet is under LATEX Project Public License 1.3c. 

Modified: trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.tex
===================================================================
--- trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.tex	2023-09-08 21:14:19 UTC (rev 68208)
+++ trunk/Master/texmf-dist/doc/metapost/wordcloud/wordcloud-doc-en.tex	2023-09-08 21:14:31 UTC (rev 68209)
@@ -6,9 +6,6 @@
 % Originally written by Maxime Chupin <notezik at gmail.com>,
 % 2023.
 %
-% Distributed under the terms of the GNU free documentation licence:
-%   http://www.gnu.org/licenses/fdl.html
-% without any invariant section or cover text.
 
 \documentclass[english]{ltxdoc}
 
@@ -42,7 +39,7 @@
 \noindent
 {\Large  drawing wordclouds \\[0.2cm]with \hologo{METAPOST} and Lua}\\[3cm]
 \parbox{0.6\textwidth}{
-  \wordcloud[scale=2,rotate=0,margin=0.5pt,usecolor]{(Wordcloud,10);(\\hologo{METAPOST},6);(\\LaTeX,7);(Lua,4);(algorithm,3);(code,2);(mathematics,2);(CTAN,2);(mplib,4);(\\hologo{LuaTeX},4);(latexmp,3);(graphism,2)}
+  \wordcloud[scale=2,rotate=0,margin=0.5pt,usecolor]{(Wordcloud,10);(\hologo{METAPOST},6);(\LaTeX,7);(Lua,4);(algorithm,3);(code,2);(mathematics,2);(CTAN,2);(mplib,4);(\hologo{LuaTeX},4);(latexmp,3);(graphism,2)}
 }\hfill
 \parbox{0.5\textwidth}{\Large\raggedleft
   \textbf{Contributor}\\
@@ -51,8 +48,8 @@
 }
 \vfill
 \begin{center}
-  Version 0.1, 2023, August, 9th \\
-  \url{https://plmlab.math.cnrs.fr/mchupin/wordcloud}
+  Version 0.2, 2023, September, 7th \\
+  \url{https://plmlab.math.cnrs.fr/mchupin/mchupin/wordcloud}
 \end{center}
 %% == Page de garde ====================================================
 \newpage
@@ -348,7 +345,7 @@
   \hologo{METAPOST}.} ;
   \item[\texttt{margin=}\meta{value with units}:] to adjust the margins
   (default \lstinline+0.3pt+) ;
-  \item[\texttt{rotation=}\meta{angle}:] to rotate (degrees) the words with
+  \item[\texttt{rotate=}\meta{angle}:] to rotate (degrees) the words with
   $\pm$\meta{angle} alternatively (default 0) ;
   \item[\texttt{usecolor}:] to use color for word drawing (boolean, default
   \lstinline+false+) as described in section~\ref{sec:colors} ;
@@ -361,12 +358,19 @@
 
 Here an example:
 \begin{ExempleLaTeX} 
-\wordcloud[scale=1,rotate=45,margin=0.5pt,usecolor,colors={red!40,blue!40,green!20!black}]{(Wordcloud,10);(\\hologo{METAPOST},6);(\\LaTeX,7);(Lua,4);(algorithm,3);(code,2);(mathematics,2);(CTAN,2);(mplib,4);(\\hologo{LuaTeX},4);(latexmp,3);(graphism,2)} 
+\wordcloud[scale=1,rotate=45,margin=0.5pt,usecolor,colors={red!40,blue!40,green!20!black}]{(Wordcloud,10);(\hologo{METAPOST},6);(\LaTeX,7);(Lua,4);(algorithm,3);(code,2);(mathematics,2);(CTAN,2);(mplib,4);(\hologo{LuaTeX},4);(\texttt{latexmp},3);(graphism,2)} 
 \end{ExempleLaTeX}
 
+Since version 0.2, you could use any \LaTeX{} code to define words for the
+wordcloud. In the definition of the \LaTeX{} command, \wordcloudpkg{} uses
+\lstinline+\luaescapestring+ to deals with commands. For example, as far as we
+know,  this \wordcloudpkg package is the only wordcloud tool that could build a
+wordcloud of mathematical formulas. 
+
 \begin{remark}
-Because the list of words and weights is given to Lua, we have to escape the
-\lstinline+\+ to use \LaTeX{} commands. 
+  Because the \hologo{METAPOST} side uses \lstinline+textext+ command to build
+  words, \lstinline+\mplibtextextlabel{enable}+ is used to enable string labels
+  typeset via \lstinline+textext()+ instead of \emph{infont} operator.
 \end{remark}
 
 \subsection{Add ignored words}
@@ -420,6 +424,13 @@
   \item Add options for rotation of words.
 \end{itemize}
 
+\section{History}
+
+\begin{description}
+  \item[v0.2 (09/2023):] Deal with \lstinline+\luaescapestring+ for list with
+  \lstinline+\wordcloud+. Typos in doc. 
+  \item[v0.1 (08/2023):] First publication.
+\end{description}
 \printbibliography
 \printindex
 \newpage

Modified: trunk/Master/texmf-dist/metapost/wordcloud/wordcloud.mp
===================================================================
--- trunk/Master/texmf-dist/metapost/wordcloud/wordcloud.mp	2023-09-08 21:14:19 UTC (rev 68208)
+++ trunk/Master/texmf-dist/metapost/wordcloud/wordcloud.mp	2023-09-08 21:14:31 UTC (rev 68209)
@@ -3,7 +3,7 @@
 %%                    drawing wordclouds                      %%
 %%                   with METAPOST and Lua                    %%
 %%                chupin at ceremade.dauphine.fr                 %%
-%%                Version 0.1 (aout    2023)                  %%
+%%                Version 0.2 (septembre    2023)             %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 % This work may be distributed and/or modified under the conditions of

Modified: trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua
===================================================================
--- trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua	2023-09-08 21:14:19 UTC (rev 68208)
+++ trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua	2023-09-08 21:14:31 UTC (rev 68209)
@@ -4,7 +4,7 @@
 %%                    drawing wordclouds                      %%
 %%                   with METAPOST and Lua                    %%
 %%                chupin at ceremade.dauphine.fr                 %%
-%%                Version 0.1 (aout    2023)                  %%
+%%                Version 0.2 (septembre    2023)             %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 % This work may be distributed and/or modified under the conditions of
@@ -128,7 +128,6 @@
     ]]
     local i=0
     for i=1, #tabular_weight do
-         
         str_mp=str_mp.."words["..i.."]:=\""..tabular_weight[i][1].."\";"
         str_mp=str_mp.."weights["..i.."]:="..tabular_weight[i][2]..";"
         if (i>=maximum) then
@@ -175,7 +174,6 @@
 
 -- build mp code for the wordcloud of a list given in LaTeX command
 function wc_build_wordcloud(str,rotation,scale,margin,usecolor,colors)
-    
     maximum = maximum or 50
     local table = wc_list_to_table(str)
     local lgth_table = wc_size_of_table(table)

Modified: trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty	2023-09-08 21:14:19 UTC (rev 68208)
+++ trunk/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty	2023-09-08 21:14:31 UTC (rev 68209)
@@ -3,7 +3,7 @@
 %%                    drawing wordclouds                      %%
 %%                   with METAPOST and Lua                    %%
 %%                chupin at ceremade.dauphine.fr                 %%
-%%                Version 0.1 (aout    2023)                  %%
+%%                Version 0.2 (septembre    2023)             %%
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
 % This work may be distributed and/or modified under the conditions of
@@ -14,13 +14,13 @@
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \NeedsTeXFormat{LaTeX2e}%
 \def\PackageName{wordcloud}%
-\def\fileversion{v0.1}%
+\def\fileversion{v0.2}%
 \def\filedate{2023/07/26}%
 \ProvidesPackage{wordcloud}[\filedate\space\fileversion]%
 %
 % package to load
 \RequirePackage{luamplib}%
-
+\mplibtextextlabel{enable} % to allow LaTeX in list of words inside LaTeX document
 %
 % load the lua code
 \directlua{require("wordcloud.lua")}%
@@ -55,7 +55,7 @@
   % mandatory argument : list (word1,weight1);(word2,weight2);etc.
   % optional arguments :
   % scale=<value> (default 1)
-  % rotation=<value> (default 0)
+  % rotate=<value> (default 0)
   % margin=<value> (default 0.3pt)
   % usecolor=true/false (default false)
   % colors={color1,color2,etc}
@@ -88,7 +88,7 @@
   %\show {coucous}
   \directlua{%
     %tex.sprint("test")
-    wc_build_wordcloud("#2",\tl_use:N \g__wc_wordcloud_rotate_tl,\tl_use:N \g__wc_wordcloud_scale_tl,"\tl_use:N \g__wc_wordcloud_margin_tl",\bool_if:NTF \g__wc_wordcloud_usecolor_bool{"true"}{"false"},"\tl_use:N \l_colors_list_tl")
+    wc_build_wordcloud("\luaescapestring{\unexpanded{#2}}",\tl_use:N \g__wc_wordcloud_rotate_tl,\tl_use:N \g__wc_wordcloud_scale_tl,"\tl_use:N \g__wc_wordcloud_margin_tl",\bool_if:NTF \g__wc_wordcloud_usecolor_bool{"true"}{"false"},"\tl_use:N \l_colors_list_tl")
   }%
 }
 
@@ -99,7 +99,7 @@
   % wordcloud 
   % optional arguments :
   % scale=<value> (default 1)
-  % rotation=<value> (default 0)
+  % rotate=<value> (default 0)
   % margin=<value> (default 0.3pt)
   % usecolor=true/false (default false)
   % colors={color1,color2,etc}
@@ -146,4 +146,4 @@
 }
 
 
-\ExplSyntaxOff
\ No newline at end of file
+\ExplSyntaxOff



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