Debian Codegraph @

texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex

raw
1 \documentclass[11pt]{article}
2 \usepackage{ideavault}
3 \author{Tomasz M. Czarkowski}
4 \title{Idea Vault}
5
6 \begin{document}
7 \maketitle
8
9 \section{Why}
10 \par Assume, You are writing something large. For example, like me, a TT RPG system.
11 \par Often You will find Yourself wanting to declare some concept (idea, if You indulge me) and later print it all over the place, without needing to copy and paste \textbf{it}
12 \par For really complicated projects, You may want to classify some ideas using tags, or make them depend on each other.
13 \par This is what the Idea Vault is used for.
14
15 \section{Dependencies}
16 \par Lua\LaTeX --- this is Lua\LaTeX package and will not work without Lua.
17 \par Additionally, Idea Vault requires some packages (most of them for styling the printed idea).
18 \begin{itemize}
19 \item \texttt{bookmark}
20 \item \texttt{xargs}
21 \item \texttt{luacode}
22 \item \texttt{xpatch}
23 \item \texttt{mdframed}
24 \item \texttt{needspace}
25 \end{itemize}
26
27 \section{Usage}
28 \par For idea creation there is \texttt{\textbackslash{}createIdea}, while for printing them there are a few more:
29 \begin{itemize}
30 \item \texttt{\textbackslash{}printIdea} -- prints one idea
31 \item \texttt{\textbackslash{}printAllWithPrefix} -- prints all ideas in given prefix
32 \item \texttt{\textbackslash{}printAllWithTag} -- prints all ideas in given prefix that have given tag
33 \end{itemize}
34
35 \subsection{\textbackslash{}createIdea}
36 \begin{verbatim}
37 \createIdea[prefix]{name}{content}[dependencies][tags][weight]
38 \end{verbatim}
39 \begin{itemize}
40 \item \texttt{prefix}: prefix to locate the idea in. By default, equals to \texttt{default}.
41 \item \texttt{name}: name of the idea. If such name exists in prefix, it will be overwritten
42 \item \texttt{content}: valid LaTeX code for the content of idea. It will be evaluated at invocation time.
43 \item \texttt{dependencies}: each dependency is Lua pair of strings, multiple dependencies are separated with comma.
44 \item \texttt{tags}: each tag is Lua string, multiple tags are separated with comma.
45 \item \texttt{weight}: a number used for sorting ideas when multiple are printed at the same time. By default, equal to \texttt{-1}. Special value of "auto" makes it number weight sequentially, starting from 1 and growing by 1 per step --- it's useful mostly for preserving order of ideas on mass printing.
46 \end{itemize}
47 \par Note: due to how \texttt{xkeyval} treats \{\}, for ideas with exactly one dependency, You need to add one space after the dependency, while for multi dependency there is no need.
48 \par Example:
49 \begin{verbatim}
50 \createIdea[somePrefix]{Not So Great Idea}{
51 \par Boring content
52 }[]["tag2"][1]
53
54 \createIdea[somePrefix]{Great Idea}{
55 \par Long content
56 \par Very Interesting
57 }[{"somePrefix", "Not So Great Idea"} ]["tag1"][13]
58 \end{verbatim}
59
60 \subsection{\textbackslash{}printIdea}
61 \begin{verbatim}
62 \printIdea[prefix][style]{name}
63 \end{verbatim}
64
65 \begin{itemize}
66 \item \texttt{prefix}: prefix to locate the idea in. By default, equals to \texttt{default}.
67 \item \texttt{style}: style for printing the idea. For options, see later.
68 \item \texttt{name}: name of the idea.
69 \end{itemize}
70
71 \par Example:
72 \begin{verbatim}
73 \printIdea[somePrefix][lcbf]{Great Idea}
74 \end{verbatim}
75
76 \subsection{\textbackslash{}printAllWithPrefix}
77 \begin{verbatim}
78 \printIdea[prefix][style]
79 \end{verbatim}
80
81 \begin{itemize}
82 \item \texttt{prefix}: prefix to print.
83 \item \texttt{style}: style for printing the idea. For options, see later.
84 \end{itemize}
85
86 \par Example:
87 \begin{verbatim}
88 \printAllWithPrefix[somePrefix][lcbf]
89 \end{verbatim}
90
91 \subsection{\textbackslash{}printAllWithTag}
92 \begin{verbatim}
93 \printIdea[prefix][style]{tag}
94 \end{verbatim}
95
96 \begin{itemize}
97 \item \texttt{prefix}: prefix to locate the ideas in.
98 \item \texttt{style}: style for printing the idea. For options, see later.
99 \item \texttt{tag}: tag to print
100 \end{itemize}
101
102 \par Example:
103 \begin{verbatim}
104 \printAllWithTag[somePrefix][lcbf]{tag1}
105 \end{verbatim}
106
107 \section{Style}
108 \par Printing style is decided by one letter flags.
109 \begin{itemize}
110 \item \texttt{f}: Frame whole idea
111 \item \texttt{c}: Center whole idea
112 \item \texttt{b}: Create bookmark leading to the idea
113 \item \texttt{l}: Use Large font for the name
114 \item \texttt{L}: Use LARGE font for the name
115 \item \texttt{h}: Use huge font for the name
116 \item \texttt{H}: Use Huge font for the name
117 \item \texttt{s}: Reserve some space using needspace to avoid awkward pagebreaks
118 \item \texttt{e}: emph the name
119 \item \texttt{q}: Do not print the name
120 \item \texttt{p}: New page before printing the idea (useful when doing serial printing, for example via \texttt{printAllWithTag})
121 \item \texttt{P}: New page after printing the idea (useful when doing serial printing, for example via \texttt{printAllWithTag})
122 \end{itemize}
123
124 \section{Debugging}
125 \par By default, this package avoids spamming too much to stdout, but sometimes it would be useful to see what idea creation/printing is triggering some problems.
126 \subsection{\textbackslash{}debugEnable}
127 \begin{verbatim}
128 \debugEnable
129 \end{verbatim}
130 \par Enables debug output --- remember, it may be quite overwhelming if there are a lot of ideas.
131 \subsection{\textbackslash{}debugDisable}
132 \begin{verbatim}
133 \debugDisable
134 \end{verbatim}
135 \par Disables debug output. Debug output is disabled by default, so it's only use is to revert the effect of enabling it.
136
137 \section{Example}
138 \par This is short example of code, and it's result. Extended example can be found in file \texttt{example.tex}.
139 \subsection{Code}
140 \begin{verbatim}
141 \createIdea[somePrefix]{Not So Great Idea}{
142 \par Boring content
143 }[]["tag2"][1]
144
145 \createIdea[somePrefix]{Great Idea}{
146 \par Long content
147 \par Very Interesting
148 }[{"somePrefix", "Not So Great Idea"} ]["tag1"][13]
149
150 \createIdea[somePrefix2]{Third Idea}{
151 \par Third try is even longer
152 \par But not very
153 \par Only 3 lines
154 }[{"somePrefix", "Not So Great Idea"}, {"somePrefix", "Great Idea"}][][21]
155
156 \par Here is a Great Idea:
157 \printIdea[somePrefix][lcf]{Great Idea}
158 \vspace{1em}
159 \par Here are all ideas in prefix \texttt{somePrefix}:
160 \printAllWithPrefix[somePrefix][lcf]
161 \vspace{1em}
162 \par Here are all ideas in prefix \texttt{somePrefix} with tag \texttt{tag1}:
163 \printAllWithTag[somePrefix][lcf]{tag1}
164 \vspace{1em}
165 \par And here is Third Idea, presenting nested dependencies:
166 \printIdea[somePrefix2][lcf]{Third Idea}
167
168 \end{verbatim}
169 \subsection{Result}
170
171 \createIdea[somePrefix]{Not So Great Idea}{
172 \par Boring content
173 }[]["tag2"][1]
174
175 \createIdea[somePrefix]{Great Idea}{
176 \par Long content
177 \par Very Interesting
178 }[{"somePrefix", "Not So Great Idea"} ]["tag1"][13]
179
180 \createIdea[somePrefix2]{Third Idea}{
181 \par Third try is even longer
182 \par But not very
183 \par Only 3 lines
184 }[{"somePrefix", "Not So Great Idea"}, {"somePrefix", "Great Idea"}][][21]
185
186 \par Here is a Great Idea:
187 \printIdea[somePrefix][lcf]{Great Idea}
188 \vspace{1em}
189 \par Here are all ideas in prefix \texttt{somePrefix}:
190 \printAllWithPrefix[somePrefix][lcf]
191 \vspace{1em}
192 \par Here are all ideas in prefix \texttt{somePrefix} with tag \texttt{tag1}:
193 \printAllWithTag[somePrefix][lcf]{tag1}
194 \vspace{1em}
195 \par And here is Third Idea, presenting nested dependencies:
196 \printIdea[somePrefix2][lcf]{Third Idea}
197
198 \end{document}