From 73d67288baa9b6754d2d2e981a3512bda7caeaa8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 11 Dec 2021 21:15:31 +0000 Subject: datestamp (11dec21) git-svn-id: svn://tug.org/texlive/trunk@61269 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/lualatex/datestamp/datestamp.sty | 38 ++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'Master/texmf-dist/tex/lualatex') diff --git a/Master/texmf-dist/tex/lualatex/datestamp/datestamp.sty b/Master/texmf-dist/tex/lualatex/datestamp/datestamp.sty index 5e0876bdb07..354a8823a7f 100644 --- a/Master/texmf-dist/tex/lualatex/datestamp/datestamp.sty +++ b/Master/texmf-dist/tex/lualatex/datestamp/datestamp.sty @@ -5,17 +5,17 @@ %% The original source files were: %% %% datestamp.dtx (with options: `package') -%% ---------------------------------------------------------- +%% ----------------------------------------------------------- %% Package: datestamp -%% Version: v0.1 (22 October, 2021) +%% Version: v0.2(08 December, 2021) %% Author: निरंजन %% Description: Fixed date-stamps with LuaLaTeX. -%% Repository: https://gitlab.com/niruvt/datestamp +%% Repository: http://savannah.nongnu.org/projects/datestamp %% License: GPLv3+, GFDLv1.3+ -%% ---------------------------------------------------------- +%% ----------------------------------------------------------- %% -%% LaTeX Package datestamp v0.1 -%% © 2021 निरंजन +%% LaTeX Package datestamp v0.2 +%% Copyright © 2021 निरंजन %% %% This program is free software: you can redistribute it %% and/or modify it under the terms of the GNU General Public @@ -40,27 +40,39 @@ %% and the derived file datestamp.sty. %% ---------------------------------------------------------- \def\datestampname{datestamp} -\def\datestampversion{0.1} -\def\datestampdate{2021-10-22} +\def\datestampversion{0.2} +\def\datestampdate{2021-12-08} \def\datestampdescription{% Fixed date-stamps with LuaLaTeX.% } -\ProvidesPackage{datestamp}[2021/10/22 v0.1 +\ProvidesPackage{datestamp}[2021/12/08 v0.2 Fixed date-stamps with LuaLaTeX.] \RequirePackage{xparse} -\NewDocumentCommand{\adddatestamp}{ m }{ - \directlua{ +\NewDocumentCommand{\luacodefordatestamp}{ m m }{% + \directlua{% dsfile = io.open("\jobname.ds", "a+") dscontent = dsfile:read "*a" if string.find(dscontent, "#1") then else - dsfile:write("#1 = \string\"\today\string\"\string\n") + dsfile:write("#1 = \string\"#2\string\"\string\n") io.close(dsfile) end dofile("\jobname.ds") tex.sprint(#1) - } + }% } +\NewDocumentCommand{\adddatestamp}{ m }{% + \luacodefordatestamp{#1}{\today}% +}% +\NewDocumentCommand{\addyearstamp}{ m }{% + \luacodefordatestamp{#1}{\the\year}% +}% +\NewDocumentCommand{\addmonthstamp}{ m }{% + \luacodefordatestamp{#1}{\the\month}% +}% +\NewDocumentCommand{\adddaystamp}{ m }{% + \luacodefordatestamp{#1}{\the\day}% +}% \endinput %% %% End of file `datestamp.sty'. -- cgit v1.2.3