\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{paketic}[Osnovne komande za latex]
% autor: Nikola Marinković

% zahteva texlive-fontsrecommended kako bi podrazumevani font radio

% fontovi
\RequirePackage[T2A]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[english,serbianc]{babel}
\RequirePackage[skip=0.2em, indent=1em]{parskip} % povecava prored izmedju paragrafa
% \RequirePackage{noto}
% \RequirePackage{mathpazo}

% ovo se ne koristi zato sto pravi interferenciju sa razmacima u sadrzaju i ostalim listama
% \setlength{\parskip}{0.2em}

% prelamanja reci
\RequirePackage[none]{hyphenat}
\RequirePackage[expansion=false]{microtype}
\sloppy



% link koji moze da se klikce
\RequirePackage[colorlinks=true,
    linkcolor=black,
    citecolor=blue,
    urlcolor=blue]{hyperref}



% images
\RequirePackage{graphicx} % inserting images
\RequirePackage{xcolor}
\RequirePackage[most]{tcolorbox}
\tcbuselibrary{skins}
\RequirePackage[hypcap=false]{caption} % fix images inside of floating environments
\RequirePackage{placeins} % slika ostaje ispod svog pitanja



% crtanje (uglavnom funkcija)
\RequirePackage{tikz}
\usetikzlibrary{arrows.meta}


% matematika
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amsthm}
\RequirePackage{amssymb}
\RequirePackage{cancel} % precrtavanje
\RequirePackage{mathtools} % :=
\RequirePackage{wasysym} % simboli
\allowdisplaybreaks % dopusti da se unutar align jednacina lomi
% \RequirePackage{mathrsfs}
% Single long equation:
% If it is a single long equation without logical alignment points,
% use the multline environment combined with \allowdisplaybreaks




% teoreme
\newtheoremstyle{stilzateoremu}
{3pt}                % Space above
{3pt}                % Space below
{}
{}                   % Indent amount
{\bfseries}          % Theorem head font
{}                   % Punctuation after theorem head
{ }                  % Space after theorem head
{\thmname{#1} \thmnumber{#2}. \thmnote{(#3)}} % Theorem head spec

\theoremstyle{stilzateoremu}

% Definicija okruzenja za teoreme
%\ifdefined\chapter
\newtheorem{definicija}{Дефиниција}[section]
\newtheorem{tvrdjenje}{Тврђење}[section]
\newtheorem{teorema}{Теорема}[section]
\newtheorem{lema}{Лема}[section]
% \newtheorem{zapazanje}{Запажање}[section]
\newtheorem{posledica}{Последица}[section]
\newtheorem{zadatak}{Задатак}[section]
\newtheorem{primer}{Пример}[section]
\newtheorem{algoritam}{Алгоритам}[section]
%\fi

\newtcolorbox{okvir}{
    enhanced,
    breakable,                  % Allows the box to split across pages
    parbox=false,               % new paragraph indent
    colback=white,              % Background color
    colframe=black,             % Border color
    arc=0mm,                    % Sharp corners (use >0mm for rounded)
    boxrule=0.8pt,              % Border thickness
% toprule at break=0pt,       % Removes top line on continuation pages
% bottomrule at break=0pt,    % Removes bottom line before page breaks
% lines before break=0,
    top=8pt, bottom=8pt,        % Inner padding
    left=10pt, right=10pt,
% Overlay for the FIRST part (bottom break)
    overlay first={%
        \draw[white, line width=1.5pt] (frame.south west) -- (frame.south east);
    },
% Overlay for MIDDLE parts (top & bottom breaks)
    overlay middle={%
        \draw[white, line width=1.5pt] (frame.north west) -- (frame.north east);
        \draw[white, line width=1.5pt] (frame.south west) -- (frame.south east);
    },
% Overlay for the LAST part (top break)
    overlay last={%
        \draw[white, line width=1.5pt] (frame.north west) -- (frame.north east);
    }
}

% dokaz teoreme
\newenvironment{dokaz}
{
    \begin{okvir}
    \textit{Доказ.}
}{

    \hfill $\blacksquare$
    \end{okvir}
}

% resenje zadatka
\newenvironment{resenje}{
    \begin{okvir}
    \textit{Решење.}
}{

    \hfill \CheckedBox % $\bigtriangledown$ $\blacktriangledown$
    \end{okvir}
}

% komentar
\newenvironment{komentar}{
    \begin{okvir}
    \textit{Коментар.}
}{

    \hfill \textleaf
    \end{okvir}
}








% code snippet package
\RequirePackage{listings}
% ako nesto preterano ne bude valjalo, zameni ceo za package minted

\renewcommand{\lstlistingname}{Код}

% menjanje boja kodu (promeni sve ovo)
\definecolor{codegreen}{rgb}{0.18, 0.435, 0.251}%{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\definecolor{codered}{rgb}{0.4275, 0.0039, 0.0000}

\lstdefinestyle{mojstil}{
    backgroundcolor=\color{backcolour},
    commentstyle=\color{codegreen},
    keywordstyle=\color{blue},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,
    breaklines=true,
    captionpos=b,
    keepspaces=true,
    numbers=left,
    numbersep=5pt,
    showspaces=false,
    showstringspaces=false,
    showtabs=false,
    tabsize=2
}

\lstset{
    style=mojstil,
    escapeinside={(*@}{@*)} % definise (*@ and @*) kao granicne simbole za normalni latex mod
}










% primer koda
\newcommand{\primerulaz}[3][0.21]{
    \begin{tcolorbox}[
        width=#1\textwidth,
        nobeforeafter,
        valign=top,
        enhanced,
        leftrule=0.25em,
        toprule=0pt,
        rightrule=0pt,
        bottomrule=0pt,
        arc=0pt,
        colback=backcolour,
        colframe=black,
        fontupper=\ttfamily
    ]
    \textcolor{codegreen}{\bfseries Улаз:}\\[0.2em]
    #2\\[0.8em]
    \textcolor{codegreen}{\bfseries Излаз:}\\[0.2em]
    \textcolor{codered}{#3}
    \end{tcolorbox}%
}



% ovo ne funkcioniše pravilno
\newtcolorbox{gorelevodoledesno}[1][]{
    enhanced,
% breakable,
    frame empty,
    colback=white,
    boxrule=0pt,
    arc=0pt,
    outer arc=0pt,
    left=8pt, right=8pt, top=8pt, bottom=8pt,
    overlay={
        % Top-left corner bracket
        \draw[line width=1.2pt] (frame.north west) -- ++(1.5cm, 0);
        \draw[line width=1.2pt] (frame.north west) -- ++(0, -1.5cm);

        % Bottom-right corner bracket
        \draw[line width=1.2pt] (frame.south east) -- ++(-1.5cm, 0);
        \draw[line width=1.2pt] (frame.south east) -- ++(0, 1.5cm);
    },
    #1
}








% figure environment
% h	here - approximately where the figure appears in the source
% t	top - at the top of a page
% b	bottom - at the bottom of a page
% p	page - on a separate page containing floats





% komande

\newcommand{\eng}[2]{#1 (енг.\ #2)}

\newcommand{\linija}{\vspace{1em} \hrule \vspace{1em}}

\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}

\newcommand{\pinf}{+ \infty}
\newcommand{\minf}{- \infty}
\newcommand{\pminf}{\pm{}\infty}

\newcommand{\eq}[1]{\overset{#1}{=}}

% ruska notacija za trigonometrijske funkcije vec postoji u okviru biblioteka


\newcommand{\limes}[3]{\lim_{#1 \rightarrow #2} #3}
\newcommand{\limesniz}[1]{\limes{n}{+ \infty}{#1}}

\newcommand{\preslikavanje}[3]{#1 :\ #2 \rightarrow #3}
\newcommand{\bijekcija}[3]{#1 :\ #2 \xrightarrow[\text{на}]{\text{1-1}} #3}
\newcommand{\injekcija}[3]{#1 :\ #2 \xrightarrow{\text{1-1}} #3}
\newcommand{\surjekcija}[3]{#1 :\ #2 \xrightarrow{\text{на}} #3}

\newcommand{\intotvoren}[2]{\left(#1, #2 \right)}
\newcommand{\intzatvoren}[2]{\left[#1, #2 \right]}

\newcommand{\rastuci}{\nearrow}
\newcommand{\opadajuci}{\searrow}

% Contradictio in adjecto
\newcommand{\kontradikcija}{\scalebox{1.5}{\lightning}}

% \nearrow ↗
% \searrow ↘
% \swarrow ↙
% \nwarrow ↖

% \wedge и
% \vee или
% \barwedge нили

% A \land B    % AND
% A \lor B     % OR
% \neg A       % NOT
% A \oplus B   % XOR

% \cup
% \cap
% \bigcup \bigcap

% \int integral
% \oint kruzni integral

% \mathcal{A} → calligraphic: A
% \mathscr{A} → script: A (requires mathrsfs)
% \mathfrak{A} → Fraktur/Gothic: A
% \mathbf{A} → bold: A
% \mathsf{A} → sans-serif: A
% \mathtt{A} → typewriter: A
% \mathbb{A} → blackboard bold: A (typically uppercase only)

% \mathring{U_a} пробушена околина тачке а

% tackica: \bullet
% funkcija se deli na vise uslova \begin{cases}

% Display-style inline fraction: $\displaystyle \frac{a}{b}$
% Inline with limits above/below: $\sum\limits_{i=1}^{n} x_i$
% Global: \everymath{\displaystyle}

% tekst u vise redova (underbrace) \substack{\text{ред један} \\ \text{ред два}}

\newcommand{\vektor}[2]{\vec{#1} = \left(#1_{1}, #1_{2}, \ldots , #1_{#2}\right)}
\newcommand{\niz}[2]{#1_{1}, #1_{2}, \ldots , #1_{#2}}

% indukcija: trenutna konfiguracija
\newcommand{\boxedword}[2]{\boxed{\begin{matrix} #1 \\ #2 \end{matrix}}}
\newcommand{\BI}[1]{\boxedword{\text{БИ}}{#1}:\quad }
\newcommand{\IH}[1]{\boxedword{\text{ИХ}}{#1}:\quad }
\newcommand{\IK}[1]{\boxedword{\text{ИК}}{#1}:\quad }

\endinput
