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 6.1KB

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