From f526217ea55785855305cbd9f365e5bf1427709b Mon Sep 17 00:00:00 2001
From: novacto3 <tomas.novacek@fit.cvut.cz>
Date: Tue, 25 Jun 2024 08:15:53 +0200
Subject: [PATCH] New paragraph document class option

---
 README.md         |  2 +-
 changelog.md      |  8 ++++++++
 ctufit-thesis.cls | 17 +++++++++++++----
 ctufit-thesis.tex |  3 ++-
 4 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index 93ae238..dacaa17 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Recommended template for theses submitted at [Faculty of Information Technology]
 
 Version
 --------
-1.3.3, built 22. 6. 2024. The whole changelog can be found in the [Changelog file](changelog.md).
+1.3.4, built 25. 6. 2024. The whole changelog can be found in the [Changelog file](changelog.md).
 
 
 Bugs and support
diff --git a/changelog.md b/changelog.md
index 9719bb1..937f056 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
+# [1.3.4] - 25. 6. 2024
+  
+Added support for paragraphs as the deepest level of headings.
+ 
+### Added
+- Added "paragraph" option for document class. If passed, it styles the paragraph command as another level of heading, adds number to it and shows it in ToC. Use with care! Normally, it is considered unwise to use it, since its too deep.
+
+
 # [1.3.3] - 22. 6. 2024
   
 Fixed warning about header height. Update of arara compilation settings.
diff --git a/ctufit-thesis.cls b/ctufit-thesis.cls
index 3b5e24c..146bfa0 100644
--- a/ctufit-thesis.cls
+++ b/ctufit-thesis.cls
@@ -51,10 +51,17 @@
 	\PassOptionsToPackage{english,main=slovak}{babel}
 	\def\@ctufitlang{S}
 }
+\DeclareOption{subsubsection}{
+	\def\@ctufitsecdepth{3}
+}
+\DeclareOption{paragraph}{
+	\def\@ctufitsecdepth{4}
+}
 \PassOptionsToPackage{svgnames}{xcolor}
 \PassOptionsToPackage{newfloat}{minted}
 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
 \ExecuteOptions{unicode}
+\ExecuteOptions{subsubsection}
 \ProcessOptions\relax
 
 % main declarations, loading files
@@ -281,13 +288,13 @@
 \def\frontsubsectionfont{\large}
 \def\frontsubsubsectionfont{\bfseries}
 
-\setcounter{secnumdepth}{4} % numbering sections; 4: paragraph
+\setcounter{secnumdepth}{\@ctufitsecdepth} % numbering sections
 \newcommand{\stopTOCentries}{
   \addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
 }
 
 \newcommand{\resumeTOCentries}{
-  \addtocontents{toc}{\protect\setcounter{tocdepth}{4}} % table of content depth; 3: paragraph
+  \addtocontents{toc}{\protect\setcounter{tocdepth}{\@ctufitsecdepth}} % table of content depth
 }
 % frontmatter headings end
 % frontmatter pseudochapters: named part without printing actual chapter heading
@@ -416,8 +423,10 @@
 \titleformat{\subsubsection}
   {\large\bfseries\color{heading}}{{{\color{black}\thesubsubsection}}}{1em}{}%[\vskip -1em]
 
-\titleformat{\paragraph}
-  {\bfseries\color{heading}}{{{\color{black}\theparagraph}}}{1em}{}%[\vskip -1em]
+\ifnum\@ctufitsecdepth=4%if paragraph should be also styled
+  \titleformat{\paragraph}
+    {\bfseries\color{heading}}{{{\color{black}\theparagraph}}}{1em}{}%[\vskip -1em]
+\fi
 }
 %%%%%%%%%%%%%%%%%%%%
 % MAINMATTER SETTINGS END
diff --git a/ctufit-thesis.tex b/ctufit-thesis.tex
index b35616c..b07eecb 100644
--- a/ctufit-thesis.tex
+++ b/ctufit-thesis.tex
@@ -1,7 +1,7 @@
 %% This is the ctufit-thesis example file. It is used to produce theses
 %% for submission to Czech Technical University, Faculty of Information Technology.
 %%
-%% This is version 1.3.3, built 22. 6. 2024.
+%% This is version 1.3.4, built 25. 6. 2024.
 %% 
 %% Get the newest version from
 %% https://gitlab.fit.cvut.cz/theses-templates/FITthesis-LaTeX
@@ -37,6 +37,7 @@
 % thesis type: bachelor/master/dissertation
 % colour: bw for black&white OR no option for default colour scheme
 % electronic (oneside) or printed (twoside), twoside is default
+% paragraph - if passed, this optional argument sets paragraphs as the deepest level of headers, styles it, numbers it and adds it to Table of Content. Use with care! Normally, it is considered unwise to use it, since its too deep.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \documentclass[czech,bachelor,unicode,oneside]{ctufit-thesis}
 
-- 
GitLab