mirror of
https://github.com/Relintai/elteikthesis.git
synced 2024-12-21 12:56:51 +01:00
Integrate with minted for source code highlighting
This commit is contained in:
parent
5377734a4b
commit
525f06716c
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -9,4 +9,7 @@ jobs:
|
||||
- name: Compile LaTeX document
|
||||
uses: xu-cheng/latex-action@master
|
||||
with:
|
||||
root_file: thesis.tex
|
||||
root_file: |
|
||||
thesis.tex
|
||||
minted-integration.tex
|
||||
latexmk_shell_escape: true
|
@ -426,7 +426,7 @@
|
||||
breaklines=true,
|
||||
breakatwhitespace=false,
|
||||
float,
|
||||
frame=linesc,
|
||||
frame=lines,
|
||||
captionpos=b
|
||||
}
|
||||
% Forráskód elnevezése
|
||||
@ -531,3 +531,27 @@
|
||||
\setcounter{page}{1}
|
||||
}
|
||||
% ------------------------------
|
||||
|
||||
\AtBeginDocument{
|
||||
% If the minted package is loaded, then provide a default for the formatting,
|
||||
% and set the labels for the listings
|
||||
\@ifpackageloaded{minted}{
|
||||
\setminted{
|
||||
style=tango,
|
||||
numbers=left,
|
||||
stepnumber=1,
|
||||
firstnumber=1,
|
||||
numbersep=5pt,
|
||||
showspaces=false,
|
||||
showtabs=false,
|
||||
tabsize=2,
|
||||
breaklines=true,
|
||||
frame=lines,
|
||||
bgcolor=codebackg,
|
||||
}
|
||||
\SetupFloatingEnvironment{listing}{
|
||||
name=\codelabel, % Forráskód elnevezése
|
||||
listname=\lstcodelabel, % Forráskódjegyzék elnevezése
|
||||
}
|
||||
}
|
||||
}
|
||||
|
33
minted-integration.tex
Normal file
33
minted-integration.tex
Normal file
@ -0,0 +1,33 @@
|
||||
\documentclass{elteikthesis}[2020/11/23]
|
||||
|
||||
\usepackage[newfloat]{minted}
|
||||
|
||||
\begin{document}
|
||||
\documentlang{magyar}
|
||||
|
||||
\chapter{Minted forráskód}
|
||||
\label{ch:chapter}
|
||||
|
||||
\begin{listing}[H]
|
||||
\begin{minted}{cpp}
|
||||
#include <stdio>
|
||||
|
||||
int main()
|
||||
{
|
||||
int c;
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
|
||||
std::cout << "Press any key to exit." << std::endl;
|
||||
std::cin >> c;
|
||||
|
||||
return 0;
|
||||
}
|
||||
\end{minted}
|
||||
\caption{Hello World in C++}
|
||||
\end{listing}
|
||||
|
||||
\phantomsection
|
||||
\addcontentsline{toc}{chapter}{\lstcodelabel}
|
||||
\listoflistings
|
||||
|
||||
\end{document}
|
@ -7,6 +7,10 @@
|
||||
%final, % Teendők elrejtése / Set final to hide todos
|
||||
]{elteikthesis}[2020/11/23]
|
||||
|
||||
% A minted csomag támogatva van forráskódok szedésére
|
||||
% The minted package is also supported for source higlighting
|
||||
%\usepackage[newfloat]{minted}
|
||||
|
||||
% Dolgozat metaadatai
|
||||
% Document's metadata
|
||||
\title{Dolgozat címe} % cím / title
|
||||
|
Loading…
Reference in New Issue
Block a user