%%====================================================================%
%%                              DyplomUS.cls
%%                         --------------------
%%  Date & ver : 2023/08/28 v1.10
%%  University : Uniwersytet Śląski w Katowicach
%%               Wydział Nauk Ścisłych i Technicznych
%%  Authors    : Marcin Zygmunt
%%--------------------------------------------------------------------%
%%
%% Copyright 2023 by Marcin Zygmunt <marcin.zygmunt@us.edu.pl>
%%--------------------------------------------------------------------%
%%
%% This is file `dyplomus.cls',
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%--------------------------------------------------------------------%
%%
%% This work has the LPPL maintenance status `maintained'.
%% The Current Maintainer of this work is Marcin Zygmunt.
%%
%% This work consists of all files listed in the file 'ReadMe'.
%%====================================================================%
%% 
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{dyplomus}
  [2023/06/21 v1.06 Praca dyplomowa z matematyki na WNST (US, Katowice)]
%
\typeout{=======================================}
\typeout{ UNIWERSYTET SLASKI w KATOWICACH       }
\typeout{ WYDZIAL NAUK SCISLYCH i TECHNICZNYCH  }
\typeout{ Class : dyplomus [2023/08/28 v1.10]   }
\typeout{ Author: Marcin Zygmunt                }
\typeout{=======================================}
%
\newif\if@restonecol
\newif\if@titlepage\@titlepagetrue
\newif\if@secondpage\@secondpagefalse
\newif\if@openright\@openrightfalse
\newif\if@mainmatter\@mainmattertrue
\newif\ifHeadingNumbered
\newif\if@authorfirst
\newif\if@wide\@widefalse
\newif\ifdyplomus@pdftex\dyplomus@pdftexfalse
\newif\ifdyplomus@marginpar\dyplomus@marginparfalse
\newif\ifdyplomus@smallfont\dyplomus@smallfontfalse
\newif\ifdyplomus@draft\dyplomus@draftfalse
\newif\ifdyplomus@man\dyplomus@manfalse
\newif\ifdyplomus@oldlayout\dyplomus@oldlayoutfalse
\ifx\l@nohyphenation\@undefined
  \newlanguage\l@nohyphenation
\fi
%
%
% -------------------------
%   Podstawowe opcje klasy 
% -------------------------
%
\DeclareOption{a4paper}
	{\setlength\paperheight{297mm}%
   \setlength\paperwidth{210mm}}
\DeclareOption{a5paper}
	{\setlength\paperheight{210mm}%
	 \setlength\paperwidth{148mm}}
\DeclareOption{b5paper}
  {\setlength\paperheight{250mm}%
   \setlength\paperwidth{176mm}}
\DeclareOption{letterpaper}
  {\setlength\paperheight{11in}%
   \setlength\paperwidth{8.5in}}
\DeclareOption{legalpaper}
  {\setlength\paperheight {14in}%
   \setlength\paperwidth  {8.5in}}
\DeclareOption{landscape}
  {\setlength\@tempdima{\paperheight}%
   \setlength\paperheight{\paperwidth}%
   \setlength\paperwidth{\@tempdima}}
\DeclareOption{marginpar}{\dyplomus@marginpartrue}
\DeclareOption{nomarginpar}{\dyplomus@marginparfalse}

\newcommand\dyplomus@usedd{%
	\p@=1dd
	\def\@vpt{5dd}%
	\def\@vipt{6dd}%
	\def\@viipt{7dd}%
	\def\@viiipt{8dd}%
	\def\@ixpt{9dd}%
	\def\@xpt{10dd}%
	\def\@xipt{11dd}%
	\def\@xiipt{12dd}%
	\def\@xivpt{14dd}%
	\def\@xviipt{16dd}%
	\def\@xxpt{18dd}%
	\def\@xxvpt{24dd}%
}
\newcommand\@ptsize{2}
\newcommand\dyplomus@basesize{12}
\newcommand\dyplomus@sizesymbol{N}
\DeclareOption{10pt}{\renewcommand\@ptsize{0}\renewcommand\dyplomus@sizesymbol{S}\def\dyplomus@basesize{10}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}\renewcommand\dyplomus@sizesymbol{M}\def\dyplomus@basesize{11}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}\renewcommand\dyplomus@sizesymbol{N}\def\dyplomus@basesize{12}}
\DeclareOption{smallsize}{% 10pt
	\renewcommand\@ptsize{0}\def\dyplomus@basesize{10}\renewcommand\dyplomus@sizesymbol{S}\dyplomus@smallfonttrue}
\DeclareOption{normalsize}{% 12pt
	\renewcommand\@ptsize{2}\def\dyplomus@basesize{12}\renewcommand\dyplomus@sizesymbol{N}\dyplomus@smallfontfalse}

\DeclareOption{oneside}{\@twosidefalse\@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue\@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\DeclareOption{titlepage}{\@titlepagetrue}
\DeclareOption{notitlepage}{\@titlepagefalse}
\DeclareOption{secondpage}{\@secondpagetrue}
\DeclareOption{nosecondpage}{\@secondpagefalse}
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}
\DeclareOption{onecolumn}{\@twocolumnfalse}
\DeclareOption{twocolumn}{\@twocolumntrue}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{openbib}{%
  \AtEndOfPackage{%
   \renewcommand\@openbib@code{%
      \advance\leftmargin\bibindent
      \itemindent -\bibindent
      \listparindent \itemindent
      \parsep \z@
      }%
   \renewcommand\newblock{\par}}%
}
%
% ----------------------------------
%  Opcje i definicje dla tytulariow
% ----------------------------------
%
\newcommand*\ussectsetup{\bfseries}
\newcommand*\uscaptionsetup{\small}
\newcommand*\secondarysize{\small}
\DeclareOption{rmheadings}{%
  \def\ussectsetup{\rmfamily\bfseries}%
}
\DeclareOption{sfheadings}{%
  \def\ussectsetup{\sffamily\bfseries}%
}
\DeclareOption{floatssmall}{%
  \def\usfiguresetup{\small}%
  \def\ustablesetup{\small}%
}
\DeclareOption{floatsnormalsize}{%
  \def\usfiguresetup{\normalsize}%
  \def\ustablesetup{\normalsize}%
}
\DeclareOption{indentfirst}{\@afterindenttrue}
\DeclareOption{noindentfirst}{\@afterindentfalse}
%
% -----------------------------------------
%  Opcje i definicje specyficzne dla klasy
% -----------------------------------------
% 
\def\dyplomus@format@output{dvips}
\newif\ifdyplomus@pdftexexpl\dyplomus@pdftexexplfalse
\newif\ifdyplomus@NoMathSpecial\dyplomus@NoMathSpecialfalse
\DeclareOption{dvips}{%
	\dyplomus@pdftexexplfalse\gdef\dyplomus@format@output@expl{X}}
\DeclareOption{pdftex}{%
	\dyplomus@pdftexexpltrue\gdef\dyplomus@format@output@expl{X}}
\DeclareOption{robocza}{\dyplomus@drafttrue}
\DeclareOption{woman}{\dyplomus@manfalse\gdef\dyplomus@ManWoman@Chck{F}}
\DeclareOption{man}{\dyplomus@mantrue\gdef\dyplomus@ManWoman@Chck{M}}
% --  deklaracja rodzaju dysertacji -- 
\DeclareOption{lic}{\gdef\dyplomus@Type{LIC}}% praca licencjacka
\DeclareOption{mgr}{\gdef\dyplomus@Type{MGR}}% praca magisterska
\DeclareOption{inz}{\gdef\dyplomus@Type{INZ}}% praca inzynierska
\DeclareOption{sem}{\gdef\dyplomus@Type{SEM}}% praca semestralna (nie dyplomowa!)
% --  deklaracja wydziału -- 
\DeclareOption{wnst}{\gdef\dyplomus@Faculty{WNST}}% Wydzial Nauk Scislych i Technicznych
\DeclareOption{bez}{\dyplomus@NoMathSpecialtrue\gdef\dyplomus@Faculty{BRAK}}% Bez wskazania wydziału
%
% Miejsce dla opcji i specjalnosci innych kierunków 
%

%
% Domyślne opcje klasy 
%
\ExecuteOptions{a4paper,oneside,onecolumn,titlepage,nosecondpage,wnst,lic%
								final,nomarginpar,indentfirst,floatsnormalsize}
\ProcessOptions
%
% Pakiety
% -------
% Taken from ifpdf.sty (2007/09/09 v1.5, by Heiko Oberdiek)
% Thank you Heiko for this nice package! :)
\ifx\pdfoutput\undefined
	\else
	\ifx\pdfoutput\relax
		\else
		\ifnum\pdfoutput<1
			\dyplomus@pdftexfalse
		\else
			\dyplomus@pdftextrue
		\fi
	\fi
\fi
%
\@ifundefined{dyplomus@fomat@output@expl}{}{%
	\ifdyplomus@pdftexexpl\dyplomus@pdftextrue
	\else\dyplomus@pdftexfalse\fi}%
\ifdyplomus@pdftex
	\def\dyplomus@format@output{pdftex}
	\ClassInfo{dyplomus}{Kompilacja przy uzyciu pdfLaTeX-a}
\else
	\def\dyplomus@format@output{dvips}
	\ClassInfo{dyplomus}{Kompilacja przy uzyciu LaTeX-a}
\fi
\RequirePackage[unknownkeysallowed]{keyval}
\RequirePackage[\dyplomus@format@output]{graphicx}
\RequirePackage[\dyplomus@format@output]{color}
% 
% ---------------------
%  Dodatkowe definicje
% ---------------------
% 
% ----- Polskie podpisy ----- %
%\newcommand*{\figurename}{Rys.}
%\newcommand*{\tablename}{Tab.}
%
% 
% ----- Pomocnicze liczniki i dlugosci ----- %
\newcounter{dyplomus@cnt@a}
\newlength{\dyplomus@dim@a}
\newlength{\dyplomus@dim@b}
\newlength{\dyplomus@dim@c}
\newlength{\dyplomus@dim@toc}  % dla TOC
\newbox\dyplomus@box@a
%
% ----- Ostrzezenia i bledy ---------------- %
\newcommand{\dyplomus@Error}[2]{\ClassError{dyplomus}{#1}{#2}}
\newcommand{\dyplomus@Warning}[1]{\ClassWarning{dyplomus}{#1}}
\newcommand{\dyplomus@Info}[1]{\ClassInfo{dyplomus}{#1}}
% 
% ----- Linie ------------------------------ %
\newcommand*{\dyplomus@GrayLine}[3]{%
	{\definecolor{dyplomus@blueA}{gray}{#1}{\color{dyplomus@blueA}\rule{#2}{#3}}}%
%	{\definecolor{dyplomus@blueA}{blue}{#1}{\color{dyplomus@blueA}\rule{#2}{#3}}}%
%	{\definecolor{dyplomus@blueA}{rgb}{.0,.1765,.349}{\color{dyplomus@blueA}\rule{#2}{#3}}}%
}
\def\hrulefillA#1{\leavevmode\leaders\hrule height#1\hfill\kern\z@}
%\def\hrulefillBlue#1#2{%
%	\definecolor{dyplomus@blueA}{blue}{#1}%
%  \leavevmode\leaders{\color{dyplomus@blueA}\hrule height#2}\hfill\kern\z@
% {\definecolor{dyplomus@blueA}{rgb}{.0,.1765,.349}\leavevmode\leaders{\color{dyplomus@blueA}\hrule height#2}\hfill\kern\z@}%
%}
% 
% ----- Operacje na dlugosciach ------------ %
\newcommand{\dyplomus@AddTwoDimOnBoxes}[3]{%
	\setbox\dyplomus@box@a\hbox{\rule{#1}{1pt}\rule{#2}{1pt}}%
	\expandafter\xdef\csname #3\endcsname{\the\wd\dyplomus@box@a}%
}
% 
% ----- Def4Def ---------------------------- %
\def\dyplomusDef#1#2#3{%
	\global\expandafter
	\def\csname #1\endcsname##1{%
		\global\expandafter
		\def\csname #2\endcsname{##1}%
	}\global\expandafter
	\def\csname #2\endcsname{#3}%
}
% 
% ----- definicje do KeyVal ---------------- %
% Taken from hyperref.sty (2003/11/30 v6.74m, by Sebastian Rahtz)
% Thank you Sebastian for this nice package! :)
%
\def\dyplomus@true{true}
\def\dyplomus@false{false}
\def\dyplomus@Expand@Key#1#2#3#4#5{%
	\lowercase{\def\dyplomus@bool@def{#2}}%
	\lowercase{\def\dyplomus@bool{#3}}%
	\ifx\dyplomus@bool\dyplomus@true
  \else
    \ifx\dyplomus@bool\dyplomus@false
    \else
			\dyplomus@Warning{`#1' should be set to `true' or `false', set to	default: `#2'}%
      \let\dyplomus@bool\dyplomus@bool@def
    \fi
  \fi
	\ifx\dyplomus@bool\dyplomus@true #4
	  \else
		\ifx\dyplomus@bool\dyplomus@false #5
	\else\relax\fi\fi
}
%
\def\dyplomus@Expand@Key@Boolean#1#2#3#4{%
	\lowercase{\def\dyplomus@bool@def{#2}}%
	\lowercase{\def\dyplomus@bool{#3}}%
	\ifx\dyplomus@bool\dyplomus@true
  \else
    \ifx\dyplomus@bool\dyplomus@false
    \else
			\dyplomus@Warning{`#1' should be set to `true' or `false', set to	default: `#2'}%
			\let\dyplomus@bool\dyplomus@bool@def
    \fi
  \fi
	\csname #4\dyplomus@bool\endcsname
}
%
\def\dyplomus@ProcessOptionsWithKV{%
  \let\@tempc\relax
  \let\dyplomus@tempa\@empty
  \@for\CurrentOption:=\@classoptionslist\do{%
    \@ifundefined{KV@dyplomus@\CurrentOption}%
    {}%
    {%
      \edef\dyplomus@tempa{\dyplomus@tempa,\CurrentOption,}%
      \@expandtwoargs\@removeelement\CurrentOption
        \@unusedoptionlist\@unusedoptionlist
    }%
  }%
  \edef\dyplomus@tempa{%
    \noexpand\setkeys{dyplomus}{%
      \dyplomus@tempa\@ptionlist{\@currname.\@currext}%
    }%
  }%
  \dyplomus@tempa
}
%
% ----- komendy do truncate ---------------- %
% Taken from truncate.sty (ver 3.6, 20-Aug-2001, by Donald Arseneau)
% Thank you Donald for this nice package! :)
\let\dyplomus@DATrunc@Pre\@empty
\def\dyplomus@DATrunc@Post{\hyphenpenalty\@M}
\def\dyplomus@DATrunc@Rebox{%
  \setbox\z@\hbox{\unhbox\z@\unskip\unskip\@tempa}%
  \ifdim\wd\z@>\hsize \hbox to\hsize{\unhbox\z@}\else \box\z@\fi}
\let\dyplomus@DATrunc@DoSelect\@empty
\newcommand{\dyplomusTruncate}[3][\,\ldots]{%
  \parbox[b]{#2}{\tolerance9999 \emergencystretch .216\hsize
		\vbadness\maxdimen \vfuzz\vsize
		\hbadness\maxdimen \hfuzz\vsize
		\edef\@tempb{\the\dyplomus@DATrunc@RestHyph}%
		\global\dyplomus@DATrunc@RestHyph{}%
		\ifx\dyplomus@DATrunc@DoSelect\relax
			\let\dyplomus@DATrunc@DoSelect\selectfont
			\def\selectfont{\dyplomus@DATrunc@DoSelect\dyplomus@DATrunc@SaveHChar}%
		\fi
		\dyplomus@DATrunc@SaveHChar
		\setbox\z@\vbox\bgroup
    \setbox\z@\@@line{\ignorespaces #3\unskip\unskip\hfil}%
    \ifnum\badness>\@M
      \settowidth\rightskip{#1}%
      \advance\rightskip \z@\@plus\p@
      \parfillskip-\@ne\rightskip \@plus\@ne fil 
      \parshape \tw@ \z@\hsize \z@\maxdimen \linepenalty60
      \tracinglostchars\z@
      \dyplomus@DATrunc@Pre
      \noindent \vadjust{\penalty-\@MM}%
      \nobreak\hskip\z@skip
      \ignorespaces #3%
      \pretolerance\hyphenpenalty \dyplomus@DATrunc@Post
      \@@par
      \ifnum\prevgraf>\@ne
				\egroup \def\@tempa{#1}%
      \else
				\egroup \let\@tempa\@empty%
      \fi
    \else
      \box\z@ \egroup \let\@tempa\@empty%
    \fi
		\setbox\@tempboxa\vsplit\z@ to\z@ \unvbox\@tempboxa
		\unskip\unpenalty\unpenalty
		\setbox\z@\lastbox
		\nointerlineskip
		\hfuzz\p@
		\dyplomus@DATrunc@Rebox
		\let\dyplomus@DATrunc@HC\@firstofone \the\dyplomus@DATrunc@RestHyph
		\global\dyplomus@DATrunc@RestHyph\expandafter{\@tempb}%
}}%
\newtoks\dyplomus@DATrunc@RestHyph
\global\dyplomus@DATrunc@RestHyph{}
\def\dyplomus@DATrunc@SaveHChar{%
	\begingroup
  \edef\@tempa{%
    \hyphenchar\the\font=\noexpand\dyplomus@DATrunc@HC{\the\hyphenchar\font}\relax 
    \the\dyplomus@DATrunc@RestHyph}%
  \global\dyplomus@DATrunc@RestHyph\expandafter{\@tempa}%
  \endgroup
}
\def\dyplomus@DATrunc@HC#1{%
  \@ifundefined{\f@encoding\string\textcompwordmark}{%
    \@ifundefined{\string\dyplomus@DATruncHyph\f@encoding}%
			{32}%
			{\csname \string\dyplomus@DATruncHyph\f@encoding\endcsname}%
  }{\csname\f@encoding\string\textcompwordmark\endcsname}%
}
%
% --- polecenie do niezerowania danego licznika wraz z innym -- %
% Taken from remreset.sty (1997/09/28, by David Carlisle)
% Thank you David for this nice package! :)
% #1 - jaki licznik bedzie zerowany, #2 - jaki byl nadrzedny
% 
\def\dyplomus@RemoveFromReset#1#2{{%
	\expandafter\let\csname c@#1\endcsname\dyplomus@RemoveFromReset
	\def\dyplomus@elt##1{%
		\expandafter\ifx\csname c@##1\endcsname\dyplomus@RemoveFromReset
		\else
			\noexpand\dyplomus@elt{##1}%
    \fi}%
  \expandafter\xdef\csname cl@#2\endcsname{%
    \csname cl@#2\endcsname}}%
}
% 
% -- polskie literki (UWAGA: lepiej używać kodowania UTF8) -- %
% 
\def\dyplomus@PLlet@def#1#2{%
  \expandafter\def \csname PL@\string #1\endcsname{#2}}
\dyplomus@PLlet@def{A}{\char129}\dyplomus@PLlet@def{a}{\char161}
\dyplomus@PLlet@def{C}{\char130}\dyplomus@PLlet@def{c}{\char162}
\dyplomus@PLlet@def{E}{\char134}\dyplomus@PLlet@def{e}{\char166}
\dyplomus@PLlet@def{L}{\L}\dyplomus@PLlet@def{l}{\l}
%\dyplomus@PLlet@def{L}{\char138}\dyplomus@PLlet@def{l}{\char170}
\dyplomus@PLlet@def{N}{\char139}\dyplomus@PLlet@def{n}{\char171}
\dyplomus@PLlet@def{O}{\char211}\dyplomus@PLlet@def{o}{\char243}
\dyplomus@PLlet@def{S}{\'S}\dyplomus@PLlet@def{s}{\'s}
%\dyplomus@PLlet@def{S}{\char145}\dyplomus@PLlet@def{s}{\char177}
\dyplomus@PLlet@def{X}{\char153}\dyplomus@PLlet@def{x}{\char185}
\dyplomus@PLlet@def{Z}{\char155}\dyplomus@PLlet@def{z}{\char187}
%
% ----- pojedyncza interlinia -------------- %
% Taken from setspace.sty (2000/12/01 v6.7, by Geoffrey Tobin)
% Thank you Geoffrey for this nice package! :)
% 
\newcommand{\dyplomus@SingleSpacing}{%
  \def\baselinestretch{1}%
  \@currsize
}
%
% ----- półtora interlinii -------------- %
% 
\newcommand{\dyplomus@DoubleSpacing}{%
  \def\baselinestretch{1.5}%
  \@currsize
}
%
%
% --------------------------------------------
%   Ustawienia dla czcionki podstawowej
% --------------------------------------------
%
\newcommand\small{\@empty}
\newcommand\footnotesize{\@empty}
\newcommand\scriptsize{\@empty}
\newcommand\tiny{\@empty}
\newcommand\large{\@empty}
\newcommand\Large{\@empty}
\newcommand\LARGE{\@empty}
\newcommand\huge{\@empty}
\newcommand\Huge{\@empty}
% 
% ------------------
%  10pt (SmallSize)
% ------------------
\newcommand{\dyplomus@SizeDef@S}{%
\renewcommand\normalsize{%
  \@setfontsize\normalsize\@xpt\@xiipt
  \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  \abovedisplayshortskip \z@ \@plus3\p@
  \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  \belowdisplayskip \abovedisplayskip
}%
\normalsize
\renewcommand\small{%
  \@setfontsize\small\@ixpt{11}%
  \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
  \abovedisplayshortskip \z@ \@plus2\p@
  \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  \belowdisplayskip \abovedisplayskip
}%
\renewcommand\footnotesize{%
  \@setfontsize\footnotesize\@viiipt{9.5}%
  \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
  \abovedisplayshortskip \z@ \@plus\p@
  \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
  \belowdisplayskip \abovedisplayskip
}%
\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}%
\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}%
\renewcommand\large{\@setfontsize\large\@xiipt{14}}%
\renewcommand\Large{\@setfontsize\Large\@xivpt{18}}%
\renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}%
\renewcommand\huge{\@setfontsize\huge\@xxpt{25}}%
\renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}%
\setlength\smallskipamount{.25\baselineskip \@plus.125\baselineskip
  \@minus.0625\baselineskip}%
\setlength\medskipamount{.5\baselineskip \@plus.25\baselineskip
  \@minus.125\baselineskip}%
\setlength\bigskipamount{1\baselineskip \@plus.5\baselineskip
  \@minus.25\baselineskip}%
%
\setlength\footnotesep{6.65\p@}%
\setlength{\skip\footins}{9\p@ \@plus 4\p@ \@minus 2\p@}%
\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\@fptop{0\p@ \@plus 1fil}%
\setlength\@fpsep{8\p@ \@plus 2fil}%
\setlength\@fpbot{0\p@ \@plus 1fil}%
\setlength\@dblfptop{0\p@ \@plus 1fil}%
\setlength\@dblfpsep{8\p@ \@plus 2fil}%
\setlength\@dblfpbot{0\p@ \@plus 1fil}%
}
% 
% -------------------
%  11pt (MediumSize)
% -------------------
\newcommand{\dyplomus@SizeDef@M}{%
\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xipt{13.6}%
   \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
}%
\normalsize
\renewcommand\small{%
   \@setfontsize\small\@xpt\@xiipt
   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
}%
\renewcommand\footnotesize{%
   \@setfontsize\footnotesize\@ixpt{11}%
   \abovedisplayskip 8\p@ \@plus2\p@ \@minus4\p@
   \abovedisplayshortskip \z@ \@plus\p@
   \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
   \belowdisplayskip \abovedisplayskip
}%
\renewcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}%
\renewcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}%
\renewcommand\large{\@setfontsize\large\@xiipt{14}}%
\renewcommand\Large{\@setfontsize\Large\@xivpt{18}}%
\renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}%
\renewcommand\huge{\@setfontsize\huge\@xxpt{25}}%
\renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}% 
\setlength\smallskipamount{.25\baselineskip \@plus.125\baselineskip
        \@minus.0625\baselineskip}%
\setlength\medskipamount{.5\baselineskip \@plus.25\baselineskip
        \@minus.125\baselineskip}%
\setlength\bigskipamount{1\baselineskip \@plus.5\baselineskip
        \@minus.25\baselineskip}%
%
\setlength\footnotesep{7.7\p@}%
\setlength{\skip\footins}{10\p@ \@plus 4\p@ \@minus 2\p@}%
\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\dblfloatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}%
\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\@fptop{0\p@ \@plus 1fil}%
\setlength\@fpsep{8\p@ \@plus 2fil}%
\setlength\@fpbot{0\p@ \@plus 1fil}%
\setlength\@dblfptop{0\p@ \@plus 1fil}%
\setlength\@dblfpsep{8\p@ \@plus 2fil}%
\setlength\@dblfpbot{0\p@ \@plus 1fil}%
}
% 
% -------------------
%  12pt (NormalSize)
% -------------------
\newcommand{\dyplomus@SizeDef@N}{%
\renewcommand\normalsize{%
  \@setfontsize\normalsize\@xiipt{14.5}%
  \abovedisplayskip 12\p@ \@plus3\p@ \@minus7\p@
  \abovedisplayshortskip \z@ \@plus3\p@
  \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  \belowdisplayskip \abovedisplayskip
}%
\normalsize
\renewcommand\small{%
  \@setfontsize\small\@xipt{13.6}%
  \abovedisplayskip 11\p@ \@plus3\p@ \@minus6\p@
  \abovedisplayshortskip \z@ \@plus3\p@
  \belowdisplayshortskip 6.5\p@ \@plus3.5\p@ \@minus3\p@
  \belowdisplayskip \abovedisplayskip
}%
\renewcommand\footnotesize{%
  \@setfontsize\footnotesize\@xpt\@xiipt
  \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  \abovedisplayshortskip \z@ \@plus3\p@
  \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  \belowdisplayskip \abovedisplayskip
}%
\renewcommand\scriptsize{\@setfontsize\scriptsize\@viiipt{9.5}}%
\renewcommand\tiny{\@setfontsize\tiny\@vipt\@viipt}%
\renewcommand\large{\@setfontsize\large\@xivpt{18}}%
\renewcommand\Large{\@setfontsize\Large\@xviipt{22}}%
\renewcommand\LARGE{\@setfontsize\LARGE\@xxpt{25}}%
\renewcommand\huge{\@setfontsize\huge\@xxvpt{30}}%
\let\Huge=\huge
\setlength\smallskipamount{.25\baselineskip \@plus.125\baselineskip
	\@minus.0625\baselineskip}%
\setlength\medskipamount{.5\baselineskip \@plus.25\baselineskip
	\@minus.125\baselineskip}%
\setlength\bigskipamount{1\baselineskip \@plus.5\baselineskip
  \@minus.25\baselineskip}%
%
\setlength\footnotesep{8.4\p@}%
\setlength{\skip\footins}{10.8\p@ \@plus 4\p@ \@minus 2\p@}%
\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\intextsep   {14\p@ \@plus 4\p@ \@minus 4\p@}%
\setlength\dblfloatsep    {14\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\dbltextfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}%
\setlength\@fptop{0\p@ \@plus 1fil}%
\setlength\@fpsep{10\p@ \@plus 2fil}%
\setlength\@fpbot{0\p@ \@plus 1fil}%
\setlength\@dblfptop{0\p@ \@plus 1fil}%
\setlength\@dblfpsep{10\p@ \@plus 2fil}%
\setlength\@dblfpbot{0\p@ \@plus 1fil}%
}
\csname dyplomus@SizeDef@\dyplomus@sizesymbol\endcsname
\normalsize
%
%
% ---------------------------
%   Dane do pakietu KeyVal
% ---------------------------
%
% -----------
%  Marginesy
% -----------
\newlength{\dyplomusleft}\newlength{\dyplomusright}
\newlength{\dyplomustop}\newlength{\dyplomusbottom}
\setlength{\dyplomusleft}{3.2cm}
\setlength{\dyplomusright}{2.5cm}
\setlength{\dyplomustop}{1.75cm}
\setlength{\dyplomusbottom}{2.2cm}
\def\dyplomus@AddToHeadHeight{0pt}
\def\dyplomus@AddToHeadSep{0pt}
\def\dyplomus@AddToFootSkip{0pt}
%
\define@key{dyplomus}{usleftmargin}{\setlength{\dyplomusleft}{#1}}
\define@key{dyplomus}{usrightmargin}{\setlength{\dyplomusright}{#1}}
\define@key{dyplomus}{uslrmargins}{\setlength{\dyplomusleft}{#1}\setlength{\dyplomusright}{#1}}
\define@key{dyplomus}{ustopmargin}{\setlength{\dyplomustop}{#1}}
\define@key{dyplomus}{usbottommargin}{\setlength{\dyplomusbottom}{#1}}
\define@key{dyplomus}{ustbmargins}{\setlength{\dyplomustop}{#1}\setlength{\dyplomusbottom}{#1}}
\define@key{dyplomus}{usaddtoheadheight}{\def\dyplomus@AddToHeadHeight{#1}}
\define@key{dyplomus}{usaddtoheadsep}{\def\dyplomus@AddToHeadSep{#1}}
\define@key{dyplomus}{usaddtofootskip}{\def\dyplomus@AddToFootSkip{#1}}
% 
% --------
%  Pagina
% --------
\newif\ifdyplomus@grayline\dyplomus@graylinetrue
\newif\ifdyplomus@headtruncate\dyplomus@headtruncatetrue
\newif\ifdyplomus@closingfoot\dyplomus@closingfootfalse
\newif\ifdyplomus@draftframe\dyplomus@draftframetrue
\newif\ifdyplomus@draftauthor\dyplomus@draftauthorfalse
\newlength{\dyplomus@HeadToLine}
\newlength{\dyplomus@LineHeight}
\setlength{\dyplomus@HeadToLine}{2.5pt}
\setlength{\dyplomus@LineHeight}{1.5pt} % wczesniej 0.5pt
\def\dyplomus@HeadStyle{\small\slshape}
\def\dyplomus@PageNumberStyle{\normalsize}
\def\dyplomus@DraftFootStyle{\ttfamily\small}
\def\dyplomus@MyHeaderTextStyle{\rmfamily\small}
\def\dyplomus@MyHeaderText{\@empty}
\def\dyplomus@GrayLineColor{0.7}
\def\dyplomus@HeadTruncateSize{0.75}
% symbole dla paginy - HeadLeft, HeadCenter itp. (strony nieparzyste)
% oraz domyslne elementy dla elementow paginy
\def\dyplomus@HFPos@HL{a}\def\dyplomus@HFPos@HC{b}\def\dyplomus@HFPos@HR{c}
\def\dyplomus@HFPos@FL{d}\def\dyplomus@HFPos@FC{e}\def\dyplomus@HFPos@FR{f}
\def\dyplomus@Head@Symbol{p}
\def\dyplomus@PageNumber@Symbol{n}
\def\dyplomus@Draft@Symbol{v}
\def\dyplomus@MyHeader@Symbol{m}
\def\dyplomus@Empty@Symbol{e}
%
\def\dyplomus@Draft@Pos{\dyplomus@HFPos@FL}
\def\dyplomus@Head@Pos{\dyplomus@HFPos@HL}
\def\dyplomus@PageNumber@Pos{\dyplomus@HFPos@HR}
\def\dyplomus@MyHeader@Pos{\@empty}
%
\define@key{dyplomus}{usheadlineskip}{\setlength{\dyplomus@HeadToLine}{#1}}% odstep od naglowka do linii
\define@key{dyplomus}{usheadlineheight}{\setlength{\dyplomus@LineHeight}{#1}}% szerokosc linii w naglowku
\define@key{dyplomus}{usheadgrayline}{%
	\dyplomus@Expand@Key@Boolean{usheadgrayline}{false}{#1}{dyplomus@grayline}}% szara linia
\define@key{dyplomus}{usheadgraylinecolor}{\def\dyplomus@GrayLineColor{#1}}% stopien szarosci linii
\define@key{dyplomus}{usheadtruncate}{\dyplomus@Expand@Key@Boolean{usheadtruncate}{true}{#1}{dyplomus@headtruncate}}% obcinanie naglowkow
\define@key{dyplomus}{usheadtruncatesize}{\def\dyplomus@HeadTruncateSize{#1}}% stopien obciecia (z przedzialu [0,1])
\define@key{dyplomus}{usclosingfoot}{\dyplomus@Expand@Key@Boolean{usclosingfoot}{false}{#1}{dyplomus@closingfoot}}% drukowanie stopki na str. zamykajacej
\define@key{dyplomus}{usdraftfoot}{\dyplomus@Expand@Key@Boolean{usdraftfoot}{false}{#1}{dyplomus@draft}}% drukowanie stopki roboczej (ogolnie)
\define@key{dyplomus}{usdraftframe}{\dyplomus@Expand@Key@Boolean{usdraftframe}{true}{#1}{dyplomus@draftframe}}% drukowanie obramowania
\define@key{dyplomus}{usdraftauthor}{\dyplomus@Expand@Key@Boolean{usdraftauthor}{false}{#1}{dyplomus@draftauthor}}% drukowanie autora w ramce
%
\def\dyplomus@OddHead@Left{{\dyplomus@HeadStyle\rightmark}}
\def\dyplomus@OddHead@Center{}
\def\dyplomus@OddHead@Right{{\dyplomus@PageNumberStyle\thepage}}
\def\dyplomus@EvenHead@Left{{\dyplomus@PageNumberStyle\thepage}}
\def\dyplomus@EvenHead@Center{}
\def\dyplomus@EvenHead@Right{{\dyplomus@HeadStyle\leftmark}}
\def\dyplomus@OddFoot@Left{\dyplomus@Draft@Foot{l}}
\def\dyplomus@OddFoot@Center{}
\def\dyplomus@OddFoot@Right{}
\def\dyplomus@EvenFoot@Left{}
\def\dyplomus@EvenFoot@Center{}
\def\dyplomus@EvenFoot@Right{\dyplomus@Draft@Foot{r}}
% ----- Stara pagina ----- %
\ifdyplomus@oldlayout
	\def\dyplomus@HeadStyle{\sffamily\small}%
	\def\dyplomus@PageNumberStyle{\sffamily\normalsize}%
	\def\dyplomus@Head@Pos{\dyplomus@HFPos@HR}%
	\def\dyplomus@PageNumber@Pos{\dyplomus@HFPos@FR}%
	\def\dyplomus@OddHead@Left{}%
	\def\dyplomus@OddHead@Right{{\dyplomus@HeadStyle\rightmark}}%
	\def\dyplomus@EvenHead@Left{{\dyplomus@HeadStyle\leftmark}}%
	\def\dyplomus@EvenHead@Right{}%
	\def\dyplomus@OddFoot@Right{{\dyplomus@PageNumberStyle\thepage}}%
	\def\dyplomus@EvenFoot@Left{{\dyplomus@PageNumberStyle\thepage}}%
\else\relax\fi
%
\define@key{dyplomus}{usheadleft}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddHead@Left{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@HL}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddHead@Left{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@HL}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddHead@Left{{\dyplomus@Draft@Foot{l}}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@Draft@Foot{r}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@HL}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddHead@Left{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@HL}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddHead@Left{}%
		\gdef\dyplomus@EvenHead@Right{}\fi
}
\define@key{dyplomus}{usheadcenter}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddHead@Center{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@HC}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddHead@Center{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@HC}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddHead@Center{{\dyplomus@Draft@Foot{c}}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@Draft@Foot{c}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@HC}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddHead@Center{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@HC}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddHead@Center{}%
		\gdef\dyplomus@EvenHead@Center{}\fi
}
\define@key{dyplomus}{usheadright}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddHead@Right{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@HR}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddHead@Right{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@HR}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddHead@Right{{\dyplomus@Draft@Foot{r}}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@Draft@Foot{l}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@HR}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddHead@Right{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@HR}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddHead@Right{}%
		\gdef\dyplomus@EvenHead@Left{}\fi
}
\define@key{dyplomus}{usfootleft}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@FL}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@FL}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@Draft@Foot{l}}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@Draft@Foot{r}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@FL}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@FL}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddFoot@Left{}%
		\gdef\dyplomus@EvenFoot@Right{}\fi
}
\define@key{dyplomus}{usfootcenter}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@FC}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@FC}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@Draft@Foot{c}}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@Draft@Foot{c}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@FC}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@FC}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddFoot@Center{}%
		\gdef\dyplomus@EvenFoot@Center{}\fi
}
\define@key{dyplomus}{usfootright}{%
	\if#1\dyplomus@Head@Symbol
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@HeadStyle\leftmark}}%
		\gdef\dyplomus@Head@Pos{\dyplomus@HFPos@FR}\fi
	\if#1\dyplomus@PageNumber@Symbol
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@PageNumber@Pos{\dyplomus@HFPos@FR}\fi
	\if#1\dyplomus@Draft@Symbol
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@Draft@Foot{r}}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@Draft@Foot{l}}}%
		\gdef\dyplomus@Draft@Pos{\dyplomus@HFPos@FR}\fi
	\if#1\dyplomus@MyHeader@Symbol
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@MyHeaderTextStyle\dyplomus@MyHeaderText}}%
		\gdef\dyplomus@MyHeader@Pos{\dyplomus@HFPos@FR}\fi
	\if#1\dyplomus@Empty@Symbol
		\gdef\dyplomus@OddFoot@Right{}%
		\gdef\dyplomus@EvenFoot@Left{}\fi
}
\define@key{dyplomus}{ushfclear}{%
	\dyplomus@Expand@Key{ushfclear}{false}{#1}{%
		\gdef\dyplomus@OddHead@Left{}%
		\gdef\dyplomus@OddHead@Center{}%
		\gdef\dyplomus@OddHead@Right{}%
		\gdef\dyplomus@EvenHead@Left{}%
		\gdef\dyplomus@EvenHead@Center{}%
		\gdef\dyplomus@EvenHead@Right{}%
		\gdef\dyplomus@OddFoot@Left{}%
		\gdef\dyplomus@OddFoot@Center{}%
		\gdef\dyplomus@OddFoot@Right{}%
		\gdef\dyplomus@EvenFoot@Left{}%
		\gdef\dyplomus@EvenFoot@Center{}%
		\gdef\dyplomus@EvenFoot@Right{}%
	}{}%
}
%
% ----- Defincje dla uzytkownika --------- %
% 
\newcommand*{\MyHeaderText}[1]{\def\dyplomus@MyHeaderText{#1}}
\newcommand*{\MyHeaderTextStyle}[1]{\def\dyplomus@MyHeaderTextStyle{#1}}
\newcommand*{\PageHeadStyle}[1]{\def\dyplomus@HeadStyle{#1}}
\newcommand*{\PageNumberStyle}[1]{\def\dyplomus@PageNumberStyle{#1}}
\newcommand*{\DraftFootStyle}[1]{\def\dyplomus@DraftFootStyle{#1}}
% 
% -----------
%  Tytularia
% -----------
\ifdyplomus@oldlayout
	\def\dyplomus@Part@type{b}     
	\def\dyplomus@Chapter@type{b}
\else
	\def\dyplomus@Part@type{a}% naglowek czesci
	\def\dyplomus@Chapter@type{a}% naglowek rozdzialu
\fi
\def\dyplomus@Section@type{Hang}% naglowek sekcji
\define@key{dyplomus}{uspart}{\def\dyplomus@Part@type{#1}}
\define@key{dyplomus}{uschapter}{\def\dyplomus@Chapter@type{#1}}
\define@key{dyplomus}{ussectionhang}{% tytuly sekcji zawieszone pod numerem
	\dyplomus@Expand@Key{dyplomus}{true}{#1}{\def\dyplomus@Section@type{Hang}}{\def\dyplomus@Section@type{NoHang}}%
}
% 
% -----------------
%  Strona tytulowa
% -----------------
\newlength{\dyplomustitleleft}\newlength{\dyplomustitleright}
\newlength{\dyplomustitletop}\newlength{\dyplomustitlebottom}
\setlength{\dyplomustitleleft}{2.0cm}
\setlength{\dyplomustitleright}{2.0cm}
\setlength{\dyplomustitletop}{2.0cm}
\setlength{\dyplomustitlebottom}{2.5cm}
\define@key{dyplomus}{us_oswiadczenie}{%
	\dyplomus@Expand@Key@Boolean{us_oswiadczenie}{true}{#1}{dyplomus@secondpage}}
% 
% ----------------
%  Parametry list
% ----------------
\def\dyplomus@AddToLabelSep{0pt}
\def\dyplomus@AddToItemIndent{0pt}
\def\dyplomus@AddToListTBSpace{0pt}
\define@key{dyplomus}{usaddtolabelsep}{\def\dyplomus@AddToLabelSep{#1}}
\define@key{dyplomus}{usaddtolistindent}{\def\dyplomus@AddToItemIndent{#1}}
\define@key{dyplomus}{usaddtolisttbspace}{\def\dyplomus@AddToListTBSpace{#1}}
% 
% -------------
%  Spis tresci
% -------------
\setlength\dyplomus@dim@toc{-1pt}
\newif\ifdyplomus@TOCPartChapter\dyplomus@TOCPartChapterfalse
\define@key{dyplomus}{ustocindent}{\setlength\dyplomus@dim@toc{#1}}
\define@key{dyplomus}{ustocpartchaptername}{%
	\dyplomus@Expand@Key@Boolean{ustocpartchaptername}{false}{#1}{dyplomus@TOCPartChapter}}
% 
% --------------------------
%  Podpisy, przypisy i inne
% --------------------------
\def\dyplomus@CaptionSpaceRate{0.9}
\newif\ifdyplomus@CaptionHang\dyplomus@CaptionHangfalse
\newif\ifdyplomus@OldCaption\dyplomus@OldCaptionfalse
\newif\ifdyplomus@Footnote\dyplomus@Footnotetrue
\newif\ifdyplomus@FootnoteResetbyCh\dyplomus@FootnoteResetbyChtrue
\define@key{dyplomus}{uscaptionspace}{\def\dyplomus@CaptionSpaceRate{#1}}
\define@key{dyplomus}{uscaptionhang}{%
	\dyplomus@Expand@Key@Boolean{uscaptionhang}{false}{#1}{dyplomus@CaptionHang}}
\define@key{dyplomus}{usoldcaption}{%
	\dyplomus@Expand@Key@Boolean{usoldcaption}{false}{#1}{dyplomus@OldCaption}}
\define@key{dyplomus}{usfootnote}{%
	\dyplomus@Expand@Key@Boolean{usfootnote}{true}{#1}{dyplomus@Footnote}}
\define@key{dyplomus}{usfootnoteresetbychapter}{%
	\dyplomus@Expand@Key@Boolean{usfootnoteresetbychapter}{true}{#1}{dyplomus@FootnoteResetbyCh}}
%
\dyplomus@ProcessOptionsWithKV
%
% -----------
%  Marginesy
% -----------
%
\setlength\headheight{\baselineskip}
\setlength\headsep{\baselineskip}
\setlength\topskip{\dyplomus@basesize\p@}
\setlength\footskip{2\baselineskip}
\setlength\maxdepth{.5\topskip}
\addtolength\headheight{\dyplomus@AddToHeadHeight}
\addtolength\headsep{\dyplomus@HeadToLine}
\addtolength\headsep{\dyplomus@LineHeight}
\addtolength\headsep{\dyplomus@AddToHeadSep}
\addtolength\footskip{\dyplomus@AddToFootSkip}
%
\ifdyplomus@marginpar
	\setlength\marginparsep{1cc}
	\setlength\marginparwidth{4cc}
	\setlength\marginparpush{.5\baselineskip}
\else
	\setlength\marginparsep{0\p@}
	\setlength\marginparwidth{0\p@}
	\setlength\marginparpush{0\p@}
	\def\marginpar{\dyplomus@Error{Notatki na marginesach sa domyslnie wylaczone w klasie 'dyplomus'.\MessageBreak
	  Uzyj opcji `marginpar' dla ich uaktywnienia}{}\global\let\marginpar\@gobble}
\fi
\setlength\columnsep{2cc}
\setlength\columnseprule{0\p@}
%
\setlength\oddsidemargin{\dyplomusleft}
\addtolength\oddsidemargin{-1in}
\setlength\evensidemargin{\dyplomusright}
\addtolength\evensidemargin{-1in}
\setlength\@tempdima{\paperwidth}
\addtolength\@tempdima{-\dyplomusleft}
\addtolength\@tempdima{-\dyplomusright}
\addtolength\@tempdima{-\marginparsep}
\addtolength\@tempdima{-\marginparwidth}
\setlength\textwidth{\@tempdima}
%% \if@twocolumn
%% \addtolength\@tempdimb{\@tempdimb}
%% \addtolength\@tempdimb{\columnsep}
%% \fi
\@settopoint\textwidth
%
\setlength\@tempdima{\paperheight}
\setlength\topmargin{\dyplomustop}
\addtolength\topmargin{-1in}
\addtolength\@tempdima{-\dyplomustop}
\addtolength\@tempdima{-\dyplomusbottom}
\addtolength\@tempdima{-\headheight}
\addtolength\@tempdima{-\headsep}
\addtolength\@tempdima{-\footskip}
  \advance\@tempdima-.5\baselineskip
  \divide\@tempdima\baselineskip
  \@tempcnta=\@tempdima
  \setlength\textheight{\@tempcnta\baselineskip}
  \addtolength\textheight{\topskip}
%%\if@twoside
%%  \addtolength\oddsidemargin{-.1\@tempdima}
%%  \addtolength\evensidemargin{.1\@tempdima}
%%\fi
%%\dyplomus@SetupMargins
%
%
% -------------------
%  Ustawienia paginy
% -------------------

% 
% -----------------------------------------
%  Ustawienia parametrow dla ukladu strony
% -----------------------------------------
\newdimen\@parindent
\@parindent\parindent
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301
\hyphenpenalty=100
\exhyphenpenalty=10000
\widowpenalty 10000
\clubpenalty  5000
	\displaywidowpenalty 5000
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or **\or *{*}*
	\else\@ctrerr\fi}}
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{4}%% bylo 3... RCz
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
% 
% ----------------------------------------
%  Definicje dla 'markboth' i 'markright'
% ----------------------------------------
\def\markboth#1#2{%
  \begingroup
    \let\label\relax \let\index\relax \let\glossary\relax
    \unrestored@protected@xdef\@themark {{#1}{#2}}%
    \@temptokena \expandafter{\@themark}%
    \mark{\the\@temptokena}%
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi}
\def\markright#1{%
  \begingroup
    \let\label\relax \let\index\relax \let\glossary\relax
    \expandafter\@markright\@themark {#1}%
    \@temptokena \expandafter{\@themark}%
    \mark{\the\@temptokena}%
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi}
\def\@markright#1#2#3{\@temptokena {#1}%
  \unrestored@protected@xdef\@themark{{\the\@temptokena}{#3}}}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{\z@}
\if@twocolumn
  \setlength\parindent{1em}
\else
  \setlength\parindent{1.5em}
\fi
% 
% -------------------------------
%  Elementy pomocnicze do paginy
% -------------------------------
\ifdyplomus@grayline
	\definecolor{dyplomus@DefaultGrayLine}{gray}{\dyplomus@GrayLineColor}
%	\definecolor{dyplomus@DefaultGrayLine}{rgb}{.0,.1765,.349}
\else\relax\fi
%
\newcommand{\dyplomus@PageHeadLine}{{% linia w naglowku
	\ifdyplomus@grayline\color{dyplomus@DefaultGrayLine}\else\fi
		\hrule height\dyplomus@LineHeight
}}
%
\newcommand{\dyplomus@HT}[1]{% naglowek obciety do maksymalnej dlugosci
	\ifdyplomus@headtruncate
		\dyplomusTruncate{\dyplomus@HeadTruncateSize\linewidth}{#1}%
	\else
		{#1}%
	\fi
}
% 
% ------------------------------
%  Sklad czesci roboczej paginy
% ------------------------------
\newcommand{\dyplomus@Date@Sep}{.}
\newcommand{\dyplomus@Time@Sep}{:}
% Taken from uiucthesis.cls (2005/03/25 v2.25, by Peter Czoschke, David Hull)
% Thank you Peter and David for this nice idea! :)
%\ifdyplomus@draft
\newcount\dyplomus@timehh\newcount\dyplomus@timemm
\dyplomus@timehh=\time\dyplomus@timemm=\time
\divide\dyplomus@timehh by 60
\count255=\dyplomus@timehh\multiply\count255 by -60
\advance\dyplomus@timemm by\count255
%\else\relax\fi
%
\newcommand{\dyplomusDate}{% drukuje date
  \ifnum\day<10 0\fi\number\day\dyplomus@Date@Sep
  \ifnum\month<10 0\fi\number\month\dyplomus@Date@Sep\number\year
}
\newcommand{\dyplomusTime}{% drukuje czas
	\ifnum\dyplomus@timehh<10 0\fi\number\dyplomus@timehh\dyplomus@Time@Sep
	\ifnum\dyplomus@timemm<10 0\fi\number\dyplomus@timemm
}
\newcommand{\dyplomusDraft}{%
	\dyplomusDate,\,\dyplomusTime\ifdyplomus@draftauthor\ : \@author\else\fi
}
\newcommand{\dyplomus@Draft@Box}[1]%  odd --- l, even --- r
{{\addtolength{\fboxsep}{-1pt}%
  \addtolength{\fboxrule}{0.2pt}%
  \makebox[0pt][#1]{%
		\ifdyplomus@draftframe\framebox{\dyplomus@DraftFootStyle\dyplomusDraft}%
		\else{\dyplomus@DraftFootStyle\dyplomusDraft}\fi}%
}}
\newcommand{\dyplomus@Draft@Foot}[1]{%
	{\ifdyplomus@draft\dyplomus@Draft@Box{#1}\else\relax\fi}}
% 
% ---------------------------------------------------
% Ustawienia naglowkow definiowane przez uzytkownika
% ---------------------------------------------------
% \StartMyLeftHeader & \StopMyLeftHeader uzywane dla naglowkow
% bibliografii, indeksu itp (nieudokumentowane dla uzytkownika)
\newcommand{\StartMyLeftHeader}[1]{% sprawdzamy gdzie jest zywa pagina
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HL
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddHead@Left
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenHead@Right
		\gdef\dyplomus@OddHead@Left{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@HeadStyle#1}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HC
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddHead@Center
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenHead@Center
		\gdef\dyplomus@OddHead@Center{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@HeadStyle#1}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HR
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddHead@Right
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenHead@Left
		\gdef\dyplomus@OddHead@Right{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@HeadStyle#1}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FL
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddFoot@Left
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenFoot@Right
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@HeadStyle#1}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FC
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddFoot@Center
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenFoot@Center
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@HeadStyle#1}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FR
		\let\dyplomus@OldOdd@HeadFoot\dyplomus@OddFoot@Right
		\let\dyplomus@OldEven@HeadFoot\dyplomus@EvenFoot@Left
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@HeadStyle#1}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@HeadStyle#1}}%
	\else\fi	
}
\newcommand{\StopMyLeftHeader}{%
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HL
		\let\dyplomus@OddHead@Left\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenHead@Right\dyplomus@OldEven@HeadFoot
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HC
		\let\dyplomus@OddHead@Center\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenHead@Center\dyplomus@OldEven@HeadFoot
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HR
		\let\dyplomus@OddHead@Right\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenHead@Left\dyplomus@OldEven@HeadFoot
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FL
		\let\dyplomus@OddFoot@Left\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenFoot@Right\dyplomus@OldEven@HeadFoot
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FC
		\let\dyplomus@OddFoot@Center\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenFoot@Center\dyplomus@OldEven@HeadFoot
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FR
		\let\dyplomus@OddFoot@Right\dyplomus@OldOdd@HeadFoot
		\let\dyplomus@EvenFoot@Left\dyplomus@OldEven@HeadFoot
	\else\fi
}
\newcommand{\dyplomus@RestoreHeaderDef}{% przywrocenie domyslnej zywej paginy
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HL
		\gdef\dyplomus@OddHead@Left{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HC
		\gdef\dyplomus@OddHead@Center{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Center{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@HR
		\gdef\dyplomus@OddHead@Right{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FL
		\gdef\dyplomus@OddFoot@Left{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Right{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FC
		\gdef\dyplomus@OddFoot@Center{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Center{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@Head@Pos\dyplomus@HFPos@FR
		\gdef\dyplomus@OddFoot@Right{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenFoot@Left{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
}
\newcommand{\RemoveMyHeaderText}{% usuniecie wlasnej dodatkowego tekstu
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@HL
		\gdef\dyplomus@OddHead@Left{{\dyplomus@HeadStyle\rightmark}}%
		\gdef\dyplomus@EvenHead@Right{{\dyplomus@HeadStyle\leftmark}}%
	\else\fi
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@HC
		\gdef\dyplomus@OddHead@Center{}%
		\gdef\dyplomus@EvenHead@Center{}%
	\else\fi
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@HR
		\gdef\dyplomus@OddHead@Right{{\dyplomus@PageNumberStyle\thepage}}%
		\gdef\dyplomus@EvenHead@Left{{\dyplomus@PageNumberStyle\thepage}}%
	\else\fi
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@FL
		\gdef\dyplomus@OddFoot@Left{\dyplomus@Draft@Foot{l}}%
		\gdef\dyplomus@EvenFoot@Right{\dyplomus@Draft@Foot{l}}%
	\else\fi
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@FC
		\gdef\dyplomus@OddFoot@Center{}%
		\gdef\dyplomus@EvenFoot@Center{}%
	\else\fi
	\if\dyplomus@MyHeader@Pos\dyplomus@HFPos@FR
		\gdef\dyplomus@OddFoot@Right{}%
		\gdef\dyplomus@EvenFoot@Left{}%
	\else\fi
	\gdef\dyplomus@MyHeader@Pos{\@empty}%
}
% 
% -----------------------
%  Sklad stylow-cegielek
% -----------------------
% (empty i plain jak poprzednio)
\newcommand\hf@empty{%
  \let\@oddhead\@empty
	\def\@oddfoot{\dyplomus@Draft@Foot{l}\hfill}%
  \let\@evenhead\@empty
	\def\@evenfoot{\dyplomus@Draft@Foot{l}\hfill}%
}
\newcommand\hf@plain{%
  \let\@oddhead\@empty
  \def\@oddfoot{\reset@font\hfil{\dyplomus@PageNumberStyle\thepage}\hfil}%
  \let\@evenhead\@empty
  \def\@evenfoot{\reset@font\hfil{\dyplomus@PageNumberStyle\thepage}\hfil}%
}
% plain/opening zgodnie z usheadings
\let\dyplomus@Plain@OddFoot@Left\dyplomus@OddFoot@Left
\let\dyplomus@Plain@OddFoot@Right\dyplomus@OddFoot@Right
\let\dyplomus@Plain@EvenFoot@Left\dyplomus@EvenFoot@Left
\let\dyplomus@Plain@EvenFoot@Right\dyplomus@EvenFoot@Right
\def\dyplomus@Plain@OddFoot@Center{{\dyplomus@PageNumberStyle\thepage}}
\def\dyplomus@Plain@EvenFoot@Center{{\dyplomus@PageNumberStyle\thepage}}
\if\dyplomus@PageNumber@Pos\dyplomus@HFPos@FL
	\let\dyplomus@Plain@OddFoot@Center\dyplomus@OddFoot@Center
	\let\dyplomus@Plain@EvenFoot@Center\dyplomus@EvenFoot@Center
\else\fi
\if\dyplomus@PageNumber@Pos\dyplomus@HFPos@FR
	\let\dyplomus@Plain@OddFoot@Center\dyplomus@OddFoot@Center
	\let\dyplomus@Plain@EvenFoot@Center\dyplomus@EvenFoot@Center
\else\fi
\newcommand\hf@usplain{%
  \let\@oddhead\@empty
  \def\@oddfoot{\reset@font\dyplomus@HT{\dyplomus@Plain@OddFoot@Left}\hfil\dyplomus@HT{\dyplomus@Plain@OddFoot@Center}\hfil\dyplomus@HT{\dyplomus@Plain@OddFoot@Right}}%
  \let\@evenhead\@empty
  \def\@evenfoot{\reset@font\dyplomus@HT{\dyplomus@Plain@EvenFoot@Left}\hfil\dyplomus@HT{\dyplomus@Plain@EvenFoot@Center}\hfil\dyplomus@HT{\dyplomus@Plain@EvenFoot@Right}}%
}
\newcommand\hf@usheadings{%
  \def\@oddhead{\vtop{%
    \hb@xt@\textwidth{%
    \reset@font\dyplomus@HT{\dyplomus@OddHead@Left}\hfil\dyplomus@HT{\dyplomus@OddHead@Center}\hfil\dyplomus@HT{\dyplomus@OddHead@Right\unskip}}%
    \vskip\dyplomus@HeadToLine\dyplomus@PageHeadLine
		\vskip-\dyplomus@LineHeight\vskip-\dyplomus@HeadToLine}}%
  \def\@oddfoot{\reset@font\dyplomus@HT{\dyplomus@OddFoot@Left}\hfil\dyplomus@HT{\dyplomus@OddFoot@Center}\hfil\dyplomus@HT{\dyplomus@OddFoot@Right}}%
  \def\@evenhead{\vtop{%
    \hb@xt@\textwidth{%
    \reset@font\dyplomus@HT{\dyplomus@EvenHead@Left}\hfil\dyplomus@HT{\dyplomus@EvenHead@Center}\hfil\dyplomus@HT{\dyplomus@EvenHead@Right}}%
		\vskip\dyplomus@HeadToLine\dyplomus@PageHeadLine
		\vskip-\dyplomus@LineHeight\vskip-\dyplomus@HeadToLine}}%
  \def\@evenfoot{\reset@font\dyplomus@HT{\dyplomus@EvenFoot@Left}\hfil\dyplomus@HT{\dyplomus@EvenFoot@Center}\hfil\dyplomus@HT{\dyplomus@EvenFoot@Right}}%
}
% closing zgodnie z usheadings
\def\dyplomus@Close@OddFoot@Left{}
\def\dyplomus@Close@OddFoot@Center{}
\def\dyplomus@Close@OddFoot@Right{}
\def\dyplomus@Close@EvenFoot@Left{}
\def\dyplomus@Close@EvenFoot@Center{}
\def\dyplomus@Close@EvenFoot@Right{}
\if\dyplomus@Draft@Pos\dyplomus@HFPos@FL
	\def\dyplomus@Close@OddFoot@Left{\dyplomus@Draft@Foot{l}}
	\def\dyplomus@Close@EvenFoot@Right{\dyplomus@Draft@Foot{r}}
\else\fi
\if\dyplomus@Draft@Pos\dyplomus@HFPos@FC
	\def\dyplomus@Close@OddFoot@Center{\dyplomus@Draft@Foot{c}}
	\def\dyplomus@Close@EvenFoot@Center{\dyplomus@Draft@Foot{c}}
\else\fi
\if\dyplomus@Draft@Pos\dyplomus@HFPos@FR
	\def\dyplomus@Close@OddFoot@Right{\dyplomus@Draft@Foot{r}}
	\def\dyplomus@Close@EvenFoot@Left{\dyplomus@Draft@Foot{l}}
\else\fi
\ifdyplomus@closingfoot
	\let\dyplomus@Close@OddFoot@Left\dyplomus@OddFoot@Left
	\let\dyplomus@Close@OddFoot@Center\dyplomus@OddFoot@Center
	\let\dyplomus@Close@OddFoot@Right\dyplomus@OddFoot@Right
	\let\dyplomus@Close@EvenFoot@Left\dyplomus@EvenFoot@Left
	\let\dyplomus@Close@EvenFoot@Center\dyplomus@EvenFoot@Center
	\let\dyplomus@Close@EvenFoot@Right\dyplomus@EvenFoot@Right
\else\fi
% 
% --------------------
%  Sklad stylow stron
% --------------------
\def\ps@empty{%
  \let\@mkboth\@gobbletwo
  \let\ps@normal\hf@empty
  \let\ps@opening\hf@empty
  \let\ps@closing\hf@empty
  \let\ps@blank\hf@empty
  \ps@normal}
\def\ps@plain{%
  \let\@mkboth\@gobbletwo
  \let\ps@normal\hf@plain
  \let\ps@opening\hf@plain
  \let\ps@closing\hf@empty
  \let\ps@blank\hf@empty
  \ps@normal}
\def\ps@usplain{%
  \let\@mkboth\@gobbletwo
  \let\ps@normal\hf@usplain
  \let\ps@opening\hf@usplain
  \let\ps@closing\hf@empty
  \let\ps@blank\hf@empty
  \ps@normal}
%
\if@twoside
  \def\ps@usheadings{%
    \let\@mkboth\markboth
    \let\ps@normal\hf@usheadings
    \let\ps@opening\hf@usplain
    \def\ps@closing{\hf@usheadings
			\def\@oddfoot{\reset@font\dyplomus@HT{\dyplomus@Close@OddFoot@Left}\hfil\dyplomus@HT{\dyplomus@Close@OddFoot@Center}\hfil\dyplomus@HT{\dyplomus@Close@OddFoot@Right}}%
			\def\@evenfoot{\reset@font\dyplomus@HT{\dyplomus@Close@EvenFoot@Left}\hfil\dyplomus@HT{\dyplomus@Close@EvenFoot@Center}\hfil\dyplomus@HT{\dyplomus@Close@EvenFoot@Right}}}%
    \let\ps@blank\hf@empty
    \ps@normal
    \def\chaptermark##1{%
      \markboth{%
				\ifHeadingNumbered
				\if@mainmatter
					\@chapapp\ \thechapter.\enspace \fi\fi ##1}%
			 {\ifHeadingNumbered
				\if@mainmatter
					\@chapapp\ \thechapter.\enspace \fi\fi ##1}}%
		\def\sectionmark##1{%
      \markright{\ifHeadingNumbered \thesection.\enspace \fi ##1}}%
}
\else
  \def\ps@usheadings{%
    \let\@mkboth\markboth
    \let\ps@normal\hf@usheadings
    \let\ps@opening\hf@usplain
    \def\ps@closing{\hf@usheadings
			\def\@oddfoot{\reset@font\dyplomus@HT{\dyplomus@Close@OddFoot@Left}\hfil\dyplomus@HT{\dyplomus@Close@OddFoot@Center}\hfil\dyplomus@HT{\dyplomus@Close@OddFoot@Right}}%
			\def\@evenfoot{\reset@font\dyplomus@HT{\dyplomus@Close@EvenFoot@Left}\hfil\dyplomus@HT{\dyplomus@Close@EvenFoot@Center}\hfil\dyplomus@HT{\dyplomus@Close@EvenFoot@Right}}}%
    \let\ps@blank\hf@empty
    \ps@normal
		\def\chaptermark##1{\markboth{%
			\ifHeadingNumbered
				\@chapapp\ \thechapter.\enspace\else\fi ##1}%
		 {\ifHeadingNumbered
				\@chapapp\ \thechapter.\enspace\else\fi ##1}}%
    \def\sectionmark##1{%
      \markright{\ifHeadingNumbered \thesection.\enspace \fi ##1}}%
}
\fi
%
%
% -----------------
%  Strona Tytulowa 
% -----------------
%
% Pomocnicze elementy strony
% ------------------------------
\newcommand{\dyplomus@Page@TitleFnt}{\LARGE\bfseries}
\newcommand{\dyplomus@Page@AuthorFnt}{\large}
\newcommand{\dyplomus@Page@BasicAFnt}{\LARGE}
\newcommand{\dyplomus@Page@BasicBFnt}{\Large}
\newcommand{\dyplomus@Page@BasicCFnt}{\large}
\newcommand{\dyplomus@Page@BasicDFnt}{\normalsize}
\newcommand{\ustitlesetup}{\rmfamily}
%
\newcommand{\tytul}[1]{\gdef\dyplomus@Tytul{#1}\gdef\@title{#1}}
\newcommand{\autor}[1]{\gdef\dyplomus@Autor{#1}\gdef\@author{#1}}
\newcommand{\promotor}[1]{\gdef\dyplomus@Promotor{#1}\gdef\@promotor{#1}}
\def\dyplomus@Promotor{\dyplomus@Error{Nazwisko promotora nie zostalo podane, to pole zostanie puste!}{}}
\newcommand{\nralbumu}[1]{\gdef\dyplomus@NrAlbumu{#1}\gdef\@nralbumu{#1}}
\def\dyplomus@NrAlbumu{\dyplomus@Error{\protect\nralbumu jest niezdefiniowany!}{}}
\newcommand{\slowakluczowe}[1]{\gdef\dyplomus@SlowaKluczowe{#1}\gdef\@slowakluczowe{#1}}
\def\dyplomus@SlowaKluczowe{\dyplomus@Error{Polskie slowa kluczowe (\protect\slowakluczowe) nie zostaly zdefiniowane!}{}}
\newcommand{\keywords}[1]{\gdef\dyplomus@Keywords{#1}\gdef\@keywords{#1}}
\def\dyplomus@Keywords{\dyplomus@Error{English keywords (\protect\keywords) are undefined!}{}}
\@ifundefined{dyplomus@ManWoman@Chck}{%
	\dyplomus@Error{Zadna z opcji man/woman nie zostala zadeklarowana! Opcja 'woman' zostanie uzyta!}{}%
	\gdef\dyplomus@ManWoman@Chck{F}}{}%
\ifdyplomus@man
	\gdef\dyplomus@Page@K{y}\else\gdef\dyplomus@Page@K{a}\fi

%----- Polecenia dla ustawienia wydzialu ----- DO POPRAWY!!!
\newcommand{\dyplomus@SetFaculty@MIN}{%
	\def\dyplomus@Page@Faculty{%
		\dyplomus@Page@BasicCFnt Matematyka w informatyce}%
}
\newcommand{\dyplomus@SetFaculty@WNST}{%
	\def\dyplomus@Page@Faculty{%
		\dyplomus@Page@BasicCFnt Wydzia{\PL@l} Nauk {\PL@S}cis{\PL@l}ych i Technicznych}%
}
\@ifundefined{dyplomus@Faculty}{%
	\dyplomus@Error{Zaden z wydzialow nie zostal zadeklarowy! Wydzial Nauk Scislych i Technicznych zostanie uzyty ('wnst')!}{}%
	\gdef\dyplomus@Faculty{WNST}}{}%
\csname dyplomus@SetFaculty@\dyplomus@Faculty\endcsname
% ----- Polecenia dla emblematow Uniwersytetu i wydzialów  ----- %
\ifdyplomus@pdftex
	\def\dyplomus@LogoUS{logoUS.pdf}
	\def\dyplomus@LogoWNST{logoWNST.pdf}
\else 
	\def\dyplomus@LogoUS{logoUS.eps}
	\def\dyplomus@LogoWNST{logoWNST.eps}
\fi
%
%
% ----- Sklad pierwszej strony ------------ %

\newcommand{\dyplomus@TitlePage}{%
\vspace*{-1.8\dyplomustitletop}
\hspace{-1.1\dyplomustitleleft}\includegraphics[width=9.9cm]{\dyplomus@LogoUS}

\vspace*{-1.0\dyplomustitletop}
\hfill
{\dyplomus@Page@Faculty} % old: {\sc Wydzia{\l} Nauk {\'S}cis{\l}ych i Technicznych}

\vskip 1.0in
\begin{center}
{\dyplomus@Page@AuthorFnt \bfseries \dyplomus@Autor}% wstaw swoje dane
\vskip 0.1cm
{\dyplomus@Page@AuthorFnt \dyplomus@NrAlbumu}% wstaw numer albumu
\vfill
{\dyplomus@Page@TitleFnt \def\baselinestretch{1.5}   % 
 \dyplomus@Tytul}% wstaw tytuł pracy
\vfill
{\dyplomus@Page@BasicCFnt PRACA DYPLOMOWA\\ \vskip 0.5cm (LICENCJACKA)} %wstaw jedną z: LICENCJACKA / MAGISTERSKA / INŻYNIERSKA)
\end{center}
\vskip 2.5cm
\begin{flushright}
{\dyplomus@Page@AuthorFnt \bfseries \dyplomus@Promotor}% wstaw tytuł, imię i nazwisko promotora
\end{flushright}
\vspace{2.5cm}
\begin{center}
{\dyplomus@Page@BasicCFnt Katowice 2023}% wstaw miasto w którym jest instytut i rok
\end{center}
}
% ----- Sklad drugiej strony - oswiadczenia 
%
% UWAGA: obowiazkowe jest zlozenie oswiadczen w APD 
% Nie jest juz wymagane zlozenie oswiadczen w pracy
% (druga strona jest drukowana tylko przy uzyciu opcji 'secondpage')
%
%
\newcommand{\dyplomus@Page@SecondPage}{%
  \newpage\thispagestyle{empty}%
  \vspace*{2\baselineskip}%
  \begin{center}%
		{\large\bfseries O{\PL@s}wiadczenie autora}\par\bigskip
  \end{center}%
  {\itshape Ja, ni{\PL@z}ej podpisan{\dyplomus@Page@K} \@author\ o{\PL@s}wiadczam, {\PL@z}e praca 
	 ta zosta{\PL@l}a napisana samodzielnie i~wykorzystywa{\PL@l}a (poza zdobyt{\PL@a} na studiach
	 wiedz{\PL@a}) jedynie wyniki prac zamieszczonych w~spisie literatury.}\par
	\vspace{3\baselineskip}%
	\hfill\parbox{15em}{{\small\dotfill}\\[-.3ex]\centerline{\footnotesize (Podpis autora)}}\par
  \vspace{4\baselineskip}%
	\begin{center}%
    {\large\bfseries O{\PL@s}wiadczenie promotora}\par\bigskip
	\end{center}%
	  {\itshape O{\PL@s}wiadczam, {\PL@z}e praca spe{\PL@l}nia wymogi stawiane pracom magisterskim.}%
	\par\vspace{3\baselineskip}%
	\hfill\parbox{15em}{{\small\dotfill}\\[-.3ex]\centerline{\footnotesize (Podpis promotora)}}\par
	\addtocounter{page}{-1}%
}
% 
% ---------------------------------
%  Wlasciwy sklad strony tytulowej
% ---------------------------------
\let\@date\@empty
\if@titlepage
\newcommand\maketitle{
%
% -- zapamietanie ustawien globalnych dla marginesow --
\newlength{\@templeft}\newlength{\@tempwidth}
\newlength{\@temptop}\newlength{\@tempheight}
\setlength\@templeft{\oddsidemargin}\setlength\@tempwidth{\textwidth}
\setlength\@temptop{\topmargin}\setlength\@tempheight{\textheight}
%
% -- ustawienie marginesow dla strony tytulowej
% -- szerokosc --
\newlength{\@temptitledima}
\setlength\oddsidemargin{\dyplomustitleleft}
\addtolength\oddsidemargin{-1in}
%\setlength\evensidemargin{\dyplomustitleright} 
%\addtolength\evensidemargin{-1in}
\setlength\@temptitledima{\paperwidth}
\addtolength\@temptitledima{-\dyplomustitleleft}
\addtolength\@temptitledima{-\dyplomustitleright}
\addtolength\@temptitledima{-\marginparsep}
\addtolength\@temptitledima{-\marginparwidth}
\setlength\textwidth{\@temptitledima}
\hsize \textwidth
\@settopoint\textwidth
% -- wysokosc --
\setlength\@temptitledima{\paperheight}
\setlength\topmargin{\dyplomustitletop}
\addtolength\topmargin{-\headheight}
\addtolength\topmargin{-\headsep}
\addtolength\topmargin{-1in}
\addtolength\@temptitledima{-\dyplomustitletop}
\addtolength\@temptitledima{-\dyplomustitlebottom}
%\addtolength\@temptitledima{-\footskip}
  \advance\@temptitledima-.5\baselineskip
  \divide\@temptitledima\baselineskip
  \@tempcnta=\@temptitledima
  \setlength\textheight{\@tempcnta\baselineskip}
  \addtolength\textheight{\topskip}
%
% -- wlasciwa strona tytulowa --
%
\begin{titlepage}
%  \thispagestyle{empty}
  \dyplomus@TitlePage
\end{titlepage}
%
% -- powrot do starych ustawien marginesow -- 
\setlength{\oddsidemargin}{\@templeft}\setlength{\textwidth}{\@tempwidth}
\setlength{\topmargin}{\@temptop}\setlength{\textheight}{\@tempheight}
\@settopoint\textwidth
\hsize\textwidth

  \setcounter{footnote}{0}%
	\global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}
\def\and{\\\Large\strut}
\else
	\newcommand\maketitle{\@maketitle}
	\def\@maketitle{\@empty}
	\def\and{\@empty}
\fi
%
%
% ------------------
%  Sklad tytulariow
% ------------------
%
% Tytularia z mwbk (I)
% --------------------
\def\@sect#1#2#3#4#5#6[#7]#8{%
  \ifnum #2>\c@secnumdepth
    \let\@svsec\@empty
  \else
    \refstepcounter{#1}%
    \protected@edef\@svsec{\@seccntformat{#1}\relax}%
  \fi
  \@tempskipa #5\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      \normalfont\ussectsetup#6{%
        \language\l@nohyphenation \raggedright
        \interlinepenalty \@M
        \leftskip #3\noindent
        \@svsec\ignorespaces
        #8\@@par}%
    \endgroup
    \csname #1mark\endcsname{#7}%
    \addcontentsline{toc}{#1}{%
      \ifnum #2>\c@secnumdepth \else
        \protect\numberline{\csname the#1\endcsname.}%
      \fi
      #8}%
  \else
    \def\@svsechd{%
      \normalfont\ussectsetup#6{\hskip #3\relax
      \@svsec\ignorespaces #8}%
      \csname #1mark\endcsname{#7}%
      \addcontentsline{toc}{#1}{%
        \ifnum #2>\c@secnumdepth \else
          \protect\numberline{\csname the#1\endcsname.}%
        \fi
        #8}}%
  \fi
  \@xsect{#5}}
\def\@ssect#1#2#3#4#5{%
  \@tempskipa #3\relax
  \ifdim \@tempskipa>\z@
    \begingroup
      \normalfont\ussectsetup#4{%
        \language\l@nohyphenation \raggedright
        \interlinepenalty \@M
        \leftskip #1\noindent\ignorespaces
        #5\@@par}%
    \endgroup
  \else
    \def\@svsechd{\normalfont\ussectsetup#4{\hskip #1\relax #5}}%
  \fi
  \@xsect{#3}}
\newcommand*\partmark[1]{\markboth{}{}}
\newcommand*\chaptermark[1]{}
%
%
% Definicje tytulow, nazw, podpisow, itp
% DLACZEGO NIE DZIALA???!!!
% ----------------------------------
\newcommand\contentsname{Contents}
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}
\newcommand\bibname{Bibliography}
\newcommand\indexname{Index}
\newcommand\figurename{Figure}
\newcommand\tablename{Table}
\newcommand\partname{Part}
\newcommand\chaptername{Chapter}
\newcommand\appendixname{Appendix}
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}
%
%
% Definicje licznikow i czesci pracy
% ----------------------------------
\setcounter{secnumdepth}{2}
\newcounter{part}
\newcounter{chapter}
\newcounter{section}[chapter]
\newcounter{subsection}[section]
\newcounter{subsubsection}[subsection]
\newcounter{paragraph}[subsubsection]
\newcounter{subparagraph}[paragraph]
\renewcommand\thepart {\@Roman\c@part}
\renewcommand\thechapter {\@arabic\c@chapter}
\renewcommand\thesection {\thechapter.\@arabic\c@section}
\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection.\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\def\part@level{-1}
\def\chapter@level{0}
\def\section@level{1}
\def\subsection@level{2}
\def\subsubsection@level{3}
\def\paragraph@level{4}
\def\subparagraph@level{5}
\newcommand\@chapapp{\chaptername}
\renewcommand*\@seccntformat[1]{\csname the#1\endcsname.\enspace}
\def\dyplomus@TOC@PartName{Cz\PL@e\PL@s\PL@c}
\def\dyplomus@TOC@ChapterName{Rozdzia\PL@l}
%
\def\cleardoublepage{\clearpage
  \if@twoside
    \ifodd\c@page\else
      \hbox{}\thispagestyle{blank}\newpage
      \if@twocolumn\hbox{}\newpage\fi
    \fi
  \fi}
\newcommand\frontmatter{%
  \cleardoublepage
  \@mainmatterfalse
  \pagenumbering{Roman}}
\newcommand\mainmatter{%
  \cleardoublepage
  \@mainmattertrue
  \pagenumbering{arabic}}
\newcommand\backmatter{%
  \if@openright
    \cleardoublepage
  \else
    \clearpage
  \fi
  \@mainmatterfalse}
%
% Tytularia z mwbk (II)
% ---------------------
\newcommand*\mw@getflags[1]{%
  \expandafter\expandafter\expandafter
  \mw@getflagsx\csname#1@flags\endcsname}
\newcommand*\mw@getflagsx[4]{%
  \def\mw@HeadingRunIn{1#1}%
  \def\mw@HeadingBreakBefore{1#2}%
  \def\mw@HeadingBreakAfter{1#3}%
  \def\mw@HeadingWholeWidth{1#4}%
}
\newcommand*\mw@setflags[1]{%
  \expandafter\edef\csname#1@flags\endcsname{%
    \if\mw@HeadingRunIn 1\else 0\fi
    \if\mw@HeadingBreakBefore 1\else 0\fi
    \if\mw@HeadingBreakAfter 1\else 0\fi
    \if\mw@HeadingWholeWidth 1\else 0\fi
  }
 }
\newcommand*\mw@section[1]{%
  \mw@getflags{#1}%
  \if@noskipsec \leavevmode \fi
  \par
  \if@nobreak \everypar{}\fi
  \@ifstar
    {\HeadingNumberedfalse\@dblarg{\mw@sectionx{#1}}}%
    {\HeadingNumberedtrue\@dblarg{\mw@sectionx{#1}}}}
\def\mw@sectionx#1[#2]{%
  \@dblarg{\mw@sectionxx{#1}{#2}}}
\def\mw@sectionxx#1#2[#3]#4{%
	\if\mw@HeadingBreakBefore
		\if@specialpage\else\thispagestyle{closing}\fi
	\if@openright\cleardoublepage\else
    \clearpage
	\fi
	\if\mw@HeadingBreakAfter
    \thispagestyle{blank}\else
    \thispagestyle{opening}\fi
    \global\@topnum\z@
	\fi
  \edef\mw@HeadingLevel{\csname #1@level\endcsname
        \space}% space delimits level number!
  \ifHeadingNumbered
    \ifnum \mw@HeadingLevel>\c@secnumdepth \HeadingNumberedfalse \fi
		\if@mainmatter\else \HeadingNumberedfalse \fi
  \fi
  \ifHeadingNumbered
    \refstepcounter{#1}%
    \protected@edef\HeadingNumber{\expandafter\noexpand\csname the#1\endcsname\relax}%
  \else
		\mw@hyperref@phantom{#1}%
		\let\HeadingNumber\@empty
  \fi
  \def\HeadingRHeadText{#2}%
  \def\HeadingTOCText{#3}%
  \def\HeadingText{#4}%
  \def\mw@HeadingType{#1}%
  \if\mw@HeadingRunIn
		\mw@runinheading
  \else
    \if\mw@HeadingWholeWidth
      \if@twocolumn
        \if\mw@HeadingBreakAfter
        \onecolumn
        \mw@normalheading
        \pagebreak\relax
              \if@twoside
                \null
                \thispagestyle{blank}%
                \newpage
              \fi
        \twocolumn
        \else
          \@topnewpage[\mw@normalheading]%
          \mw@markandtoc
        \fi
      \else
        \mw@normalheading
        \if\mw@HeadingBreakAfter\pagebreak\relax\fi
      \fi
    \else
      \mw@normalheading
      \if\mw@HeadingBreakAfter\pagebreak\relax\fi
    \fi
  \fi
}
%----- Zmiana polecenia \mw@markandtoc -----%
\def\dyplomus@SecTOC@OptionalHeaderName{}
\newcommand*{\dyplomus@SecTOC@CheckOptionalName}[1]{%
	\ifdyplomus@TOCPartChapter
		\ifnum #1<1
			\ifnum #1=-1
				\def\dyplomus@SecTOC@OptionalHeaderName{\partname\space}\else\fi
			\ifnum #1=0
				\def\dyplomus@TOC@ChapTemp{\@chapapp\space}%
				\def\dyplomus@SecTOC@OptionalHeaderName{\@chapapp\space}\else\fi
		\else
			\def\dyplomus@SecTOC@OptionalHeaderName{}\fi
	\else\fi
}
\newcommand*\mw@markandtoc{%
  \csname \mw@HeadingType mark\endcsname{\HeadingRHeadText}%
  \ifnum \mw@HeadingLevel>\c@tocdepth \else
		\expandafter\ifx\csname \mw@HeadingType @toc\endcsname\relax
		\dyplomus@SecTOC@CheckOptionalName{\mw@HeadingLevel}%
    \addcontentsline{toc}{\mw@HeadingType}{%
			\ifHeadingNumbered
				\protect\numberline{\dyplomus@SecTOC@OptionalHeaderName\dyplomus@SecCnt@Format{\HeadingNumber}}\fi
				\HeadingTOCText}%
		\else
      \csname \mw@HeadingType @toc\endcsname
    \fi
	\fi
}%
\def\dyplomus@SecCnt@Format#1{#1.\enspace}% zmiana z \mw@seccntformat (!)
%
\newcommand*\mw@normalheading{%
  \if\mw@HeadingBreakBefore \hrule\@height\z@\nobreak
     \else \addpenalty\@secpenalty \fi
  \addvspace{\csname \mw@HeadingType @preskip\endcsname}%
  \bgroup\language\l@nohyphenation
   \raggedright
   \interlinepenalty\@M
   \normalfont\ussectsetup
   \csname \mw@HeadingType @head\endcsname
   \@@par
  \egroup
  \ifnum0<%
    \if@twocolumn0\else1\fi
    \if\mw@HeadingWholeWidth0\else1\fi
    \if\mw@HeadingBreakAfter1\else0\fi
  \mw@markandtoc\fi
  \nobreak
  \vskip\csname\mw@HeadingType @postskip\endcsname
  \@afterheading
}
\newcommand*\mw@runinheading{%
    \addvspace{\csname \mw@HeadingType @preskip\endcsname}%
    \@nobreakfalse
    \global\@noskipsectrue
    \everypar{%
      \if@noskipsec
        \global\@noskipsecfalse
       {\setbox\z@\lastbox}%
        \clubpenalty\@M
        \bgroup\language\l@nohyphenation
           \normalfont\ussectsetup
           \csname \mw@HeadingType @head\endcsname
        \egroup
        \mw@markandtoc
        \hspace{\csname\mw@HeadingType @postskip\endcsname}%
      \else
        \clubpenalty \@clubpenalty
        \everypar{}%
      \fi}
}
\let\@titleindent\z@
%
\newcommand*\SetSectionFormatting[5][default]{%
 \def\mw@HeadingRunIn{10}\def\mw@HeadingBreakBefore{10}%
 \def\mw@HeadingBreakAfter{10}\def\mw@HeadingWholeWidth{10}%
 \mw@processflags#1,\relax
 \expandafter\def\csname #2\endcsname{\mw@section{#2}}%
 \expandafter\def\csname #2@preskip\endcsname{#3}%
 \expandafter\def\csname #2@head\endcsname{#4}%
 \expandafter\def\csname #2@postskip\endcsname{#5}%
 \mw@setflags{#2}%
 }
\newcommand*\DeclareSectioningCommand[3][default]{%
  \SetSectionFormatting[#1]{#2}}
\def\mw@processflags#1,#2\relax{%
  \expandafter\ifx\csname sec@@flag@#1\endcsname\relax
        \dyplomus@Error{Unknown sectioning flag `#1'}{}\else
  \csname sec@@flag@#1\endcsname\fi
  \if,#2,\else \mw@processflags#2\relax \fi
  }
\def\sec@@flag@default{}
\def\sec@@flag@runin{\def\mw@HeadingRunIn{11}}
\def\sec@@flag@breakbefore{\def\mw@HeadingBreakBefore{11}}
\def\sec@@flag@breakafter{\def\mw@HeadingBreakAfter{11}}
\def\sec@@flag@wholewidth{\def\mw@HeadingWholeWidth{11}}
%
% Sklad wlasciwych tytulariow
%----------------------------
%----- podstawowe parametry -----%
\def\dyplomus@Part@Number{\LARGE\bfseries}
\def\dyplomus@Part@Name{\huge\bfseries}
\def\dyplomus@Part@Middle{\@empty}
%
\def\dyplomus@Chapter@Number{\Large\slshape}
\def\dyplomus@Chapter@Name{\LARGE\bfseries}
\def\dyplomus@Chapter@Middle{\@empty}
%
\def\dyplomus@Sec@Format{\large}
\def\dyplomus@SubSec@Format{\normalsize}
\def\dyplomus@SubSubSec@Format{\normalsize}
\def\dyplomus@Par@Format{\normalsize}
%
\newcommand*{\SectionStyle}[1]{\renewcommand*\ussectsetup{#1}}
%----- odstepy w tytulariach  -----%
\newskip\dyplomus@Part@Before      \newskip\dyplomus@Part@After
\newskip\dyplomus@Chapter@Before   \newskip\dyplomus@Chapter@After
\newskip\dyplomus@Sec@Before       \newskip\dyplomus@Sec@After
\newskip\dyplomus@SubSec@Before    \newskip\dyplomus@SubSec@After
\newskip\dyplomus@SubSubSec@Before \newskip\dyplomus@SubSubSec@After
%
\dyplomus@Sec@Before=2.95ex plus.3ex minus.2ex       \dyplomus@Sec@After=1.95ex plus.2ex
\dyplomus@SubSec@Before=2.35ex plus.2ex minus.1ex    \dyplomus@SubSec@After=1.35ex plus.15ex
\dyplomus@SubSubSec@Before=1.75ex plus.1ex minus.1ex \dyplomus@SubSubSec@After=0.95ex plus.1ex
%
%----- szablony do skladu poszczegolnych tytulariow -----%
% dla czesci
\newcommand{\dyplomus@Part@Temp@a}{%
	\dyplomus@Part@Before=0\p@ plus1fil
	\dyplomus@Part@After=0\p@ plus1fil
	\def\dyplomus@Part@Middle{\baselineskip}%
	\let\dyplomus@Part@tempA=\raggedleft
	\def\dyplomus@Part@tempB{0.7}%
}
\newcommand{\dyplomus@Part@Header@a}[3]{%
 {\dyplomus@SingleSpacing
	\if@twoside
		\ifodd\c@page\def\dyplomus@Part@tempA{\raggedleft}%
		\else\def\dyplomus@Part@tempA{\raggedright}\fi
	\else\def\dyplomus@Part@tempA{\raggedleft}\fi
	\dyplomus@Part@tempA
	\ifHeadingNumbered
		\noindent\normalfont #2\partname\space\HeadingNumber\ignorespaces
		\par%%\vspace{\baselineskip}%
		\noindent\dyplomus@GrayLine{0.7}{.25\textwidth}{5pt}%
		\par\vspace{#1}%
	\else\fi
	\normalfont #3\HeadingText\par\nobreak
}}
%
\newcommand{\dyplomus@Part@Temp@b}{%
	\dyplomus@Part@Before=0\p@ plus1fil
	\dyplomus@Part@After=0\p@ plus1fil
	\def\dyplomus@Part@Middle{20\p@}%
}
\newcommand{\dyplomus@Part@Header@b}[3]{%
 {\dyplomus@SingleSpacing
	\ifHeadingNumbered
		\centering #2\partname\space\HeadingNumber\par\nobreak
		\vspace{#1}%
  \fi
  \centering #3\HeadingText\par\nobreak
}}
\@ifundefined{dyplomus@Part@Header@\dyplomus@Part@type}{%
	\dyplomus@Error{Naglowek czesci '\dyplomus@Part@type' nie jest zdefiniowany, 'a' zostanie uzyte!}{}%
	\def\dyplomus@Part@type{a}}{}%
%
% dla rozdzialow
\newcommand{\dyplomus@Chapter@FindHalf}[3]{%
	\settoheight{\dyplomus@dim@a}{#1}%
	\setlength{\dyplomus@dim@b}{\dyplomus@dim@a}%
	\addtolength{\dyplomus@dim@b}{-#2}\divide\dyplomus@dim@b by 2
	\setlength{#3}{\dyplomus@dim@b}%
}
\let\mw@hyperref@phantom\@gobble
\newcommand{\dyplomusChapterFixHyperrefBug}{\@empty}
% chapter a
\newcommand{\dyplomus@Chapter@Temp@a}{%
	\dyplomus@Chapter@Before=0pt
	\dyplomus@Chapter@After=5\baselineskip % bylo 6
	\def\dyplomus@Chapter@Number{\Large\bfseries}%
	\def\dyplomus@Chapter@Height{8\baselineskip}% bylo 10
	\def\dyplomus@Chapter@Middle{3\baselineskip}%
	\def\dyplomus@Chapter@tempA{0.5pt}% grubosc linii,  bylo 0.5pt
	\def\dyplomus@Chapter@tempB{\rule{.25\linewidth}{\dyplomus@Chapter@tempA}}% old version
	%\def\dyplomus@Chapter@tempB{\dyplomus@GrayLine{\dyplomus@Chapter@tempA}{.23\linewidth}{\dyplomus@Chapter@tempA}}%
}
\newcommand{\dyplomus@Chapter@Header@a}[3]{%
	\dyplomus@Chapter@FindHalf{#2 RD}{\dyplomus@Chapter@tempA}{\dyplomus@dim@c}%
  {\dyplomus@SingleSpacing
	\parbox[b][\dyplomus@Chapter@Height][b]{\linewidth}{%
		\vfill
		\ifHeadingNumbered
		\begin{center}%
		\begin{tabular}{@{}c@{}}%
			%\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempB}\hspace{.5em}%
			{\normalfont #2\@chapapp\space\HeadingNumber}\ignorespaces%
			%\hspace{.5em}\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempB} 
			\\[-.5ex]%
			\dyplomus@Chapter@tempB
			%\hrulefillA{\dyplomus@Chapter@tempA}%
		\end{tabular}%
		\end{center}\par\nobreak
		\vspace{#1}\fi
		\centering\normalfont #3\HeadingText\par\nobreak}%
}}
% chapter b
\newcommand{\dyplomus@Chapter@Temp@b}{%
	\dyplomus@Chapter@Before=-2\baselineskip plus 0.1ex
	\dyplomus@Chapter@After=5\baselineskip plus 0.5ex
	\def\dyplomus@Chapter@Middle{10\baselineskip}% bylo 11
	\def\dyplomus@Chapter@tempA{1.5pt}%
	\def\dyplomus@Chapter@tempB{1.5pt}% bylo 0.7pt
	\def\dyplomus@Chapter@tempC{\dyplomus@GrayLine{\dyplomus@Chapter@tempB}{.2\linewidth}{\dyplomus@Chapter@tempA}}%
}
\newcommand{\dyplomus@Chapter@Header@b}[3]{%
	\dyplomus@Chapter@FindHalf{#2 RD}{\dyplomus@Chapter@tempA}{\dyplomus@dim@c}%
	\settoheight{\dyplomus@dim@a}{#2 RD}%
	\settowidth{\dyplomus@dim@b}{%
		\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempC}%
		\hspace{.5em}{\normalfont #2\@chapapp\space\HeadingNumber}\ignorespaces\hspace{.5em}%
		\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempC}}%
	{\dyplomus@SingleSpacing
	 \parbox[c][\dyplomus@Chapter@Middle][b]{\linewidth}{%
   \begin{center}%
		\ifHeadingNumbered
			\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempC}%
			\hspace{.5em}{\normalfont #2\@chapapp\space\HeadingNumber}\ignorespaces\hspace{.5em}%
			\raisebox{\dyplomus@dim@c}{\dyplomus@Chapter@tempC}\par
		\vfill\else
			\dyplomus@GrayLine{\dyplomus@Chapter@tempB}{\dyplomus@dim@b}{\dyplomus@Chapter@tempA}\par
			\vspace{1.75\baselineskip}\vspace{-\dyplomus@dim@a}\vspace{\dyplomus@Chapter@tempA}%
		\fi
	{\normalfont #3\HeadingText\par}\nobreak\vspace{0.75\baselineskip}%
	 \dyplomus@GrayLine{\dyplomus@Chapter@tempB}{\dyplomus@dim@b}{\dyplomus@Chapter@tempA}%
	\end{center}}%
}}
% chapter c
\newcommand{\dyplomus@Chapter@Temp@c}{%
	\dyplomus@Chapter@Before=0pt
	\dyplomus@Chapter@After=5\baselineskip
	\def\dyplomus@Chapter@Number{\Large\bfseries}%
	\def\dyplomus@Chapter@Middle{6.4\baselineskip}%
}
\newcommand{\dyplomus@Chapter@Header@c}[3]{%
  {\dyplomus@SingleSpacing
	\nointerlineskip
  \vbox to#1{\color@begingroup
    \vfil
    \ifHeadingNumbered
			\normalfont #2\@chapapp\space\HeadingNumber\par\nobreak
			\vspace{\baselineskip}%
    \fi
    \normalfont #3\HeadingText\par\nobreak
    \color@endgroup
  }}%
}
%
%\newcommand{\dyplomus@Chapter@Temp@<x>}{%
%	\dyplomus@Chapter@Before=
%	\dyplomus@Chapter@After=
%	\def\dyplomus@Chapter@Middle{<X>\baselineskip}
%	\def\dyplomus@Chapter@tempA{<abc>}
%}
%\newcommand{\dyplomus@Chapter@Header@<x>}[3]{%
%
%}
\@ifundefined{dyplomus@Chapter@Header@\dyplomus@Chapter@type}{%
	\dyplomus@Error{Naglowek rozdzialu '\dyplomus@Chapter@type' nie jest zdefiniowany, 'a' zostanie uzyte!}{}%
	\def\dyplomus@Chapter@type{a}}{}%
%
% dla sekcji
\newcommand{\dyplomus@Section@Template@Hang}[1]{%
  #1{\@hangfrom{\hskip\@titleindent
     \ifHeadingNumbered\dyplomus@SecCnt@Format{\HeadingNumber}\fi}%
     \ignorespaces\HeadingText\@@par}%
}
\newcommand{\dyplomus@Section@Template@NoHang}[1]{%
  \leftskip\@titleindent
  #1{\noindent
  \ifHeadingNumbered\dyplomus@SecCnt@Format{\HeadingNumber}\fi
  \ignorespaces\HeadingText\@@par}%
}
\newcommand*{\dyplomus@Section@Template@RunIn}[1]{%
  \hskip\@titleindent
  #1{\ifHeadingNumbered\dyplomus@SecCnt@Format{\HeadingNumber}\fi
		 \ignorespaces\HeadingText\unskip}%
}
%----- podstawowe parametry  -----%
% part
\csname dyplomus@Part@Temp@\dyplomus@Part@type\endcsname
\SetSectionFormatting[breakbefore,breakafter,wholewidth]{part}
  {\dyplomus@Part@Before}
	{\csname dyplomus@Part@Header@\dyplomus@Part@type\endcsname{\dyplomus@Part@Middle}{\dyplomus@Part@Number}{\dyplomus@Part@Name}}
  {\dyplomus@Part@After}
% chapters
\csname dyplomus@Chapter@Temp@\dyplomus@Chapter@type\endcsname
\SetSectionFormatting[breakbefore,wholewidth]{chapter}
  {\dyplomus@Chapter@Before}
  {\csname dyplomus@Chapter@Header@\dyplomus@Chapter@type\endcsname{\dyplomus@Chapter@Middle}{\dyplomus@Chapter@Number}{\dyplomus@Chapter@Name}}
  {\dyplomus@Chapter@After}
%
\newcommand*\dyplomus@Chapter@TOC{%
  \ifHeadingNumbered\typeout{\@chapapp\space\thechapter.}\fi
  \addcontentsline{toc}{chapter}{%
		\ifHeadingNumbered
			\dyplomus@SecCnt@Format{\@chapapp\ \HeadingNumber}%
    \fi
    \HeadingTOCText}%
  \addtocontents{lof}{\protect\addvspace{10\p@}}%
  \addtocontents{lot}{\protect\addvspace{10\p@}}%
}
% section
\SetSectionFormatting{section}
	{\dyplomus@Sec@Before}
	{\csname dyplomus@Section@Template@\dyplomus@Section@type\endcsname{\dyplomus@Sec@Format}}
	{\dyplomus@Sec@After}
% subsection
\SetSectionFormatting{subsection}
	{\dyplomus@SubSec@Before}
	{\csname dyplomus@Section@Template@\dyplomus@Section@type\endcsname{\dyplomus@SubSec@Format}}
	{\dyplomus@SubSec@After}
% subsubsection
\SetSectionFormatting{subsubsection}
	{\dyplomus@SubSubSec@Before}
	{\csname dyplomus@Section@Template@\dyplomus@Section@type\endcsname{\dyplomus@SubSubSec@Format}}
	{\dyplomus@SubSubSec@After}
% paragraph
\SetSectionFormatting[runin]{paragraph}
  {\bigskipamount}
  {\dyplomus@Section@Template@RunIn{\dyplomus@Par@Format}}
  {.5em}
% subparagraph
\SetSectionFormatting[runin]{subparagraph}
  {\medskipamount}
  {\dyplomus@Section@Template@RunIn{\dyplomus@Par@Format}}
  {.5em}
%
%
% ==============
%   SKLAD LIST
% ==============
%
% Ustawienia parametrow dla list
% ------------------------------
\newcommand{\dyplomus@List@SetLeftMarginItem}[1]{%
	\settowidth\dyplomus@dim@a{#1}%
	\setlength\labelwidth{\dyplomus@dim@a}%
	\addtolength\labelwidth{\dyplomus@AddToLabelSep}%
	\setlength\leftmargin{\labelwidth}%
	\addtolength\leftmargin{\labelsep}%
	\ifnum\@itemdepth >1\else
		\ifnum\@enumdepth >0\else
		\addtolength\topsep{\dyplomus@AddToListTBSpace}%
		\addtolength\leftmargin{\dyplomus@AddToItemIndent}\fi\fi
}
\newcommand{\dyplomus@List@SetLeftMarginEnum}{%
	\addtolength\labelwidth{\dyplomus@AddToLabelSep}%
	\addtolength\leftmargin{\dyplomus@AddToLabelSep}%
	\ifnum\@enumdepth >1\else
		\ifnum\@itemdepth >0\else
			\addtolength\topsep{\dyplomus@AddToListTBSpace}%
			\addtolength\leftmargin{\dyplomus@AddToItemIndent}\fi\fi
}
\setlength\leftmargini{\parindent}
\leftmargin\leftmargini
\setlength\leftmarginii  {\parindent}
\setlength\leftmarginiii {\parindent}
\setlength\leftmarginiv  {\parindent}
\if@twocolumn
  \setlength\leftmarginv  {.5em}
  \setlength\leftmarginvi {.5em}
\else
  \setlength\leftmarginv  {1em}
  \setlength\leftmarginvi {1em}
\fi
\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\setlength\partopsep{0\p@}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty
\def\@listi{%
	\leftmargin\leftmargini
  \parsep  \z@
  \topsep  .5\baselineskip plus .25\baselineskip minus
           .125\baselineskip
  \itemsep \z@}
\@listi
\def\@listii{%
	\leftmargin\leftmarginii
	\labelwidth\leftmarginii
	\advance\labelwidth-\labelsep
	\topsep  \z@
	\parsep  \z@
	\itemsep \z@}
\def\@listiii{%
	\leftmargin\leftmarginiii
	\labelwidth\leftmarginiii
	\advance\labelwidth-\labelsep
	\itemsep   \z@}
\def\@listiv{%
	\leftmargin\leftmarginiv
	\labelwidth\leftmarginiv
	\advance\labelwidth-\labelsep}
\def\@listv{%
	\leftmargin\leftmarginv
	\labelwidth\leftmarginv
	\advance\labelwidth-\labelsep}
\def\@listvi{%
	\leftmargin\leftmarginvi
	\labelwidth\leftmarginvi
	\advance\labelwidth-\labelsep}
%
% Srodowisko "enumerate"
% -----------------------
\def\enumerate{%
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname
        {\partopsep\z@ \topsep\z@ %MW, RCz
         \usecounter\@enumctr\def\makelabel##1{##1\hfil}%
				 \dyplomus@List@SetLeftMarginEnum}%
  \fi}
\newenvironment*{enumerate*}{%
  \ifnum \@enumdepth >\thr@@\@toodeep\else
    \advance\@enumdepth\@ne
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
      \expandafter
      \list
        \csname label\@enumctr\endcsname
        {\partopsep\topsep \topsep\z@ %MW
         \leftmargin\z@ \labelwidth\z@
         \itemindent\@parindent \advance\itemindent\labelsep
         \usecounter\@enumctr\def\makelabel##1{##1\hfil}}%
  \fi}
{\endlist}
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
%
% Srodowisko "itemize"
% ---------------------
\def\itemize{%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list
      \csname\@itemitem\endcsname
      {\partopsep\z@ \topsep\z@ %MW, RCz
       \def\makelabel##1{##1\hfil}%
			 \dyplomus@List@SetLeftMarginItem{\csname\@itemitem\endcsname}}%
  \fi}
\newenvironment*{itemize*}{%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
    \advance\@itemdepth\@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \expandafter
    \list
      \csname\@itemitem\endcsname
      {\partopsep\topsep \topsep\z@ %MW
      \leftmargin\z@ \labelwidth\z@
      \itemindent\@parindent \advance\itemindent\labelsep
      \def\makelabel##1{##1\hfil}}%
  \fi}
{\endlist}
\newcommand{\labelitemi}{\textbullet}% powrot do kropki w wyliczeniu
\newcommand\labelitemii{\textemdash}
\newcommand\labelitemiii{\textemdash}
\newcommand\labelitemiv{\textemdash}
%
% Pozostale srodowiska listowe
% ----------------------------
%----- description -----%
\newenvironment{description}
{\list{}{\partopsep\topsep \topsep\z@ %MW
  \labelwidth\z@ \itemindent-\leftmargin
  \let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep\normalfont\bfseries #1}
%----- verse -----%
\newenvironment{verse}{%
	\let\\\@centercr
  \list{}{\itemsep      \z@
    \parsep \medskipamount
    \itemindent   -1.5em%
    \listparindent\itemindent
    \rightmargin  \leftmargin
    \advance\leftmargin 1.5em}%
  \item\relax}
{\endlist}
%----- quotation -----%
\newenvironment{quotation}{%
	\list{}{\listparindent 1.5em%
  \itemindent    \listparindent
  \rightmargin   \leftmargin
  \parsep        \z@ \@plus\p@}%
  \item\relax}
{\endlist}
\newenvironment{quote}{%
	\list{}{\rightmargin\leftmargin}%
	\item\relax}
{\endlist}
%----- kropka po numerze twierdzenia  -----%
\def\@begintheorem#1#2{\trivlist
   \item[\hskip \labelsep{\bfseries #1\ #2.}]\itshape}
\def\@opargbegintheorem#1#2#3{\trivlist
      \item[\hskip \labelsep{\bfseries #1\ #2\ (#3).}]\itshape}
%
%
% ======================================
%   POZOSTALE SRODOWISKA i SPIS TRESCI
% ======================================
%
% 'titlepage', 'appendix', parametry
% -----------------------------------
%----- titlepage -----%
\newenvironment{titlepage}{%
	\cleardoublepage
	\if@twocolumn
		\@restonecoltrue\onecolumn
	\else
		\@restonecolfalse\newpage
  \fi
  \thispagestyle{blank}%
  \setcounter{page}\@ne
}{%
	\if@restonecol\twocolumn \else \newpage \fi
  \if@twoside\else
		\setcounter{page}\@ne
	\fi
}
%----- appendix -----%
\newcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}%
}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\@addtoreset{equation}{chapter}
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}
\def\@floatboxreset{%
  \reset@font
  \normalsize
  \@setminipage
  \csname us\@captype setup\endcsname
}
%
% Srodowiska figure i table
% -------------------------
%----- figure -----%
\newcounter{figure}[chapter]
\renewcommand\thefigure{%
	\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
%\def\fnum@figure{Rys.~\thefigure}  % dla pani Oliwii Gładysz
\newenvironment{figure}%
  {\@float{figure}}
  {\end@float}
\newenvironment{figure*}
  {\@dblfloat{figure}}
  {\end@dblfloat}
%
%----- table -----%
\newcounter{table}[chapter]
\renewcommand\thetable{%
	\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment{table}
  {\@float{table}}
  {\end@float}
\newenvironment{table*}
  {\@dblfloat{table}}
  {\end@dblfloat}
\def\centeredlast{%
  \let\\\@centercr
  \rightskip\z@\@plus-.5fil
  \leftskip\z@\@plus.5fil
  \parindent\z@
  \parfillskip\@flushglue
}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{.5\baselineskip}
\setlength\belowcaptionskip{.5\baselineskip}
%----- Definicja 'caption' -----%
\newif\ifdyplomus@CaptionInBox\dyplomus@CaptionInBoxfalse % czy caption za dlugi...
\newsavebox{\dyplomus@Caption@Box}
\newcommand{\dyplomus@Caption@HangText}[1]{%
	\settowidth{\dyplomus@dim@a}{\uscaptionsetup #1.\enspace}%
	\setlength{\dyplomus@dim@b}{\dyplomus@CaptionSpaceRate\linewidth}%
	\addtolength{\dyplomus@dim@b}{-\dyplomus@dim@a}%
}
\long\def\@caption#1[#2]#3{%
  \par
  \addcontentsline{\csname ext@#1\endcsname}{#1}%
    {\protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}}%
  \begingroup
    \@parboxrestore
    \if@minipage
      \@setminipage
    \fi
    \uscaptionsetup
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup
}
\long\def\@makecaption#1#2{%
	\settowidth{\dyplomus@dim@c}{{\uscaptionsetup\begin{tabular}{@{}l@{}}#1.\enspace#2\end{tabular}}}%
	\ifdim\dyplomus@dim@c>\dyplomus@CaptionSpaceRate\linewidth\dyplomus@CaptionInBoxtrue\else\fi
	\ifdyplomus@CaptionHang
		\dyplomus@Caption@HangText{#1}%
	\else\fi
  \addvspace\abovecaptionskip
  \bgroup\centeredlast
		\makebox[0pt][c]{%
			\ifdyplomus@CaptionInBox
				\parbox[t]{\dyplomus@CaptionSpaceRate\linewidth}{%
					#1.\enspace
					\ifdyplomus@CaptionHang
						\parbox[t]{\dyplomus@dim@b}{#2}%
					\else #2\fi}%
				\else\parbox[t]{\dyplomus@dim@c}{#1.\enspace#2}\fi
			}\par
  \egroup
  \vskip\belowcaptionskip
}
\ifdyplomus@OldCaption
	\long\def\@makecaption#1#2{%
		\addvspace\abovecaptionskip
		\bgroup\centeredlast
			#1.\enspace#2\par
		\egroup
		\vskip\belowcaptionskip}
\else\relax\fi
%
% Definicje fontow w stylu LaTeX-a 2.09
% --------------------------------------
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
%
% Spis tresci
% -----------
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em plus 2cm}
\newcommand\@dotsep{4.5}
\setcounter{tocdepth}{2}
\newcommand\tableofcontents{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
	{\@tempcnta=\c@tocdepth
   \c@tocdepth=-1
	 \chapter*{\contentsname}%
   \protect\@mkboth{\contentsname}{\contentsname}%
   \c@tocdepth=\@tempcnta
   \secondarysize
   \gdef\previous@toc@level{-1000}%
   \@starttoc{toc}}%
  \if@restonecol\twocolumn\fi
}
\def\mw@tocskip#1#2{%
  \ifnum#1>\previous@toc@level
    \nobreak
  \else\ifnum#1<\previous@toc@level
    \addpenalty\@secpenalty
  \fi\fi
  \gdef\previous@toc@level{#1}%
  \vskip #2\relax
}
\def\mw@tocline#1#2#3#4#5{%
  \ifnum #1>\c@tocdepth \else
    \mw@tocskip{#1}{\z@ \@plus.2\p@}%
    {\leftskip #3\relax
     \@tempdima #3\relax
     \advance\@tempdima -#2\relax
     \rightskip \@tocrmarg \parfillskip -\rightskip
     \interlinepenalty\@M
     \noindent\kern-\@tempdima{\ignorespaces #4}\nobreak
     \leaders\hbox{$\m@th
        \mkern \@dotsep mu\hbox{.}\mkern \@dotsep
        mu$}\hfill
     \nobreak
     \hb@xt@\@pnumwidth{\hfil\normalfont\normalcolor #5}%
     \par}%
  \fi
}
\newcommand*\dyplomus@SetTOCLabels[1]{%
	\bgroup
		\reset@font\secondarysize
		\setbox\@tempboxa\hbox{}%
		\dyplomus@SetTOCLabelsX{}#1\relax
  \egroup
}
\def\dyplomus@SetTOCLabelsX#1#2{%
  \ifx\relax#2\expandafter\@gobble
	\else
		\setbox\@tempboxa\hbox{#2}%
		\expandafter\xdef\csname dyplomus@TOCLabel#1\endcsname{\the\wd\@tempboxa}%
		\expandafter\dyplomus@SetTOCLabelsX
  \fi
  {#1I}%
}
\newcommand*\SetTOCIndents[1]{%
	\bgroup
		\reset@font\secondarysize
		\setbox\@tempboxa\hbox{}%
		\set@tocindentsX{}#1\relax
  \egroup
}
\def\set@tocindentsX#1#2{%
  \ifx\relax#2\expandafter\@gobble
	\else
		\setbox\@tempboxa\hbox{\unhbox\@tempboxa#2}%
		\expandafter\xdef\csname @tocindent#1\endcsname{\the\wd\@tempboxa}%
		\expandafter\set@tocindentsX
  \fi
  {#1i}%
}
%
\def\dyplomus@TOC@PartName@Wd{0pt}
\def\dyplomus@TOC@ChapterName@Wd{0pt}
\newcommand{\dyplomus@TOC@DefNameWd}{%
	\reset@font\secondarysize
	\setbox\dyplomus@box@a\hbox{\dyplomus@TOC@PartName\space}%
	\def\dyplomus@TOC@PartName@Wd{\the\wd\dyplomus@box@a}%
	\setbox\dyplomus@box@a\hbox{\dyplomus@TOC@ChapterName A.\enspace}%
	\def\dyplomus@TOC@ChapterName@Wd{\the\wd\dyplomus@box@a}%
}
\ifdim\dyplomus@dim@toc<0\p@
	\SetTOCIndents{{}{A.\enspace}{9.10.\enspace}{9.9.10.\enspace}{9.9.9.10.\enspace}{\quad}{\quad}}%%pierwszy \quad --> wyrzucony [RCz]
	\ifdyplomus@TOCPartChapter\dyplomus@TOC@DefNameWd\else\fi
	\def\dyplomus@TOCIndent@z{\@tocindent}
	\dyplomus@AddTwoDimOnBoxes{\@tocindenti}{\dyplomus@TOC@ChapterName@Wd}{dyplomus@TOCIndent@w}
	\def\dyplomus@TOCIndent@Iz{\@tocindenti}					\def\dyplomus@TOCIndent@Iw{\@tocindentii}
	\def\dyplomus@TOCIndent@IIz{\@tocindentii}				\def\dyplomus@TOCIndent@IIw{\@tocindentiii}
	\def\dyplomus@TOCIndent@IIIz{\@tocindentiii}			\def\dyplomus@TOCIndent@IIIw{\@tocindentiiii}
	\def\dyplomus@TOCIndent@IVz{\@tocindentiiii}		\def\dyplomus@TOCIndent@IVw{\@tocindentiiiii}
	\def\dyplomus@TOCIndent@Vz{\@tocindentiiiii}	\def\dyplomus@TOCIndent@Vw{\@tocindentiiiiii}
\else
	\dyplomus@SetTOCLabels{{}{A.\enspace}{9.10.\enspace}{9.9.10.\enspace}{9.9.9.10.\enspace}{\quad}{\quad}}%
	\ifdyplomus@TOCPartChapter\dyplomus@TOC@DefNameWd\else\fi
	\def\dyplomus@TOCIndent@z{0pt}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOC@ChapterName@Wd}{\dyplomus@TOCLabelI}{dyplomus@TOCIndent@w}
	\def\dyplomus@TOCIndent@Iz{\dyplomus@dim@toc}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@Iz}{\dyplomus@TOCLabelII}{dyplomus@TOCIndent@Iw}
	\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@Iz}{\dyplomus@dim@toc}{dyplomus@TOCIndent@IIz}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IIz}{\dyplomus@TOCLabelIII}{dyplomus@TOCIndent@IIw}
	\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IIz}{\dyplomus@dim@toc}{dyplomus@TOCIndent@IIIz}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IIIz}{\dyplomus@TOCLabelIIII}{dyplomus@TOCIndent@IIIw}
	\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IIIz}{\dyplomus@dim@toc}{dyplomus@TOCIndent@IVz}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IVz}{\dyplomus@TOCLabelIIIII}{dyplomus@TOCIndent@IVw}
	\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@IVz}{\dyplomus@dim@toc}{dyplomus@TOCIndent@Vz}
		\dyplomus@AddTwoDimOnBoxes{\dyplomus@TOCIndent@Vz}{\dyplomus@TOCLabelIIIIII}{dyplomus@TOCIndent@Vw}
\fi
%
\def\numberline#1{\hb@xt@\@tempdima{#1\hfil}\ignorespaces}
\newcommand*\l@part[2]{%
  \ifnum \c@tocdepth >-2\relax
    \mw@tocskip{-1}{.6\baselineskip}%
    \begingroup
      \parindent \z@ \rightskip \@pnumwidth
      \parfillskip -\@pnumwidth
      {\leavevmode\normalsize
        \def\numberline##1{##1\enspace}%
        \hfil\bfseries #1\hfil\null %\hb@xt@\@pnumwidth{\hss #2}%
			}\par
      \nobreak
      \global\@nobreaktrue
      \everypar{\global\@nobreakfalse\everypar{}}%
    \endgroup
	\addvspace{.4\baselineskip}%
	\fi
}
\newcommand*\l@chapter[2]{%
	\addvspace{.3\baselineskip}%
  \mw@tocline{0}{\dyplomus@TOCIndent@z}{\dyplomus@TOCIndent@w}{\textbf{#1}}{#2}%
  \addvspace{.2\baselineskip}%
}
\newcommand*\l@section{\mw@tocline{1}{\dyplomus@TOCIndent@Iz}{\dyplomus@TOCIndent@Iw}}
\newcommand*\l@subsection{\mw@tocline{2}{\dyplomus@TOCIndent@IIz}{\dyplomus@TOCIndent@IIw}}
\newcommand*\l@subsubsection{\mw@tocline{3}{\dyplomus@TOCIndent@IIIz}{\dyplomus@TOCIndent@IIIw}}
\newcommand*\l@paragraph{\mw@tocline{4}{\dyplomus@TOCIndent@IVz}{\dyplomus@TOCIndent@IVw}}
\newcommand*\l@subparagraph{\mw@tocline{5}{\dyplomus@TOCIndent@Vz}{\dyplomus@TOCIndent@Vw}}
%
% streszczenie, abstract i wstep
% ------------------------------
\def\dyplomus@Abs@Headers{\ussectsetup\dyplomus@Sec@Format}
\def\dyplomus@Abs@Keyword{\normalfont\normalsize}
\newcommand{\dyplomus@Abs@Wciecie}[3]{%
	\begin{list}{}{%
		\setlength{\leftmargin}{#1}\setlength{\rightmargin}{#2}\item[]\relax}%
		#3%
	\end{list}}
\newenvironment{dyplomus@Abstract}[3]{%
	\chapter*{#1}%
  \renewcommand\thesection{\@arabic\c@section}%
	\def\dyplomus@AbstractName{#2}%
	\def\dyplomus@AbstractContent{#3}%
}{%
	\par\bigskip
  \noindent{\dyplomus@Abs@Headers\dyplomus@AbstractName}%
  \nopagebreak\par\smallskip\nopagebreak% 
  \ifdyplomus@oldlayout
		\dyplomus@Abs@Wciecie{\parindent}{\parindent}{\dyplomus@Abs@Keyword\dyplomus@AbstractContent}%
  \else
		{\dyplomus@Abs@Keyword\dyplomus@AbstractContent}%
	\fi
	\setcounter{section}{0}%
	\renewcommand\thesection{\thechapter.\@arabic\c@section}%
}
\newenvironment{streszczenie}{\begin{dyplomus@Abstract}{Streszczenie}{S{\PL@l}owa kluczowe}{\dyplomus@SlowaKluczowe}}{\end{dyplomus@Abstract}}
\newenvironment{abstract}{\begin{dyplomus@Abstract}{Abstract}{Keywords}{\dyplomus@Keywords}}{\end{dyplomus@Abstract}}
%
\newenvironment{dyplomus@wstep}[1]{%
	\chapter*{#1}%
	\renewcommand\thesection{\@arabic\c@section}%
}{%
	\setcounter{section}{0}%
  \renewcommand\thesection{\thechapter.\@arabic\c@section}%
}
%
\newenvironment{wstep}[1][Wst{\PL@e}p]{\begin{dyplomus@wstep}{#1}}{\end{dyplomus@wstep}}
\newenvironment{zakonczenie}[1][Zako{\PL@n}czenie]{\begin{dyplomus@wstep}{#1}}{\end{dyplomus@wstep}}
%
% Spis rysunkow
% --------------
\newcommand\listoffigures{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listfigurename}{%
		\secondarysize
    \gdef\previous@toc@level{-1000}%
    \@starttoc{lof}}%
  \if@restonecol\twocolumn\fi
}
\newcommand*\l@figure{\mw@tocline{1}{0pt}{2.5em}}
%
% Spis tabel
% -----------
\newcommand\listoftables{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listtablename}{%
		\secondarysize
    \gdef\previous@toc@level{-1000}%
    \@starttoc{lot}}%
  \if@restonecol\twocolumn\fi
}
\let\l@table\l@figure
%
% Bibliografia
% -------------
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]{%
	\def\chaptermark##1{\@mkboth{##1}{##1}}%
	\chapter*{\bibname}%
  \list{\@biblabel{\@arabic\c@enumiv}}{%
		\settowidth\labelwidth{\@biblabel{#1}}%
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \@openbib@code
    \usecounter{enumiv}%
    \let\p@enumiv\@empty
    \renewcommand\theenumiv{\@arabic\c@enumiv}%
    \secondarysize}%
	\sloppy
	\sfcode`\.\@m
}{%
	\def\@noitemerr
  {\@latex@warning{Empty `thebibliography' environment}}%
  \endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
%
% Indeks/Skorowidz
% ----------------
\newenvironment{theindex}{%
	\if@twocolumn
		\@restonecolfalse
	\else
		\@restonecoltrue
  \fi
  \columnseprule \z@
  \columnsep 35\p@
  \twocolumn
	\chapter*{\indexname}%
	\StartMyLeftHeader{\indexname}%
  \thispagestyle{usplain}\parindent\z@%
	\parskip\z@ \@plus .3\p@\relax
  \let\item\@idxitem
  \secondarysize
}{%
	\if@restonecol\onecolumn\else
		\clearpage
	\fi\dyplomus@RestoreHeaderDef
}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
%
% Sklad przypisow
% ----------------
\renewcommand\footnoterule{%
  \kern-3\p@
  \hrule\@height.3\p@\@width60\p@
  \kern2.6\p@}
\ifdyplomus@FootnoteResetbyCh
	\@addtoreset{footnote}{chapter}
\else
	\dyplomus@RemoveFromReset{footnote}{chapter}
\fi
\ifdyplomus@Footnote
	\newcommand{\dyplomus@Footnote@Mark}{\@thefnmark.}
\else
	\newcommand{\dyplomus@Footnote@Mark}{\@makefnmark}
\fi
\newcommand\@makefntext[1]{%
	\parindent\@parindent
	\noindent\hb@xt@\@parindent{\hss\dyplomus@Footnote@Mark\enspace}#1}
%
%
% Pozostale polecenia
% --------------------
% dla kompatybilnosci z poprzednimi wersjami %%% skopiowane ze starej wersji
\newcommand*\mgrclosechapter{\@empty}
%
% Czesc koncowa klasy
% --------------------
\pagestyle{usheadings}%
\pagenumbering{arabic}%
\flushbottom
\if@twocolumn
  \twocolumn
  \sloppy
\else
  \onecolumn
\fi
\AtBeginDocument{%
%----- Patch dla natbib.sty -----%
\@ifpackageloaded{natbib}{%
\renewcommand\bibsection{\chapter*{\bibname}%
  \@mkboth{\bibname}{\bibname}}%
}{}%
%----- Patch dla hyperref.sty -----%
\@ifpackageloaded{hyperref}{%
	\def\mw@hyperref@phantom#1{%
		\Hy@GlobalStepCount\Hy@linkcounter
		\xdef\@currentHref{#1*.\the\Hy@linkcounter}%
    \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
	}%
	\long\def\@caption#1[#2]#3{%
		\hyper@makecurrent{\@captype}%
		\def\@currentlabelname{#2}%
		\par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
			\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
		\begingroup
			\@parboxrestore
			\if@minipage
				\@setminipage
			\fi
			\uscaptionsetup
			\@makecaption{\csname fnum@#1\endcsname}{%
				\ignorespaces
				\makebox[0pt][l]{\ifHy@nesting
					\hyper@@anchor{\@currentHref}{#3}%
				\else
					\Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}}#3%
				\fi}%
			\par
		\endgroup
	}%
	\renewcommand{\dyplomusChapterFixHyperrefBug}{\clearpage\phantomsection}%
}{}%
%----- Patch dla listings.sty -----%%%%%%%%%   PO CO TO JEST ?????
\@ifpackageloaded{listings}{%
	\long\def\@makecaption#1#2{%
		\addvspace\abovecaptionskip
		\bgroup\centeredlast
			#1.\enspace#2\par
		\egroup
		\vskip\belowcaptionskip}
}{}%
}% koniec czesci dla '\AtBeginDocument'
%
\def\@doendpe{\@endpetrue
  \clubpenalty\@clubpenalty
  \def\par{\@restorepar\everypar{}\par\@endpefalse}%
  \everypar{{\setbox\z@\lastbox}\everypar{}\@endpefalse}%
}
%%
%%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
\endinput
%%
%%====================================================================%
%% End of file `dyplomus.cls'.
%% (c) 2023 by Marcin Zygmunt
%%====================================================================%