کد زیر برای کلاس book است:
کد: [انتخاب]
\documentclass{book}
\usepackage{color}
\usepackage{ptext}
\usepackage{xepersian}
\definecolor{ChapBlue}{rgb}{0.00,0.65,0.65}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
\reset@font
\parindent \z@
\vspace*{10\p@}%
\hboxR{%
\vbox{%
\hsize=2cm%
\begin{tabular}{c}
\sayehfamily \strut \@chapapp{} \\
\colorbox{ChapBlue}{%
\vrule depth 8em width 0pt%
\vrule height 0pt depth 0pt width 10pt%
{\normalcolor \LARGE \bfseries
\strut \vrule height 1em depth 0pt width 0pt
\thechapter}%
\vrule height 0pt depth 0pt width 10pt%
}
\end{tabular}%
}%
\vbox{%
\advance\hsize by -2cm
\hrule height 0.4pt depth 0pt width \hsize
\par
\vskip 6pt%
\hspace{20pt}%
\parbox{260pt}{%
\Huge \bfseries #1}%
}%
}%
\vskip 100\p@
}
\def\@makeschapterhead#1{%
\reset@font
\parindent \z@
\vspace*{10\p@}%
\hboxR{%
\vbox{%
\hsize=2cm%
\begin{tabular}{c}
\sayehfamily \strut \phantom{\@chapapp{}} \\
\colorbox{ChapBlue}{%
\vrule depth 8em width 0pt%
\vrule height 0pt depth 0pt width 10pt%
{\normalcolor \LARGE \bfseries
\strut \vrule height 1em depth 0pt width 0pt
\vphantom{\thechapter}}%
\vrule height 0pt depth 0pt width 10pt%
}
\end{tabular}%
}%
\vbox{%
\advance\hsize by -2cm
\hrule height 0.4pt depth 0pt width \hsize
\par
\vskip 6pt%
\hspace{20pt}%
\parbox{260pt}{%
\Huge \bfseries #1}%
}%
}%
\vskip 100\p@
}
\begin{document}
\chapter{مقدمه}
\ptext
\end{document}