summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-09-08 21:14:31 +0000
committerKarl Berry <karl@freefriends.org>2023-09-08 21:14:31 +0000
commita86c9186885d2699c2ddaccd59b7ae9df984a0cd (patch)
tree7902ae43280bb7cda96e62a4f1bf61ddd843f1d1 /Master/texmf-dist/tex/latex
parent9d78621bc02c9782ba73496bba31df60e423ec57 (diff)
wordcloud (8sep23)
git-svn-id: svn://tug.org/texlive/trunk@68209 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua4
-rw-r--r--Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty14
2 files changed, 8 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua b/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua
index 209ab0ca710..8df2c5a405e 100644
--- a/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua
+++ b/Master/texmf-dist/tex/latex/wordcloud/wordcloud.lua
@@ -4,7 +4,7 @@
%% drawing wordclouds %%
%% with METAPOST and Lua %%
%% chupin@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 @@ function wc_build_mp_code(table_weight,maximum,rotation)
]]
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 @@ end
-- 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)
diff --git a/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty b/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty
index 6fce2b03d93..378a8da3156 100644
--- a/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty
+++ b/Master/texmf-dist/tex/latex/wordcloud/wordcloud.sty
@@ -3,7 +3,7 @@
%% drawing wordclouds %%
%% with METAPOST and Lua %%
%% chupin@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