LaTeX class za diplomske i master teze na Katedri za tehničku mehaniku i teoriju konstrukcija Građevinskog fakulteta Univerziteta u Beogradu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tmtkthesis.cls 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. \NeedsTeXFormat{LaTeX2e}
  2. \ProvidesClass{tmtk}[2020/06/06 MSc BSc template class for GRF uni]
  3. \newif\if@msc
  4. \newif\if@bsc
  5. \newif\if@tocitem
  6. \@tocitemfalse
  7. \@mscfalse
  8. \@bscfalse
  9. \DeclareOption{msc}{\@msctrue}
  10. \DeclareOption{bsc}{\@bsctrue}
  11. \DeclareOption{tocitem}{\@tocitemtrue}
  12. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
  13. \ProcessOptions
  14. % \relax
  15. \LoadClass[a4paper, 12pt, oneside]{book}
  16. % PAGE
  17. \RequirePackage[margin=2cm]{geometry} % Margins
  18. % FONT
  19. \RequirePackage[T1, T2A]{fontenc} % Font rendering
  20. \RequirePackage[utf8]{inputenc} % Input encoding
  21. \RequirePackage[english, serbianc]{babel}
  22. \RequirePackage{microtype}
  23. % PARAGRAPH
  24. \widowpenalty10000 % Prevent widows
  25. \clubpenalty10000 % Prevent orphans
  26. \setlength{\parindent}{0pt} % Paragraph indentation
  27. \setlength{\parskip}{12pt} % Space between paragraphs
  28. % CHAPTER
  29. \RequirePackage{titlesec} % Modify titles style
  30. \titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter%
  31. \hspace{20pt}}{0pt}{} % Modify chapter style
  32. % NUMBERING
  33. \setcounter{secnumdepth}{5} % Depth of section numbering
  34. \RequirePackage{chngcntr}
  35. \counterwithout{figure}{chapter}
  36. \counterwithout{table}{chapter}
  37. \counterwithout{equation}{chapter}
  38. % HEADER AND FOOTER
  39. \RequirePackage{fancyhdr}
  40. \pagestyle{fancy}
  41. \makeatletter
  42. \renewcommand{\footrulewidth}{0.4pt}
  43. \renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
  44. \fancypagestyle{mainmatter}{
  45. \fancyhf{}
  46. \lhead{\nouppercase{\removelinebreaks\@naslov}}
  47. \rhead{}
  48. \if@bsc \lfoot{\nouppercase{\removelinebreaks\@student} - Дипломски рад} \fi
  49. \if@msc \lfoot{\nouppercase{\removelinebreaks\@student} - Мастер рад} \fi
  50. \cfoot{}
  51. \rfoot{\thepage}
  52. }
  53. \fancypagestyle{frontmatter}{
  54. \fancyhf{}
  55. \lhead{}
  56. \rhead{}
  57. \cfoot{}
  58. \rfoot{}
  59. }
  60. \fancypagestyle{plain}{
  61. \lhead{\nouppercase{\removelinebreaks\@naslov}}
  62. \rhead{}
  63. \if@bsc \lfoot{\nouppercase{\removelinebreaks\@student} - Дипломски рад} \fi
  64. \if@msc \lfoot{\nouppercase{\removelinebreaks\@student} - Мастер рад} \fi
  65. \cfoot{}
  66. \rfoot{\thepage}
  67. }
  68. \addtocontents{toc}{\protect\thispagestyle{frontmatter}}
  69. \makeatother
  70. % BIBLIOGRAPHY
  71. \addto{\captionsserbianc}{\renewcommand{\bibname}{Литература}}
  72. \RequirePackage{cite}
  73. % QUOTES
  74. \RequirePackage[style=german]{csquotes}
  75. % MATH
  76. \RequirePackage{amsmath}
  77. \RequirePackage{mathtools}
  78. \RequirePackage{siunitx}
  79. % REFERENCES & CAPTIONS
  80. \RequirePackage{hyperref} % use [hidelinks] to hide links
  81. \RequirePackage{subcaption}
  82. \captionsetup{justification=centering}
  83. % ITEMIZE
  84. \RequirePackage{enumitem}
  85. \setlist[itemize]{noitemsep, topsep=0pt}
  86. % TABLES
  87. \RequirePackage{booktabs}
  88. % TITLE PAGE
  89. \makeatletter
  90. \newcommand{\naslov}[2]{\gdef\@naslov{#1} \gdef\@title{#2}}
  91. \newcommand{\rezime}[2]{\gdef\@rezime{#1} \gdef\@abstract{#2}}
  92. \newcommand{\kljucnereci}[2]{\gdef\@kljucnereci{#1} \gdef\@keywords{#2}}
  93. \newcommand{\krataksadrzaj}[1]{\gdef\@krataksadrzaj{#1}}
  94. \newcommand{\predlogpoglavlja}[1]{\gdef\@predlogpoglavlja{#1}}
  95. \newcommand{\teza}[1]{\gdef\@teza{#1}}
  96. \newcommand{\mentor}[1]{\gdef\@mentor{#1}}
  97. \newcommand{\student}[2]{\gdef\@student{#1} \gdef\@studentEN{#2}}
  98. \newcommand{\odobreno}[1]{\gdef\@odobreno{#1}}
  99. \newcommand{\godina}[1]{\gdef\@godina{#1}}
  100. \newcommand{\removelinebreaks}[1]{%
  101. \begingroup\def\n{ }#1\endgroup}
  102. \newcommand{\n}{\vadjust{\vspace{12pt}}\nolinebreak\hspace{\fill}\linebreak}
  103. \renewcommand{\maketitle}{
  104. \frontmatter
  105. \pagestyle{frontmatter}
  106. \begin{titlepage}
  107. \begin{center}
  108. {\fontsize{16}{\baselineskip}\selectfont УНИВЕРЗИТЕТ У БЕОГРАДУ\\[6pt] ГРАЂЕВИНСКИ ФАКУЛТЕТ}
  109. \includegraphics[width=46mm]{img/grf.png}
  110. \vspace{2cm}
  111. {\fontsize{20}{\baselineskip}\selectfont\bfseries\MakeUppercase{\@naslov}}
  112. \vspace{1cm}
  113. { \fontsize{16}{\baselineskip}\selectfont
  114. \if@bsc - ДИПЛОМСКИ РАД - \fi
  115. \if@msc - МАСТЕР РАД - \fi
  116. }
  117. \vfill
  118. { \fontsize{16}{\baselineskip}\selectfont
  119. \begin{tabular*}{\textwidth}{l @{\extracolsep{\fill}} l}
  120. \textbf{Ментор:} & \textbf{Кандидат:} \\[12pt]
  121. \@mentor & \@student \\
  122. \end{tabular*}
  123. }
  124. \vspace{1cm}
  125. { \fontsize{16}{\baselineskip}\selectfont Београд, \@godina }
  126. \end{center}
  127. \end{titlepage}
  128. }
  129. \newcommand{\prvestrane}{
  130. \textbf{%
  131. \if@bsc ДИПЛОМСКИ РАД \fi
  132. \if@msc МАСТЕР РАД \fi
  133. ИЗ УЖЕ НАУЧНЕ ОБЛАСТИ:}\\
  134. ТЕХНИЧКА МЕХАНИКА И ТЕОРИЈА КОНСТРУКЦИЈА
  135. \textbf{Кандидат:} \@student
  136. \textbf{Тема:} \removelinebreaks{\@naslov}
  137. \textbf{Кратак садржај рада (попуњава ментор):}
  138. \if@tocitem
  139. \begin{enumerate}[itemsep=0mm, topsep=0mm]
  140. \@krataksadrzaj
  141. \end{enumerate}
  142. \else
  143. \@krataksadrzaj
  144. \fi
  145. \textbf{Предлог поглавља (попуњава ментор):}
  146. \begin{enumerate}[itemsep=0mm, topsep=0mm]
  147. \@predlogpoglavlja
  148. \end{enumerate}
  149. Тема
  150. \if@bsc дипломског рада \fi
  151. \if@msc мастер рада \fi
  152. рада одобрена је на седници
  153. Катедре за техничку механику и теорију конструкција
  154. одржаној \@odobreno{} године.
  155. \hfill
  156. \begin{tabular}{@{}l@{}}
  157. Ментор,\\
  158. \@mentor
  159. \end{tabular}
  160. \newpage
  161. {\bfseries\removelinebreaks{\MakeUppercase{\@naslov}}}
  162. \textbf{Резиме:}
  163. {\@rezime}
  164. \textbf{Kljuчне речи:}
  165. {\@kljucnereci}
  166. \vspace{1cm}
  167. {\bfseries\MakeUppercase{\@title}}
  168. \textbf{Abstract:}
  169. {\@abstract}
  170. \textbf{Keywords:}
  171. {\@keywords}
  172. }
  173. \newcommand{\sadrzaj}{
  174. \tableofcontents
  175. \mainmatter
  176. \pagestyle{mainmatter}
  177. }
  178. \makeatother