[Code] Add better code snippets
This commit is contained in:
BIN
docs/docs.pdf
BIN
docs/docs.pdf
Binary file not shown.
@@ -432,6 +432,7 @@ This outputs as
|
|||||||
\end{fullTable}
|
\end{fullTable}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{Index}
|
\subsection{Index}
|
||||||
\textit{Included in \texttt{most} and up}
|
\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
|
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}
|
\subsection{Extras}
|
||||||
\subsubsection{BibTeX}
|
\subsubsection{BibTeX}
|
||||||
\textit{Included in \texttt{recommended} and up}
|
\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}}
|
\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!
|
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}
|
||||||
|
@@ -1 +1,15 @@
|
|||||||
\usepackage{minted}
|
\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}}
|
||||||
|
Reference in New Issue
Block a user