mirror of
https://github.com/Relintai/elteikthesis.git
synced 2025-02-15 13:24:19 +01:00
Merge pull request #6 from Maetveis/improvements
* Use the subcaption package instead of the outdated subfigure * Use setspace package for spacing * Integrate with minted for source code highlighting * Set theorem and definition styles * Thesis template: use algorithmicx package for algorithms * Add the list of algorithms * Enable the use of XeTex or LuaTex * Move settings.tex definitons inside the class file * Load geometry before fancyhdr * Add PDF * Update ci.yml: PDF output as a build artifact * Add luatex to automatic ci run
This commit is contained in:
commit
c48fb6d899
28
.github/workflows/ci.yml
vendored
28
.github/workflows/ci.yml
vendored
@ -2,11 +2,35 @@ name: Build LaTeX document
|
|||||||
on: [push]
|
on: [push]
|
||||||
jobs:
|
jobs:
|
||||||
build_latex:
|
build_latex:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
engine: [pdflatex, lualatex]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Git repository
|
- name: Set up Git repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Compile LaTeX document
|
- if: ${{ matrix.engine == 'pdflatex' }}
|
||||||
|
name: Compile LaTeX document
|
||||||
uses: xu-cheng/latex-action@master
|
uses: xu-cheng/latex-action@master
|
||||||
with:
|
with:
|
||||||
root_file: thesis.tex
|
root_file: |
|
||||||
|
thesis.tex
|
||||||
|
minted-integration.tex
|
||||||
|
latexmk_shell_escape: true
|
||||||
|
- if: ${{ matrix.engine == 'lualatex' }}
|
||||||
|
name: Compile LaTeX document
|
||||||
|
uses: xu-cheng/latex-action@master
|
||||||
|
with:
|
||||||
|
root_file: |
|
||||||
|
thesis.tex
|
||||||
|
minted-integration.tex
|
||||||
|
latexmk_shell_escape: true
|
||||||
|
latexmk_use_lualatex: true
|
||||||
|
- name: Upload the compiled pdf
|
||||||
|
uses: actions/upload-artifact@v2.2.4
|
||||||
|
with:
|
||||||
|
name: thesis-${{ matrix.engine }}
|
||||||
|
path: |
|
||||||
|
thesis.pdf
|
||||||
|
minted-integration.pdf
|
||||||
|
if-no-files-found: error
|
||||||
|
@ -95,21 +95,21 @@ Példa forrása: \href{https://www.inf.u-szeged.hu/actacybernetica/}{Acta Cybern
|
|||||||
\label{alg:ibb}
|
\label{alg:ibb}
|
||||||
\textbf{\underline{Funct}} IBB($S,f$)
|
\textbf{\underline{Funct}} IBB($S,f$)
|
||||||
\begin{algorithmic}[1] % sorszámok megjelenítése minden n. sor előtt, most n = 1
|
\begin{algorithmic}[1] % sorszámok megjelenítése minden n. sor előtt, most n = 1
|
||||||
\STATE Set the working list ${\cal L}_W$ := $\{S\}$ and the final list ${\cal L}_Q$ := $\{\}$
|
\State Set the working list ${\cal L}_W$ := $\{S\}$ and the final list ${\cal L}_Q$ := $\{\}$
|
||||||
\WHILE{( ${\cal L}_W \neq \emptyset$ )} \label{alg:igoend}
|
\While{( ${\cal L}_W \neq \emptyset$ )} \label{alg:igoend}
|
||||||
\STATE Select an interval $X$ from ${\cal L}_W$ \label{step:selrule}\COMMENT{Selection rule}
|
\State Select an interval $X$ from ${\cal L}_W$ \label{step:selrule}\Comment{Selection rule}
|
||||||
\STATE Compute $lbf(X)$ \COMMENT{Bounding rule}
|
\State Compute $lbf(X)$ \Comment{Bounding rule}
|
||||||
\IF[Elimination rule]{$X$ cannot be eliminated}
|
\If{$X$ cannot be eliminated} \Comment{Elimination rule}
|
||||||
\STATE Divide $X$ into $X^j,\ j=1,\dots, p$, subintervals \COMMENT{Division rule}
|
\State Divide $X$ into $X^j,\ j=1,\dots, p$, subintervals \Comment{Division rule}
|
||||||
\FOR{$j=1,\ldots,p$}
|
\For{$j=1,\ldots,p$}
|
||||||
\IF[Termination rule]{$X^j$ satisfies the termination criterion}
|
\If{$X^j$ satisfies the termination criterion} \Comment{Termination rule}
|
||||||
\STATE Store $X^j$ in ${\cal L}_W$
|
\State Store $X^j$ in ${\cal L}_W$
|
||||||
\ELSE
|
\Else
|
||||||
\STATE Store $X^j$ in ${\cal L}_W$
|
\State Store $X^j$ in ${\cal L}_W$
|
||||||
\ENDIF
|
\EndIf
|
||||||
\ENDFOR
|
\EndFor
|
||||||
\ENDIF
|
\EndIf
|
||||||
\ENDWHILE
|
\EndWhile
|
||||||
\STATE \textbf{return} ${\cal L}_Q$
|
\State \textbf{return} ${\cal L}_Q$
|
||||||
\end{algorithmic}
|
\end{algorithmic}
|
||||||
\end{algorithm}
|
\end{algorithm}
|
||||||
|
@ -85,10 +85,10 @@ In non ipsum fermentum urna feugiat rutrum a at odio. Pellentesque habitant morb
|
|||||||
|
|
||||||
\begin{figure}[H]
|
\begin{figure}[H]
|
||||||
\centering
|
\centering
|
||||||
\subfigure[Vestibulum quis mattis urna]{
|
\subcaptionbox{Vestibulum quis mattis urna}{
|
||||||
\includegraphics[width=0.45\linewidth]{elte_cimer_szines}}
|
\includegraphics[width=0.45\linewidth]{elte_cimer_szines}}
|
||||||
\hspace{5pt}
|
\hspace{5pt}
|
||||||
\subfigure[Donec hendrerit quis dui sit amet venenatis]{
|
\subcaptionbox{Donec hendrerit quis dui sit amet venenatis}{
|
||||||
\includegraphics[width=0.45\linewidth]{elte_cimer_szines}}
|
\includegraphics[width=0.45\linewidth]{elte_cimer_szines}}
|
||||||
\caption{Aenean porttitor mi volutpat massa gravida}
|
\caption{Aenean porttitor mi volutpat massa gravida}
|
||||||
\label{fig:example-2}
|
\label{fig:example-2}
|
||||||
|
@ -53,8 +53,13 @@
|
|||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Karakterkódolás, nyelv
|
% Karakterkódolás, nyelv
|
||||||
|
\RequirePackage{iftex} % XeTex or LuaTex
|
||||||
|
\iftutex
|
||||||
|
\RequirePackage{fontspec}
|
||||||
|
\else % other (PdfTex)
|
||||||
\RequirePackage[utf8]{inputenc}
|
\RequirePackage[utf8]{inputenc}
|
||||||
\RequirePackage[T1]{fontenc}
|
\RequirePackage[T1]{fontenc}
|
||||||
|
\fi
|
||||||
\RequirePackage[english,magyar]{babel}
|
\RequirePackage[english,magyar]{babel}
|
||||||
\RequirePackage{indentfirst}
|
\RequirePackage{indentfirst}
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
@ -102,6 +107,7 @@
|
|||||||
\newcommand{\alglabel}{Algoritmus}
|
\newcommand{\alglabel}{Algoritmus}
|
||||||
|
|
||||||
\newcommand{\biblabel}{Irodalomjegyzék}
|
\newcommand{\biblabel}{Irodalomjegyzék}
|
||||||
|
\newcommand{\lstalgorithmlabel}{Algoritmusjegyzék}
|
||||||
\newcommand{\lstfigurelabel}{Ábrajegyzék}
|
\newcommand{\lstfigurelabel}{Ábrajegyzék}
|
||||||
\newcommand{\lsttablelabel}{Táblázatjegyzék}
|
\newcommand{\lsttablelabel}{Táblázatjegyzék}
|
||||||
\newcommand{\lstcodelabel}{Forráskódjegyzék}
|
\newcommand{\lstcodelabel}{Forráskódjegyzék}
|
||||||
@ -125,6 +131,7 @@
|
|||||||
\newcommand{\alglabel}{Algorithm}
|
\newcommand{\alglabel}{Algorithm}
|
||||||
|
|
||||||
\newcommand{\biblabel}{Bibliography}
|
\newcommand{\biblabel}{Bibliography}
|
||||||
|
\newcommand{\lstalgorithmlabel}{List of Algorithms}
|
||||||
\newcommand{\lstfigurelabel}{List of Figures}
|
\newcommand{\lstfigurelabel}{List of Figures}
|
||||||
\newcommand{\lsttablelabel}{List of Tables}
|
\newcommand{\lsttablelabel}{List of Tables}
|
||||||
\newcommand{\lstcodelabel}{List of Codes}
|
\newcommand{\lstcodelabel}{List of Codes}
|
||||||
@ -136,6 +143,13 @@
|
|||||||
}
|
}
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
|
|
||||||
|
% ------------------------------
|
||||||
|
% Margók
|
||||||
|
\RequirePackage[left=35mm, right=25mm, top=25mm, bottom=25mm, headheight=16pt]{geometry}
|
||||||
|
%\setlength{\textwidth}{150mm}
|
||||||
|
%\setlength{\textheight}{247mm}
|
||||||
|
% ------------------------------
|
||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Fejlécek és láblécek
|
% Fejlécek és láblécek
|
||||||
\RequirePackage{fancyhdr}
|
\RequirePackage{fancyhdr}
|
||||||
@ -194,7 +208,7 @@
|
|||||||
% Maximális ill. minimális méret megadása ábráknak
|
% Maximális ill. minimális méret megadása ábráknak
|
||||||
\RequirePackage[export]{adjustbox}
|
\RequirePackage[export]{adjustbox}
|
||||||
% Több ábra egy figure-on belül
|
% Több ábra egy figure-on belül
|
||||||
\RequirePackage[center]{subfigure}
|
\RequirePackage{subcaption}
|
||||||
% Ábrák forgatása
|
% Ábrák forgatása
|
||||||
\RequirePackage{rotating}
|
\RequirePackage{rotating}
|
||||||
|
|
||||||
@ -214,13 +228,6 @@
|
|||||||
\paperheight 297mm
|
\paperheight 297mm
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
|
|
||||||
% ------------------------------
|
|
||||||
% Margók
|
|
||||||
\RequirePackage[left=35mm, right=25mm, top=25mm, bottom=25mm]{geometry}
|
|
||||||
%\setlength{\textwidth}{150mm}
|
|
||||||
%\setlength{\textheight}{247mm}
|
|
||||||
% ------------------------------
|
|
||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Térköz bekezdések közé
|
% Térköz bekezdések közé
|
||||||
\iftoggle{parspace}{
|
\iftoggle{parspace}{
|
||||||
@ -247,7 +254,6 @@
|
|||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Helyközök és tördelés
|
% Helyközök és tördelés
|
||||||
\linespread{1.5}
|
|
||||||
% Egyszeres helyköz a mondatok végén
|
% Egyszeres helyköz a mondatok végén
|
||||||
\frenchspacing
|
\frenchspacing
|
||||||
% Szavak jobb margón túlnyúlásának tiltása
|
% Szavak jobb margón túlnyúlásának tiltása
|
||||||
@ -256,10 +262,15 @@
|
|||||||
\nottoggle{hypenation}{\RequirePackage[none]{hyphenat}}{}
|
\nottoggle{hypenation}{\RequirePackage[none]{hyphenat}}{}
|
||||||
|
|
||||||
% Beállítás alternatív módon
|
% Beállítás alternatív módon
|
||||||
%\RequirePackage{setspace}
|
\RequirePackage{setspace}
|
||||||
%\singlespacing % ~1.0 linespread
|
% According to
|
||||||
%\onehalfspacing % ~1.3 linespread
|
% https://tex.stackexchange.com/questions/442030/setting-spaces-with-titlespacing-and-fonts
|
||||||
%\doublespacing % ~1.6 linespread
|
% this matches the 1.5 linespacing in MS Word
|
||||||
|
\setstretch{1.427465}
|
||||||
|
|
||||||
|
% Vektorok és mátrixok egyszeres sorközzel
|
||||||
|
% https://tex.stackexchange.com/questions/568084/problem-with-matrices-using-linespread
|
||||||
|
\everydisplay=\expandafter{\the\everydisplay\linespread{1}\selectfont}
|
||||||
|
|
||||||
% Azonos sorköz használata láblácben
|
% Azonos sorköz használata láblácben
|
||||||
%\RequirePackage{footmisc}
|
%\RequirePackage{footmisc}
|
||||||
@ -286,8 +297,13 @@
|
|||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Tételek, definíciók
|
% Tételek, definíciók
|
||||||
|
\theoremstyle{definition}
|
||||||
\newtheorem{definition}{\deflabel}
|
\newtheorem{definition}{\deflabel}
|
||||||
|
|
||||||
|
\theoremstyle{plain}
|
||||||
\newtheorem{theorem}{\theolabel}
|
\newtheorem{theorem}{\theolabel}
|
||||||
|
|
||||||
|
\theoremstyle{remark}
|
||||||
\newtheorem*{remark}{\remlabel}
|
\newtheorem*{remark}{\remlabel}
|
||||||
\newtheorem*{note}{\notelabel}
|
\newtheorem*{note}{\notelabel}
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
@ -344,6 +360,9 @@
|
|||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Számozott elemek kezelése
|
% Számozott elemek kezelése
|
||||||
\RequirePackage{chngcntr}
|
\RequirePackage{chngcntr}
|
||||||
|
% Lábjegyzet folytonos számozása fejezetek között
|
||||||
|
% Continuous counting of footnotes among chapters
|
||||||
|
\counterwithout{footnote}{chapter}
|
||||||
% Lábjegyzet oldalak közti eltörésének tiltása
|
% Lábjegyzet oldalak közti eltörésének tiltása
|
||||||
\interfootnotelinepenalty=10000
|
\interfootnotelinepenalty=10000
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
@ -374,7 +393,7 @@
|
|||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Feliratok, tartalomjegyzék, ábrajegyzék, táblázatjegyzék
|
% Feliratok, tartalomjegyzék, ábrajegyzék, táblázatjegyzék
|
||||||
\RequirePackage[justification=centering]{caption}
|
\RequirePackage[justification=centering]{caption}
|
||||||
\RequirePackage[subfigure]{tocloft}
|
\RequirePackage{tocloft}
|
||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
|
|
||||||
@ -402,7 +421,7 @@
|
|||||||
% ------------------------------
|
% ------------------------------
|
||||||
% Algoritmusok és kódblokkok írása
|
% Algoritmusok és kódblokkok írása
|
||||||
\RequirePackage{algorithm}
|
\RequirePackage{algorithm}
|
||||||
\RequirePackage{algorithmic}
|
\RequirePackage{algpseudocode}
|
||||||
\RequirePackage{listingsutf8}
|
\RequirePackage{listingsutf8}
|
||||||
\lstset{
|
\lstset{
|
||||||
basicstyle=\footnotesize\ttfamily,
|
basicstyle=\footnotesize\ttfamily,
|
||||||
@ -422,17 +441,16 @@
|
|||||||
breaklines=true,
|
breaklines=true,
|
||||||
breakatwhitespace=false,
|
breakatwhitespace=false,
|
||||||
float,
|
float,
|
||||||
frame=linesc,
|
frame=lines,
|
||||||
captionpos=b
|
captionpos=b
|
||||||
}
|
}
|
||||||
% Forráskód elnevezése
|
% Forráskód elnevezése
|
||||||
\renewcommand{\lstlistingname}{\codelabel}
|
\renewcommand{\lstlistingname}{\codelabel}
|
||||||
% Forráskódjegyzék elnevezése
|
% Forráskódjegyzék elnevezése
|
||||||
\renewcommand{\lstlistlistingname}{\lstcodelabel}
|
\renewcommand{\lstlistlistingname}{\lstcodelabel}
|
||||||
% Algoritmus kommentek jobb szélre igazítása
|
|
||||||
\renewcommand{\algorithmiccomment}[1]{\hfill {\it #1}}
|
|
||||||
% Algoritmus elnevezése
|
% Algoritmus elnevezése
|
||||||
\renewcommand{\ALG@name}{\alglabel}
|
\floatname{algorithm}{\alglabel}
|
||||||
|
\renewcommand{\listalgorithmname}{\lstalgorithmlabel}
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
|
|
||||||
% ------------------------------
|
% ------------------------------
|
||||||
@ -527,3 +545,40 @@
|
|||||||
\setcounter{page}{1}
|
\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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
% Az oldalszámozás a tartalomjegyzékkel kezdődik, de ott nem látható
|
||||||
|
\let\oldtableofcontents\tableofcontents
|
||||||
|
\renewcommand{\tableofcontents}{
|
||||||
|
\pagenumbering{gobble}
|
||||||
|
\oldtableofcontents
|
||||||
|
\cleardoublepage
|
||||||
|
% Oldalszám mentése és betöltésem mert a \pagenumbering visszállítja
|
||||||
|
\newcounter{conpageno}
|
||||||
|
\defcounter{conpageno}{\value{page}}
|
||||||
|
\pagenumbering{arabic}
|
||||||
|
\setcounter{page}{\value{conpageno}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BIN
minted-integration.pdf
Normal file
BIN
minted-integration.pdf
Normal file
Binary file not shown.
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}
|
16
settings.tex
16
settings.tex
@ -1,16 +0,0 @@
|
|||||||
% Lábjegyzet folytonos számozása fejezetek között
|
|
||||||
% Continuous counting of footnotes among chapters
|
|
||||||
\counterwithout{footnote}{chapter}
|
|
||||||
|
|
||||||
% Tartalomjegyzék oldalszámozásának rejtése
|
|
||||||
% Hide page numbering of ToC
|
|
||||||
\newcounter{conpageno}
|
|
||||||
\let\oldtableofcontents\tableofcontents
|
|
||||||
\renewcommand{\tableofcontents}{
|
|
||||||
\pagenumbering{gobble}
|
|
||||||
\oldtableofcontents
|
|
||||||
\cleardoublepage
|
|
||||||
\setcounter{conpageno}{\value{page}}
|
|
||||||
\pagenumbering{arabic}
|
|
||||||
\setcounter{page}{\value{conpageno}}
|
|
||||||
}
|
|
BIN
thesis.pdf
BIN
thesis.pdf
Binary file not shown.
15
thesis.tex
15
thesis.tex
@ -7,6 +7,10 @@
|
|||||||
%final, % Teendők elrejtése / Set final to hide todos
|
%final, % Teendők elrejtése / Set final to hide todos
|
||||||
]{elteikthesis}[2020/11/23]
|
]{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
|
% Dolgozat metaadatai
|
||||||
% Document's metadata
|
% Document's metadata
|
||||||
\title{Dolgozat címe} % cím / title
|
\title{Dolgozat címe} % cím / title
|
||||||
@ -49,10 +53,6 @@
|
|||||||
% List of todos (not in the final document)
|
% List of todos (not in the final document)
|
||||||
%\listoftodos[\todolabel]
|
%\listoftodos[\todolabel]
|
||||||
|
|
||||||
% Dokumentum beállítások
|
|
||||||
% Some document settings
|
|
||||||
\input{settings.tex}
|
|
||||||
|
|
||||||
% Címlap (kötelező)
|
% Címlap (kötelező)
|
||||||
% Title page (mandatory)
|
% Title page (mandatory)
|
||||||
\maketitle
|
\maketitle
|
||||||
@ -104,6 +104,13 @@
|
|||||||
\listoftables
|
\listoftables
|
||||||
\cleardoublepage
|
\cleardoublepage
|
||||||
|
|
||||||
|
% Algorithmusjegyzék
|
||||||
|
% List of algorithms
|
||||||
|
\phantomsection
|
||||||
|
\addcontentsline{toc}{chapter}{\lstalgorithmlabel}
|
||||||
|
\listofalgorithms
|
||||||
|
\cleardoublepage
|
||||||
|
|
||||||
% Forráskódjegyzék (opcionális) - 3-5 kódpélda fölött érdemes
|
% Forráskódjegyzék (opcionális) - 3-5 kódpélda fölött érdemes
|
||||||
% List of codes (optional) - useful over 3-5 code samples
|
% List of codes (optional) - useful over 3-5 code samples
|
||||||
\phantomsection
|
\phantomsection
|
||||||
|
Loading…
Reference in New Issue
Block a user