diff options
author | Norbert Preining <norbert@preining.info> | 2024-04-11 03:01:09 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-04-11 03:01:09 +0000 |
commit | d0af7e48198e8633e9bc60a77a66515bf39ad69f (patch) | |
tree | 7906f93970dd67212ac3c10a779880362ccfaf8a /macros | |
parent | f58130da9ab2f6181b0b2ca4e02895b11d902e20 (diff) |
CTAN sync 202404110301
Diffstat (limited to 'macros')
30 files changed, 1920 insertions, 502 deletions
diff --git a/macros/latex/contrib/cs-techrep/COPYING b/macros/latex/contrib/cs-techrep/COPYING index 241acd1c5d..cfe1772eff 100644 --- a/macros/latex/contrib/cs-techrep/COPYING +++ b/macros/latex/contrib/cs-techrep/COPYING @@ -1,4 +1,4 @@ -Copyright 2024 Christoph P. Neumann +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c diff --git a/macros/latex/contrib/cs-techrep/README b/macros/latex/contrib/cs-techrep/README index d133b67a2d..bb3aefdd37 100644 --- a/macros/latex/contrib/cs-techrep/README +++ b/macros/latex/contrib/cs-techrep/README @@ -1,5 +1,5 @@ ----------------------------- - Version 0.1 of the cs-techrep class + Version 0.2 of the cs-techrep class Christoph P. Neumann ----------------------------- diff --git a/macros/latex/contrib/cs-techrep/cs-techrep.dtx b/macros/latex/contrib/cs-techrep/cs-techrep.dtx index 8f9dccfa51..35775ca107 100644 --- a/macros/latex/contrib/cs-techrep/cs-techrep.dtx +++ b/macros/latex/contrib/cs-techrep/cs-techrep.dtx @@ -1,16 +1,16 @@ %\iffalse % cs-techrep.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -src "(cs-techrep.cls)=>\1" +% -preamble "Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. " +% -setambles ".*=>\nopreamble" +% -author "Christoph P. Neumann " % -dir "src" -% -date "0.1" +% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|cs-techrep.cls)=>\1" % -doc "doc/cs-techrep.tex" -% -author "Christoph P. Neumann " +% -date "2023-2024" % -macrocode ".*" -% -preamble "Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. " -% -setambles ".*=>\nopreamble" % cs-techrep -% Created on 2024/3/22 20:18 +% Created on 2024/4/10 18:14 %\fi %\iffalse %<*package> @@ -33,27 +33,10 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 0.1 Christoph P. Neumann , all rights reserved. +% Copyright (C) 2023-2024 Christoph P. Neumann , all rights reserved. % \fi % \iffalse %<*driver> -%% -%% Copyright 2023 Christoph P. Neumann -%% -%% This LaTeX class provides a simple interface for creating -%% a verfy fancy Curriculum Vitae. At the moment only CVs in -%% the german language are supported. -%% -%% This file is free property; as a special exception the author -%% gives unlimited permission to copy and/or distribute it, with -%% or without modifications, as long as this notice is -%% preserved. -%% -%% This file is distributed in the hope that it will be useful, -%% but WITHOUT ANY WARRANTY, to the extent permitted by law; -%% without even the implied warranty of MERCHANTABILITY or -%% FITNESS FOR A PARTICULAR PURPOSE. - \documentclass{ltxdoc} \CodelineNumbered @@ -73,6 +56,7 @@ %\title{\textsf{cs-techrep}\\ %Technical Reports in Computer Science and Software Engineering} %\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}} +%\date{Version 0.2} %\maketitle %\PrintChanges % @@ -195,6 +179,31 @@ %\section{The Code} %\iffalse % \begin{macrocode} +%<*_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +% \begin{macrocode} +@echo off + +rem *************************************************************************** +rem * author: Christoph P. Neumann +rem *************************************************************************** +cd /d "%~dp0" + +echo == ..\examples\* == +for /D %%D in (..\examples\*) do ( + echo == %%D == + xcopy /Y ".\*.cls" "%%~D" +) + +pause% \end{macrocode} +%\iffalse +% \begin{macrocode} +%</_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*cs-techrep.cls> % \end{macrocode} %\fi @@ -213,7 +222,7 @@ \NeedsTeXFormat{LaTeX2e} % Provide the name of your document class, the date it was last updated, and a comment about what it's used for -\ProvidesClass{cs-techrep}[2024/03/20 Technical Reports in Computer Science and Software Engineering v0.1] +\ProvidesClass{cs-techrep}[2024/04/10 Technical Reports in Computer Science and Software Engineering v0.2] % Define marker counter for options (counter are global in latex): \newcounter{cstechrep@pbalancetracker} @@ -553,8 +562,6 @@ \RequirePackage{orcidlink} -\RequirePackage[caption=false,font=footnotesize]{subfig} - % For easy quotations: \enquote{text} % This package is very smart when nesting is applied, otherwise textcmds (see below) provides a shorter command \RequirePackage[autostyle=true]{csquotes} @@ -613,9 +620,6 @@ % Does not work on MiKTeX, therefore disabled - issue reported at https://github.com/MiKTeX/miktex-packaging/issues/271 % \input{ushyphex} -% correct bad hyphenation here -\hyphenation{op-tical net-works semi-conduc-tor} - % Enable copy and paste of text from the PDF % Only required for pdflatex. It "just works" in the case of lualatex. % Alternative: cmap or mmap package diff --git a/macros/latex/contrib/cs-techrep/cs-techrep.ins b/macros/latex/contrib/cs-techrep/cs-techrep.ins index 28d177822b..0fc5868464 100644 --- a/macros/latex/contrib/cs-techrep/cs-techrep.ins +++ b/macros/latex/contrib/cs-techrep/cs-techrep.ins @@ -1,13 +1,14 @@ -% cs-techrep.ins generated using makedtx version 1.2 2024/3/22 20:18 +% cs-techrep.ins generated using makedtx version 1.2 2024/4/10 18:14 \input docstrip \preamble -Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. \endpreamble \askforoverwritefalse -\generate{\file{cs-techrep.cls}{\nopreamble\from{cs-techrep.dtx}{cs-techrep.cls}} +\generate{\file{_cpn_copyIntoExamplesFolder_cls.cmd}{\nopreamble\from{cs-techrep.dtx}{_cpn_copyIntoExamplesFolder_cls.cmd}} +\file{cs-techrep.cls}{\nopreamble\from{cs-techrep.dtx}{cs-techrep.cls}} } \endbatchfile diff --git a/macros/latex/contrib/cs-techrep/cs-techrep.pdf b/macros/latex/contrib/cs-techrep/cs-techrep.pdf Binary files differindex 543f528806..766e80d57b 100644 --- a/macros/latex/contrib/cs-techrep/cs-techrep.pdf +++ b/macros/latex/contrib/cs-techrep/cs-techrep.pdf diff --git a/macros/latex/contrib/cs-techrep/template/cpn_all_all.bib b/macros/latex/contrib/cs-techrep/template/cpn_all_all.bib index d7796e6272..cc7abaec4a 100644 --- a/macros/latex/contrib/cs-techrep/template/cpn_all_all.bib +++ b/macros/latex/contrib/cs-techrep/template/cpn_all_all.bib @@ -281,7 +281,7 @@ publisher = {Gesellschaft f{\"u}r Informatik e.V.\ (GI), K{\"o}ln, Germany}, doi = {10.1145/1620432.1620442}, url = {https://dl.gi.de/20.500.12116/20447}, - _isbn = {978\-/3\-/88579\-/238\-/3}, + _isbn = {978-3-88579-238-3}, _issn = {1617\-/5468}, } @@ -347,9 +347,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19459}, + doi = {10.48550/arXiv.2310.19459}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_10_28004}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19459}, + _issn = {2308-4294}, pages = {21--29}, } @@ -361,9 +362,10 @@ address = {Venice, Italy}, month=apr, year={2024}, - _doi = {TODO}, + doi = {10.48550/arXiv.2404.02637}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2024_X_YY_ZZZZZ}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2404.02637}, + _issn = {2308\-/4294}, _pages = {AA--OO}, note = {accepted for publication} } @@ -402,9 +404,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19461}, + doi = {10.48550/arXiv.2310.19461}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_30_28006}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19461}, + _issn = {2308\-/4294}, pages = {41--46}, } diff --git a/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.pdf b/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.pdf Binary files differindex ab3603dce7..ca478d3d61 100644 --- a/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.pdf +++ b/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.pdf diff --git a/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.tex b/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.tex index 9122c3ddf4..1ae583aed0 100644 --- a/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.tex +++ b/macros/latex/contrib/cs-techrep/template/cs-techrep-example-neumann.tex @@ -16,6 +16,7 @@ % Team example: %\cstechrepAuthorListBib{Vorname1 Nachname1 and Vorname2 Nachname2 and Vorname3 Nachname3 and Vorname4 Nachname4 and Vorname5 Nachname5 and Vorname6 Nachname6 and Christoph P. Neumann} +% Capitalization: https://capitalizemytitle.com/style/Chicago/ \cstechrepTitleTex{The cs-techrep Example of a Technical Report in Computer Science and Software Engineering} % IF you need manual linebreaks in the titel, then clone the title without linebreaks for BibTeX: \cstechrepTitleBib{{\cstechrepTitleTex}} @@ -42,57 +43,57 @@ % DO NOT DELETE THIS: \filecontentsForceExpansion|[] % force command expansion inside a filecontents* environment \begin{filecontents*}[overwrite]{selfref.bib} - @TECHREPORT{selfref, - author = {|cstechrepAuthorListBib}, - title = {\cstechrepTitleBib}, - institution = {\cstechrepInstitution, \cstechrepDepartment}, - series = {\cstechrepSeries}, - number = {\cstechrepNumber}, - year = {|cstechrepYear}, - month = {|cstechrepMonth}, - langid = {|cstechrepLang}, - } + @TECHREPORT{selfref, + author = {|cstechrepAuthorListBib}, + title = {\cstechrepTitleBib}, + institution = {\cstechrepInstitution, \cstechrepDepartment}, + series = {\cstechrepSeries}, + number = {\cstechrepNumber}, + year = {|cstechrepYear}, + month = {|cstechrepMonth}, + langid = {|cstechrepLang}, + } \end{filecontents*} % ====================================================================== % EDIT THIS: \begin{filecontents}[overwrite]{embedded.bib} - @online{ieee2015howto, - author = {Michael Shell}, - title = {How to Use the {IEEEtran} \LaTeX\ Class}, - url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, - year = {2015} - } - @online{ieee2018formattingrules, - author = {{IEEE}}, - title = {Conference Template and Formatting Specifications}, - url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, - year = {2018} - } - @online{iaria2014formattingrules, - author = {{IARIA}}, - title = {Formatting Rules}, - url = {http://www.iaria.org/formatting.doc}, - year = {2014} - } - @online{iaria2009editorialrules, - _author = {Cosmin Dini}, - author = {{IARIA}}, - title = {Editorial Rules}, - url = {https://www.iaria.org/editorialrules.html}, - year = {2009} - } - @online{languagetool, - author = {{LanguageTooler GmbH}}, - title = {{LangueTool}}, - url = {https://languagetool.org/overleaf} - } - @online{overleaf, - author = {{Digital Science UK Limited}}, - title = {{Overleaf}}, - url = {https://www.overleaf.com} - } +@online{ieee2015howto, + author = {Michael Shell}, + title = {How to Use the {IEEEtran} \LaTeX\ Class}, + url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, + year = {2015} +} +@online{ieee2018formattingrules, + author = {{IEEE}}, + title = {Conference Template and Formatting Specifications}, + url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, + year = {2018} +} +@online{iaria2014formattingrules, + author = {{IARIA}}, + title = {Formatting Rules}, + url = {http://www.iaria.org/formatting.doc}, + year = {2014} +} +@online{iaria2009editorialrules, + _author = {Cosmin Dini}, + author = {{IARIA}}, + title = {Editorial Rules}, + url = {https://www.iaria.org/editorialrules.html}, + year = {2009} +} +@online{languagetool, + author = {{LanguageTooler GmbH}}, + title = {{LangueTool}}, + url = {https://languagetool.org/overleaf} +} +@online{overleaf, + author = {{Digital Science UK Limited}}, + title = {{Overleaf}}, + url = {https://www.overleaf.com} +} \end{filecontents} \usepackage{fontawesome} % i.a., \faWarning{} @@ -108,8 +109,8 @@ % plural, within sentence = \acp{gui} % plural, beginning of sentence = \Acp{gui} \begin{acronym} - \acro{gui}[GUI]{Graphical User Interface} - \acro{ide}[IDE]{Integrated Development Environment} + \acro{gui}[GUI]{Graphical User Interface} + \acro{ide}[IDE]{Integrated Development Environment} \end{acronym} % https://www.silbentrennung24.de/ @@ -122,15 +123,15 @@ \maketitle \begin{abstract} - \lipsum[1][3-10] - \{\,\faWarning{}The abstract does neither mention a teaching module nor a team/project, - it is a summary of the content of the technical report, thus, the objectives and architecture.\} +\lipsum[1][3-10] +\{\,\faWarning{}The abstract does neither mention a teaching module nor a team/project, +it is a summary of the content of the technical report, thus, the objectives and architecture.\} \end{abstract} % A list of IEEE Computer Society appoved keywords can be obtained at % http://www.computer.org/mc/keywords/keywords.htm \begin{IEEEkeywords} - template; lorem ipsum. +template; lorem ipsum. \end{IEEEkeywords} \section{Introduction and Objectives \textbar{} Functional Requirements \textbar{} Problem Statement} @@ -255,5 +256,5 @@ Could include (3) a software bill of materials (SBOM), at least for the major li \sloppy \printbibliography[notcategory=selfref] \endgroup - + \end{document} diff --git a/macros/latex/contrib/cs-techrep/template/selfref.bib b/macros/latex/contrib/cs-techrep/template/selfref.bib index ecd901e557..f498920efc 100644 --- a/macros/latex/contrib/cs-techrep/template/selfref.bib +++ b/macros/latex/contrib/cs-techrep/template/selfref.bib @@ -1,10 +1,10 @@ - @TECHREPORT{selfref, - author = {Christoph P. Neumann}, - title = {\cstechrepTitleBib}, - institution = {\cstechrepInstitution, \cstechrepDepartment}, - series = {\cstechrepSeries}, - number = {\cstechrepNumber}, - year = {2024}, - month = {3}, - langid = {english}, - } + @TECHREPORT{selfref, + author = {Christoph P. Neumann}, + title = {\cstechrepTitleBib}, + institution = {\cstechrepInstitution, \cstechrepDepartment}, + series = {\cstechrepSeries}, + number = {\cstechrepNumber}, + year = {2024}, + month = {3}, + langid = {english}, + } diff --git a/macros/latex/contrib/iaria-lite/COPYING b/macros/latex/contrib/iaria-lite/COPYING index 778959f22c..cfe1772eff 100644 --- a/macros/latex/contrib/iaria-lite/COPYING +++ b/macros/latex/contrib/iaria-lite/COPYING @@ -1,13 +1,13 @@ -Copyright 2024 Christoph P. Neumann +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 +conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. -This work has the LPPL maintenance status «maintained». +This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. diff --git a/macros/latex/contrib/iaria-lite/README b/macros/latex/contrib/iaria-lite/README index 3211e97595..018e09ba46 100644 --- a/macros/latex/contrib/iaria-lite/README +++ b/macros/latex/contrib/iaria-lite/README @@ -1,5 +1,5 @@ ----------------------------- - Version 0.1 of the iaria-lite class + Version 0.2 of the iaria-lite class Christoph P. Neumann ----------------------------- @@ -40,11 +40,28 @@ Call: mktexlsr + Templates --------- -In template.zip document templates for a german and an english CV can be -found. Just unzip the template.zip, cd to template and run make to get the -pdf. +In the template directory you can find an example document. + + +Source Code +----------- + +The source code of this latex package can be found at: +https://github.com/cyberlytics/iaria-lite + +The build that creates the CTAN-conforming upload ZIP archive +can be achieved with the Docker image at Dockerhub: +cyberlytics/ctan-prep:latest + +An examplery 'make dist' call is: +docker run --rm -it -v ${PWD}/:/app cyberlytics/ctan-prep:latest make dist + +The source code of this supportive Docker image can be found at: +https://github.com/cyberlytics/ctan-prep + /Christoph P. Neumann, <cyberpetaneuron+iarialite@gmail.com> diff --git a/macros/latex/contrib/iaria-lite/iaria-lite.dtx b/macros/latex/contrib/iaria-lite/iaria-lite.dtx index 4b0a3b1c27..3bc6f34d28 100644 --- a/macros/latex/contrib/iaria-lite/iaria-lite.dtx +++ b/macros/latex/contrib/iaria-lite/iaria-lite.dtx @@ -1,16 +1,16 @@ %\iffalse % iaria-lite.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -preamble "Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status «maintained». The Current Maintainer of this work is Christoph P. Neumann. " -% -date "2023-2024" -% -author "Christoph P. Neumann " +% -dir "src" +% -preamble "Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. " +% -macrocode ".*" % -setambles ".*=>\nopreamble" % -doc "doc/iaria-lite.tex" -% -src "(iaria-lite.cls)=>\1" -% -macrocode ".*" -% -dir "src" +% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria-lite.cls)=>\1" +% -author "Christoph P. Neumann " +% -date "2024-2024" % iaria-lite -% Created on 2024/3/20 15:52 +% Created on 2024/4/10 18:20 %\fi %\iffalse %<*package> @@ -33,27 +33,10 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 2023-2024 Christoph P. Neumann , all rights reserved. +% Copyright (C) 2024-2024 Christoph P. Neumann , all rights reserved. % \fi % \iffalse %<*driver> -%% -%% Copyright 2023 Christoph P. Neumann -%% -%% This LaTeX class provides a simple interface for creating -%% a verfy fancy Curriculum Vitae. At the moment only CVs in -%% the german language are supported. -%% -%% This file is free property; as a special exception the author -%% gives unlimited permission to copy and/or distribute it, with -%% or without modifications, as long as this notice is -%% preserved. -%% -%% This file is distributed in the hope that it will be useful, -%% but WITHOUT ANY WARRANTY, to the extent permitted by law; -%% without even the implied warranty of MERCHANTABILITY or -%% FITNESS FOR A PARTICULAR PURPOSE. - \documentclass{ltxdoc} \CodelineNumbered @@ -73,6 +56,7 @@ %\title{\textsf{iaria-lite}\\ % An Unofficial IARIA LaTeX Class (Lite Version)} %\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}} +%\date{Version 0.2} %\maketitle %\PrintChanges % @@ -171,6 +155,31 @@ %\section{The Code} %\iffalse % \begin{macrocode} +%<*_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +% \begin{macrocode} +@echo off + +rem *************************************************************************** +rem * author: Christoph P. Neumann +rem *************************************************************************** +cd /d "%~dp0" + +echo == ..\examples\* == +for /D %%D in (..\examples\*) do ( + echo == %%D == + xcopy /Y ".\*.cls" "%%~D" +) + +pause% \end{macrocode} +%\iffalse +% \begin{macrocode} +%</_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*iaria-lite.cls> % \end{macrocode} %\fi @@ -189,7 +198,7 @@ \NeedsTeXFormat{LaTeX2e} % Provide the name of your document class, the date it was last updated, and a comment about what it's used for -\ProvidesClass{iaria-lite}[2023/01/01 unofficial IARIA-lite conference template] +\ProvidesClass{iaria-lite}[2024/04/10 unofficial IARIA-lite conference template v0.2] % Define marker counter for options (counter are global in latex): \newcounter{iaria@pbalancetracker} @@ -242,6 +251,10 @@ % Diferring from IEEE, IARIA requires a hyphen after "Keywords" instead of an emdash: \xpatchcmd\IEEEkeywords{---}{-}{}{} +% Diferring from IEEE, IARIA requires also the keywords in Italic (and Bold)(and lower case!): +\let\oldIEEEkeywords\IEEEkeywords +\def\IEEEkeywords{\oldIEEEkeywords\itshape\ignorespaces} + \makeatletter \renewcommand{\IEEEauthorblockN}[1]{% % copied from IEEEtran.cls: @@ -261,6 +274,19 @@ \crcr} \makeatother +% IARIA subfigure captions require this: +\RequirePackage[caption=false,font=footnotesize]{subfig} + +% IARIA requires to bring the table caption in the same line of "Table I" +\usepackage{etoolbox} +\makeatletter +\patchcmd{\@makecaption} + {\\} + {.\ } + {} + {} +\makeatother + % Balance/level columns at the last page / in bibliography % DISCLAIMER: No solution is a 100%/perfect one! % Mainstream option: pbalance (see https://ctan.org/pkg/pbalance) diff --git a/macros/latex/contrib/iaria-lite/iaria-lite.ins b/macros/latex/contrib/iaria-lite/iaria-lite.ins index c24fad9888..5f61f6cac0 100644 --- a/macros/latex/contrib/iaria-lite/iaria-lite.ins +++ b/macros/latex/contrib/iaria-lite/iaria-lite.ins @@ -1,13 +1,14 @@ -% iaria-lite.ins generated using makedtx version 1.2 2024/3/20 15:52 +% iaria-lite.ins generated using makedtx version 1.2 2024/4/10 18:20 \input docstrip \preamble -Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status «maintained». The Current Maintainer of this work is Christoph P. Neumann. +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. \endpreamble \askforoverwritefalse -\generate{\file{iaria-lite.cls}{\nopreamble\from{iaria-lite.dtx}{iaria-lite.cls}} +\generate{\file{_cpn_copyIntoExamplesFolder_cls.cmd}{\nopreamble\from{iaria-lite.dtx}{_cpn_copyIntoExamplesFolder_cls.cmd}} +\file{iaria-lite.cls}{\nopreamble\from{iaria-lite.dtx}{iaria-lite.cls}} } \endbatchfile diff --git a/macros/latex/contrib/iaria-lite/iaria-lite.pdf b/macros/latex/contrib/iaria-lite/iaria-lite.pdf Binary files differindex b976032ec0..a004deb1be 100644 --- a/macros/latex/contrib/iaria-lite/iaria-lite.pdf +++ b/macros/latex/contrib/iaria-lite/iaria-lite.pdf diff --git a/macros/latex/contrib/iaria-lite/template/cpn_all_all.bib b/macros/latex/contrib/iaria-lite/template/cpn_all_all.bib index d7796e6272..cc7abaec4a 100644 --- a/macros/latex/contrib/iaria-lite/template/cpn_all_all.bib +++ b/macros/latex/contrib/iaria-lite/template/cpn_all_all.bib @@ -281,7 +281,7 @@ publisher = {Gesellschaft f{\"u}r Informatik e.V.\ (GI), K{\"o}ln, Germany}, doi = {10.1145/1620432.1620442}, url = {https://dl.gi.de/20.500.12116/20447}, - _isbn = {978\-/3\-/88579\-/238\-/3}, + _isbn = {978-3-88579-238-3}, _issn = {1617\-/5468}, } @@ -347,9 +347,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19459}, + doi = {10.48550/arXiv.2310.19459}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_10_28004}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19459}, + _issn = {2308-4294}, pages = {21--29}, } @@ -361,9 +362,10 @@ address = {Venice, Italy}, month=apr, year={2024}, - _doi = {TODO}, + doi = {10.48550/arXiv.2404.02637}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2024_X_YY_ZZZZZ}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2404.02637}, + _issn = {2308\-/4294}, _pages = {AA--OO}, note = {accepted for publication} } @@ -402,9 +404,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19461}, + doi = {10.48550/arXiv.2310.19461}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_30_28006}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19461}, + _issn = {2308\-/4294}, pages = {41--46}, } diff --git a/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.pdf b/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.pdf Binary files differindex a577cadf32..a7d0a9b52f 100644 --- a/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.pdf +++ b/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.pdf diff --git a/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.tex b/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.tex index defc029c2e..e4a4a45462 100644 --- a/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.tex +++ b/macros/latex/contrib/iaria-lite/template/iaria-lite-example-neumann.tex @@ -11,12 +11,16 @@ \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} -% en-US = [english]/[american]/[usenglish] (+ [canadian]) <DEFAULT> +% en-US = [english]/[american]/[USenglish] <DEFAULT> \usepackage[babel=true,english=american]{csquotes} -\usepackage[usenglish]{babel} -% en-UK = [british] /[ukenglish] (+ [australian]) <OXFORD> +\usepackage[english]{babel} % en-US +% IARIA requires uppercase TABLE, and babel intervenes in the tablename +\addto\captionsenglish{\renewcommand\tablename{TABLE}} +% en-UK = [british] /[UKenglish] <OXFORD> %\usepackage[babel=true,english=british]{csquotes} -%\usepackage[ukenglish]{babel} +%\usepackage[british]{babel} % en-UK +%% IARIA requires uppercase TABLE, and babel intervenes in the tablename +%\addto\captionsbritish{\renewcommand\tablename{TABLE}} % Diferring from IEEE, IARIA requires % in bibliography: 6+ authors as first author et al. @@ -80,41 +84,41 @@ ]{microtype} \begin{filecontents}[overwrite]{embedded.bib} - @online{ieee2015howto, - author = {Michael Shell}, - title = {How to Use the {IEEEtran} \LaTeX\ Class}, - url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, - year = {2015} - } - @online{ieee2018formattingrules, - author = {{IEEE}}, - title = {Conference Template and Formatting Specifications}, - url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, - year = {2018} - } - @online{iaria2014formattingrules, - author = {{IARIA}}, - title = {Formatting Rules}, - url = {http://www.iaria.org/formatting.doc}, - year = {2014} - } - @online{iaria2009editorialrules, - _author = {Cosmin Dini}, - author = {{IARIA}}, - title = {Editorial Rules}, - url = {https://www.iaria.org/editorialrules.html}, - year = {2009} - } - @online{languagetool, - author = {{LanguageTooler GmbH}}, - title = {{LangueTool}}, - url = {https://languagetool.org/overleaf} - } - @online{overleaf, - author = {{Digital Science UK Limited}}, - title = {{Overleaf}}, - url = {https://www.overleaf.com} - } +@online{ieee2015howto, + author = {Michael Shell}, + title = {How to Use the {IEEEtran} \LaTeX\ Class}, + url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, + year = {2015} +} +@online{ieee2018formattingrules, + author = {{IEEE}}, + title = {Conference Template and Formatting Specifications}, + url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, + year = {2018} +} +@online{iaria2014formattingrules, + author = {{IARIA}}, + title = {Formatting Rules}, + url = {http://www.iaria.org/formatting.doc}, + year = {2014} +} +@online{iaria2009editorialrules, + _author = {Cosmin Dini}, + author = {{IARIA}}, + title = {Editorial Rules}, + url = {https://www.iaria.org/editorialrules.html}, + year = {2009} +} +@online{languagetool, + author = {{LanguageTooler GmbH}}, + title = {{LangueTool}}, + url = {https://languagetool.org/overleaf} +} +@online{overleaf, + author = {{Digital Science UK Limited}}, + title = {{Overleaf}}, + url = {https://www.overleaf.com} +} \end{filecontents} \usepackage{fontawesome} % i.a., \faWarning{} @@ -127,128 +131,128 @@ % https://www.hyphenation24.com/ \hyphenation{block-chain block-chains Ethe-re-um} +% Capitalization: https://capitalizemytitle.com/style/Chicago/ \title{The Unofficial \textsmaller{IARIA}-lite \LaTeX{} Class Paper Example (v2024-03)} \author{ - \IEEEauthorblockN{Christoph P.\ Neumann\,\orcidlink{0000-0002-5936-631X}} - \IEEEauthorblockA{% - Department of Electrical Engineering, Media, and Computer Science\\ - Ostbayerische Technische Hochschule Amberg-Weiden\\ - Amberg, Germany\\ - % Diferring from IEEE ("Email"), IARIA requires "e-mail": - e-mail: \texttt{c.neumann@oth-aw.de} - % Multiple authors and their e-mail addresses: - %e-mail: {\tt$\lbrace$j.smith\,|\,c.neumann$\rbrace$@oth-aw.de} - } + \IEEEauthorblockN{Christoph P.\ Neumann\,\orcidlink{0000-0002-5936-631X}} + \IEEEauthorblockA{% + Department of Electrical Engineering, Media, and Computer Science\\ + Ostbayerische Technische Hochschule Amberg-Weiden\\ + Amberg, Germany\\ + % Diferring from IEEE ("Email"), IARIA requires "e-mail": + e-mail: \texttt{c.neumann@oth-aw.de} + % Multiple authors and their e-mail addresses: + %e-mail: {\tt$\lbrace$j.smith\,|\,c.neumann$\rbrace$@oth-aw.de} + } } \begin{document} - - \maketitle - - \begin{abstract} - \lipsum[1][3-12] - \end{abstract} - - % A list of IEEE Computer Society appoved keywords can be obtained at - % http://www.computer.org/mc/keywords/keywords.htm - \begin{IEEEkeywords} - % Diferring from IEEE, IARIA requires also the keywords in Bold and Italic (and lower case): - \textbf{\textit{template; lorem ipsum.}} - \end{IEEEkeywords} - - \section{Introduction} - - The \textsmaller{IARIA} formatting is based on \textsmaller{IEEE} style. - The unofficial \textsmaller{IARIA}-lite \LaTeX\ class is based on \textsmaller{IEEE}tran class \cite{ieee2015howto}. - The \textsmaller{IARIA} formatting rules \cite{iaria2014formattingrules} are adopted from the \textsmaller{IEEE} template and formatting specifications \cite{ieee2018formattingrules}. - In addition, be aware of the supplementary \textsmaller{IARIA} editorial rules \cite{iaria2009editorialrules} \faWarning{} that provide a beginner-friendly set of further advices. - It is recommended to use a grammar tool, e.\,g., the LanguageTool \cite{languagetool} browser plugin in combination with Overleaf \cite{overleaf}. - - \lipsum[2] - - \{\faWarning{} \textsmaller{IARIA} editorial rules: Introduction must end with a paragraph describing the structure of the paper!\} - The remainder of the paper is organized as follows: In Section~II, … - - \section{Related work \textbar{} Methods} - \lipsum[3] - - \section{Results} - \lipsum[4] - - \section{Discussion \textbar{} Evalution} - \lipsum[5] - - \section{Conclusion and Future Work} - \{\faWarning{} \textsmaller{IARIA} editorial rules: Last section must be \textquote{Conclusion and Future Work}!\} - \lipsum[6] - - - - %%% Advisor - \nocite{StNe23foodfresh} - - %%% First-Author - \nocite{NeLe13adhocCoop} - \nocite{Neumann2012lni} - \nocite{NeLe12alphaFlow} - \nocite{NeHL12hydra} - \nocite{NeWL12offsync} - \nocite{NSWL11alphaadaptive} - \nocite{NeFL10oxdbs} - \nocite{NeLe10alphaUC} - \nocite{NeLe09alphaflow} - \nocite{NeLe09dmps} - \nocite{NHSL09oxdbs} % DE - \nocite{NeWL09xdsrig} % DE - \nocite{NRDL09deus} - - %%% Co-Authorship - \nocite{LeNe24vocattllm} - \nocite{PANP23seccloudfogai} - \nocite{WaNe12alphaoffsync} - \nocite{ToNe11alphaprops} - \nocite{FDI+10esmmog} - \nocite{JBN+10fcmdb} - \nocite{ILN+09semrttx} - \nocite{IND+09lzatav} % DE - \nocite{MeNe04testejb} - - %%% Monographic Work - \nocite{Neumann2013dissBook} - \nocite{Neumann2012dissPreprint} - \nocite{neumann2005da} - \nocite{neumann2004sa} - - %%% TechRep / Non-Peer-Reviewed - - \nocite{SaNe24othfb} - - \nocite{ModA-TR-2023SS-WAE-TeamWeiss-Neunerln} - \nocite{ModA-TR-2023SS-BDCC-TeamRot-CompVisPipeline} - \nocite{ModA-TR-2023SS-BDCC-TeamBlau-NauticalNonsense} - \nocite{ModA-TR-2023SS-BCN-TeamGruen-TorpedoTactics} - \nocite{ModA-TR-2023SS-BCN-TeamCyan-Stockbird} - \nocite{ModA-TR-2023SS-BCN-TeamBlau-FancyChess} - \nocite{ModA-TR-2023WS-SWT-TeamRot-SGDb} - \nocite{ModA-TR-2023WS-SWT-TeamGruen-OPCUANetzwerk} - \nocite{ModA-TR-2022SS-WAE-TeamWeiss-WoIstMeinGeld} - \nocite{ModA-TR-2022SS-BDCC-TeamWeiss-TwitterDash} - \nocite{ModA-TR-2022SS-BDCC-TeamRot-Reddiment} - \nocite{ModA-TR-2022SS-BDCC-TeamGruen-ExplosionGuy} - \nocite{ModA-TR-2022SS-BDCC-TeamCyan-OTHWiki} - \nocite{ModA-TR-2022WS-SWT-TeamGruen-Graphvio} - \nocite{ModA-TR-2021SS-WAE-TeamWeiss-CovidDashboard} - \nocite{ModA-TR-2021SS-WAE-TeamRot-FireForceDefense} - \nocite{ModA-TR-2021SS-WAE-TeamGruen-MedPlanner} - - \nocite{NeRL12deus} - \nocite{LNR+11egr} - - % ======== References ========= - \begingroup - \sloppy - \printbibliography - \endgroup - + +\maketitle + +\begin{abstract} + \lipsum[1][3-12] +\end{abstract} + +% A list of IEEE Computer Society appoved keywords can be obtained at +% http://www.computer.org/mc/keywords/keywords.htm +\begin{IEEEkeywords} + template; lorem ipsum. +\end{IEEEkeywords} + +\section{Introduction} + +The \textsmaller{IARIA} formatting is based on \textsmaller{IEEE} style. +The unofficial \textsmaller{IARIA}-lite \LaTeX\ class is based on \textsmaller{IEEE}tran class \cite{ieee2015howto}. +The \textsmaller{IARIA} formatting rules \cite{iaria2014formattingrules} are adopted from the \textsmaller{IEEE} template and formatting specifications \cite{ieee2018formattingrules}. +In addition, be aware of the supplementary \textsmaller{IARIA} editorial rules \cite{iaria2009editorialrules} \faWarning{} that provide a beginner-friendly set of further advices. +It is recommended to use a grammar tool, e.\,g., the LanguageTool \cite{languagetool} browser plugin in combination with Overleaf \cite{overleaf}. + +\lipsum[2] + +\{\faWarning{} \textsmaller{IARIA} editorial rules: Introduction must end with a paragraph describing the structure of the paper!\} +The remainder of the paper is organized as follows: In Section~II, … + +\section{Related work \textbar{} Methods} +\lipsum[3] + +\section{Results} +\lipsum[4] + +\section{Discussion \textbar{} Evalution} +\lipsum[5] + +\section{Conclusion and Future Work} +\{\faWarning{} \textsmaller{IARIA} editorial rules: Last section must be \textquote{Conclusion and Future Work}!\} +\lipsum[6] + + + +%%% Advisor +\nocite{StNe23foodfresh} + +%%% First-Author +\nocite{NeLe13adhocCoop} +\nocite{Neumann2012lni} +\nocite{NeLe12alphaFlow} +\nocite{NeHL12hydra} +\nocite{NeWL12offsync} +\nocite{NSWL11alphaadaptive} +\nocite{NeFL10oxdbs} +\nocite{NeLe10alphaUC} +\nocite{NeLe09alphaflow} +\nocite{NeLe09dmps} +\nocite{NHSL09oxdbs} % DE +\nocite{NeWL09xdsrig} % DE +\nocite{NRDL09deus} + +%%% Co-Authorship +\nocite{LeNe24vocattllm} +\nocite{PANP23seccloudfogai} +\nocite{WaNe12alphaoffsync} +\nocite{ToNe11alphaprops} +\nocite{FDI+10esmmog} +\nocite{JBN+10fcmdb} +\nocite{ILN+09semrttx} +\nocite{IND+09lzatav} % DE +\nocite{MeNe04testejb} + +%%% Monographic Work +\nocite{Neumann2013dissBook} +\nocite{Neumann2012dissPreprint} +\nocite{neumann2005da} +\nocite{neumann2004sa} + +%%% TechRep / Non-Peer-Reviewed + +\nocite{SaNe24othfb} + +\nocite{ModA-TR-2023SS-WAE-TeamWeiss-Neunerln} +\nocite{ModA-TR-2023SS-BDCC-TeamRot-CompVisPipeline} +\nocite{ModA-TR-2023SS-BDCC-TeamBlau-NauticalNonsense} +\nocite{ModA-TR-2023SS-BCN-TeamGruen-TorpedoTactics} +\nocite{ModA-TR-2023SS-BCN-TeamCyan-Stockbird} +\nocite{ModA-TR-2023SS-BCN-TeamBlau-FancyChess} +\nocite{ModA-TR-2023WS-SWT-TeamRot-SGDb} +\nocite{ModA-TR-2023WS-SWT-TeamGruen-OPCUANetzwerk} +\nocite{ModA-TR-2022SS-WAE-TeamWeiss-WoIstMeinGeld} +\nocite{ModA-TR-2022SS-BDCC-TeamWeiss-TwitterDash} +\nocite{ModA-TR-2022SS-BDCC-TeamRot-Reddiment} +\nocite{ModA-TR-2022SS-BDCC-TeamGruen-ExplosionGuy} +\nocite{ModA-TR-2022SS-BDCC-TeamCyan-OTHWiki} +\nocite{ModA-TR-2022WS-SWT-TeamGruen-Graphvio} +\nocite{ModA-TR-2021SS-WAE-TeamWeiss-CovidDashboard} +\nocite{ModA-TR-2021SS-WAE-TeamRot-FireForceDefense} +\nocite{ModA-TR-2021SS-WAE-TeamGruen-MedPlanner} + +\nocite{NeRL12deus} +\nocite{LNR+11egr} + +% ======== References ========= +\begingroup +\sloppy +\printbibliography +\endgroup + \end{document} diff --git a/macros/latex/contrib/iaria/COPYING b/macros/latex/contrib/iaria/COPYING index 778959f22c..cfe1772eff 100644 --- a/macros/latex/contrib/iaria/COPYING +++ b/macros/latex/contrib/iaria/COPYING @@ -1,13 +1,13 @@ -Copyright 2024 Christoph P. Neumann +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License, either version 1.3 +conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. -This work has the LPPL maintenance status «maintained». +This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. diff --git a/macros/latex/contrib/iaria/README b/macros/latex/contrib/iaria/README index 7f8ea18dcf..73edb8b502 100644 --- a/macros/latex/contrib/iaria/README +++ b/macros/latex/contrib/iaria/README @@ -1,5 +1,5 @@ ----------------------------- - Version 0.1 of the iaria class + Version 0.2 of the iaria class Christoph P. Neumann ----------------------------- @@ -40,11 +40,28 @@ Call: mktexlsr + Templates --------- -In template.zip document templates for a german and an english CV can be -found. Just unzip the template.zip, cd to template and run make to get the -pdf. +In the template directory you can find an example document. + + +Source Code +----------- + +The source code of this latex package can be found at: +https://github.com/cyberlytics/iaria + +The build that creates the CTAN-conforming upload ZIP archive +can be achieved with the Docker image at Dockerhub: +cyberlytics/ctan-prep:latest + +An examplery 'make dist' call is: +docker run --rm -it -v ${PWD}/:/app cyberlytics/ctan-prep:latest make dist + +The source code of this supportive Docker image can be found at: +https://github.com/cyberlytics/ctan-prep + /Christoph P. Neumann, <cyberpetaneuron+iaria@gmail.com> diff --git a/macros/latex/contrib/iaria/iaria.dtx b/macros/latex/contrib/iaria/iaria.dtx index 8d8d394d09..bc091c3b83 100644 --- a/macros/latex/contrib/iaria/iaria.dtx +++ b/macros/latex/contrib/iaria/iaria.dtx @@ -1,16 +1,16 @@ %\iffalse % iaria.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -setambles ".*=>\nopreamble" +% -author "Christoph P. Neumann " % -dir "src" -% -src "(iaria.cls)=>\1" +% -src "(_cpn_copyIntoExamplesFolder_cls.cmd|iaria.cls)=>\1" +% -preamble "Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. " % -date "2023-2024" -% -author "Christoph P. Neumann " -% -macrocode ".*" -% -preamble "Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status «maintained». The Current Maintainer of this work is Christoph P. Neumann. " % -doc "doc/iaria.tex" +% -macrocode ".*" +% -setambles ".*=>\nopreamble" % iaria -% Created on 2024/3/20 15:50 +% Created on 2024/4/10 18:20 %\fi %\iffalse %<*package> @@ -37,23 +37,6 @@ % \fi % \iffalse %<*driver> -%% -%% Copyright 2023 Christoph P. Neumann -%% -%% This LaTeX class provides a simple interface for creating -%% a verfy fancy Curriculum Vitae. At the moment only CVs in -%% the german language are supported. -%% -%% This file is free property; as a special exception the author -%% gives unlimited permission to copy and/or distribute it, with -%% or without modifications, as long as this notice is -%% preserved. -%% -%% This file is distributed in the hope that it will be useful, -%% but WITHOUT ANY WARRANTY, to the extent permitted by law; -%% without even the implied warranty of MERCHANTABILITY or -%% FITNESS FOR A PARTICULAR PURPOSE. - \documentclass{ltxdoc} \CodelineNumbered @@ -73,6 +56,7 @@ %\title{\textsf{iaria}\\ %An Unofficial IARIA LaTeX Class} %\author{Christoph P.\ Neumann \texttt{$<$cyberpetaneuron@gmail.com$>$}} +%\date{Version 0.2} %\maketitle %\PrintChanges % @@ -165,6 +149,31 @@ %\section{The Code} %\iffalse % \begin{macrocode} +%<*_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +% \begin{macrocode} +@echo off + +rem *************************************************************************** +rem * author: Christoph P. Neumann +rem *************************************************************************** +cd /d "%~dp0" + +echo == ..\examples\* == +for /D %%D in (..\examples\*) do ( + echo == %%D == + xcopy /Y ".\*.cls" "%%~D" +) + +pause% \end{macrocode} +%\iffalse +% \begin{macrocode} +%</_cpn_copyIntoExamplesFolder_cls.cmd> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*iaria.cls> % \end{macrocode} %\fi @@ -197,7 +206,7 @@ \NeedsTeXFormat{LaTeX2e} % Provide the name of your document class, the date it was last updated, and a comment about what it's used for -\ProvidesClass{iaria}[2023/01/01 unofficial IARIA conference template] +\ProvidesClass{iaria}[2024/04/10 unofficial IARIA conference template v0.2] % Define marker counter for options (counter are global in latex): \newcounter{iaria@pbalancetracker} @@ -300,6 +309,10 @@ % Diferring from IEEE, IARIA requires a hyphen after "Keywords" instead of an emdash: \xpatchcmd\IEEEkeywords{---}{-}{}{} +% Diferring from IEEE, IARIA requires also the keywords in Italic (and Bold)(and lower case!): +\let\oldIEEEkeywords\IEEEkeywords +\def\IEEEkeywords{\oldIEEEkeywords\itshape\ignorespaces} + \makeatletter \renewcommand{\IEEEauthorblockN}[1]{% % copied from IEEEtran.cls: @@ -319,6 +332,19 @@ \crcr} \makeatother +% IARIA subfigure captions require this: +\RequirePackage[caption=false,font=footnotesize]{subfig} + +% IARIA requires to bring the table caption in the same line of "Table I" +\usepackage{etoolbox} +\makeatletter +\patchcmd{\@makecaption} + {\\} + {.\ } + {} + {} +\makeatother + % Allows to hyphenate a word that contains a dash: % https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash \RequirePackage[shortcuts]{extdash} % Use \-/ for a breakable dash that does not prevent the remainer of the word to be hyphenated diff --git a/macros/latex/contrib/iaria/iaria.ins b/macros/latex/contrib/iaria/iaria.ins index 187a236425..846e42400d 100644 --- a/macros/latex/contrib/iaria/iaria.ins +++ b/macros/latex/contrib/iaria/iaria.ins @@ -1,13 +1,14 @@ -% iaria.ins generated using makedtx version 1.2 2024/3/20 15:50 +% iaria.ins generated using makedtx version 1.2 2024/4/10 18:20 \input docstrip \preamble -Copyright 2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status «maintained». The Current Maintainer of this work is Christoph P. Neumann. +Copyright 2023-2024 Christoph P. Neumann This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or any later version. The latest version of this license is in https://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2008 or later. This work has the LPPL maintenance status maintained. The Current Maintainer of this work is Christoph P. Neumann. \endpreamble \askforoverwritefalse -\generate{\file{iaria.cls}{\nopreamble\from{iaria.dtx}{iaria.cls}} +\generate{\file{_cpn_copyIntoExamplesFolder_cls.cmd}{\nopreamble\from{iaria.dtx}{_cpn_copyIntoExamplesFolder_cls.cmd}} +\file{iaria.cls}{\nopreamble\from{iaria.dtx}{iaria.cls}} } \endbatchfile diff --git a/macros/latex/contrib/iaria/iaria.pdf b/macros/latex/contrib/iaria/iaria.pdf Binary files differindex 9696d69f44..f7665d3d4b 100644 --- a/macros/latex/contrib/iaria/iaria.pdf +++ b/macros/latex/contrib/iaria/iaria.pdf diff --git a/macros/latex/contrib/iaria/template/cpn_all_all.bib b/macros/latex/contrib/iaria/template/cpn_all_all.bib index d7796e6272..cc7abaec4a 100644 --- a/macros/latex/contrib/iaria/template/cpn_all_all.bib +++ b/macros/latex/contrib/iaria/template/cpn_all_all.bib @@ -281,7 +281,7 @@ publisher = {Gesellschaft f{\"u}r Informatik e.V.\ (GI), K{\"o}ln, Germany}, doi = {10.1145/1620432.1620442}, url = {https://dl.gi.de/20.500.12116/20447}, - _isbn = {978\-/3\-/88579\-/238\-/3}, + _isbn = {978-3-88579-238-3}, _issn = {1617\-/5468}, } @@ -347,9 +347,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19459}, + doi = {10.48550/arXiv.2310.19459}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_10_28004}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19459}, + _issn = {2308-4294}, pages = {21--29}, } @@ -361,9 +362,10 @@ address = {Venice, Italy}, month=apr, year={2024}, - _doi = {TODO}, + doi = {10.48550/arXiv.2404.02637}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2024_X_YY_ZZZZZ}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2404.02637}, + _issn = {2308\-/4294}, _pages = {AA--OO}, note = {accepted for publication} } @@ -402,9 +404,10 @@ address = {Nice, France}, month=jun, year={2023}, - doi = {10.48550/ARXIV.2310.19461}, + doi = {10.48550/arXiv.2310.19461}, _url = {https://www.thinkmind.org/index.php?view=article&articleid=cloud_computing_2023_2_30_28006}, - issn = {2308-4294}, + _url = {https://doi.org/10.48550/arXiv.2310.19461}, + _issn = {2308\-/4294}, pages = {41--46}, } diff --git a/macros/latex/contrib/iaria/template/iaria-example-neumann.pdf b/macros/latex/contrib/iaria/template/iaria-example-neumann.pdf Binary files differindex 8277068b7b..7c5d190398 100644 --- a/macros/latex/contrib/iaria/template/iaria-example-neumann.pdf +++ b/macros/latex/contrib/iaria/template/iaria-example-neumann.pdf diff --git a/macros/latex/contrib/iaria/template/iaria-example-neumann.tex b/macros/latex/contrib/iaria/template/iaria-example-neumann.tex index eb9514ad8f..eda28b0f0c 100644 --- a/macros/latex/contrib/iaria/template/iaria-example-neumann.tex +++ b/macros/latex/contrib/iaria/template/iaria-example-neumann.tex @@ -2,12 +2,16 @@ \documentclass[conference,flushend]{iaria} \pdfoutput=1 % pdflatex hint for arxiv.org (within first 5 lines) -% en-US = [english]/[american]/[USenglish] (+ [canadian]) <DEFAULT> +% en-US = [english]/[american]/[USenglish] <DEFAULT> \usepackage[babel=true,english=american]{csquotes} -\usepackage[USenglish]{babel} -% en-UK = [british] /[UKenglish] (+ [australian]) <OXFORD> +\usepackage[english]{babel} % en-US +% IARIA requires uppercase TABLE, and babel intervenes in the tablename +\addto\captionsenglish{\renewcommand\tablename{TABLE}} +% en-UK = [british] /[UKenglish] <OXFORD> %\usepackage[babel=true,english=british]{csquotes} -%\usepackage[UKenglish]{babel} +%\usepackage[british]{babel} % en-UK +%% IARIA requires uppercase TABLE, and babel intervenes in the tablename +%\addto\captionsbritish{\renewcommand\tablename{TABLE}} % Allows to hyphenate a word that contains a dash: % https://stackoverflow.com/questions/2193307/how-do-i-get-latex-to-hyphenate-a-word-that-contains-a-dash @@ -31,41 +35,41 @@ final % Always enable microtype, even if in draft mode. This helps finding bad b \begin{filecontents}[overwrite]{embedded.bib} - @online{ieee2015howto, - author = {Michael Shell}, - title = {How to Use the {IEEEtran} \LaTeX\ Class}, - url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, - year = {2015} - } - @online{ieee2018formattingrules, - author = {{IEEE}}, - title = {Conference Template and Formatting Specifications}, - url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, - year = {2018} - } - @online{iaria2014formattingrules, - author = {{IARIA}}, - title = {Formatting Rules}, - url = {http://www.iaria.org/formatting.doc}, - year = {2014} - } - @online{iaria2009editorialrules, - _author = {Cosmin Dini}, - author = {{IARIA}}, - title = {Editorial Rules}, - url = {https://www.iaria.org/editorialrules.html}, - year = {2009} - } - @online{languagetool, - author = {{LanguageTooler GmbH}}, - title = {{LangueTool}}, - url = {https://languagetool.org/overleaf} - } - @online{overleaf, - author = {{Digital Science UK Limited}}, - title = {{Overleaf}}, - url = {https://www.overleaf.com} - } +@online{ieee2015howto, + author = {Michael Shell}, + title = {How to Use the {IEEEtran} \LaTeX\ Class}, + url = {http://mirrors.ctan.org/macros/latex/contrib/IEEEtran/IEEEtran_HOWTO.pdf}, + year = {2015} +} +@online{ieee2018formattingrules, + author = {{IEEE}}, + title = {Conference Template and Formatting Specifications}, + url = {https://www.ieee.org/content/dam/ieee-org/ieee/web/org/conferences/Conference-template-A4.doc}, + year = {2018} +} +@online{iaria2014formattingrules, + author = {{IARIA}}, + title = {Formatting Rules}, + url = {http://www.iaria.org/formatting.doc}, + year = {2014} +} +@online{iaria2009editorialrules, + _author = {Cosmin Dini}, + author = {{IARIA}}, + title = {Editorial Rules}, + url = {https://www.iaria.org/editorialrules.html}, + year = {2009} +} +@online{languagetool, + author = {{LanguageTooler GmbH}}, + title = {{LangueTool}}, + url = {https://languagetool.org/overleaf} +} +@online{overleaf, + author = {{Digital Science UK Limited}}, + title = {{Overleaf}}, + url = {https://www.overleaf.com} +} \end{filecontents} \usepackage{fontawesome} % i.a., \faWarning{} @@ -78,128 +82,129 @@ final % Always enable microtype, even if in draft mode. This helps finding bad b % https://www.hyphenation24.com/ \hyphenation{block-chain block-chains Ethe-re-um} +% Capitalization: https://capitalizemytitle.com/style/Chicago/ \title{The Unofficial \textsmaller{IARIA} \LaTeX{} Class Paper Example (v2024-03)} \author{ - \IEEEauthorblockN{Christoph P.\ Neumann\,\orcidlink{0000-0002-5936-631X}} - \IEEEauthorblockA{% - Department of Electrical Engineering, Media, and Computer Science\\ - Ostbayerische Technische Hochschule Amberg-Weiden\\ - Amberg, Germany\\ - % Diferring from IEEE ("Email"), IARIA requires "e-mail": - e-mail: \texttt{c.neumann@oth-aw.de} - % Multiple authors and their e-mail addresses: - %e-mail: {\tt$\lbrace$j.smith\,|\,c.neumann$\rbrace$@oth-aw.de} - } + \IEEEauthorblockN{Christoph P.\ Neumann\,\orcidlink{0000-0002-5936-631X}} + \IEEEauthorblockA{% + Department of Electrical Engineering, Media, and Computer Science\\ + Ostbayerische Technische Hochschule Amberg-Weiden\\ + Amberg, Germany\\ + % Diferring from IEEE ("Email"), IARIA requires "e-mail": + e-mail: \texttt{c.neumann@oth-aw.de} + % Multiple authors and their e-mail addresses: + %e-mail: {\tt$\lbrace$j.smith\,|\,c.neumann$\rbrace$@oth-aw.de} + } } \begin{document} - - \maketitle - - \begin{abstract} - \lipsum[1][3-12] - \end{abstract} - - % A list of IEEE Computer Society appoved keywords can be obtained at - % http://www.computer.org/mc/keywords/keywords.htm - \begin{IEEEkeywords} - % Diferring from IEEE, IARIA requires also the keywords in Bold and Italic (and lower case): - \textbf{\textit{template; lorem ipsum.}} - \end{IEEEkeywords} - - \section{Introduction} - - The \textsmaller{IARIA} formatting is based on \textsmaller{IEEE} style. - The unofficial \textsmaller{IARIA} \LaTeX\ class is based on \textsmaller{IEEE}tran class \cite{ieee2015howto}. - The \textsmaller{IARIA} formatting rules \cite{iaria2014formattingrules} are adopted from the \textsmaller{IEEE} template and formatting specifications \cite{ieee2018formattingrules}. - In addition, be aware of the supplementary \textsmaller{IARIA} editorial rules \cite{iaria2009editorialrules} \faWarning{} that provide a beginner-friendly set of further advices. - It is recommended to use a grammar tool, e.\,g., the LanguageTool \cite{languagetool} browser plugin in combination with Overleaf \cite{overleaf}. - - \lipsum[2] - - \{\faWarning{} \textsmaller{IARIA} editorial rules: Introduction must end with a paragraph describing the structure of the paper!\} - The remainder of the paper is organized as follows: In Section~II, … - - \section{Related work \textbar{} Methods} - \lipsum[3] - - \section{Results} - \lipsum[4] - - \section{Discussion \textbar{} Evalution} - \lipsum[5] - - \section{Conclusion and Future Work} - \{\faWarning{} \textsmaller{IARIA} editorial rules: Last section must be \textquote{Conclusion and Future Work}!\} - \lipsum[6] - - - - %%% Advisor - \nocite{StNe23foodfresh} - - %%% First-Author - \nocite{NeLe13adhocCoop} - \nocite{Neumann2012lni} - \nocite{NeLe12alphaFlow} - \nocite{NeHL12hydra} - \nocite{NeWL12offsync} - \nocite{NSWL11alphaadaptive} - \nocite{NeFL10oxdbs} - \nocite{NeLe10alphaUC} - \nocite{NeLe09alphaflow} - \nocite{NeLe09dmps} - \nocite{NHSL09oxdbs} % DE - \nocite{NeWL09xdsrig} % DE - \nocite{NRDL09deus} - - %%% Co-Authorship - \nocite{LeNe24vocattllm} - \nocite{PANP23seccloudfogai} - \nocite{WaNe12alphaoffsync} - \nocite{ToNe11alphaprops} - \nocite{FDI+10esmmog} - \nocite{JBN+10fcmdb} - \nocite{ILN+09semrttx} - \nocite{IND+09lzatav} % DE - \nocite{MeNe04testejb} - - %%% Monographic Work - \nocite{Neumann2013dissBook} - \nocite{Neumann2012dissPreprint} - \nocite{neumann2005da} - \nocite{neumann2004sa} - - %%% TechRep / Non-Peer-Reviewed - - \nocite{SaNe24othfb} - - \nocite{ModA-TR-2023SS-WAE-TeamWeiss-Neunerln} - \nocite{ModA-TR-2023SS-BDCC-TeamRot-CompVisPipeline} - \nocite{ModA-TR-2023SS-BDCC-TeamBlau-NauticalNonsense} - \nocite{ModA-TR-2023SS-BCN-TeamGruen-TorpedoTactics} - \nocite{ModA-TR-2023SS-BCN-TeamCyan-Stockbird} - \nocite{ModA-TR-2023SS-BCN-TeamBlau-FancyChess} - \nocite{ModA-TR-2023WS-SWT-TeamRot-SGDb} - \nocite{ModA-TR-2023WS-SWT-TeamGruen-OPCUANetzwerk} - \nocite{ModA-TR-2022SS-WAE-TeamWeiss-WoIstMeinGeld} - \nocite{ModA-TR-2022SS-BDCC-TeamWeiss-TwitterDash} - \nocite{ModA-TR-2022SS-BDCC-TeamRot-Reddiment} - \nocite{ModA-TR-2022SS-BDCC-TeamGruen-ExplosionGuy} - \nocite{ModA-TR-2022SS-BDCC-TeamCyan-OTHWiki} - \nocite{ModA-TR-2022WS-SWT-TeamGruen-Graphvio} - \nocite{ModA-TR-2021SS-WAE-TeamWeiss-CovidDashboard} - \nocite{ModA-TR-2021SS-WAE-TeamRot-FireForceDefense} - \nocite{ModA-TR-2021SS-WAE-TeamGruen-MedPlanner} - - \nocite{NeRL12deus} - \nocite{LNR+11egr} - - % ======== References ========= - \begingroup - \sloppy - \printbibliography - \endgroup - + +\maketitle + +\begin{abstract} + \lipsum[1][3-12] +\end{abstract} + +% A list of IEEE Computer Society appoved keywords can be obtained at +% http://www.computer.org/mc/keywords/keywords.htm +\begin{IEEEkeywords} + % Diferring from IEEE, IARIA requires also the keywords in Bold and Italic (and lower case): + template; lorem ipsum. +\end{IEEEkeywords} + +\section{Introduction} + +The \textsmaller{IARIA} formatting is based on \textsmaller{IEEE} style. +The unofficial \textsmaller{IARIA} \LaTeX\ class is based on \textsmaller{IEEE}tran class \cite{ieee2015howto}. +The \textsmaller{IARIA} formatting rules \cite{iaria2014formattingrules} are adopted from the \textsmaller{IEEE} template and formatting specifications \cite{ieee2018formattingrules}. +In addition, be aware of the supplementary \textsmaller{IARIA} editorial rules \cite{iaria2009editorialrules} \faWarning{} that provide a beginner-friendly set of further advices. +It is recommended to use a grammar tool, e.\,g., the LanguageTool \cite{languagetool} browser plugin in combination with Overleaf \cite{overleaf}. + +\lipsum[2] + +\{\faWarning{} \textsmaller{IARIA} editorial rules: Introduction must end with a paragraph describing the structure of the paper!\} +The remainder of the paper is organized as follows: In Section~II, … + +\section{Related work \textbar{} Methods} +\lipsum[3] + +\section{Results} +\lipsum[4] + +\section{Discussion \textbar{} Evalution} +\lipsum[5] + +\section{Conclusion and Future Work} +\{\faWarning{} \textsmaller{IARIA} editorial rules: Last section must be \textquote{Conclusion and Future Work}!\} +\lipsum[6] + + + +%%% Advisor +\nocite{StNe23foodfresh} + +%%% First-Author +\nocite{NeLe13adhocCoop} +\nocite{Neumann2012lni} +\nocite{NeLe12alphaFlow} +\nocite{NeHL12hydra} +\nocite{NeWL12offsync} +\nocite{NSWL11alphaadaptive} +\nocite{NeFL10oxdbs} +\nocite{NeLe10alphaUC} +\nocite{NeLe09alphaflow} +\nocite{NeLe09dmps} +\nocite{NHSL09oxdbs} % DE +\nocite{NeWL09xdsrig} % DE +\nocite{NRDL09deus} + +%%% Co-Authorship +\nocite{LeNe24vocattllm} +\nocite{PANP23seccloudfogai} +\nocite{WaNe12alphaoffsync} +\nocite{ToNe11alphaprops} +\nocite{FDI+10esmmog} +\nocite{JBN+10fcmdb} +\nocite{ILN+09semrttx} +\nocite{IND+09lzatav} % DE +\nocite{MeNe04testejb} + +%%% Monographic Work +\nocite{Neumann2013dissBook} +\nocite{Neumann2012dissPreprint} +\nocite{neumann2005da} +\nocite{neumann2004sa} + +%%% TechRep / Non-Peer-Reviewed + +\nocite{SaNe24othfb} + +\nocite{ModA-TR-2023SS-WAE-TeamWeiss-Neunerln} +\nocite{ModA-TR-2023SS-BDCC-TeamRot-CompVisPipeline} +\nocite{ModA-TR-2023SS-BDCC-TeamBlau-NauticalNonsense} +\nocite{ModA-TR-2023SS-BCN-TeamGruen-TorpedoTactics} +\nocite{ModA-TR-2023SS-BCN-TeamCyan-Stockbird} +\nocite{ModA-TR-2023SS-BCN-TeamBlau-FancyChess} +\nocite{ModA-TR-2023WS-SWT-TeamRot-SGDb} +\nocite{ModA-TR-2023WS-SWT-TeamGruen-OPCUANetzwerk} +\nocite{ModA-TR-2022SS-WAE-TeamWeiss-WoIstMeinGeld} +\nocite{ModA-TR-2022SS-BDCC-TeamWeiss-TwitterDash} +\nocite{ModA-TR-2022SS-BDCC-TeamRot-Reddiment} +\nocite{ModA-TR-2022SS-BDCC-TeamGruen-ExplosionGuy} +\nocite{ModA-TR-2022SS-BDCC-TeamCyan-OTHWiki} +\nocite{ModA-TR-2022WS-SWT-TeamGruen-Graphvio} +\nocite{ModA-TR-2021SS-WAE-TeamWeiss-CovidDashboard} +\nocite{ModA-TR-2021SS-WAE-TeamRot-FireForceDefense} +\nocite{ModA-TR-2021SS-WAE-TeamGruen-MedPlanner} + +\nocite{NeRL12deus} +\nocite{LNR+11egr} + +% ======== References ========= +\begingroup +\sloppy +\printbibliography +\endgroup + \end{document} diff --git a/macros/latex/contrib/jsonparse/LICENCE b/macros/latex/contrib/jsonparse/LICENCE new file mode 100644 index 0000000000..4db9b5af29 --- /dev/null +++ b/macros/latex/contrib/jsonparse/LICENCE @@ -0,0 +1,415 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. diff --git a/macros/latex/contrib/jsonparse/README.md b/macros/latex/contrib/jsonparse/README.md new file mode 100644 index 0000000000..9576069ea3 --- /dev/null +++ b/macros/latex/contrib/jsonparse/README.md @@ -0,0 +1,46 @@ +![Version 0.5.5](https://img.shields.io/badge/version-0.5.5-blue) + +# The `jsonparse` package + +The `jsonparse` package provides an easy way to read in JSON data from files or strings in LaTeX documents, parse the data and store it in a user-defined token variable. The package allows accessing the stored data via a JavaScript-flavored syntax. + +Using the commands `\JSONParseFromFile` or `\JSONParse`, JSON data can be stored in a token variable. Using the command `\JSONParseGetValue`, certain entried can be extracted from the stored data. + +--- + +Let's assume a file with the name `example.json` is stored in the working directory with the following contents: + +``` +{ + "first_name": "John", + "last_name": "Smith", + "is_alive": true, + "age": 27, + "address": { + "street_address": "21 2nd Street", + "city": "New York", + "state": "NY", + "postal_code": "10021-3100" + }, + "phone_numbers": [ + { + "type": "home", + "number": "212 555-1234" + }, + { + "type": "office", + "number": "646 555-4567" + } + ], + "children": [ + "Catherine", + "Thomas", + "Trevor" + ], + "spouse": null +} +``` + +We can store it in the token variable `\myJSONdata` using the command `\JSONParseFromFile{\myJSONdata}{example.json}`. Calling the command `\JSONParseGetValue{\myJSONdata}{phone_numbers[0].number}` would then result in the output `212 555-1234` (indices are zero-based per default). + +This package including all files is subject to the LPPL 1.3c license. diff --git a/macros/latex/contrib/jsonparse/jsonparse-doc.pdf b/macros/latex/contrib/jsonparse/jsonparse-doc.pdf Binary files differnew file mode 100644 index 0000000000..127c25d2a5 --- /dev/null +++ b/macros/latex/contrib/jsonparse/jsonparse-doc.pdf diff --git a/macros/latex/contrib/jsonparse/jsonparse-doc.tex b/macros/latex/contrib/jsonparse/jsonparse-doc.tex new file mode 100644 index 0000000000..3fe058a3ea --- /dev/null +++ b/macros/latex/contrib/jsonparse/jsonparse-doc.tex @@ -0,0 +1,360 @@ +% File: jsonparse-doc.tex +% Copyright 2024 Jasper Habicht (mail@jasperhabicht.de). +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License version 1.3c, +% available at http://www.latex-project.org/lppl/. +% +% This file is part of the `jsonparse' package (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% This work has the LPPL maintenance status `author-maintained'. +% +\documentclass[a4paper]{article} +\def\jsonparsefileversion{0.5.5} +\def\jsonparsefiledate{9 April 2024} + +\usepackage[T1]{fontenc} +\usepackage{Alegreya} +\usepackage{AlegreyaSans} +\usepackage{FiraMono} + +\usepackage{geometry, longtable, booktabs, tcolorbox, hyperref} +\geometry{margin=25mm, left=45mm} + +\usepackage{fancyhdr} +\pagestyle{fancy} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +\fancyfoot[R]{\thepage} + +\linespread{1.1}\selectfont +\addtolength{\skip\footins}{1em plus 5pt} +\makeatletter +\renewcommand*{\thefootnote}{\fnsymbol{footnote}} +\renewcommand{\@makefntext}[1]{% + \noindent\hbox to 0.75em{\normalfont\@thefnmark\hss}~#1% +} +\makeatother + +\tcbuselibrary{listings} +\lstdefinestyle{jsonparsedocmacro}{ + basicstyle=\small\ttfamily, + literate=*{<}{{{\color{black!50}\guilsinglleft}}}1 + {>}{{{\color{black!50}\guilsinglright}}}1, + keywords={}, + moredelim=[is][\bfseries]{|}{|}, + moredelim=[is][\color{black!50}]{!}{!}, +} +\lstdefinestyle{jsonparsedoccodeexample}{ + basicstyle=\small\ttfamily, + keywords={}, +} + +\hypersetup{colorlinks} + +\ExplSyntaxOn +\int_new:N \l_jsonparse_doc_change_int +\NewDocumentCommand{\changes}{ m m m }{ + \int_incr:N \l_jsonparse_doc_change_int + \prop_new:c { l_jsonparse_doc_change_ + \int_to_roman:n { \l_jsonparse_doc_change_int } _prop } + \prop_put:cnn { l_jsonparse_doc_change_ + \int_to_roman:n { \l_jsonparse_doc_change_int } _prop } { version } {#1} + \prop_put:cnn { l_jsonparse_doc_change_ + \int_to_roman:n { \l_jsonparse_doc_change_int } _prop } { date } {#2} + \prop_put:cnn { l_jsonparse_doc_change_ + \int_to_roman:n { \l_jsonparse_doc_change_int } _prop } { changes } {#3} +} +\NewDocumentCommand{\printchanges}{ }{ + \section{Changes} + \begin{description} + \int_step_inline:nn { \l_jsonparse_doc_change_int } { + \item[ + \prop_item:cn { l_jsonparse_doc_change_ + \int_to_roman:n { ##1 } _prop } { version } ] + ( \prop_item:cn { l_jsonparse_doc_change_ + \int_to_roman:n { ##1 } _prop } { date } ) \\ + \prop_item:cn { l_jsonparse_doc_change_ + \int_to_roman:n { ##1 } _prop } { changes } + } + \end{description} +} + +\tl_new:N \l_jsonparse_doc_doctitle_tl +\NewExpandableDocumentCommand{\makedoctitle}{ o m o m m o m }{ + \hypersetup{ + pdfauthor={#5}, + pdftitle={\IfValueTF{#1}{#1}{#2}}, + pdfsubject={\IfValueTF{#3}{#3}{#4}} + } + \tl_set:Nn \l_jsonparse_doc_doctitle_tl { + \group_begin: + \tcbset{ + title ~ style ~ hook/.style={ + boxrule=2pt, + fontupper=\huge\ttfamily + } + } + \setlength{\parindent}{0pt}\sffamily + \Huge{\bfseries #2}\par\bigskip + \Large #4\par\bigskip + \large #5 + \IfValueT{#6}{ + \,\footnote{#6}\par\bigskip + } + #7\par\bigskip + \rule{\textwidth}{.08em} + \group_end: + } +} + +\NewExpandableDocumentCommand{\printdoctitle}{ }{ + \tl_use:N \l_jsonparse_doc_doctitle_tl +} +\ExplSyntaxOff + +\tcbset{ + size=small, + arc=2.5pt, + outer arc=2.5pt, + colframe=black!10, + colback=black!10, + title style hook/.style={} +} + +\NewTCBListing{macrodef}{ }{ + listing only, + listing style={jsonparsedocmacro}, + grow to left by=2cm, + boxrule=0pt, + after={\par\smallskip\noindent} +} + +\NewTCBListing{codeexample}{ }{ + listing only, + listing style={jsonparsedoccodeexample}, + after={\par\smallskip\noindent} +} + +\NewTCBListing{codeexamplecolumns}{ }{ + text side listing, + lefthand width=4.5cm, + listing style={jsonparsedoccodeexample}, + after={\par\smallskip\noindent} +} + +\NewTotalTCBox{\macro}{ O{} v }{ + verbatim, + size=tight, + arc=1pt, + outer arc=1pt, + top=0.5pt, + bottom=0.5pt, + left=2pt, + right=2pt, + boxrule=0pt, + colframe=black!10, + colback=black!10, + fontupper=\small\ttfamily, + #1 +}{\vphantom{/g}\lstinline^#2^} + +\NewTotalTCBox{\titlemacro}{ s O{} m }{ + verbatim, + size=tight, + arc=1pt, + outer arc=1pt, + top=0.5pt, + bottom=0.5pt, + left=2pt, + right=2pt, + boxrule=0pt, + colframe=black!10, + colback=black!10, + fontupper=\small\ttfamily, + title style hook, + #2 +}{\vphantom{/g}\IfBooleanT{#1}{\textbackslash}#3} + +\usepackage{jsonparse} + +\makedoctitle + [The jsonparse package] + {The \titlemacro{jsonparse} package} + {An easy way to parse, store and access JSON data from files or strings in LaTeX documents} + {Jasper Habicht}[E-mail: \href{mailto:mail@jasperhabicht.de}{mail@jasperhabicht.de}] + {Version \jsonparsefileversion, released on \jsonparsefiledate} + +\changes{v0.3.0}{2024/04/08}{First public beta release.} +\changes{v0.5.0}{2024/04/09}{Changed from string token variables to token lists to support Unicode.} +\changes{v0.5.5}{2024/04/09}{Bug fixes, introduction and enhancement of user functions.} + +\begin{document} + +\printdoctitle + +\bigskip + +\section{Introduction} + +The \macro{jsonparse} package provides an easy way to read in JSON data from files or strings in LaTeX documents, parse the data and store it in a user-defined token variable. The package allows accessing the stored data via a JavaScript-flavored syntax. + +\section{Loading the package} + +To install the package, copy the package file \macro{jsonparse.sty} into the working directory or into the \macro{texmf} directory. After the package has been installted, the \macro{jsonparse} package is loaded by calling \macro{\usepackage{jsonparse}} in the preamble of the document. + +The package does not load any dependencies. + +\begin{macrodef}debug\end{macrodef} +The package can be loaded with the option \macro{debug}. It will then output to the log file every instance of a string, a boolean (true or false) value, a null value, a number as well as the start and end of every object and the start and end of every array that is found while parsing the JSON string or JSON file. + +\section{Main user commands} + +\begin{macrodef} +|\JSONParse|{<token variable>}{<JSON string>} +\end{macrodef} +The command \macro{\JSONParse} is used to parse a JSON string and store the parsed result in a token variable (a property list). The first argument takes the name of the token variable that is created by the command. The second argument takes the JSON string to be parsed. + +For example, using \macro{\JSONParse{\myJSONdata}{ { "key" : "value" } }}, the relevant JSON string will be parsed and the result stored in the token variable \macro{\myJSONdata} as property list. In this case, the property list only consists of one entry with the key \macro{key} and the value \macro{value}. The command \macro{\JSONParseGetValue{\myJSONdata}{key}}, for example, can then be used to extract the relevant value from this property list (see the description below). + +\begin{macrodef} +|\JSONParseFromFile|{<token variable>}{<JSON file>} +\end{macrodef} +The command \macro{\JSONParseFromFile} is used to parse a JSON file and store the parsed result in a token variable (a property list). It works the same way as \macro{\JSONParse}, but instead of a JSON string, it takes as second argument the path to the JSON file relative to the working directory. + +\begin{macrodef} +|\JSONParseGetValue|{<token variable>}{<key>} +\end{macrodef} +The command \macro{\JSONParseGetValue} is used to select values from the token variable (property list) that has been created using the commands \macro{\JSONParse} or \macro{\JSONParseFromFile}. The first argument takes the token variable that holds the parsed JSON data. The second argument takes the key to select the relevant entry from the parsed JSON data using JavaScript syntax. + +If the JSON string \macro{{ "key" : "value" }} is parsed into the token variable \macro{\myJSONdata}, using \macro{\JSONParseGetValue{\myJSONdata}{key}} would extract the value associated with the key \macro{key}, which in this case is \macro{value}, and typeset it to the document. + +Nested objects and arrays are assigned keys that adhere to JavaScript syntax. For example, if the JSON string \macro{{ "outer_key" : { "inner_key" : "value" } }} is parsed into the token variable \macro{\myJSONdata}, to select the value associated with the key \macro{inner_key}, the command \macro{\JSONParseGetValue{\myJSONdata}{outer_key.inner_key}} can be used. The command \macro{\JSONParseGetValue{\myJSONdata}{key[0]}} selects the first value of the array associated with the key \macro{key} in the parsed JSON string \macro{{ "key" : [ "one" , "two" ] }}. + +When a key is associated with an object or array, the whole object or array is output as JSON string. This string can again be parsed using \macro{\JSONParse}. The special key \macro{.} (or the string defined using \macro{\JSONParseSetChildSeparator}) return the whole JSON object. + +\begin{macrodef} +|\JSONParseGetArrayValues|{<token variable>}{<key>}[<subkey>]{<string>} +\end{macrodef} +The command \macro{\JSONParseGetArrayValues} is used to select all values from an array from a parsed JSON string or JSON file. The first argument takes the token variable that holds the parsed JSON data. The second argument takes the key to select the relevant entry from the parsed JSON data using JavaScript syntax. The third argument is optional an can be used to pass a subkey, i.\,e. a key that is used to select a value for every item. The last argument takes a string that is inserted between all values when they are typeset. + +For example, let us assume the following JSON data structure is parsed into the token variable \macro{\myJSONdata}: + +\begin{codeexample} +{ + "array" : [ + { + "key_a" : "one" , + "key_b" : "two" + } , + { + "key_a" : "three" , + "key_b" : "four" + } + ] +} +\end{codeexample} + +Then using \macro{\JSONParseGetArrayValues{\myJSONdata}{array}[key_a]{, }}, the text \macro{one, three} is typeset to the document. + +\begin{macrodef} +|\JSONParseUseArrayValues|{<token variable>}{<key>}[<subkey>]{<command name>} +\end{macrodef} +The command \macro{\JSONParseUseArrayValues} takes the same first three arguments as the command \macro{\JSONParseGetArrayValues} and works in a similar way. However, instead of a string that is added between the array items, it takes a command name as fourth argument. This command can be defined beforehand and will be called for every array item. Inside its defintion, the commands \macro{\JSONParseArrayIndex}, \macro{\JSONParseArrayKey} and \macro{\JSONParseArrayValue} can be used which are updated for each item and output the index, the key and the value of the current item respectively. + +For example, let us assume the same JSON data structure as defined above parsed into the token variable \macro{\myJSONdata}. Then, the following can be done: + +\JSONParse{\myJSONdata}{ { "array" : [ { "key_a" : "one" , "key_b" : "two" } , { "key_a" : "three" , "key_b" : "four" } ] } } + +\begin{codeexamplecolumns} +\newcommand{\myJSONitem}{ + \item \emph{\JSONParseArrayValue} +} + +\begin{itemize} + \JSONParseUseArrayValues{\myJSONdata} + {array}[key_a]{myJSONitem} +\end{itemize} +\end{codeexamplecolumns} + +\begin{macrodef} +|\JSONParseGetArrayCount|{<token variable>}{<key>} +\end{macrodef} +The command \macro{\JSONParseGetArrayCount} takes as frist argument a token variable that holds a parsed JSON string or JSON file and as second argument a key. It returns an integer representing the number of items contained in the selected array. + +\subsection{Commands to alter separators and output} + +The package provides a set of commands that can be used to change the separators used to select the relevant value in the JSON structure as well as the output that is generated from the JSON data. + +\begin{macrodef} +|\JSONParseSetChildSeparator|{<string>} +|\JSONParseSetArraySeparator|{<string>}{<string>} +\end{macrodef} +The two commands \macro{\JSONParseSetChildSeparator} and \macro{\JSONParseSetArraySeparator} can be used to change the separators for child objects or array items in the syntax used to select a specific value in the JSON data structure. Per default, the child separator is a dot (\macro{.}) while the array separators are sqare brackets (\macro{[} and \macro{]}). The command \macro{\JSONParseSetArraySeparator} takes two arguments of which the first is the character used before the array separator and the second is used after. Changing the separators can be useful if keys in the JSON structure already use these characters. + +\begin{macrodef} +|\JSONParseSetTrueString|{<string>} +|\JSONParseSetFalseString|{<string>} +|\JSONParseSetNullString|{<string>} +\end{macrodef} +The commands \macro{\JSONParseSetTrueString} and \macro{\JSONParseSetFalseString} as well as the command \macro{\JSONParseSetNullString} can be used to change the output that is typeset if the JSON value is \macro{true}, \macro{false} or \macro{null}. The default strings that are typeset are \macro{true}, \macro{false} or \macro{null} resepctively. + +\begin{macrodef} +|\JSONParseSetArrayIndexZeroBased| +|\JSONParseSetArrayIndexOneBased| +\end{macrodef} +The command \macro{\JSONParseSetArrayIndexZeroBased} sets the numbering of the index of array items to zero-based. With the command \macro{\JSONParseSetArrayIndexOneBased}, the indexing starts with one instead. Per default, the package uses zero-based indexing to resemble JavaScript notation. + +\subsection{Internal variables and commands} + +\begin{macrodef} +|\l_jsonparse_debug_mode_bool| +\end{macrodef} +The token variable \macro{\l_jsonparse_debug_mode_bool} holds the boolean value true if the package is loaded with the \macro{debug} option and false otherwise. If set to true, the debug mode will be used for the following use of \macro{\jsonparse_parse:n}. + +\begin{macrodef} +|\l_jsonparse_child_sep_str| +|\l_jsonparse_array_sep_left_str| +|\l_jsonparse_array_sep_right_str| +|\l_jsonparse_true_str| +|\l_jsonparse_false_str| +|\l_jsonparse_null_str| +|\l_jsonparse_array_index_zero_based_bool| +\end{macrodef} +The token variable \macro{\l_jsonparse_child_sep_str} holds the string \macro{.} per default or the string set by the user command \macro{\JSONParseSetChildSeparator}. + +The token variable \macro{\l_jsonparse_array_sep_left_str} holds the string \macro{[} per default or the string given as first argument to the user command \macro{\JSONParseSetArraySeparator}. + +The token variable \macro{\l_jsonparse_array_sep_right_str} holds the string \macro{]} per default or the string given as second argument to the user command \macro{\JSONParseSetArraySeparator}. + +The token variable \macro{\l_jsonparse_true_str} holds the string \macro{true} per default or the string set by the user command \macro{\JSONParseSetTrueString}. + +{\sloppy The token variable \macro{\l_jsonparse_false_str} holds the string \macro{false} per default or the string set by the user command \macro{\JSONParseSetFalseString}. \par} + +The token variable \macro{\l_jsonparse_null_str} holds the string \macro{null} per default or the string set by the user command \macro{\JSONParseSetNullString}. + +The token variable \macro{\l_jsonparse_array_index_zero_based_bool} holds a boolean value which is \macro{true} per default or if the user command \macro{\JSONParseSetArrayIndexZeroBased} was called. The boolean value is \macro{false} if the user command \macro{\JSONParseSetArrayIndexOneBased} was called. + +\begin{macrodef} +|\g_jsonparse_entries_prop| +\end{macrodef} +The token variable (property list) \macro{\g_jsonparse_entries_prop} holds key-value pairs representing all elements of a JSON data structure generated by a previous run of \macro{\jsonparse_parse:n}. + +\begin{macrodef} +|\jsonparse_parse:n| {<JSON string>} +\end{macrodef} +The command \macro{\jsonparse_parse:n} takes as argument a JSON string and populates the token variable (property list) \macro{\g_jsonparse_entries_prop} with key-value pairs representing all elements of the JSON data structure represented by this string. + +\begin{macrodef} +|\jsonparse_parse_to_prop:Nn| <token variable> {<JSON string>} +\end{macrodef} +The command \macro{\jsonparse_parse_to_prop:Nn} creates the token variable given as the first arguments as property list and, after having called \macro{\jsonparse_parse:n} using the second argument, sets this newly created property list equal to \macro{\g_jsonparse_entries_prop}. + +% ===== + +\printchanges + +\end{document} + +%% End of file `jsonparse-doc.tex`. diff --git a/macros/latex/contrib/jsonparse/jsonparse.sty b/macros/latex/contrib/jsonparse/jsonparse.sty new file mode 100644 index 0000000000..64ce2e2193 --- /dev/null +++ b/macros/latex/contrib/jsonparse/jsonparse.sty @@ -0,0 +1,485 @@ +% File: jsonparse.sty +% Copyright 2024 Jasper Habicht (mail@jasperhabicht.de). +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License version 1.3c, +% available at http://www.latex-project.org/lppl/. +% +% This file is part of the `jsonparse' package (The Work in LPPL) +% and all files in that bundle must be distributed together. +% +% This work has the LPPL maintenance status `author-maintained'. +% +\ProvidesExplPackage {jsonparse} {2024-04-09} {0.5.5} + {JSON Parse} + +\bool_new:N \l_jsonparse_debug_mode_bool +\keys_define:nn { jsonparse } { + debug .bool_set:N = \l_jsonparse_debug_mode_bool , + debug .default:n = { true } , +} +\ProcessKeyOptions [ jsonparse ] + +\msg_new:nnn { jsonparse } { parsing-error } { + \msg_warning_text:n { jsonparse } \iow_newline: + Could ~ not ~ parse ~ JSON. \iow_newline: + Parsing ~ error ~ at ~ key ~ `#1` ~ with ~ value ~ `#2`. +} + +\msg_new:nnn { jsonparse } { debug-info } { + #1 +} + +% === + +\str_new:N \l_jsonparse_child_sep_str +\str_set:Nn \l_jsonparse_child_sep_str { . } +\str_new:N \l_jsonparse_array_sep_left_str +\str_set:Nn \l_jsonparse_array_sep_left_str { [ } +\str_new:N \l_jsonparse_array_sep_right_str +\str_set:Nn \l_jsonparse_array_sep_right_str { ] } +\str_new:N \l_jsonparse_true_str +\str_set:Nn \l_jsonparse_true_str { true } +\str_new:N \l_jsonparse_false_str +\str_set:Nn \l_jsonparse_false_str { false } +\str_new:N \l_jsonparse_null_str +\str_set:Nn \l_jsonparse_null_str { null } + +\bool_new:N \l_jsonparse_array_index_zero_based_bool +\bool_set_true:N \l_jsonparse_array_index_zero_based_bool + +\NewDocumentCommand { \JSONParseSetChildSeparator } { m } { + \str_set:Nn \l_jsonparse_child_sep_str { #1 } +} + +\NewDocumentCommand { \JSONParseSetArraySeparator } { m m } { + \str_set:Nn \l_jsonparse_array_sep_left_str { #1 } + \str_set:Nn \l_jsonparse_array_sep_right_str { #2 } +} + +\NewDocumentCommand { \JSONParseSetTrueString } { m } { + \str_set:Nn \l_jsonparse_true_str { #1 } +} + +\NewDocumentCommand { \JSONParseSetFalseString } { m } { + \str_set:Nn \l_jsonparse_false_str { #1 } +} + +\NewDocumentCommand { \JSONParseSetNullString } { m } { + \str_set:Nn \l_jsonparse_null_str { #1 } +} + +\NewDocumentCommand { \JSONParseSetArrayIndexZeroBased } { } { + \bool_set_true:N \l_jsonparse_array_index_zero_based_bool +} + +\NewDocumentCommand { \JSONParseSetArrayIndexOneBased } { } { + \bool_set_false:N \l_jsonparse_array_index_zero_based_bool +} + +% === + +\cs_generate_variant:Nn \tl_range:nnn { nne , nen } +\cs_generate_variant:Nn \tl_range:Nnn { Nne , Nen } +\cs_generate_variant:Nn \tl_remove_once:Nn { Ne } +\cs_generate_variant:Nn \tl_set:Nn { Ne } +\cs_generate_variant:Nn \str_count:n { e } +\cs_generate_variant:Nn \str_head_ignore_spaces:n { e } +\cs_generate_variant:Nn \str_set:Nn { Ne } +\cs_generate_variant:Nn \prop_gput:Nnn { Nee } +\cs_generate_variant:Nn \seq_use:Nn { Ne } +\cs_generate_variant:Nn \msg_log:nnn { nno } + +\prg_generate_conditional_variant:Nnn \tl_if_head_is_group:n { e } { TF } +\prg_generate_conditional_variant:Nnn \str_case:nn { en } { F } +\prg_generate_conditional_variant:Nnn \str_case_e:nn { en } { F } +\prg_generate_conditional_variant:Nnn \str_if_eq:nn { ee } { T } +\prg_generate_conditional_variant:Nnn \str_if_eq:nn { en } { T , TF } + +\prop_new:N \g_jsonparse_entries_prop +\prop_new:N \l__jsonparse_temp_prop + +\tl_new:N \l__jsonparse_json_tl +\tl_new:N \l__jsonparse_input_tl +\tl_new:N \l__jsonparse_temp_tl +\tl_new:N \l__jsonparse_prefix_tl +\tl_new:N \l__jsonparse_key_tl +\tl_new:N \l__jsonparse_val_tl +\tl_new:N \l__jsonparse_object_array_key_tl +\tl_new:N \l__jsonparse_object_array_val_tl +\tl_new:N \l__jsonparse_array_prefix_tl +\tl_new:N \l__jsonparse_remainder_tl + +\int_new:N \l__jsonparse_array_index_int +\int_new:N \l__jsonparse_array_count_int +\int_new:N \l__jsonparse_array_count_last_int + +\bool_new:N \l__prop_map_first_bool + +\ior_new:N \l__jsonparse_json_ior + +% === + +\cs_new:Npn \jsonparse_parse_to_prop:Nn #1#2 { + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + \iow_newline: + Parsing ~ JSON ~ ... + } + } + \prop_gclear:N \g_jsonparse_entries_prop + \group_begin: + \tl_set_eq:NN \par \c_space_tl + \jsonparse_parse:n {#2} + \group_end: + \prop_set_eq:NN #1 \g_jsonparse_entries_prop + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + JSON ~ parsing ~ done. \iow_newline: + } + } +} + +\cs_new:Npn \jsonparse_parse:n #1 { + \tl_set:Ne \l__jsonparse_input_tl { \tl_trim_spaces:n {#1} } + \tl_if_head_is_group:eTF { \l__jsonparse_input_tl } { + \exp_last_unbraced:Ne + \__jsonparse_parse_object:w \l__jsonparse_input_tl \q_stop + } { + \str_case_e:enF { \str_head_ignore_spaces:e { \l__jsonparse_input_tl } } { + { [ } { + \exp_last_unbraced:Ne + \__jsonparse_parse_array_begin:w \l__jsonparse_input_tl \q_stop + } + { ] } { + \exp_last_unbraced:Ne + \__jsonparse_parse_array_end:w \l__jsonparse_input_tl \q_stop + } + { " } { + \exp_last_unbraced:Ne + \__jsonparse_parse_string_key:w \l__jsonparse_input_tl \q_stop + } + } { + % other + \exp_last_unbraced:Ne + \__jsonparse_parse_other:w \l__jsonparse_input_tl \q_stop + } + } +} + +% === + +\cs_new:Npn \__jsonparse_parse_object:w #1#2 \q_stop { + \__jsonparse_array_key_set: + \tl_set:Ne \l__jsonparse_remainder_tl {#2} + \group_begin: + % object begin + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (obj ~ begin) + } + } + \tl_if_empty:NTF \l__jsonparse_key_tl { + \tl_set:Ne \l__jsonparse_object_array_key_tl { \l_jsonparse_child_sep_str } + } { + \tl_set:Ne \l__jsonparse_object_array_key_tl { \l__jsonparse_key_tl } + \tl_set:Ne \l__jsonparse_prefix_tl { \l__jsonparse_key_tl \l_jsonparse_child_sep_str } + \tl_set:Ne \l__jsonparse_val_tl {#1} + } + \tl_set:Ne \l__jsonparse_object_array_val_tl { { #1 } } + \exp_args:Ne \jsonparse_parse:n {#1} + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_object_array_key_tl } { \l__jsonparse_object_array_val_tl } + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_object_array_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (obj) ~ \str_use:N \l__jsonparse_object_array_val_tl + } + } + % object end + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (obj ~ end) + } + } + \group_end: + \__jsonparse_parse_remainder: +} + +\cs_new:Npn \__jsonparse_parse_array_begin:w [ #1 \q_stop { + \__jsonparse_array_key_set: + \group_begin: + \tl_set:Ne \l__jsonparse_remainder_tl {#1} + % array begin + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (arr ~ begin) + } + } + \int_zero:N \l__jsonparse_array_index_int + \bool_if:NT \l_jsonparse_array_index_zero_based_bool { + \int_decr:N \l__jsonparse_array_index_int + } + \tl_set:Ne \l__jsonparse_object_array_key_tl { \l__jsonparse_key_tl } + \tl_set:Nn \l__jsonparse_object_array_val_tl { [ #1 } + \tl_set:Ne \l__jsonparse_prefix_tl { \l__jsonparse_key_tl \l_jsonparse_array_sep_left_str } + \__jsonparse_parse_remainder: +} + +\cs_new:Npn \__jsonparse_parse_array_end:w ] #1 \q_stop { + \tl_set:Ne \l__jsonparse_object_array_val_tl { + \tl_range:Nne \l__jsonparse_object_array_val_tl { 1 } { + \int_eval:n { + -1 * \tl_count:e {#1} - 1 + } + } + } + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_object_array_key_tl } { \l__jsonparse_object_array_val_tl } + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_object_array_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (arr) ~ \str_use:N \l__jsonparse_object_array_val_tl + } + } + \group_end: + \tl_set:Ne \l__jsonparse_remainder_tl {#1} + % array end + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (arr ~ end) + } + } + \__jsonparse_parse_remainder: +} + +\cs_new:Npn \__jsonparse_array_key_set: { + \str_if_eq:eeT { \tl_item:Nn \l__jsonparse_prefix_tl { -1 } } + { \l_jsonparse_array_sep_left_str } { + \int_incr:N \l__jsonparse_array_index_int + \tl_set:Ne \l__jsonparse_key_tl { + \l__jsonparse_prefix_tl \int_use:N \l__jsonparse_array_index_int \l_jsonparse_array_sep_right_str + } + } +} + +\cs_new:Npn \__jsonparse_parse_string_key:w " #1 " #2 \q_stop { + \__jsonparse_array_key_set: + \tl_set:Ne \l__jsonparse_remainder_tl {#2} + % key or string? + \str_if_eq:enTF { \tl_head:n { #2 } } { : } { + \tl_remove_once:Ne \l__jsonparse_remainder_tl { \c_colon_str } + \tl_set:Ne \l__jsonparse_key_tl { \l__jsonparse_prefix_tl #1 } + } { + \tl_set:Ne \l__jsonparse_val_tl {#1} + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_key_tl } { \l__jsonparse_val_tl } + % string + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (str) ~ \str_use:N \l__jsonparse_val_tl + } + } + } + \__jsonparse_parse_remainder: +} + +\cs_new:Npn \__jsonparse_parse_other:w #1 \q_stop { + \__jsonparse_array_key_set: + \tl_set:Ne \l__jsonparse_remainder_tl {#1} + \tl_set:Ne \l__jsonparse_temp_tl { #1 , } + \tl_replace_once:Nnn \l__jsonparse_temp_tl { ] } { , } + \exp_last_unbraced:Ne + \__jsonparse_parse_other_aux:w \l__jsonparse_temp_tl \q_stop +} + +\cs_new:Npn \__jsonparse_parse_other_aux:w #1 , #2 \q_stop { + \tl_set:Ne \l__jsonparse_temp_tl {#1} + \str_case:enF { + \str_lowercase:f { \l__jsonparse_temp_tl } + } { + { true } { + \tl_set:Ne \l__jsonparse_val_tl { + \l_jsonparse_true_str + } + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_key_tl } { \l__jsonparse_val_tl } + % true + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (tru) ~ \str_use:N \l__jsonparse_val_tl + } + } + } + { false } { + \tl_set:Ne \l__jsonparse_val_tl { + \l_jsonparse_false_str + } + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_key_tl } { \l__jsonparse_val_tl } + % false + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (fal) ~ \str_use:N \l__jsonparse_val_tl + } + } + } + { null } { + \tl_set:Ne \l__jsonparse_val_tl { + \l_jsonparse_null_str + } + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_key_tl } { \l__jsonparse_val_tl } + % null + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (nul) ~ \str_use:N \l__jsonparse_val_tl + } + } + } + } { + \fp_compare:nNnTF {#1} ? { 0 } { + % nan + \msg_error:nnee { jsonparse } { parsing-error } + { \l__jsonparse_key_tl } {#1} + } { + \tl_set:Ne \l__jsonparse_val_tl {#1} + \prop_gput:Nee \g_jsonparse_entries_prop + { \l__jsonparse_key_tl } { \l__jsonparse_val_tl } + % number + \bool_if:NT \l_jsonparse_debug_mode_bool { + \msg_log:nne { jsonparse } { debug-info } { + (key) ~ \str_use:N \l__jsonparse_key_tl : \iow_newline: + \iow_char:N \ \iow_char:N \ (num) ~ \str_use:N \l__jsonparse_val_tl + } + } + } + } + \tl_set:Ne \l__jsonparse_remainder_tl { \tl_trim_spaces:V \l__jsonparse_remainder_tl } + \tl_set:Ne \l__jsonparse_remainder_tl { + \tl_range:Nen \l__jsonparse_remainder_tl { + \int_eval:n { + \tl_count:e { #1 } + 1 + } + } { -1 } + } + \__jsonparse_parse_remainder: +} + +\cs_new:Npn \__jsonparse_parse_remainder: { + \tl_set:Ne \l__jsonparse_remainder_tl { \tl_trim_spaces:V \l__jsonparse_remainder_tl } + \str_if_eq:enT { \tl_head:N \l__jsonparse_remainder_tl } { , } { + \tl_remove_once:Nn \l__jsonparse_remainder_tl { , } + } + \tl_if_empty:NF \l__jsonparse_remainder_tl { + \exp_args:Ne \jsonparse_parse:n { \l__jsonparse_remainder_tl } + } +} + +\cs_new:Npn \jsonparse_filter:Nn #1#2 { + \prop_map_inline:Nn #1 { + \str_case_e:en { + \tl_range:nne {##1} { 1 } { \int_eval:n { \tl_count:e {#2} + 1 } } + } { + { #2 \l_jsonparse_child_sep_str } { + \prop_put:Nee \l__jsonparse_temp_prop + { \tl_range:nen {##1} { \int_eval:n { \tl_count:e {#2} + 2 } } { -1 } } {##2} + } + { #2 \l_jsonparse_array_sep_left_str } { + \prop_put:Nee \l__jsonparse_temp_prop + { \tl_range:nen {##1} { \int_eval:n { \tl_count:e {#2} + 1 } } { -1 } } {##2} + } + } + } + \prop_set_eq:NN #1 \l__jsonparse_temp_prop +} + +% === + +\NewExpandableDocumentCommand { \JSONParse } { m +m } { + \prop_new:N #1 + \jsonparse_parse_to_prop:Nn #1 {#2} +} + +\NewExpandableDocumentCommand { \JSONParseFromFile } { m m } { + \ior_open:Nn \l__jsonparse_json_ior {#2} + + \tl_clear:N \l__jsonparse_json_tl + \ior_map_inline:Nn \l__jsonparse_json_ior { + \tl_put_right:Nn \l__jsonparse_json_tl {##1} + } + + \ior_close:N \l__jsonparse_json_ior + + \prop_new:N #1 + \jsonparse_parse_to_prop:Nn #1 { \l__jsonparse_json_tl } +} + +\NewExpandableDocumentCommand { \JSONParseGetValue } { m m } { + \prop_item:Nn #1 {#2} +} + +\NewExpandableDocumentCommand { \JSONParseGetArrayValues } { m m O{} m } { + \group_begin: + \jsonparse_filter:Nn #1 {#2} + \bool_set_true:N \l__prop_map_first_bool + \prop_map_inline:Nn #1 { + \str_if_eq:enT { + \tl_range:nen {##1} { \int_eval:n { -1 * \tl_count:n {#3} } } { -1 } + } {#3} { + \bool_if:NTF \l__prop_map_first_bool { + \bool_set_false:N \l__prop_map_first_bool + } { + #4 + } + ##2 + } + } + \group_end: +} + +\cs_new:Npn \__jsonparse_get_array_index_aux:w [ #1 ] #2 \q_stop { + #1 +} + +\NewExpandableDocumentCommand { \JSONParseGetArrayCount } { m m } { + \group_begin: + \jsonparse_filter:Nn #1 {#2} + \int_zero:N \l__jsonparse_array_count_int + \int_set:Nn \l__jsonparse_array_count_last_int { -1 } + \prop_map_inline:Nn #1 { + \int_compare:nNnF { + \__jsonparse_get_array_index_aux:w ##1 \q_stop + } = { \l__jsonparse_array_count_last_int } { + \int_incr:N \l__jsonparse_array_count_int + } + \int_set:Nn \l__jsonparse_array_count_last_int { + \__jsonparse_get_array_index_aux:w ##1 \q_stop + } + } + \int_use:N \l__jsonparse_array_count_int + \group_end: +} + +\NewExpandableDocumentCommand { \JSONParseUseArrayValues } { m m O{} m } { + \group_begin: + \jsonparse_filter:Nn #1 {#2} + \prop_map_inline:Nn #1 { + \str_if_eq:enT { + \tl_range:nen {##1} { \int_eval:n { -1 * \tl_count:n {#3} } } { -1 } + } {#3} { + \int_incr:N \l__jsonparse_array_index_int + \tl_set:Ne \JSONParseArrayIndex { \__jsonparse_get_array_index_aux:w ##1 \q_stop } + \tl_set:Ne \JSONParseArrayKey { ##1 } + \tl_set:Ne \JSONParseArrayValue { \prop_item:Nn #1 {##1} } + \use:c {#4} + } + } + \group_end: +} + +% EOF |