Update docs (mostly), fixes, etc
Some checks failed
Update docs / build_docs (push) Has been cancelled
Update helpers / build_helpers (push) Successful in 25s

This commit is contained in:
2026-02-21 16:24:21 +01:00
parent 2a592753bf
commit baebaa99d0
45 changed files with 1038 additions and 691 deletions

View File

@@ -1,9 +1,7 @@
\newpage
\subsection{CS-Commands}
These commands have to be executed inside math environment, except \verb|\timecomplexity| and \verb|\tc|.
These commands have to be executed inside math environment
\begin{itemize}
\item \verb|\timecomplexity| Prints the word time complexity with a coloured box.
\item \verb|\tc| Shorthand for \verb|\tct|. Deprecated
\item \verb|\tct| Time complexity in $\tct{}$-notation (average case)
\item \verb|\tco| Time complexity in $\tco{}$-notation (worst case / upper bound)
\item \verb|\tcl| Time complexity in $\tcl{}$-notation (best case / lower bound)
@@ -16,7 +14,7 @@ These commands have to be executed inside math environment, except \verb|\timeco
\item \verb|\alphabetbool| Prints $\alphabetbool$
\end{itemize}
\fhlc{Aquamarine}{Algorithms}
\subsubsection{Algorithms}
\begin{minted}{latex}
\begin{algo}{functionName(A)}
\Procedure{functionName}{$(A)$}
@@ -30,3 +28,40 @@ These commands have to be executed inside math environment, except \verb|\timeco
\State\Return "Hello World"
\EndProcedure
\end{algo}
\subsubsection{Code}
If you get compilation errors, be sure to enable \texttt{-shell-escape} for your compiler.
\textit{(Note: Some newer versions of LaTeX do no longer require this and it is better to keep it turned off for security reasons, if it works without)}!
\paragraph{Code inlined in tex file}
\begin{minted}{latex}
\begin{code}{language}
//Code goes here
\end{code}
\end{minted}
This is nothing different than a wrapper for a minted environment with a box drawn around it.
Example (in python):
\begin{code}{python}
def hello_world():
print("hello world!")
\end{code}
\paragraph{Code in separate files}
It is also possible to load code from a source file using the provided commands:
\begin{itemize}
\item \verb|\inputcode|\{\textit{language}\}\{\textit{file}\}, where \textit{language} is the programming language
and \textit{file} is the file name of the file to be loaded, relative to the main tex file.
\item \verb|\inputcodewithfilename|\{\textit{language}\}\{\textit{hidden-path}\}\{\textit{shown-path}\}, where \textit{language} is the programming language,
\textit{hidden-path} is the part of the path you want to hide of the file to be loaded, relative to the main tex file
and \textit{shown-path} is the displayed part.
\end{itemize}
\inlineexample
\begin{minted}{latex}
\inputcodewithfilename{python}{/start/of/path}{/shown/path/file.py}
\end{minted}