summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/lualatex/ideavault/ideavault-doc.tex
blob: 7bba38fc449e0c8a15c0476df468c3b182c90c37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
\documentclass[11pt]{article}
\usepackage{ideavault}
\author{Tomasz M. Czarkowski}
\title{Idea Vault}

\begin{document}
\maketitle

\section{Why}
\par Assume, You are writing something large. For example, like me, a TT RPG system.
\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}
\par For really complicated projects, You may want to classify some ideas using tags, or make them depend on each other.
\par This is what the Idea Vault is used for.

\section{Dependencies}
\par Idea Vault requires some packages (most of them for styling the printed idea).
\begin{itemize}
\item \texttt{bookmark}
\item \texttt{xargs}
\item \texttt{luacode}
\item \texttt{xpatch}
\item \texttt{mdframed}
\item \texttt{needspace}
\end{itemize}

\section{Usage}
\par For idea creation there is \texttt{\textbackslash{}createIdea}, while for printing them there are a few more:
\begin{itemize}
\item \texttt{\textbackslash{}printIdea} -- prints one idea
\item \texttt{\textbackslash{}printAllWithPrefix} -- prints all ideas in given prefix
\item \texttt{\textbackslash{}printAllWithTag} -- prints all ideas in given prefix that have given tag
\end{itemize}

\subsection{\textbackslash{}createIdea}
\begin{verbatim}
\printIdea[prefix]{name}{content}[dependencies][tags][weight]
\end{verbatim}
\begin{itemize}
\item \texttt{prefix}: prefix to locate the idea in. By default, equals to \texttt{default}.
\item \texttt{name}: name of the idea. If such name exists in prefix, it will be overwritten
\item \texttt{content}: valid LaTeX code for the content of idea. It will be evaluated at invocation time.
\item \texttt{dependencies}: each dependency is Lua pair of strings, multiple dependencies are separated with comma.
\item \texttt{tags}: each tag is Lua string, multiple tags are separated with comma.
\item \texttt{weight}: a number used for sorting ideas when multiple are printed at the same time. By default, equal to \texttt{-1}.
\end{itemize}
\par Note: due to some strange problems on LaTeX/Lua connection, for ideas with exactly one dependency, the \{\} needs to be duplicated, while for multi dependency there is no need.
\par Example:
\begin{verbatim}
\createIdea[somePrefix]{Not So Great Idea}{
\par Boring content
}[]["tag2"][1]

\createIdea[somePrefix]{Great Idea}{
 \par Long content
 \par Very Interesting
}[{{"somePrefix", "Not So Great Idea"}}]["tag1"][13]
\end{verbatim}

\subsection{\textbackslash{}printIdea}
\begin{verbatim}
\printIdea[prefix][style]{name}
\end{verbatim}

\begin{itemize}
\item \texttt{prefix}: prefix to locate the idea in. By default, equals to \texttt{default}.
\item \texttt{style}: style for printing the idea. For options, see later.
\item \texttt{name}: name of the idea.
\end{itemize}

\par Example:
\begin{verbatim}
\printIdea[somePrefix][lcbf]{Great Idea}
\end{verbatim}

\subsection{\textbackslash{}printAllWithPrefix}
\begin{verbatim}
\printIdea[prefix][style]
\end{verbatim}

\begin{itemize}
\item \texttt{prefix}: prefix to print.
\item \texttt{style}: style for printing the idea. For options, see later.
\end{itemize}

\par Example:
\begin{verbatim}
\printIdeaAllWithPrefix[somePrefix][lcbf]
\end{verbatim}

\subsection{\textbackslash{}printAllWithTag}
\begin{verbatim}
\printIdea[prefix][style]{tag}
\end{verbatim}

\begin{itemize}
\item \texttt{prefix}: prefix to locate the ideas in.
\item \texttt{style}: style for printing the idea. For options, see later.
\item \texttt{tag}: tag to print
\end{itemize}

\par Example:
\begin{verbatim}
\printIdeaAllWithTag[somePrefix][lcbf]{tag1}
\end{verbatim}

\section{Style}
\par Printing style is decided by one letter flags.
\begin{itemize}
\item \texttt{f}: Frame whole idea
\item \texttt{c}: Center whole idea
\item \texttt{b}: Create bookmark leading to the idea
\item \texttt{l}: Use large font for the name
\item \texttt{s}: Reserve some space using needspace to avoid awkward pagebreaks
\item \texttt{e}: emph the name
\item \texttt{q}: do not print the name
\end{itemize}

\section{Example}
\subsection{Code}
\begin{verbatim}
\createIdea[somePrefix]{Not So Great Idea}{
\par Boring content
}[]["tag2"][1]

\createIdea[somePrefix]{Great Idea}{
\par Long content
\par Very Interesting
}[{{"somePrefix", "Not So Great Idea"}}]["tag1"][13]

\createIdea[somePrefix2]{Third Idea}{
\par Third try is even longer
\par But not very
\par Only 3 lines
}[{"somePrefix", "Not So Great Idea"}, {"somePrefix", "Great Idea"}][][21]

\par Here is a Great Idea:
\printIdea[somePrefix][lcf]{Great Idea}
\vspace{1em}
\par Here are all ideas in prefix \texttt{somePrefix}:
\printAllWithPrefix[somePrefix][lcf]
\vspace{1em}
\par Here are all ideas in prefix \texttt{somePrefix} with tag \texttt{tag1}:
\printAllWithTag[somePrefix][lcf]{tag1}
\vspace{1em}
\par And here is Third Idea, presenting nested dependencies:
\printIdea[somePrefix2][lcf]{Third Idea}

\end{verbatim}
\subsection{Result}

\createIdea[somePrefix]{Not So Great Idea}{
\par Boring content
}[]["tag2"][1]

\createIdea[somePrefix]{Great Idea}{
\par Long content
\par Very Interesting
}[{{"somePrefix", "Not So Great Idea"}}]["tag1"][13]

\createIdea[somePrefix2]{Third Idea}{
\par Third try is even longer
\par But not very
\par Only 3 lines
}[{"somePrefix", "Not So Great Idea"}, {"somePrefix", "Great Idea"}][][21]

\par Here is a Great Idea:
\printIdea[somePrefix][lcf]{Great Idea}
\vspace{1em}
\par Here are all ideas in prefix \texttt{somePrefix}:
\printAllWithPrefix[somePrefix][lcf]
\vspace{1em}
\par Here are all ideas in prefix \texttt{somePrefix} with tag \texttt{tag1}:
\printAllWithTag[somePrefix][lcf]{tag1}
\vspace{1em}
\par And here is Third Idea, presenting nested dependencies:
\printIdea[somePrefix2][lcf]{Third Idea}

\end{document}