mirror of
https://github.com/Relintai/elteikthesis.git
synced 2024-11-17 07:47:18 +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]
|
||||
jobs:
|
||||
build_latex:
|
||||
strategy:
|
||||
matrix:
|
||||
engine: [pdflatex, lualatex]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Git repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Compile LaTeX document
|
||||
- if: ${{ matrix.engine == 'pdflatex' }}
|
||||
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
|
||||
- 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}
|
||||
\textbf{\underline{Funct}} IBB($S,f$)
|
||||
\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$ := $\{\}$
|
||||
\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 Compute $lbf(X)$ \COMMENT{Bounding rule}
|
||||
\IF[Elimination rule]{$X$ cannot be eliminated}
|
||||
\STATE Divide $X$ into $X^j,\ j=1,\dots, p$, subintervals \COMMENT{Division rule}
|
||||
\FOR{$j=1,\ldots,p$}
|
||||
\IF[Termination rule]{$X^j$ satisfies the termination criterion}
|
||||
\STATE Store $X^j$ in ${\cal L}_W$
|
||||
\ELSE
|
||||
\STATE Store $X^j$ in ${\cal L}_W$
|
||||
\ENDIF
|
||||
\ENDFOR
|
||||
\ENDIF
|
||||
\ENDWHILE
|
||||
\STATE \textbf{return} ${\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}
|
||||
\State Select an interval $X$ from ${\cal L}_W$ \label{step:selrule}\Comment{Selection rule}
|
||||
\State Compute $lbf(X)$ \Comment{Bounding rule}
|
||||
\If{$X$ cannot be eliminated} \Comment{Elimination rule}
|
||||
\State Divide $X$ into $X^j,\ j=1,\dots, p$, subintervals \Comment{Division rule}
|
||||
\For{$j=1,\ldots,p$}
|
||||
\If{$X^j$ satisfies the termination criterion} \Comment{Termination rule}
|
||||
\State Store $X^j$ in ${\cal L}_W$
|
||||
\Else
|
||||
\State Store $X^j$ in ${\cal L}_W$
|
||||
\EndIf
|
||||
\EndFor
|
||||
\EndIf
|
||||
\EndWhile
|
||||
\State \textbf{return} ${\cal L}_Q$
|
||||
\end{algorithmic}
|
||||
\end{algorithm}
|
||||
|
@ -85,10 +85,10 @@ In non ipsum fermentum urna feugiat rutrum a at odio. Pellentesque habitant morb
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\subfigure[Vestibulum quis mattis urna]{
|
||||
\subcaptionbox{Vestibulum quis mattis urna}{
|
||||
\includegraphics[width=0.45\linewidth]{elte_cimer_szines}}
|
||||
\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}}
|
||||
\caption{Aenean porttitor mi volutpat massa gravida}
|
||||
\label{fig:example-2}
|
||||
|
@ -53,8 +53,13 @@
|
||||
|
||||
% ------------------------------
|
||||
% Karakterkódolás, nyelv
|
||||
\RequirePackage[utf8]{inputenc}
|
||||
\RequirePackage[T1]{fontenc}
|
||||
\RequirePackage{iftex} % XeTex or LuaTex
|
||||
\iftutex
|
||||
\RequirePackage{fontspec}
|
||||
\else % other (PdfTex)
|
||||
\RequirePackage[utf8]{inputenc}
|
||||
\RequirePackage[T1]{fontenc}
|
||||
\fi
|
||||
\RequirePackage[english,magyar]{babel}
|
||||
\RequirePackage{indentfirst}
|
||||
% ------------------------------
|
||||
@ -102,6 +107,7 @@
|
||||
\newcommand{\alglabel}{Algoritmus}
|
||||
|
||||
\newcommand{\biblabel}{Irodalomjegyzék}
|
||||
\newcommand{\lstalgorithmlabel}{Algoritmusjegyzék}
|
||||
\newcommand{\lstfigurelabel}{Ábrajegyzék}
|
||||
\newcommand{\lsttablelabel}{Táblázatjegyzék}
|
||||
\newcommand{\lstcodelabel}{Forráskódjegyzék}
|
||||
@ -125,6 +131,7 @@
|
||||
\newcommand{\alglabel}{Algorithm}
|
||||
|
||||
\newcommand{\biblabel}{Bibliography}
|
||||
\newcommand{\lstalgorithmlabel}{List of Algorithms}
|
||||
\newcommand{\lstfigurelabel}{List of Figures}
|
||||
\newcommand{\lsttablelabel}{List of Tables}
|
||||
\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
|
||||
\RequirePackage{fancyhdr}
|
||||
@ -194,7 +208,7 @@
|
||||
% Maximális ill. minimális méret megadása ábráknak
|
||||
\RequirePackage[export]{adjustbox}
|
||||
% Több ábra egy figure-on belül
|
||||
\RequirePackage[center]{subfigure}
|
||||
\RequirePackage{subcaption}
|
||||
% Ábrák forgatása
|
||||
\RequirePackage{rotating}
|
||||
|
||||
@ -214,13 +228,6 @@
|
||||
\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é
|
||||
\iftoggle{parspace}{
|
||||
@ -247,7 +254,6 @@
|
||||
|
||||
% ------------------------------
|
||||
% Helyközök és tördelés
|
||||
\linespread{1.5}
|
||||
% Egyszeres helyköz a mondatok végén
|
||||
\frenchspacing
|
||||
% Szavak jobb margón túlnyúlásának tiltása
|
||||
@ -256,10 +262,15 @@
|
||||
\nottoggle{hypenation}{\RequirePackage[none]{hyphenat}}{}
|
||||
|
||||
% Beállítás alternatív módon
|
||||
%\RequirePackage{setspace}
|
||||
%\singlespacing % ~1.0 linespread
|
||||
%\onehalfspacing % ~1.3 linespread
|
||||
%\doublespacing % ~1.6 linespread
|
||||
\RequirePackage{setspace}
|
||||
% According to
|
||||
% https://tex.stackexchange.com/questions/442030/setting-spaces-with-titlespacing-and-fonts
|
||||
% 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
|
||||
%\RequirePackage{footmisc}
|
||||
@ -286,8 +297,13 @@
|
||||
|
||||
% ------------------------------
|
||||
% Tételek, definíciók
|
||||
\theoremstyle{definition}
|
||||
\newtheorem{definition}{\deflabel}
|
||||
|
||||
\theoremstyle{plain}
|
||||
\newtheorem{theorem}{\theolabel}
|
||||
|
||||
\theoremstyle{remark}
|
||||
\newtheorem*{remark}{\remlabel}
|
||||
\newtheorem*{note}{\notelabel}
|
||||
% ------------------------------
|
||||
@ -344,6 +360,9 @@
|
||||
% ------------------------------
|
||||
% Számozott elemek kezelése
|
||||
\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
|
||||
\interfootnotelinepenalty=10000
|
||||
% ------------------------------
|
||||
@ -374,7 +393,7 @@
|
||||
% ------------------------------
|
||||
% Feliratok, tartalomjegyzék, ábrajegyzék, táblázatjegyzék
|
||||
\RequirePackage[justification=centering]{caption}
|
||||
\RequirePackage[subfigure]{tocloft}
|
||||
\RequirePackage{tocloft}
|
||||
|
||||
% ------------------------------
|
||||
|
||||
@ -402,7 +421,7 @@
|
||||
% ------------------------------
|
||||
% Algoritmusok és kódblokkok írása
|
||||
\RequirePackage{algorithm}
|
||||
\RequirePackage{algorithmic}
|
||||
\RequirePackage{algpseudocode}
|
||||
\RequirePackage{listingsutf8}
|
||||
\lstset{
|
||||
basicstyle=\footnotesize\ttfamily,
|
||||
@ -422,17 +441,16 @@
|
||||
breaklines=true,
|
||||
breakatwhitespace=false,
|
||||
float,
|
||||
frame=linesc,
|
||||
frame=lines,
|
||||
captionpos=b
|
||||
}
|
||||
% Forráskód elnevezése
|
||||
\renewcommand{\lstlistingname}{\codelabel}
|
||||
% Forráskódjegyzék elnevezése
|
||||
\renewcommand{\lstlistlistingname}{\lstcodelabel}
|
||||
% Algoritmus kommentek jobb szélre igazítása
|
||||
\renewcommand{\algorithmiccomment}[1]{\hfill {\it #1}}
|
||||
% Algoritmus elnevezése
|
||||
\renewcommand{\ALG@name}{\alglabel}
|
||||
\floatname{algorithm}{\alglabel}
|
||||
\renewcommand{\listalgorithmname}{\lstalgorithmlabel}
|
||||
% ------------------------------
|
||||
|
||||
% ------------------------------
|
||||
@ -527,3 +545,40 @@
|
||||
\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
|
||||
]{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
|
||||
@ -49,10 +53,6 @@
|
||||
% List of todos (not in the final document)
|
||||
%\listoftodos[\todolabel]
|
||||
|
||||
% Dokumentum beállítások
|
||||
% Some document settings
|
||||
\input{settings.tex}
|
||||
|
||||
% Címlap (kötelező)
|
||||
% Title page (mandatory)
|
||||
\maketitle
|
||||
@ -104,6 +104,13 @@
|
||||
\listoftables
|
||||
\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
|
||||
% List of codes (optional) - useful over 3-5 code samples
|
||||
\phantomsection
|
||||
|
Loading…
Reference in New Issue
Block a user