summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/yamlvars/yamlvars.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-03-16 03:01:05 +0000
committerNorbert Preining <norbert@preining.info>2022-03-16 03:01:05 +0000
commit725ce6a3e602c7516d471df841ea433b8c5bcd9d (patch)
tree6cc54f5bd90984b9b63976a0386ae2681a08b7cb /macros/luatex/latex/yamlvars/yamlvars.tex
parentd6f947fa36ed3b76d36a8dfad4e9247319b4d622 (diff)
CTAN sync 202203160301
Diffstat (limited to 'macros/luatex/latex/yamlvars/yamlvars.tex')
-rw-r--r--macros/luatex/latex/yamlvars/yamlvars.tex23
1 files changed, 22 insertions, 1 deletions
diff --git a/macros/luatex/latex/yamlvars/yamlvars.tex b/macros/luatex/latex/yamlvars/yamlvars.tex
index 1c412c2f6d..344185dd5f 100644
--- a/macros/luatex/latex/yamlvars/yamlvars.tex
+++ b/macros/luatex/latex/yamlvars/yamlvars.tex
@@ -1,5 +1,5 @@
% Kale Ewasiuk (kalekje@gmail.com)
-% 2022-03-03
+% 2022-03-15
% Copyright (C) 2021-2022 Kale Ewasiuk
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -147,6 +147,16 @@ If the token is available, it is set to a package error, so that if the variable
tell the user they forgot to set it.
This will be overwritten when you parse the variables and assign a value to it.
+\paragraph{If you want a case-insensitive variable} In the declaration YAML document,
+add a \cmd{lowcasevar: true} under the variable name.
+This will make the variable name lowercase before any transforms or processing is done.
+For example, if you have \cmd{title} as a YAML variable to set
+the \cmd{prc} function \cmd{setdocvar}, a user could write
+\cmd{Title} in the parsing file and still have it work.
+You can toggle this behaviour globally with
+the commands \cmd{\lowercasevarYVon} and \cmd{\lowercasevarYVoff}
+See the last example below.
+
You can change the default \texttt{xfm}, \texttt{prc}, or \texttt{dft} by changing
the value (in Lua): \texttt{YAMLvars.xfmDefault = ''} etc.
@@ -164,6 +174,17 @@ Revisions:
xfm: [sortZA, list2tab]
Rhead:
prc: setRightHead
+
+
+author:
+ xfm: list2and # (joins a list with \and (or lets a single string be passed)
+ prc: setdocvar # calls \author{val}
+ lowcasevar: true # allows user to use Title: or TITLE:
+
+title:
+ xfm: lb2nl # (make line-breaks \\)
+ prc: setdocvar # calls \title{val}
+ lowcasevar: true # allows user to use Title: or TITLE:
\end{declareYAMLvars}
\end{verbatim}