From 06c86213684e81ad9352044255c3853d8158575c Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:36:51 +0200 Subject: [PATCH 1/9] fix: reorder wrongly ordered packages pdfLaTeX compiler on Overleaf warns about packages 'inputenc' and 'microtype', which should both be placed before the package 'biblatex' --- FEIstyle.cls | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/FEIstyle.cls b/FEIstyle.cls index 39fba18..8e2573a 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -59,6 +59,8 @@ \usepackage[overload]{textcase} \usepackage[acronym,nopostdot,nogroupskip,nonumberlist]{glossaries} +\usepackage{microtype} +\usepackage[utf8]{inputenc} % we should use ISO 690 & 690-2 http://www.fei.stuba.sk/sk/kniznica-fei/vzory-bibliografickych-odkazov-a-citovanie.html?page_id=1756 % package for biblatex https://github.com/michal-h21/biblatex-iso690 \usepackage[backend=biber,style=iso-numeric,autolang=other,bibencoding=utf8,seconds=true]{biblatex} @@ -69,10 +71,7 @@ \usepackage[english]{babel} \fi -\usepackage[utf8]{inputenc} - \usepackage[style=slovak]{csquotes} -\usepackage{microtype} \usepackage[T1]{fontenc} \usepackage[immediate]{silence} From 56cfc9663b0b7577c8d22acd082da546ca3e078e Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:37:56 +0200 Subject: [PATCH 2/9] feat: replace package 'url' with 'xurl' 'xurl' loads 'url' package and adds some useful URL breaks. See: https://ctan.org/pkg/xurl --- FEIstyle.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FEIstyle.cls b/FEIstyle.cls index 8e2573a..ff50b2d 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -97,7 +97,7 @@ \usepackage{changepage} \usepackage{scrextend} \usepackage{xstring} -\usepackage{url} +\usepackage{xurl} \usepackage{enumitem} \usepackage{caption} \usepackage{subcaption} From d9abd66d31eac2f36eca2903a2fdddc851330716 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:40:06 +0200 Subject: [PATCH 3/9] feat: add package 'booktabs' for better tables 'booktabs' improves the design and usage of tables. See: https://ctan.org/pkg/booktabs --- FEIstyle.cls | 1 + includes/core.tex | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/FEIstyle.cls b/FEIstyle.cls index ff50b2d..242eaf6 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -104,6 +104,7 @@ \usepackage[bookmarksopen,colorlinks,plainpages=false,urlcolor=blue,hypertexnames=false,unicode]{hyperref} \usepackage{algorithm} \usepackage{algorithmic} +\usepackage{booktabs} % \usepackage{showframe} % debugging overflows % \cftsetpnumwidth{1.8em} % set the dots width in loX (f,t,l,a...) https://tex.stackexchange.com/q/369283/106389 diff --git a/includes/core.tex b/includes/core.tex index e03774a..613d9b8 100644 --- a/includes/core.tex +++ b/includes/core.tex @@ -10,7 +10,7 @@ \section{Možnosti anonymizácie} \subsection{Súkromné prehliadanie} \noindent Najpoužívanejšie internetové prehliadače súčasnosti majú v sebe zabudovanú funkcionalitu, ktorá dokáže čiastočne anonymizovať prístup na internet. Táto funkcionalita blokuje ukladanie navštívených stránok do histórie a nezaznamenáva súbory, ktoré sa stiahnu z~internetu. \acrshort{sw} a \acrlong{hw} sú skratky. -\begin{table}[!htbp] +\begin{table}[h] \caption{Moduly a ich funkcie pri anonymizácii} \label{modulyVlastnosti} \begin{center} @@ -35,12 +35,20 @@ \subsection{Súkromné prehliadanie} Proxify it & & &X & X & & & & & & & & & & \\ \hline I'm not here & & & & X & & & & & & & & & & \\ \hline Get edition & &X &X &X &X&X & & & & & & & & \\ \hline -Anonymous browsing toolbar & & & X & X & & & & & & & & & & \\ \hline -Easy hide your IP and surf & & & X & X& & & & X & X & X & X & & & \\ \hline \end{tabular} \end{center} \end{table} +\begin{table}[h] + \centering + \caption{Príklad tabuľky s použitím balíka \texttt{booktabs}} + \begin{tabular}{@{}ll@{}} \toprule + Veľkosť (B) & Typ správy \\ \midrule + 8 & Nejaký typ správy \\ \bottomrule + \end{tabular} + \label{tab:my_label} +\end{table} + \subsection{Anonymná sieť} \noindent Anonymná sieť je sieť serverov, medzi ktorými dáta prechádzajú šifrované. V anonymných sieťach dáta prechádzajú z počítača používateľa, odkiaľ bola požiadavka poslaná, cez viaceré proxy smerovače, z ktorých každý správu doplní o smerovanie a zašifruje vlastným kľúčom. Cesta od ... From 96cdeaa1b4e5f1f3ea601c949f08808a79adc5d5 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:41:59 +0200 Subject: [PATCH 4/9] feat: add accented slovak chars support for 'lstlisting' Based on the StackOverflow thread (link in the code, but also at the bottom of this message), there is no better way to support accented characters in latex, so people grouped up and provided sets of special characters for different languages. See: https://stackoverflow.com/a/74266238 --- FEIstyle.cls | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/FEIstyle.cls b/FEIstyle.cls index 242eaf6..7a48fc5 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -109,6 +109,46 @@ % \cftsetpnumwidth{1.8em} % set the dots width in loX (f,t,l,a...) https://tex.stackexchange.com/q/369283/106389 +% https://stackoverflow.com/a/74266238 +\lstset{ + extendedchars=true, + literate= + {á}{{\'a}}1 + {ä}{{\"a}}1 + {č}{{\v{c}}}1 + {ď}{{\v{d}}}1 + {é}{{\'e}}1 + {í}{{\'i}}1 + {ĺ}{{\'l}}1 + {ľ}{{\v{l}}}1 + {ň}{{\v{n}}}1 + {ó}{{\'o}}1 + {ô}{{\^o}}1 + {ŕ}{{\'{r}}}1 + {š}{{\v{s}}}1 + {ť}{{\v{t}}}1 + {ú}{{\'u}}1 + {ý}{{\'y}}1 + {ž}{{\v{z}}}1 + {Á}{{\'A}}1 + {Ä}{{\""A}}1 + {Č}{{\v{C}}}1 + {Ď}{{\v{C}}}1 + {É}{{\'E}}1 + {Í}{{\'I}}1 + {Ĺ}{{\'L}}1 + {Ľ}{{\v{L}}}1 + {Ň}{{\v{N}}}1 + {Ó}{{\'O}}1 + {Ô}{{\^O}}1 + {Ŕ}{{\'{R}}}1 + {Š}{{\v{S}}}1 + {Ť}{{\v{T}}}1 + {Ú}{{\'U}}1 + {Ý}{{\'Y}}1 + {Ž}{{\v{Z}}}1 +} + \newboolean{isThesis} \IfEqCase*{\isThesis}{ From e54a2efa7fba8597116a7b82adc88e3c4d533425 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:45:30 +0200 Subject: [PATCH 5/9] feat: add style 'code-listing' for lstlistings --- FEIstyle.cls | 24 ++++++++++++++++++++++++ includes/core.tex | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/FEIstyle.cls b/FEIstyle.cls index 7a48fc5..1ec8945 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -149,6 +149,30 @@ {Ž}{{\v{Z}}}1 } +% https://www.overleaf.com/learn/latex/Code_listing +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{code-listing}{ + backgroundcolor=\color{backcolour}, + commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\footnotesize, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=none, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=2 +} + \newboolean{isThesis} \IfEqCase*{\isThesis}{ diff --git a/includes/core.tex b/includes/core.tex index 613d9b8..b855857 100644 --- a/includes/core.tex +++ b/includes/core.tex @@ -95,7 +95,8 @@ \subsection{Vzhľad} \begin{lstlisting}[ caption={Ukážka algoritmu}, label={lst:main-c}, - language=c + language=c, + style=code-listing ] /* Hello World program */ From 644c1df6cbe76147da6a93d0f96377492c610619 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 17:58:34 +0200 Subject: [PATCH 6/9] fix: relax float placement If only 'h' is specified for float placement, Overleaf warns about it being 'too strict' and recommends to change it to at least 'ht' --- includes/core.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/core.tex b/includes/core.tex index b855857..8b50739 100644 --- a/includes/core.tex +++ b/includes/core.tex @@ -10,7 +10,7 @@ \section{Možnosti anonymizácie} \subsection{Súkromné prehliadanie} \noindent Najpoužívanejšie internetové prehliadače súčasnosti majú v sebe zabudovanú funkcionalitu, ktorá dokáže čiastočne anonymizovať prístup na internet. Táto funkcionalita blokuje ukladanie navštívených stránok do histórie a nezaznamenáva súbory, ktoré sa stiahnu z~internetu. \acrshort{sw} a \acrlong{hw} sú skratky. -\begin{table}[h] +\begin{table}[ht] \caption{Moduly a ich funkcie pri anonymizácii} \label{modulyVlastnosti} \begin{center} @@ -39,7 +39,7 @@ \subsection{Súkromné prehliadanie} \end{center} \end{table} -\begin{table}[h] +\begin{table}[ht] \centering \caption{Príklad tabuľky s použitím balíka \texttt{booktabs}} \begin{tabular}{@{}ll@{}} \toprule From b3dd9a396c367c4d64a1c02853ccb6268cc8f874 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 19:39:37 +0200 Subject: [PATCH 7/9] fix: referencing unknown language When specifying parameter 'langid={english}' in bibliography without telling 'babel' that we want to use it, it will work, but ask us to rerun LaTeX. --- FEIstyle.cls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FEIstyle.cls b/FEIstyle.cls index 1ec8945..b70fe92 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -66,7 +66,7 @@ \usepackage[backend=biber,style=iso-numeric,autolang=other,bibencoding=utf8,seconds=true]{biblatex} \ifnum\FEIenglish=0 - \usepackage[slovak]{babel} + \usepackage[english,slovak]{babel} \else \usepackage[english]{babel} \fi From a99bd09e9039632e219fb16c00ef9af9b58d80c7 Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Wed, 17 May 2023 22:34:21 +0200 Subject: [PATCH 8/9] chore: increase version --- CHANGELOG.md | 8 ++++++++ FEIstyle.cls | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f5a214..1302479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Changelog + - 1.6.4 (2023.05.17) + 1. fix order of packages `inputenc` and `microtype` + 2. replace package `url` with `xurl` + 3. add package `booktabs` + 4. add list of accented slovak characters for `lstlisting` + 5. add style `code-listing` for code listings + 6. fix referencing unknown language + - 1.6.3 (2023.04.17) 1. more thorough make clean 2. fix slovak labels (Výpis, Algoritmus) diff --git a/FEIstyle.cls b/FEIstyle.cls index b70fe92..0b457b9 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{FEIstyle}[2023/04/17 v. 1.6.3 Thesis template - FEI STUBA] +\ProvidesClass{FEIstyle}[2023/05/17 v. 1.6.4 Thesis template - FEI STUBA] % parse arguments \DeclareOption{dizp}{\def\typPraceSkr{dizp} From 75028ebcd60a5a9a3b709e913615dc157be09c0c Mon Sep 17 00:00:00 2001 From: Martin Kustra Date: Thu, 18 May 2023 01:57:31 +0200 Subject: [PATCH 9/9] chore: increase minor version instead of patch --- CHANGELOG.md | 2 +- FEIstyle.cls | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1302479..33c63d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog - - 1.6.4 (2023.05.17) + - 1.7.0 (2023.05.18) 1. fix order of packages `inputenc` and `microtype` 2. replace package `url` with `xurl` 3. add package `booktabs` diff --git a/FEIstyle.cls b/FEIstyle.cls index 0b457b9..6baa2ba 100644 --- a/FEIstyle.cls +++ b/FEIstyle.cls @@ -1,5 +1,5 @@ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{FEIstyle}[2023/05/17 v. 1.6.4 Thesis template - FEI STUBA] +\ProvidesClass{FEIstyle}[2023/05/18 v. 1.7.0 Thesis template - FEI STUBA] % parse arguments \DeclareOption{dizp}{\def\typPraceSkr{dizp}