Skip to content

Instantly share code, notes, and snippets.

@PadreSVK
Last active May 14, 2019 13:46
Show Gist options
  • Save PadreSVK/d2505309d4e87e0b105f6a93972b5315 to your computer and use it in GitHub Desktop.
Save PadreSVK/d2505309d4e87e0b105f6a93972b5315 to your computer and use it in GitHub Desktop.
Setup minted package for latex template FEKT

Minted package setup

Prerequisites

  • choco install python -y
  • pip -v install pygments
  • pdflatex.exe -synctex=-1 -interaction=nonstopmode "%pm" -shell-escape
\usepackage[chapter]{minted}
\input{variable}
\begin{listing}[!ht]
\inputminted{languageName}{relativePathToCodeFileFromSablonaPrace}
\vspace*{-\baselineskip}
\caption[list of listing caption]{ caption \label{code:NameOfCode}}
\end{listing}
\begin{listing}[!ht]
\begin{minted}[firstnumber=28]{csharp}
config.Resources.Register("config", new ScriptResource()
{
Location = new UrlResourceLocation("~/config.js"),
});
config.Resources.Register("mono", new ScriptResource()
{
Location = new UrlResourceLocation("~/mono.js"),
Dependencies = new[] { "config", "require", "wasm-bootstrap"}
});
\end{minted}
\vspace*{-\baselineskip}
\caption[list of listing caption]{ caption \label{code:NameOfCode}}
\end{listing}
%renew List of listing - for minted package
\renewcommand{\listingscaption}{Výpis kódu}
\renewcommand{\listoflistingscaption}{Zoznam výpisov kódov}
\renewcommand{\listoflistings}{%
\cleardoublepage
%\addcontentsline{toc}{chapter}{\listoflistingscaption}%
\listof{listing}{\listoflistingscaption}%
}
\setminted{
tabsize=4,
fontsize=\footnotesize,
%style=tango,
%style=autumn,
%style=lovelace,
%style=abap,
%bgcolor=gray, %background color
%fontsize= ,
linenos, %line number
breaklines % allow word wrap for code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment