Skip to content

Commit

Permalink
Multiple definition indices
Browse files Browse the repository at this point in the history
  • Loading branch information
schliz committed Feb 6, 2022
1 parent 297ace9 commit 3575d92
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .run/Make Documentation Indices.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Make Documentation Indices" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="cd build/docs; for file in *.idx; do; _=$(makeindex $file); done;" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
21 changes: 19 additions & 2 deletions docs/elite-docs-en.tex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
\author{Christian Schliz \& Julian Keck}
\date{\today}

\makeindex[name=alternative, title=Alternative]
\newcommand{\altindex}{alternative}

\begin{document}

\maketitle
Expand Down Expand Up @@ -83,7 +86,8 @@ \section{Elite Definitions}

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

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

\defindex[1]{\altindex}{Different Index}{
Definitions can be grouped into different indices.\hfill\break
Use \texttt{\textbackslash{}defindex\{\textit{indexname}\}\{\textit{name}\}\{\textit{content}\}}
}

\defproblem{Paragraphs and Emergency Stops}{You cannot end a paragraph regularly from inside a definition.
This is happening due to the use of parboxes. In order to insert a line break, use double-backslash or
preferably \code{\textbackslash{}break}. It is worth mentioning that two line breaks in the source code
have the same effect as inserting a paragraph manually. You will need to avoid this!}

\newpage

\section{Include Graphics and Figures}
Expand Down Expand Up @@ -243,7 +257,8 @@ \subsection{language=riscv}
\end{CodeListing}
\endcode

\printindices
% \printindices
\printindex[definition]

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

\printindex[\altindex]

\end{document}
19 changes: 15 additions & 4 deletions src/elite-definitions.sty
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
% 3: Color
% 4: Title
% 5: Content
\newcommand{\abstractDefinition}[5]{
\providecommand{\abstractDefinition}[5]{
\noindent
\parbox[t]{\linewidth}{
#2{ } %$\:$
Expand All @@ -26,7 +26,7 @@
\par % End the line
}

\newcommand{\definition}[3][1]{
\providecommand{\definition}[3][1]{
\abstractDefinition{#1}{\faArchive}{kit-blue}{#2}{#3}
% Stichwortverzeichnis am Ende erzeugen.
\index[definition]{
Expand All @@ -37,11 +37,22 @@
}
}

\newcommand{\defwarn}[3][1]{
\providecommand{\defindex}[4][1]{
\abstractDefinition{#1}{\faArchive}{kit-blue}{#3}{#4}
% Stichwortverzeichnis am Ende erzeugen.
\index[#2]{
\vspace{0.2cm}
\hspace*{-0.5cm}
\underline{\textsc{#3}}\\
#4
}
}

\providecommand{\defwarn}[3][1]{
\abstractDefinition{#1}{\textcolor{kit-orange}{\faExclamationTriangle}}{kit-orange}{#2}{#3}
}

\newcommand{\defproblem}[3][1]{
\providecommand{\defproblem}[3][1]{
\abstractDefinition{#1}{\textcolor{kit-red}{\faExclamationCircle}}{kit-red}{#2}{#3}
}

Expand Down
1 change: 1 addition & 0 deletions src/elite.cls
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
\RequirePackage{booktabs} % prettier tables
\RequirePackage{csquotes} % \enquote command
\RequirePackage{environ} % better environments
\RequirePackage{xparse} % better commands

% Math packages and symbols
\RequirePackage{amsmath}
Expand Down

0 comments on commit 3575d92

Please # to comment.