Skip to content

Commit 3575d92

Browse files
committed
Multiple definition indices
1 parent 297ace9 commit 3575d92

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Make Documentation Indices" type="ShConfigurationType">
3+
<option name="SCRIPT_TEXT" value="cd build/docs; for file in *.idx; do; _=$(makeindex $file); done;" />
4+
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
5+
<option name="SCRIPT_PATH" value="" />
6+
<option name="SCRIPT_OPTIONS" value="" />
7+
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
8+
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/" />
9+
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
10+
<option name="INTERPRETER_PATH" value="/bin/zsh" />
11+
<option name="INTERPRETER_OPTIONS" value="" />
12+
<option name="EXECUTE_IN_TERMINAL" value="false" />
13+
<option name="EXECUTE_SCRIPT_FILE" value="false" />
14+
<envs />
15+
<method v="2" />
16+
</configuration>
17+
</component>

docs/elite-docs-en.tex

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
\author{Christian Schliz \& Julian Keck}
1919
\date{\today}
2020

21+
\makeindex[name=alternative, title=Alternative]
22+
\newcommand{\altindex}{alternative}
23+
2124
\begin{document}
2225

2326
\maketitle
@@ -83,7 +86,8 @@ \section{Elite Definitions}
8386

8487
\definition{Definition}{%
8588
A definition is created with the command \texttt{\textbackslash{}definition\{\textit{name}\}\{\textit{content}\}}.
86-
All styles are based on \texttt{\textbackslash{}abstractDefinition}
89+
All styles are based on \texttt{\textbackslash{}abstractDefinition}. All definitions have one optional argument:
90+
Specify 1 or 0 for bottom spacing or nothing respectively (default is 1: bottom spacing)
8791
}
8892

8993
\defwarn{Warnung}{%
@@ -98,6 +102,16 @@ \section{Elite Definitions}
98102
is created by \texttt{\textbackslash{}defhint\{\textit{Hinweis}\}\{\textit{content}\}}
99103
}
100104

105+
\defindex[1]{\altindex}{Different Index}{
106+
Definitions can be grouped into different indices.\hfill\break
107+
Use \texttt{\textbackslash{}defindex\{\textit{indexname}\}\{\textit{name}\}\{\textit{content}\}}
108+
}
109+
110+
\defproblem{Paragraphs and Emergency Stops}{You cannot end a paragraph regularly from inside a definition.
111+
This is happening due to the use of parboxes. In order to insert a line break, use double-backslash or
112+
preferably \code{\textbackslash{}break}. It is worth mentioning that two line breaks in the source code
113+
have the same effect as inserting a paragraph manually. You will need to avoid this!}
114+
101115
\newpage
102116

103117
\section{Include Graphics and Figures}
@@ -243,7 +257,8 @@ \subsection{language=riscv}
243257
\end{CodeListing}
244258
\endcode
245259

246-
\printindices
260+
% \printindices
261+
\printindex[definition]
247262

248263
\defwarn{Please Note}{that the index might split a definition over two columns. This can be avoided by inserting
249264
a \code{\textbackslash{}filbreak} at the top of the index element definition. Since this has some side effects if
@@ -252,4 +267,6 @@ \subsection{language=riscv}
252267
\lstlistoflistings
253268
\listoffigures
254269

270+
\printindex[\altindex]
271+
255272
\end{document}

src/elite-definitions.sty

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
% 3: Color
1313
% 4: Title
1414
% 5: Content
15-
\newcommand{\abstractDefinition}[5]{
15+
\providecommand{\abstractDefinition}[5]{
1616
\noindent
1717
\parbox[t]{\linewidth}{
1818
#2{ } %$\:$
@@ -26,7 +26,7 @@
2626
\par % End the line
2727
}
2828

29-
\newcommand{\definition}[3][1]{
29+
\providecommand{\definition}[3][1]{
3030
\abstractDefinition{#1}{\faArchive}{kit-blue}{#2}{#3}
3131
% Stichwortverzeichnis am Ende erzeugen.
3232
\index[definition]{
@@ -37,11 +37,22 @@
3737
}
3838
}
3939

40-
\newcommand{\defwarn}[3][1]{
40+
\providecommand{\defindex}[4][1]{
41+
\abstractDefinition{#1}{\faArchive}{kit-blue}{#3}{#4}
42+
% Stichwortverzeichnis am Ende erzeugen.
43+
\index[#2]{
44+
\vspace{0.2cm}
45+
\hspace*{-0.5cm}
46+
\underline{\textsc{#3}}\\
47+
#4
48+
}
49+
}
50+
51+
\providecommand{\defwarn}[3][1]{
4152
\abstractDefinition{#1}{\textcolor{kit-orange}{\faExclamationTriangle}}{kit-orange}{#2}{#3}
4253
}
4354

44-
\newcommand{\defproblem}[3][1]{
55+
\providecommand{\defproblem}[3][1]{
4556
\abstractDefinition{#1}{\textcolor{kit-red}{\faExclamationCircle}}{kit-red}{#2}{#3}
4657
}
4758

src/elite.cls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
\RequirePackage{booktabs} % prettier tables
4343
\RequirePackage{csquotes} % \enquote command
4444
\RequirePackage{environ} % better environments
45+
\RequirePackage{xparse} % better commands
4546

4647
% Math packages and symbols
4748
\RequirePackage{amsmath}

0 commit comments

Comments
 (0)