Add source code rendering

This commit is contained in:
Emil Miler 2024-02-15 17:37:28 +01:00
parent ac373d1bad
commit adfa115e8f
3 changed files with 28 additions and 6 deletions

View File

@ -1,3 +1,14 @@
\chapter{Ipsum} \chapter{Ipsum}
... \begin{listing}[!ht]
\caption{Code example}
\label{lst:example}
\begin{minted}{c}
#include<stdio.h>
int main(void) {
printf("Hello World\n");
return 0;
}
\end{minted}
\end{listing}

View File

@ -5,15 +5,14 @@ PRACE=prace.tex
all: vlna pdf all: vlna pdf
pdf: pdf:
latexmk -pdflua $(PRACE) latexmk -quiet -shell-escape -pdflua $(PRACE)
#latexmk -pdf $(PRACE)
clean: clean:
latexmk -c latexmk -quiet -c
rm -f pdfa.xmpi prace.bbl prace.run.xml rm -rf pdfa.xmpi prace.bbl prace.run.xml _minted-prace/
cleanall: clean cleanall: clean
latexmk -C latexmk -quiet -C
vlna: vlna:
vlna -l -r *.tex vlna -l -r *.tex

View File

@ -40,6 +40,17 @@
\setlength{\footnotesep}{0.5cm} \setlength{\footnotesep}{0.5cm}
\renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt} \renewcommand{\footnoterule}{\vfill\kern -3pt \hrule width 0.4\columnwidth \kern 2.6pt}
% Source code
\usepackage{minted}
\setminted{
frame=lines,
framesep=2mm,
baselinestretch=1.2,
fontsize=\footnotesize,
linenos
}
\renewcommand{\listingscaption}{Kód}
\renewcommand\listoflistingscaption{Seznam ukázek zdrojového kódu}
\def\Title{Název práce v~čestině} \def\Title{Název práce v~čestině}
\def\TitleEN{Title of the publication in english} \def\TitleEN{Title of the publication in english}
@ -67,5 +78,6 @@
\newpage \newpage
\printbibliography \printbibliography
\listoflistings
\end{document} \end{document}