| 1 |
\documentclass{elteikthesis}[2024/04/26] |
| 2 |
|
| 3 |
\usepackage[newfloat]{minted} |
| 4 |
|
| 5 |
\begin{document} |
| 6 |
\documentlang{english} |
| 7 |
|
| 8 |
\chapter{Minted source code example} |
| 9 |
\label{ch:chapter} |
| 10 |
|
| 11 |
\begin{listing}[H] |
| 12 |
\begin{minted}{cpp} |
| 13 |
#include <stdio> |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
int c; |
| 18 |
std::cout << "Hello World!" << std::endl; |
| 19 |
|
| 20 |
std::cout << "Press any key to exit." << std::endl; |
| 21 |
std::cin >> c; |
| 22 |
|
| 23 |
return 0; |
| 24 |
} |
| 25 |
\end{minted} |
| 26 |
\caption{Hello World in C++} |
| 27 |
\end{listing} |
| 28 |
|
| 29 |
\phantomsection |
| 30 |
\addcontentsline{toc}{chapter}{\lstcodelabel} |
| 31 |
\listoflistings |
| 32 |
|
| 33 |
\end{document} |