[Code] Add inline code snippets, docs on typeface change

This commit is contained in:
2025-09-29 15:16:38 +02:00
parent 6c75936b18
commit c4779f3d6a
4 changed files with 13 additions and 1 deletions

Binary file not shown.

View File

@@ -29,8 +29,10 @@
\item \verb|\setcounter{descriptorShadeStrength}|\{\textit{number}\} Change the colour saturation of the inline descriptors
\item \verb|\setcounter{shadeStrength}|\{\textit{number}\} Change the colour saturation of the \verb|\shade| command
\item \verb|\setLang|\{\textit{language}\} Change the language. Will automatically load babel in German. Can only be used once and only at the start of the document or in the preamble, as repeated usage leads to undefined behaviour
\item To change the font for the entire document, load the font package using \verb|\usepackage|, then select it by using \verb|\setFont{<font name>}|. A list of fonts is available \color{Cyan}\href{https://www.overleaf.com/learn/latex/Font_typefaces#Reference_guide}{here}\color{black}. You may change the font only for a specific section, by enclosing \verb|\setFont| and the text that should be written in said typeface in curly braces.
\end{itemize}
\newpage
\subsection{Setup, Loading \& Translation}
\begin{itemize}
\item \verb|\load|\{\textit{scope}\} Load the selected \textit{scope}
@@ -448,6 +450,10 @@ Using \verb|\addIndex|\{\textit{string}\}, you can do the same, but the text rem
Use \verb|\setupBiber|\{\textit{/path/to/your/bib/sources.bib file}\} in the preamble to prepare, then use \verb|\printbib| to print your bibliography.
To add more sources, simply use bibter's built-in macro \verb|\addbibresource|\textit{\{filepath\}}, which will load your \texttt{.bib} file.
You need to use that inside the preamble as well.
\subsubsection{Glossary}
\textit{Included in \texttt{recommended} and up}
@@ -456,7 +462,7 @@ Use \verb|\setupGlossary| in the preamble to prepare, then use the normal glossa
\subsubsection{Minted}
\textit{Included in \texttt{full}}
No extra configs or commands provided by this one, simply an import for minted. Be sure to enable \texttt{shell-escape} for your compiler!
Be sure to enable \texttt{shell-escape} for your compiler!
When \texttt{minted} is available via these helpers, you will also have access to the \texttt{codesnippet} macro:
@@ -474,3 +480,7 @@ Example (in python):
def hello_world():
print("hello world!")
\end{code}
If you want to print code inline, use \verb|\inlinecode|\textit{\{string\}}, which redners to \inlinecode{code}.
\textit{Caveat: This is not using the \texttt{verbatim} environment due to various limitations of that environment and instead is simply using} \verb|\texttt{}|, so you cannot use this to print \LaTeX-commands

View File

@@ -1,6 +1,7 @@
\usepackage{minted}
\usepackage{fancyvrb}
\newcommand{\inlinecode}[1]{\shade{gray}{\texttt{#1}}}
\newenvironment{code}[1]{
\VerbatimEnvironment

View File

@@ -44,6 +44,7 @@
% -------------------- %
% Small style elements %
% -------------------- %
\newcommand{\setFont}[1]{\fontfamily{#1}\selectfont}
\renewcommand{\footrulewidth}{0.4pt}
\newcommand{\TODO}{\color{red} \hl{TODO:} \color{black}}
\newcommand{\bi}[1]{\textbf{\textit{#1}}}