%% The LaTeX package tcolorbox - version 2.00 (2013/03/01)
%% tcolorbox-example.tex: an example for tcolorbox

\documentclass{article}
\usepackage{ptext}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\usepackage{tikz,lipsum}
\usetikzlibrary{shadings,decorations.pathmorphing} 
\usepackage[listings,theorems,skins,breakable,documentation]{tcolorbox}
\usepackage{hyperref}
\usepackage{xepersian}

\settextfont{HM_XBZar}
\setdigitfont{HM_XBZar}
%\tcbset{noparskip}

\begin{document}

%----------------------------------------------------------
\section{جعبه های رنگی}

\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black]
  جعبه من
\end{tcolorbox}

\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black,title=\rl{جعبه من}]
جعبه و عنوان من
\end{tcolorbox}

\begin{tcolorbox}[colback=green!5!white,colframe=green!75!black]
 قسمت بالای جعبه من
  \tcblower
قسمت پایین جعبه من
\end{tcolorbox}

\begin{tcolorbox}[colback=yellow!5!white,colframe=yellow!75!black,title=عنوان من]
 این کار را با عنوان نیز می توانم انجام دهم
  \tcblower
قسمت پایین
\end{tcolorbox}

\begin{tcolorbox}[colback=yellow!10!white,colframe=red!75!black,lowerbox=invisible,
  savelowerto=\jobname_ex.tex]
 حالا قایم باشک بازی می کنیم
  \tcblower
قایم می شم تا پیدانم کنی
\end{tcolorbox}

\begin{tcolorbox}[colback=yellow!10!white,colframe=red!75!black,title=\rl{من اینجام}]
  \input{\jobname_ex.tex}
\end{tcolorbox}


\begin{tcolorbox}[colback=blue!50!white,colframe=blue!25!black,coltext=yellow,
    fontupper=\Large\bfseries,arc=6mm,boxrule=2mm,boxsep=5mm]
تنظیمات فانتزی
\end{tcolorbox}


\clearpage
%----------------------------------------------------------
\section{مثالهای-\texorpdfstring{\lr{LaTeX}}{\lr{LaTeX}}}

\begin{tcblisting}{colback=red!5!white,colframe=red!75!black}
این یک مثال  \lr{\LaTeX} است

$\displaystyle\sum\limits_{i=1}^n i = \frac{n(n+1)}{2}$.
\end{tcblisting}


%----------------------------------------------------------
\section{قضیه ها}

\newcounter{mytheorem}[section]
\def\themytheorem{\arabic{mytheorem}-\thesection}

\tcbmaketheorem{theo}{قضیه}{fonttitle=\bfseries\upshape, fontupper=\slshape,
     arc=0mm, colback=blue!5!white,colframe=blue!75!black}{mytheorem}{theorem}

\begin{theo}{مجموع اعداد}{summation}
 برای هر عدد طبیعی  $n$ داریم\\[2mm]
  $\displaystyle\sum\limits_{i=1}^n i = \frac{n(n+1)}{10}$.
\end{theo}

ما در قضیه مفروض \ref{theorem:summation} در صفحه \pageref{theorem:summation}.


%----------------------------------------------------------
\section{پس زمینه ها}

\begin{tcolorbox}[enhanced,watermark graphics=xepersian-logo.pdf,
  watermark opacity=0.3,watermark zoom=0.9,
  colback=green!5!white,colframe=green!75!black,
  fonttitle=\bfseries, title=جعبه با عکس پس زمینه]
  اینجا شما یک جعبه زیبا را می  بینی با یک تصویر پس زمینه که به طور خودکار مقیاس می شود تا با اندازه جعبه همخوانی داشته باشد
  همچنین می توانید به جای عکس از نوشته برای پس زمینه استفاده کنید. به راهنما نگه کنید.
\end{tcolorbox}

%----------------------------------------------------------
\section{جعبه های قابل شکستن}

\begin{tcolorbox}[enhanced,breakable,
  colback=blue!5!white,colframe=blue!75!black,title=جعبه قابل شکستن,
  watermark color=yellow,watermark text=\harfi{tcbbreakpart}]
\ptext[1-15]
\end{tcolorbox}

افزایش پهنای نوار بالایی
\tcbset{colback=red!5!white,colframe=red!75!black}
\begin{tcolorbox}[toprule=3mm]
این یک \textbf{جعبه رنگی} است 
\end{tcolorbox}


افزایش پهنای نوار پایینی

\tcbset{colback=red!5!white,colframe=red!75!black}
\begin{tcolorbox}[bottomrule=3mm]
این یک \textbf{جعبه رنگی} است 
\end{tcolorbox}

افزایش پهنای نوار سمت چپ

\tcbset{colback=red!5!white,colframe=red!75!black}
\begin{tcolorbox}[leftrule=3mm]
این یک \textbf{جعبه رنگی} است 
\end{tcolorbox}


\tcbset{colback=red!5!white,colframe=red!75!black}
\begin{tcolorbox}[arc=4mm,outer arc=1mm]
این یک \textbf{جعبه رنگی} است 
\end{tcolorbox}


\begin{tcolorbox}[adjusted title=عنوان,skin=freelance,
frame code={\path[draw=red,fill=red!25]
(frame.south west) rectangle (frame.north east);},
interior titled code={\path[draw=blue,fill=blue!25]
(interior.south west) rectangle (interior.north east);},
segmentation code={\path[draw=green,fill=green!25]
(segmentation.south west) rectangle (segmentation.north east);},
title code={\path[draw=black,fill=brown!75!black]
(title.south west) rectangle (title.north east);}]
قسمت بالا
\tcblower 
قسمت پایین
\end{tcolorbox}

\tcbset{colback=red!5!white,fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=عنوان,
frame style={left color=red!75!black,right color=blue!75!black}]
این یک \textbf{جعبه رنگی} است 
\tcblower
این قسمت پایینی است
\end{tcolorbox}


\begin{tcolorbox}[enhanced,title=عنوان من,
interior style={left color=red!20!white,right color=yellow!50!white}]
این یک \textbf{جعبه رنگی} است 
\tcblower
این قسمت پایینی است
\end{tcolorbox}


\begin{tcolorbox}[enhanced,title=عنوان من,
segmentation style={double=white,draw=blue,double distance=1pt,solid}]
این یک \textbf{جعبه رنگی} است 
\tcblower
این قسمت پایینی است
\end{tcolorbox}

\tcbset{colback=red!5!white,colframe=red!75!black,coltitle=blue!50!black,
fonttitle=\bfseries}
\begin{tcolorbox}[enhanced,title=عنوان من,
title style={fill=blue!15!yellow}]
این یک \textbf{جعبه رنگی} است 
\tcblower
این قسمت پایینی است
\end{tcolorbox}

\tcbset{colback=green!50!white,colframe=red!75!black}
\begin{tcolorbox}[freelance,frame code={
\foreach \n in {north east,north west,south east,south west}
{\path [fill=red!75!black] (interior.\n) circle (3mm); }; }]
این یک \textbf{جعبه رنگی} است 
\tcblower
این قسمت پایینی است
\end{tcolorbox}




\tcbset{
defstyle/.style={fonttitle=\bfseries\upshape, coltitle=blue!50!black,fontupper=\slshape,
arc=0mm, colback=blue!5!white,colframe=blue!75!black},
theostyle/.style={fonttitle=\bfseries\upshape, coltitle=blue!10!white, fontupper=\slshape,
colback=red!10!white,colframe=red!75!black},
}


\tcbmaketheorem{Definition}{تعریف}{defstyle}{mytheorem}{def}
\tcbmaketheorem{Theorem}{قضیه}{theostyle}{mytheorem}{theo}
\tcbmaketheorem{Corollary}{نتیجه}{theostyle}{mytheorem}{cor}

\begin{Theorem}{Differenzierbarkeit bedingt Stetigkeit, wobei diese Benennung
zu Testzwecken ungew\"{o}hnlich lang ist}{diffbarstetig}%
Eine Funktion $f:I\to\mathbb{R}$ ist in $x_0\in I$ stetig, wenn $f$ in
$x_0$ differenzierbar ist.
\end{Theorem}





\begin{Theorem}[boxrule=2mm,toptitle=-1.5mm,bottomtitle=-1.5mm]{%
Hinreichende Bedingung f\"{u}r Wendepunkte}{wendehinreichend}%
$f$ sei eine auf einem Intervall $]a,b[$ dreimal stetig differenzierbare Funktion.
Ist $f’’(x_0)=0$ in $x_0\in]a,b[$ und $f’’’(x_0)\ne 0$, so ist
$(x_0,f(x_0))$ ein Wendepunkt von $f$.
\end{Theorem}


%\begin{Theorem}[enhanced,frame style={circular glow={fill=yellow}},
%watermark color=red!35!white,
%watermark text={Overacting\\Fundamental Theorem}]%
%{Fundamental Theorem of Theorems}{fundamental}%
%\ptext[1-2]
%\end{Theorem}

\begin{dispExample}
This is my \LaTeX content.
\end{dispExample}


\begin{dispListing}
This is my \LaTeX content.
\end{dispListing}

\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,
coltitle=black}
\begin{tcolorbox}[freelance,title=عنوان من,title code={
\path[draw=yellow,solid,decorate,line width=2mm,
decoration={coil,aspect=0,segment length=10.1mm}]
([xshift=1mm]title.west) -- ([xshift=-1mm]title.east);}]
این یک جعبه رنگی است
\tcblower
این قسمت پایین
\end{tcolorbox}


\end{document}

