\addtolength{\textwidth}{3cm}
\addtolength{\hoffset}{-1.5cm}
\addtolength{\textheight}{3cm}
\addtolength{\voffset}{-1.5cm}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{amsmath}
\usepackage[textwidth=40]{todonotes}
%\usepackage{todonotes}
%\usepackage[disable]{todonotes}
%\usepackage{titlesec}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{gensymb}
\usepackage{longtable}
\usepackage{makeidx}
\usepackage{indentfirst}
\usepackage{graphicx}
%\usepackage{tabularx}
\usepackage{epstopdf}
\usepackage{lmodern}
\usepackage{color}
\usepackage{xcolor}
\usepackage{url}
\usepackage{subfiles}
\usepackage{hhline}
\usepackage{nameref}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{lastpage}
\makeatletter
\newcommand*{\currentname}{\@currentlabelname}
\makeatother
\usepackage[printwatermark]{xwatermark}
\usepackage{pdfpages}
\usepackage{multirow}
\usepackage{svg}
\setsvg{inkscape = inkscape -z -D}
\usepackage[toc,page]{appendix}
\usepackage{caption}
\usepackage{listings}
\usepackage[graphicx]{realboxes}
\usepackage{array}
\usepackage{placeins}
\graphicspath{{./},{./img/}}
\newcommand{\figref}{Fig.~\ref}
%\renewcommand{\bibname}{References}
\definecolor{gray}{rgb}{0.4,0.4,0.4}
\definecolor{lgray}{rgb}{0.8,0.8,0.8}
\definecolor{lred}{rgb}{1,0.4,0.4}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
%\newwatermark*[allpages,color=lred,angle=-45,scale=1,xpos=105,ypos=118]{DRAFT}
\newwatermark*[allpages,scale=0.4,xpos=-57,ypos=120]{\includegraphics{template_img/logo_cti.png}}
%\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\rhead{\CtiHeader}

\usepackage{lastpage}
\newcommand*{\thesecondlastpage}{%
  \the\numexpr(\getrefbykeydefault{LastPage}{page}{0})\relax
}
\AtBeginDocument{\refused{LastPage}}

\rfoot{Page \thepage \hspace{1pt} of \thesecondlastpage}
\usepackage{hyperref}
\hypersetup{
colorlinks,
citecolor=black,
filecolor=black,
linkcolor=blue,
urlcolor=blue
}

% Make fonts sans serif
\usepackage[T1]{fontenc}
\usepackage[sfdefault]{AlegreyaSans}
\renewcommand*\oldstylenums[1]{{\AlegreyaSansOsF #1}}
%\usepackage{DejaVuSansCondensed}
%\renewcommand*\familydefault{\sfdefault}
%\usepackage[T1]{fontenc}

%\usepackage[scaled]{helvet}
%\renewcommand\familydefault{\sfdefault}
%\usepackage[T1]{fontenc}


\sloppy

%\renewcommand{\bibname}{References}
%------------------------------------------------------

%------------------------------------------------------
%zaczynaj każdą sekcję na nowej stronie
%\let\oldsection\section
%\renewcommand\section{\clearpage\oldsection}

\renewcommand{\footrulewidth}{1pt}
%% if footer
\lfoot{
Creotech Instruments S.A. \hspace{15pt} tel. +48 22 233 10 27    \\
ul. Gen. L. Okulickiego 7/9    \hspace{9pt} e-mail: support@creotech.pl \\
05-500 Piaseczno, Poland    \hspace{23pt}    www.creotech.pl
}
%% endif
\cfoot{}

% Some vertical spacing definitions
\newcommand{\afterTitleVerticalSpacing}{0.3cm}
\newcommand{\fieldVerticalSpacing}{0.3cm}
\newcommand{\afterActionVerticalSpacing}{0.3cm}

% Prevent visible subsection numbers
\setcounter{secnumdepth}{1}

\renewcommand*\contentsname{Table of Contents}
