\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{enumitem}
\usepackage{amsthm}
\usepackage{pdfpages} % pro zadani
%\usepackage{lscape} %pro stranku na sirku zobrazena na vysku
\usepackage{pdflscape} %pro stranku na sirku zobrazena na sirku

\usepackage[ruled,vlined,linesnumbered]{algorithm2e}
\SetKwProg{Fn}{Function}{ is}{end}

% pro tabulky vnorene
\usepackage{caption}
\usepackage{subcaption}
\usepackage{tabularx}



%\usepackage{algorithmicx}
%\usepackage{algpseudocode}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{stmaryrd} % for Iverson brackets
\usepackage{tcolorbox} % for box with input file format
\usepackage{pifont}% for check mark and cross mark
%\usepackage{siunitx} % for alignment of numbers
\usepackage{dcolumn}
\usepackage{textcomp} % for permille sign
\graphicspath{ {images/} }

\renewcommand\qedsymbol{$\blacksquare$}

\def\xmark{$\text{\sffamily X}$}
\def\checkmark{\tikz\fill[scale=0.4](0,.35) -- (.25,0) -- (1,.7) -- (.25,.15) -- cycle;} 


\newcommand{\argmin}{\mathop{\mathrm{argmin}}}
\newcommand{\argmax}{\mathop{\mathrm{argmax}}}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}
\newcommand{\iverson}[1]{\llbracket#1\rrbracket}
\DeclarePairedDelimiter\sgn{\left}{\right}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}

%[section]
\theoremstyle{definition}
\newtheorem{definition}{Definition}[chapter]
 
\theoremstyle{corollary}
\newtheorem{remark}{Remark}[chapter]

\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}[chapter]
\theoremstyle{corollary}
\newtheorem{corollary}{Proposition}[chapter]
\theoremstyle{lemma}
\newtheorem{lemma}{Lemma}[chapter]
\theoremstyle{definition}
\newtheorem{example}{Example}[chapter]

%https://wiki.bath.ac.uk/pages/viewpage.action?pageId=72944122
\makeatletter
\newenvironment{proofof}[1]{
\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
		\itshape
    Proof of #1\@addpunct{.}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother

\newcommand*{\exampleEnd}{\hfill\ensuremath{\square}} % for ending examples

%%%%%

\usepackage{tikz}
\usetikzlibrary{angles,calc,intersections,quotes,arrows.meta}


\usepackage[utf8]{inputenc}
\usepackage{latexsym}
\usepackage{a4wide}
\usepackage{color} 
\usepackage{indentfirst}
\usepackage{graphicx}       %%% graphics for dvips
\usepackage{fancyhdr}
\usepackage{longtable}
\usepackage{pifont}
\usepackage{makeidx}
\usepackage{lastpage}
\usepackage{multirow}
\usepackage{dcolumn} 
\usepackage{listings}
\usepackage{indentfirst}
\usepackage{booktabs}
\usepackage{caption}
\usepackage{rotating}
\usepackage{pgf}
\usepackage{setspace}
\usepackage{color}
\usepackage[hyphens]{url}
\usepackage{multirow}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{setspace}
\usepackage{array}
\usepackage{todonotes}
\usepackage{tabularx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsthm}
\usepackage[round]{natbib}

\allowdisplaybreaks[1]

\usepackage{listings}
\lstset{breaklines=true,basicstyle=\small,captionpos=b,frame=single,language=sh,float=h}

\usepackage[]{geometry}
\geometry{vcentering,pdftex,papersize={210mm,297mm},total={151mm,257mm},includefoot,includehead,twoside,hmarginratio=35:24}
%\geometry{vcentering,pdftex,papersize={210mm,297mm},total={151mm,257mm},includefoot,includehead,hmarginratio=35:24}
% European layout (no extra space after `.')
\frenchspacing


% no indent, free space between paragraphs
\setlength{\parindent}{1.0cm}
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}

\usepackage{ifthen} %%% package for conditionals in TeX
\newread\testin
\def\softinput #1 {\let\next=\relax \openin\testin=#1
\ifeof\testin \message{Info: the file #1 does not exist}%
\else \closein\testin \def\next{\input #1 }\fi
\next}

\softinput{makeconfig}

\ifx\clinks\undefined
\def\clinks{true}
\fi

\ifx\pdfoutput\undefined %%% LATEX %%%
\def\nothtml{}  %%% \nothtml is defined if not processed with latex2html
%\usepackage[dvips]{graphicx}       %%% graphics for dvips
\usepackage[                %%% hyper-references for ps2pdf
unicode=true, 
bookmarks=true,%                   %%% generate bookmarks ...
breaklinks=true,%                  %%% breaks lines, but links are very small
hypertexnames=false,%              %%% needed for correct links to figures
colorlinks=\clinks,%
urlcolor=blue
]{hyperref}           %%% blue instead of cyan URLS
\hypersetup{
pdfcreator  = {LaTeX with hyperref package},
pdfproducer = {dvips + ps2pdf},
}
\else %%% PDFLATEX %%%
\def\nothtml{}  %%% \nothtml is defined if not processed with latex2html
%\usepackage[pdftex]{graphicx}        %%% graphics for pdfLaTeX
\usepackage[              %%% hyper-references for pdflatex
unicode=true, 
bookmarks=true,%                   %%% generate bookmarks ...
hypertexnames=false,%              %%% needed for correct links to figures
breaklinks=true,%                  %%% break links if exceeding a single line
colorlinks={\clinks},%
urlcolor=blue]{hyperref}           %%% blue instead of cyan URLS
\pdfadjustspacing=1                %%% force LaTeX-like character spacing

\hypersetup{
    unicode=true,          % non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        % show Acrobat’s toolbar?
    pdfmenubar=true,        % show Acrobat’s menu?
    pdffitwindow=false,     % window fit to page when opened
    pdfstartview={FitH},    % fits the width of the page to the window
	colorlinks=false,       % false: boxed links; true: colored links
	%linkcolor=black,          % color of internal links
	%citecolor=black,        % color of links to bibliography
	%filecolor=black,      % color of file links
	%urlcolor=black,           % color of external links
	%linkbordercolor = {0 1 1}
	linkcolor=blue
}
\fi

%\renewcommand{\baselinestretch}{1.10}
% trim=l b r t
% ,trim=5cm 10cm 5cm 5cm,clip=true
% page=3 % for 3rd page of pdf file

\newcommand{\figX}[5][t]{
\begin{figure}[#1]
  \begin{center}
	\catcode`\_=11
	\edef\ImageUnderscore{_}
	\catcode`\_=8
	\let\_=\ImageUnderscore
    \includegraphics[#3]{fig/#2}
  \end{center}
  \vspace{-20pt}
  \caption{#4\label{fig:#5}}
  \end{figure}
}

\newcommand{\figref}[1]{\ref{fig:#1}}

\newcommand{\rov}[1]{(\ref{#1})}

\newcommand{\riskm}{\ensuremath{\varTheta}}

\newcommand{\R}{\ensuremath{\mathbb{R}}}

\newcommand{\Rp}{\ensuremath{\mathbb{R}^{\geq 0}}}

\newcommand{\itodo}[1]{\todo[inline]{#1}}

\newcommand{\set}[1]{\mathcal{#1}}

\newcommand{\vek}[1]{\mathbf{#1}}

\newcommand{\graph}[1]{\mathsf{#1}}

\usepackage[figure]{hypcap}



