diff --git a/docs/docs.pdf b/docs/docs.pdf index 8d78f93..9a0431d 100644 Binary files a/docs/docs.pdf and b/docs/docs.pdf differ diff --git a/docs/parts/reference.tex b/docs/parts/reference.tex index ec1aefe..891ea31 100644 --- a/docs/parts/reference.tex +++ b/docs/parts/reference.tex @@ -432,6 +432,7 @@ This outputs as \end{fullTable} + \subsection{Index} \textit{Included in \texttt{most} and up} @@ -439,6 +440,8 @@ If you want to use index, add \verb|\prepareIndex| to the preamble. Using \verb| Using \verb|\addIndex|\{\textit{string}\}, you can do the same, but the text remains normal and using \verb|\addIndexItalic|\{\textit{string}\}, it is printed in italics + +\newpage \subsection{Extras} \subsubsection{BibTeX} \textit{Included in \texttt{recommended} and up} @@ -454,3 +457,20 @@ Use \verb|\setupGlossary| in the preamble to prepare, then use the normal glossa \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! + +When \texttt{minted} is available via these helpers, you will also have access to the \texttt{codesnippet} macro: + +\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} diff --git a/extra/minted.tex b/extra/minted.tex index 6371ecf..907b2d4 100644 --- a/extra/minted.tex +++ b/extra/minted.tex @@ -1 +1,15 @@ \usepackage{minted} +\usepackage{fancyvrb} + + +\newenvironment{code}[1]{ + \VerbatimEnvironment + \begin{minted}[ + autogobble, + breaklines, + breakindentnchars=2, + frame=lines, + framesep=2mm, + baselinestretch=1.1, + linenos]{#1}} +{\end{minted}}