
\documentclass[12pt,oneside]{book} 
%----------------------------------------------------------------
\usepackage{amsmath,amsthm,amssymb,amsfonts}
\usepackage[chatter]{rotating}
\usepackage{epsfig}
\usepackage{tocbibind}
\usepackage{makeidx}
\usepackage{fancyhdr,graphicx}
\usepackage[a4paper,vmargin=3.5cm,left=3cm,right=4cm]{geometry}
%----------------------------------------------------------------
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\usepackage{fancyhdr}
\usepackage{perpage}
\MakePerPage[1]{footnote}
\usepackage{xepersian}
    
    %\makeatother
%----------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
\pagestyle{fancy}
\fancyhead[OL,EL]{}
\fancyhead[OR,ER]{\small\nouppercase\leftmark}
\renewcommand{\headrulewidth}{0.4pt}
\cfoot{\thepage}

%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%

\settextfont[Scale=1.2]{XB Niloofar}


\setdigitfont[Scale=1]{Parsi Digits}
\setlatintextfont[Scale=1]{Times New Roman}
\defpersianfont\timesNewRoman[Scale=1]{Times New Roman}
\defpersianfont\Nastaliq[Scale=1.3]{IranNastaliq}
\defpersianfont\Titre[Scale=1]{XB Titre}
\defpersianfont\nastaliq[Scale=2]{IranNastaliq}
\defpersianfont\nastaliqq[Scale=2]{IranNastaliq}
\defpersianfont\nastaliqqq[Scale=3]{IranNastaliq}
\defpersianfont\chapternumber[Scale=2]{IranNastaliq}
%\defpersianfont\chapternumber[Scale=2]{XB Titre}
    
    
    
    
    
%----------------------------------------------------------------

\def\d{\displaystyle}
\def\SL{\mathrm{sl}}
\def\gl{\mathrm{gl}}
\def\trc{\mathrm{trc}}
\def\Im{\mathrm{Im}}
%----------------------------------------------------------------
\theoremstyle{plain}
\newtheorem{thm}{قضیه}%[section]
\numberwithin{thm}{section}
\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thesubsection}{\arabic{subsection}.\arabic{section}}
\renewcommand{\thesubsubsection}{\arabic{subsubsection}.\arabic{subsection}.\arabic{section}}
\renewcommand{\thesection}{\arabic{section}.\arabic{chapter}}
\renewcommand{\thethm}{\arabic{thm}.\arabic{section}.\arabic{chapter}}
\renewcommand{\theequation}{\arabic{equation}}
\newtheorem{lem}[thm]{لم}
\newtheorem{prop}[thm]{گزاره}
\newtheorem{cor}[thm]{نتیجه}
\newtheorem{note}[thm]{نکته}
\newtheorem{remark}[thm]{تذکر}
\newtheorem{notee}[thm]{توجه}
\theoremstyle{definition}
\newtheorem{dfn}[thm]{تعریف}
\newtheorem{exam}[thm]{مثال}
\newtheorem{rem}[thm]{ملاحظه}
\newtheorem{remark2}[]{یادآوری}
\newtheorem{remark3}[thm]{تبصره}
\newtheorem{notation}[thm]{نمادگذاری}
\renewcommand{\bibname}{مراجع}
\setcounter{secnumdepth}{3}
\allowdisplaybreaks 
\oddsidemargin =0cm 
\evensidemargin =0cm
\textheight =21cm
\textwidth= 15cm
\headsep= 1.2cm
\topmargin =0cm
\usepackage{perpage}
\MakePerPage{footnote}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%این برای اول فصل هاست که به صورت نستعلیق در امده و وسط نوشته شده % 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\proofname{برهان}
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%

%این برای بولد نوشتن برهان است

\renewcommand{\proofname}{برهان} 
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont \topsep6pt plus 6pt\relax
\trivlist
\item[\hskip\labelsep
\bfseries
#1\@addpunct{.}]\ignorespaces
}{%
\popQED\endtrivlist\@endpefalse
}
\makeatother

%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%نمیدونم چیه این!
\makeatletter
\renewcommand\tableofcontents{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse
\fi
\centerline{\huge\bfseries\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\vskip 40\p@
\@starttoc{toc}%
\if@restonecol\twocolumn\fi
}
\makeatother


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% این برای علامت n - آیزوکلینیسم است. 
\newcommand{\nisoclinism    }{\;\raisebox{0pt}[0pt][0pt]{\Large 
$\sim$\raisebox{-0.2ex}{\kern-.50em\scriptsize $n$}}\ \; }
%%%%


%%%%%%%%%%%%%%%%%%%5
%این برای فهرست مطالب هست: 

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\chaptername~\protect\numberline{\@tartibi\c@chapter:}~~#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand*\l@section{\@dottedtocline{1}{4.3em}{2.3em}}        
\renewcommand*\l@subsection{\@dottedtocline{2}{6.5em}{3.2em}}  
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{document}


\begin{center}
\begin{tikzpicture}
\newcommand{\rad}{2pt}
\newcommand{\crcl}[2]{circle (\rad) node[#1] {$#2$}}
\newcommand{\row}[5]{\filldraw (#1,#2) \crcl{#3}{#4} \foreach \i in {#5} { -- ++(2,0) \crcl{#3}{\i} };}
\begin{scope}[rotate=-40]
\row{0}{0}{above=3pt}
{G}{HZ_n(G)=K,  Z_n(H)Z_n(G)=Z_n(K), Z_n(G)}

\row{2}{-1.5}{below=5pt}{H}{Z_n(H), H \cap Z_n(G), 1}
\foreach \x in {2,4,6} \draw (\x,0) -- (\x,-1.5);
\end{scope}
\end{tikzpicture}
\end{center}

% این هم نمونه ای که انگار با نوشته ها و دستورات نوشته شده مشکل دارد! توی فایل جدا بدون دستورات اولیه بالا اجرا میشه! 
ab
\begin{sideways}%
kj
\end{sideways}
End here



\end{document}