| 1 |
\subsection{Available Keys\label{sec:keys}} |
| 2 |
\begin{function}{\enverbsetup} |
| 3 |
\begin{syntax} |
| 4 |
\cs{enverbsetup} \marg{key=value} |
| 5 |
\end{syntax} |
| 6 |
This macro can be used to (locally) change the settings of \envlogo\ outside |
| 7 |
of the |\enverb| macro. |
| 8 |
\end{function} |
| 9 |
|
| 10 |
The available keys are: |
| 11 |
\begin{function}{ignore} |
| 12 |
\begin{syntax} |
| 13 |
ignore = \meta{int}\keydefault{\emph{unused}} |
| 14 |
\end{syntax} |
| 15 |
Set up the number of tokens to ignore at the start of each line. This is only |
| 16 |
applied after the matching |\end| was found, hence doesn't affect the |
| 17 |
|\end|-line. A line containing any non-whitespace tokens but in total |
| 18 |
fewer tokens (counting whitespace) than \meta{int} will lead to undefined |
| 19 |
behaviour.\par |
| 20 |
|ignore| and |auto-ignore| are mutually exclusive. |
| 21 |
\end{function} |
| 22 |
|
| 23 |
\begin{function}{auto-ignore} |
| 24 |
\begin{syntax} |
| 25 |
auto-ignore\keydefault{true} |
| 26 |
auto-ignore = \meta{bool} |
| 27 |
\end{syntax} |
| 28 |
If this is true (or no value is given) the number of leading tokens is |
| 29 |
determined by the number of leading tokens found in the line with the matching |
| 30 |
|\end|. This allows for nice nesting of indentation levels in your \LaTeX\ |
| 31 |
sources without affecting functionality. A line containing any non-whitespace |
| 32 |
tokens but in total fewer tokens (counting whitespace) than the leading tokens |
| 33 |
in the |\end|-line will lead to undefined behaviour.\par |
| 34 |
|ignore| and |auto-ignore| are mutually exclusive. |
| 35 |
\end{function} |
| 36 |
|
| 37 |
\begin{function}{more-ignore} |
| 38 |
\begin{syntax} |
| 39 |
more-ignore = \meta{int}\keydefault{2} |
| 40 |
\end{syntax} |
| 41 |
If |auto-ignore| is true this specifies how many tokens in addition to the |
| 42 |
number of leading tokens shall be ignored at the start of each line. This |
| 43 |
allows for even the contents of the |\enverb|-environment to be further |
| 44 |
indented than the |\begin| and |\end| statement. |
| 45 |
\end{function} |
| 46 |
|
| 47 |
\begin{function}{bol} |
| 48 |
\begin{syntax} |
| 49 |
bol = \meta{tokens}\keydefault{\emph{empty}} |
| 50 |
bol+ = \meta{tokens} |
| 51 |
+bol = \meta{tokens} |
| 52 |
\end{syntax} |
| 53 |
Defines which \meta{tokens} are placed at the \textbf{b}egin \textbf{o}f |
| 54 |
\textbf{l}ines. Your \meta{tokens} can be arbitrary contents and are placed as |
| 55 |
is (so can contain macros which work as you intend when using |
| 56 |
\cs{enverbBody}). Keep in mind that if you want to use this with |
| 57 |
\cs{enverbExecute} or \cs{enverbListing} your tokens should be rescanned to |
| 58 |
the same code after they got |\detokenize|d.\par |
| 59 |
The |bol+| variant adds your \meta{tokens} after the current contents of |
| 60 |
|bol|, while |+bol| adds them in front of the contents. |
| 61 |
\end{function} |
| 62 |
|
| 63 |
\begin{function}{eol} |
| 64 |
\begin{syntax} |
| 65 |
eol = \meta{tokens}\keydefault{\emph{\string^\string^M\textsubscript{12}}} |
| 66 |
eol+ = \meta{tokens} |
| 67 |
+eol = \meta{tokens} |
| 68 |
\end{syntax} |
| 69 |
Defines which \meta{tokens} are placed at the \textbf{e}nd \textbf{o}f |
| 70 |
\textbf{l}ines. Your \meta{tokens} can be arbitrary contents and are placed as |
| 71 |
is (so can contain macros which work as you intend when using |
| 72 |
\cs{enverbBody}). Keep in mind that if you want to use this with |
| 73 |
\cs{enverbExecute} or \cs{enverbListing} your tokens should be rescanned to |
| 74 |
the same code after they got |\detokenize|d.\par |
| 75 |
The |eol+| variant adds your \meta{tokens} after the current contents of |
| 76 |
|eol|, while |+eol| adds them in front of the contents. |
| 77 |
\end{function} |
| 78 |
|
| 79 |
\begin{function}{key-handler} |
| 80 |
\begin{syntax} |
| 81 |
key-handler = \meta{code}\keydefault{\emph{throw an error}} |
| 82 |
\end{syntax} |
| 83 |
If used any undefined keys encountered while parsing the mandatory and |
| 84 |
optional arguments of \cs{enverb} is parsed via \meta{code}. Inside your |
| 85 |
\meta{code} use |#1| to specify where to input the list of unknown keys. This |
| 86 |
can be used to specify additional keys to provide an interface to control your |
| 87 |
wrapping code. This includes the handling of any unknown keys encountered |
| 88 |
while parsing the mandatory \meta{key=value} argument of \cs{enverb}. |
| 89 |
\end{function} |
| 90 |
|
| 91 |
\begin{function}{key-set} |
| 92 |
\begin{syntax} |
| 93 |
key-set = \meta{set} |
| 94 |
\end{syntax} |
| 95 |
\envlogo\ uses \pkg{expkv} for its key-parsing. This key is a special form of |
| 96 |
|key-handler| defining a handler that parses the unknown keys as part of |
| 97 |
\meta{set} in \pkg{expkv} (so basically a shorthand for |
| 98 |
|key-handler = \ekvset{|\meta{set}|}{#1}|). |
| 99 |
\end{function} |
| 100 |
|
| 101 |
\begin{function}{oarg-not-enverb} |
| 102 |
\begin{syntax} |
| 103 |
oarg-not-enverb\keydefault{false} |
| 104 |
oarg-not-enverb = \meta{bool} |
| 105 |
\end{syntax} |
| 106 |
If this is true (or no value is given) the \meta{key=value} list in the |
| 107 |
optional argument to \cs{enverb} is not parsed as keys of \envlogo\ but only |
| 108 |
inside your defined |key-handler|. Obviously this key doesn't have any effect |
| 109 |
if only used as part of the optional argument of \cs{enverb}. |
| 110 |
\end{function} |
| 111 |
|