summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-12-11 21:15:31 +0000
committerKarl Berry <karl@freefriends.org>2021-12-11 21:15:31 +0000
commit73d67288baa9b6754d2d2e981a3512bda7caeaa8 (patch)
tree3ead8d9c6adf82350819250e2c2e96f5fc79a0a1 /Master/texmf-dist/source/lualatex
parent69e62ac44dee4d0eb7d22d349cfdce7c89186135 (diff)
datestamp (11dec21)
git-svn-id: svn://tug.org/texlive/trunk@61269 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/lualatex')
-rw-r--r--Master/texmf-dist/source/lualatex/datestamp/datestamp.dtx127
-rw-r--r--Master/texmf-dist/source/lualatex/datestamp/datestamp.ins12
2 files changed, 87 insertions, 52 deletions
diff --git a/Master/texmf-dist/source/lualatex/datestamp/datestamp.dtx b/Master/texmf-dist/source/lualatex/datestamp/datestamp.dtx
index 39494d88d9b..7e9861f42e3 100644
--- a/Master/texmf-dist/source/lualatex/datestamp/datestamp.dtx
+++ b/Master/texmf-dist/source/lualatex/datestamp/datestamp.dtx
@@ -1,23 +1,23 @@
% \iffalse meta-comment
%
% File: datestamp.dtx
-% ----------------------------------------------------
-% Package: datestamp
-% Version: v0.1 (22 October, 2021)
-% Author: निरंजन
-% Description: Fixed date-stamps with LuaLaTeX.
-% Repository: https://gitlab.com/niruvt/datestamp
-% License: GPLv3+, GFDLv1.3+
-% ----------------------------------------------------
+% ----------------------------------------------------------
+% Package: datestamp
+% Version: v0.2 (08 December, 2021)
+% Author: निरंजन
+% Description: Fixed date-stamps with LuaLaTeX.
+% 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
-% License as published by the Free Software Foundation, either
-% version 3 of the License, or (at your option) any later
-% version.
+% License as published by the Free Software Foundation,
+% either version 3 of the License, or (at your option) any
+% later version.
%
% This program is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied
@@ -40,22 +40,22 @@
\iffalse
%</internal>
%<*readme>
-----------------------------------------------------------
+-----------------------------------------------------------
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+
-----------------------------------------------------------
+-----------------------------------------------------------
%</readme>
%<*internal>
\fi
%</internal>
%<*driver|package>
\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.%
}
@@ -91,17 +91,17 @@ License: GPLv3+, GFDLv1.3+
% \fi
% \title{The \pkg{\datestampname} package}
% \author{{\devanagari निरंजन}}
-% \date^^A
+% \date
% {^^A
-% Version \datestampversion\ --- \datestampdate\\[1ex]^^A
-% {^^A
-% \small\faIcon{link}\quad
-% \url{https://ctan.org/pkg/datestamp}^^A
-% }\\^^A
-% {^^A
-% \small\faIcon{gitlab}\quad
-% \url{https://gitlab.com/niruvt/datestamp}^^A
-% }^^A
+% Version \datestampversion\ --- \datestampdate\\[1ex]^^A
+% {^^A
+% \small\faIcon{link}\quad
+% \url{https://ctan.org/pkg/datestamp}^^A
+% }\\^^A
+% {^^A
+% \small\faIcon{bug}\quad
+% \url{http://savannah.nongnu.org/bugs/?group=datestamp}^^A
+% }^^A
% }
%
% \maketitle
@@ -114,7 +114,7 @@ License: GPLv3+, GFDLv1.3+
% Lua\LaTeX\ provided a smooth interface for achieving
% this and thus this package was developed.
% \end{abstract}
-%
+% \section{Documentation}
% \begin{function}{\adddatestamp}
% \begin{syntax}
% \cs{adddatestamp} \marg{key}
@@ -134,12 +134,29 @@ License: GPLv3+, GFDLv1.3+
% One can fool the program by writing a file like this
% themselves!
% \end{function}
+% \begin{function}{\addmonthstamp}
+% \begin{syntax}
+% \cs{addmonthstamp} \marg{key}
+% \end{syntax}
+% Similar to \cs{adddatestamp}, this command prints a
+% fixed month-stamp.
+% \end{function}
+% \begin{function}{\addyearstamp}
+% \begin{syntax}
+% \cs{addyearstamp} \marg{key}
+% \end{syntax}
+% This command prints a fixed year-stamp.
+% \end{function}
% \vfill
+%
+% \hrule
+%
+% \medskip
% {^^A
% \setlength{\parindent}{0pt}
% \LaTeX\ package \pkg{datestamp}
%
-% © 2021 {\devanagari निरंजन}
+% Copyright © 2021 {\devanagari निरंजन}
%
% Permission is granted to copy, distribute and/or
% modify this document under the terms of the GNU Free
@@ -158,20 +175,21 @@ License: GPLv3+, GFDLv1.3+
% \begin{macrocode}
%<@@=datestamp>
%<*package>
-\ProvidesPackage{datestamp}[2021/10/22 v0.1
+\ProvidesPackage{datestamp}[2021/12/08 v0.2
Fixed date-stamps with LuaLaTeX.]
% \end{macrocode}
% Load package \pkg{xparse} for declaring the robust command
-% \cs{adddatestamp}. Call \cs{directlua} \& open a file in
-% append mode so that it will be created if doesn't exist
-% \& only appended if exists. The following code creates a
-% file with extension \verb|.ds| \& the name of the root
+% \cs{luacodefordatestamp}. This is a generic \& internal
+% command. We will Call \cs{directlua} \& open a file in
+% append mode so that it will be created if doesn't exist \&
+% just appended if exists. The following code creates a file
+% with the extension \verb|.ds| \& the name of the root
% file. Note that using \verb|a+| mode also enables the
% \verb|read| mode.
% \begin{macrocode}
\RequirePackage{xparse}
-\NewDocumentCommand{\adddatestamp}{ m }{
- \directlua{
+\NewDocumentCommand{\luacodefordatestamp}{ m m }{%
+ \directlua{%
dsfile = io.open("\jobname.ds", "a+")
% \end{macrocode}
% Now we store the content of the \verb|.ds| file in a
@@ -184,14 +202,11 @@ Fixed date-stamps with LuaLaTeX.]
% if it is present, our code does nothing. It adds the key
% followed by the \verb|=| sign and the date to the
% \verb|.ds| file if the key is absent. We close the file
-% when this job is done \& we end the if-conditional. Note
-% that Lua itself is writing some Lua-code\footnote{The
-% output of this process produces the actual syntax of Lua.}
-% ;-)
+% when this job is done \& we end the if-conditional.
% \begin{macrocode}
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
% \end{macrocode}
@@ -201,18 +216,38 @@ Fixed date-stamps with LuaLaTeX.]
% \begin{macrocode}
dofile("\jobname.ds")
% \end{macrocode}
-% Finally we print the dates by calling the key as a Lua
-% variable.
+% Finally we print the date by calling the key as a Lua
+% variable (which is by the way our \TeX-argument XD).
% \begin{macrocode}
tex.sprint(#1)
- }
+ }%
}
% \end{macrocode}
+% After creating this generic internal command, we use it
+% for producing various stamps. i.e.\ date, month \& year. I
+% am using the default \TeX-commands for producing them as
+% these commands have great localization-support.
+% \begin{macrocode}
+\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}%
+}%
+% \end{macrocode}
+% End of the package.
% \begin{macrocode}
%</package>
% \end{macrocode}
% \end{implementation}
% \newpage
+% \phantomsection
% \addcontentsline{toc}{section}{GNU Free Documentation License}
% \include{gfdl-tex.tex}
% \Finale
diff --git a/Master/texmf-dist/source/lualatex/datestamp/datestamp.ins b/Master/texmf-dist/source/lualatex/datestamp/datestamp.ins
index 291552f7a7b..abfd0bbfe76 100644
--- a/Master/texmf-dist/source/lualatex/datestamp/datestamp.ins
+++ b/Master/texmf-dist/source/lualatex/datestamp/datestamp.ins
@@ -5,17 +5,17 @@
\askforoverwritefalse
\preamble
-----------------------------------------------------------
+-----------------------------------------------------------
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