
\listfiles
%\documentclass[twoside, openright, a4paper,12pt]{report} % Two side 
\documentclass[a4paper,12pt]{report} % one side

% Persian thesis template for the sharif university. 
% Maintained by Sadegh Dorri Nogoorani (dorri@ce.sharif.edu)
% Feel free to send me any corrections/improvements.
\usepackage{fancyvrb}
\usepackage{bera}
\usepackage{listings}

\usepackage{graphicx} % inserting images

%\usepackage{caption}
\usepackage[font={small}]{caption}

\usepackage{subcaption}
\usepackage{amsmath} % for \DeclareMathOperator
\usepackage{color}
\usepackage{setspace} % for switching between double/single space in document
\usepackage{algorithmic}
\usepackage{algorithm}
%\usepackage{algpseudocode}
\usepackage[top=3cm,right=2.5cm,bottom=2.5cm,left=2.5cm]{geometry} % setting the margins of page
\usepackage{enumerate}
\usepackage{booktabs}
\usepackage{multicol} % multicolumn page
\usepackage{multirow}
\usepackage[normalem]{ulem} % for wavy underline \uwave
\usepackage{url}
%\usepackage[xetex,colorlinks,bookmarksnumbered]{hyperref} %Online Version
\usepackage[xetex,bookmarksnumbered]{hyperref} %Print Version
\usepackage[all]{hypcap} % fix hyperref to point to the figure/table instead of its caption. Must be loaded after hyperref.
\usepackage[xindy,sanitize={name=true,description=false,symbol=true}]{glossaries} % must be after hyperref for links. Special handling is required for latin toc section, so better to disable toc.
\usepackage{minitoc} % For minitoc. \usepackage{mtcoff} to disable
\usepackage{appendix} % for more control over appendices

% == Footnote fixes == %
\usepackage[bottom]{footmisc}  %bottom option: to fix the behavior: a footnote and a figure with b (bottom) placement on the same page, then the figure will be placed under the footnote. perpage option to enclose Footnote Numbers within a Page doesn't work and perpage package must be used.
\usepackage{fancyhdr} % package for changing Headings style
\usepackage{zref-abspage}
\usepackage{perpage} % reset footnotes on each page
\MakePerPage{footnote} % reset footnotes on each page
% see the \interfootnotelinepenalty after begin{doc} for another setting
% == Footnote fixes == %

\usepackage{xifthen}% provides \isempty test
\usepackage{pbox} % to put some lines of text in an autosized box in a figure
\usepackage{xepersian} % Should be loaded after all other packages
% tell tex engine address of folder containing your pictures
\graphicspath{{images/}}
% commands to print the page number in header
\setlength{\headheight}{17pt} % avoid latex warning
\pagestyle{fancy}
\cfoot{}
\lhead{\thepage}
% commands related to XePersian package
\settextfont[Scale=1.1]{B Nazanin} %{B Yas}
\setlatintextfont[Scale=0.9]{Times New Roman} %{Linux Libertine}
\setdigitfont[Scale=1.1]{B Nazanin} %{B Yas}
\linespread{1.5}
\frenchspacing
\newcommand{\tab}[1]{\hspace{.1\textwidth}\rlap{#1}} %me
\newtheorem{theorem}{قضیه}[section]

%Start commands for minitoc package - \usepackage{mtcoff} to disable
%\nomtcrule % disable rulers before and after the minitoc
%\tightmtctrue % use less space between minitoc lines
\setcounter{minitocdepth}{1} % show just sections
\setlength{\mtcindent}{12pt} % two-side indentation 
\renewcommand{\mtcfont}{\small\rm} % font size
\renewcommand{\mtcSfont}{\small\rm} % Section entries font
\renewcommand{\mtifont}{\small\bf} % title of minitoc font
%\renewcommand{\mtcfont}{\tiny\rm}
%\renewcommand{\mtcSfont}{\tiny\bf}
%\renewcommand{\mtcSSfont}{\tiny\bf}
\let \Oldminitoc \minitoc 
\renewcommand{\minitoc}{\Oldminitoc \vspace{12pt}} % add auto-vspace after \minitoc's
\renewcommand{\mtctitle}{مطالب این فصل}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
%End -------------------------------------

%\input{jeld_info}

%\hypersetup{
%   pdftitle={\entitle}
%   ,pdfauthor ={\enAuthor}
%   ,pdfsubject={\enlevel{} \entype{} (\enmajor), \enDep, Sharif University of Technology, Tehran, I.R.Iran}
%   %,pdfkeywords ={}
%}
\def\sectionautorefname{بخش} % localizing \autoref{}
\def\subsectionautorefname{بخش} % localizing \autoref{}
\def\chapterautorefname{فصل} % localizing \autoref{}
\def\itemautorefname{بند} % localizing \autoref{}
\def\figureautorefname{شکل} % localizing \autoref{}
\def\equationautorefname{رابطه} % localizing \autoref{}
\def\tableautorefname{جدول} % localizing \autoref{}
\def\pageautorefname{صفحهٔ} % localizing \autoref{}
\def\footnoteautorefname{پاورقی} % localizing \autoref{}

%\citestyle{}
% IEEEtran BibTeX style special control command (\bstctlcite). See its guide for more info.
\makeatletter
\def\bstctlcite{\@ifnextchar[{\@bstctlcite}{\@bstctlcite[@auxout]}}
\def\@bstctlcite[#1]#2{\@bsphack
  \@for\@citeb:=#2\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\csname #1\endcsname{\string\citation{\@citeb}}\fi}%
  \@esphack}
\makeatother
% End of IEEEtran...

% ===============
% Fix blank pages in a twoside, openright document to not show header/footer. see fancyhdr doc on section "those blank pages"
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
%\vspace*{\fill}
%\begin{center}
%This page intentionally contains only this sentence.
%\end{center}
%\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%============ end of fix

% Use tl2009 for TeXLive 2009
%\input{glossary_style-tl2009}
\input{glossary_style}
\makeglossaries

\newtheorem{Defination}{تعریف}[section]
\newtheorem{example}{مثال}[section]
\begin{document}

\interfootnotelinepenalty=10000 % prevent LaTeX from splitting footnotes across pages

\bstctlcite{Proposal:BSTcontrol} % activate IEEEtran_biboptions.bib options

\dominitoc %initialization of minitoc

\include{commands}

\input{glossaries}

%=========== Front matter ===============
%\include{cover_fa}
%\cleardoublepage % terminates the current paragraph and page, the same way as a report document.
%\include{besmellah}
%\include{taeid}
%\include{acknowledgment}
%\include{offer_fa}
%\include{abstract_fa}

%=========== Tables ===============
%\cleardoublepage % terminates the current paragraph and page, the same way as a report document.
%\pagenumbering{harfi} % .تغییر شماره صفحات به حرفی. شماره صفحه ریست می‌شود باید از اینکه در صفحه درستی هستیم مطمئن باشیم.

%\tableofcontents
%\cleardoublepage % terminates the current paragraph and page, the same way as a report document.

\renewcommand*\listfigurename{فهرست شکل‌ها}
\renewcommand*\listtablename{فهرست جدول‌ها}
%\listoffigures
%\listoftables

%=========== Regular chapters ===============
\cleardoublepage % terminates the current paragraph and page, the same way as a report document.
\pagenumbering{arabic} % تغییر شماره صفحات به عددی
{ % \doublespacing
%\include{introduction}
%\include{ini-concepts}
%\include{relatedwork}
%\include{solution}
%\include{implementation}
%\include{conclusion}
%\include{salam}
}
%=========== Appendicies ===============
% If do not have appendix then comment this section!
%{\doublespacing
%\begin{appendices}
%\resettranslations % reset the first-use flag of tranlsation glossareis
%\include{appnd1}
%\include{appnd2}
%\end{appendices}
%}
%
%=========== References ===============
{ \singlespacing
%\include{references}
}
%=========== Glossaries ===============
%\cleardoublepage % terminates the current paragraph and page, the same way as a report document.
{\singlespacing
%\printpersianglossary
%\cleardoublepage
%\printenglishglossary
}
%=========== Back matter ===============
%\include{abstract_en}
\cleardoublepage % terminates the current paragraph and page, the same way as a report document.
%\include{cover_en}


\end{document}
