\documentclass[a4paper,twoside]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}%definišemo da je ulaz utf-8 fajl

\usepackage[serbian]{babel}

\newcommand{\varijacija}{jk}
%jk=jedna kolona, dk=dve kolone

\newcommand{\mainstart}{
%\begin{multicols}{2}
}

\newcommand{\mainend}{
%\end{multicols}
}

\newcommand{\manbreakJK}{
\pagebreak
}

%margine
%experiment 
\usepackage[top=2.5cm, bottom=1.5cm, left=3cm, right=3cm]{geometry}
%staro: 
%\usepackage[top=1.5cm, bottom=1cm, left=2cm, right=1cm]{geometry}

\usepackage{fancyhdr}
\pagestyle{fancy}

%% ovi redovi daju header i footer
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{} % delete current setting for header and footer
% \fancyfoot[C]{\thepage}
\fancyhead[LO]{\bfseries\rightmark}
\fancyhead[RO]{\thepage}

\fancyhead[RE]{Strukture podataka i algoritmi 1 -- skripta}
\fancyhead[LE]{\thepage}

\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\headwidth}{\textwidth}
% \renewcommand{\footrulewidth}{0.5pt}
% \addtolength{\headheight}{0.5pt} % make space for the rule

\fancypagestyle{plain}{%
  \fancyhead{} % get rid of headers on plain pages
  \fancyfoot{}
  \renewcommand{\headrulewidth}{0pt} % and the line
  \renewcommand{\footrulewidth}{0pt} % and the line
}
\setlength{\headheight}{15pt}

%promene u marginama:
%\setlength{\marginparwidth}{32pt}
%\setlength{\textwidth}{620pt}
%\setlength{\textheight}{620pt}

\include{skripta-spa1-sadrzaj}

\end{document}