diff options
Diffstat (limited to 'macros/luatex/latex/yamlvars/YAMLvars.tex')
-rw-r--r-- | macros/luatex/latex/yamlvars/YAMLvars.tex | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/macros/luatex/latex/yamlvars/YAMLvars.tex b/macros/luatex/latex/yamlvars/YAMLvars.tex index e97b325df3..38cc59dc48 100644 --- a/macros/luatex/latex/yamlvars/YAMLvars.tex +++ b/macros/luatex/latex/yamlvars/YAMLvars.tex @@ -1,6 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2021-09-24 -% +% 2021-11-07 % Copyright (C) 2021 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy @@ -24,16 +23,42 @@ % OR OTHER DEALINGS IN THE SOFTWARE. -\documentclass{article} +\documentclass[11pt,parskip=half]{scrartcl} +\setlength{\parindent}{0ex} +\newcommand{\llcmd}[1]{\leavevmode\llap{\texttt{\detokenize{#1}\ }}} +\newcommand{\cmd}[1]{\texttt{\detokenize{#1}}} +\newcommand{\qcmd}[1]{``\cmd{#1}''} \usepackage{url} +\usepackage{showexpl} +\lstset{explpreset={justification=\raggedright,pos=r,wide=true}} +\setlength\ResultBoxRule{0mm} +\lstset{ + language=[LaTeX]TeX, + basicstyle=\ttfamily\small, + commentstyle=\ttfamily\small\color{gray}, + frame=none, + numbers=left, + numberstyle=\ttfamily\small\color{gray}, + prebreak=\raisebox{0ex}[0ex][0ex]{\color{gray}\ensuremath{\hookleftarrow}}, + extendedchars=true, + breaklines=true, + tabsize=4, +} +\addtokomafont{title}{\raggedright} +\addtokomafont{author}{\raggedright} +\addtokomafont{date}{\raggedright} +\author{Kale Ewasiuk (\url{kalekje@gmail.com})} +\usepackage[yyyymmdd]{datetime}\renewcommand{\dateseparator}{--} +\date{\today} + + + \usepackage{YAMLvars} -\setlength{\parindent}{0ex} -\setlength{\parskip}{0.75em} +\title{YAMLvars} +\subtitle{a YAML variable parser for LuaLaTeX} \begin{document} - -{\noindent\huge\bfseries YAMLvars \LARGE -- a YAML variable parser for LuaLaTeX}\\ - 2021-09-24, Kale Ewasiuk, \url{kalekje@gmail.com} +\maketitle YAMLvars is a LuaLaTeX-based package to help make definitions or produce LaTeX code using a YAML file. This package might be useful for you if you want to batch create docummnts @@ -163,6 +188,14 @@ end YAMLvars.xfm['addmyfunction'] = myfunction \end{verbatim} +If you want to run some Lua code and write in your YAML file (weird idea, but maybe useful for one-off functions), +you can do so by specifying a transform function with an \texttt{=} in it to make a lambda function. +For example, a \texttt{xfm} equal to +``\texttt{= '---'..x..'---'}'' +would surround your YAML variable's value with em-dashes. +You can access the variable name with this lambda function with \texttt{v}. +If you want to just execute code (instead of settings \texttt{x = }, use \texttt{/}). + \section{prc -- Processing Functions} Like the transform functions, the processing function must accept \texttt{(var, val)}. Only one processing function is applied to the final (var, val) after the transforms are done. |