texlive[74773] Master/texmf-dist: ideavault (28mar25)
commits+karl at tug.org
commits+karl at tug.org
Fri Mar 28 22:30:48 CET 2025
Revision: 74773
https://tug.org/svn/texlive?view=revision&revision=74773
Author: karl
Date: 2025-03-28 22:30:48 +0100 (Fri, 28 Mar 2025)
Log Message:
-----------
ideavault (28mar25)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/lualatex/ideavault/README.md
trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.pdf
trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex
trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty
Modified: trunk/Master/texmf-dist/doc/lualatex/ideavault/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/ideavault/README.md 2025-03-28 21:30:24 UTC (rev 74772)
+++ trunk/Master/texmf-dist/doc/lualatex/ideavault/README.md 2025-03-28 21:30:48 UTC (rev 74773)
@@ -10,7 +10,7 @@
## LICENCE
-Copyright 2024 Tomasz M. Czarkowski
+Copyright 2024-2025 Tomasz M. Czarkowski
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
Modified: trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex 2025-03-28 21:30:24 UTC (rev 74772)
+++ trunk/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex 2025-03-28 21:30:48 UTC (rev 74773)
@@ -42,7 +42,7 @@
\item \texttt{content}: valid LaTeX code for the content of idea. It will be evaluated at invocation time.
\item \texttt{dependencies}: each dependency is Lua pair of strings, multiple dependencies are separated with comma.
\item \texttt{tags}: each tag is Lua string, multiple tags are separated with comma.
-\item \texttt{weight}: a number used for sorting ideas when multiple are printed at the same time. By default, equal to \texttt{-1}.
+\item \texttt{weight}: a number used for sorting ideas when multiple are printed at the same time. By default, equal to \texttt{-1}. Special value of "auto" makes it number weight sequentially, starting from 1 and growing by 1 per step --- it's useful mostly for preserving order of ideas on mass printing.
\end{itemize}
\par Note: due to how \texttt{xkeyval} treats \{\}, for ideas with exactly one dependency, You need to add one space after the dependency, while for multi dependency there is no need.
\par Example:
Modified: trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua 2025-03-28 21:30:24 UTC (rev 74772)
+++ trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua 2025-03-28 21:30:48 UTC (rev 74773)
@@ -1,5 +1,5 @@
-- ideavault-lua.lua
--- Copyright 2024 Tomasz M. Czarkowski
+-- Copyright 2024-2025 Tomasz M. Czarkowski
--
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3c
@@ -136,6 +136,28 @@
end
end
+AutoCounter = {}
+AutoCounter.__index = AutoCounter
+
+setmetatable(AutoCounter, {
+ __call = function (cls, ...)
+ return cls.new(...)
+ end,
+})
+
+function AutoCounter.new(value)
+ local self = setmetatable({}, AutoCounter)
+ self.value = value or 0
+ return self
+end
+
+function AutoCounter:next()
+ self.value = self.value + 1
+ return self.value
+end
+
+globalCounter = AutoCounter()
+
IdeaClass = {}
IdeaClass.__index = IdeaClass
@@ -151,7 +173,12 @@
self.content = content
self.dependencies = dependencies or {}
self.tags = tags or {}
- self.value = value or 0
+ if (value == "auto")
+ then
+ self.value = globalCounter:next()
+ else
+ self.value = value or 0
+ end
return self
end
@@ -261,8 +288,12 @@
then
tex.sprint("\\needspace{5cm}%")
end
- if (bookmark)
+ if (frame)
then
+ tex.sprint("\\begin{mdframed}%")
+ end
+ if (bookmark)
+ then
tex.sprint("\\hypertarget{" .. bookmark_counter .. "}{}%")
tex.sprint("\\bookmark[dest=" .. bookmark_counter .. ", level=\\bookDepth]{" .. self:getTitle() .. "}%")
--tex.sprint("\\subpdfbookmark{" .. self:getTitle() .. "}{" .. bookmark_counter .. "}%")
@@ -269,10 +300,6 @@
bookmark_counter = bookmark_counter + 1
tex.sprint("\\bookDown%")
end
- if (frame)
- then
- tex.sprint("\\begin{mdframed}%")
- end
if (center)
then
tex.sprint("\\begin{center}%")
@@ -378,6 +405,7 @@
return false
end
end
+
ideaVault = IdeaVaultClass()
function createIdea(prefix, key, content, dependencies, tags, value)
Modified: trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty
===================================================================
--- trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty 2025-03-28 21:30:24 UTC (rev 74772)
+++ trunk/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty 2025-03-28 21:30:48 UTC (rev 74773)
@@ -1,5 +1,5 @@
% ideavault.sty
-% Copyright 2024 Tomasz M. Czarkowski
+% Copyright 2024-2025 Tomasz M. Czarkowski
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -17,7 +17,7 @@
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ideavault}[1.0.4]
+\ProvidesPackage{ideavault}[1.0.5]
\RequirePackage[open,openlevel=2,atend]{bookmark}
\RequirePackage{xargs}
\RequirePackage{luacode}
More information about the tex-live-commits
mailing list.