سلام
من با استفاده از کد زیر میتونم نحوه نمایش عنوان بخشها رو به شکل مطلوبم تغییر بدم.
\newcommand\sectiontriangle{%
\tikz[baseline=-0.25ex, line cap=round, line join=round] {%
\path [draw=red, very thick] (0,0) -- (30:2ex) -- (-30:2ex) -- cycle;
\path [xshift=2.2ex, draw=red!75, very thick] (0,-1ex) rectangle (0.5ex,1ex);
}
}
\titleformat{\section}{\Large}{\llap{\subsubsectiontriangle}}{0cm}{\textcolor{red}{\textbf{#1}}}
\titlespacing*{\section}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\titlespacing*{name=\section, numberless}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\renewcommand*{\thesection}{\arabic{section}}
اما هنگامی که میخوام با نوشتن کدی مشابه کد بالا همین کار رو برای بخشها و زیربخشها هم انجام بدم، شکل تعریف شده در کنار عنوان بخشها و زیربخشها نمایش داده نمیشود.
\documentclass[14pt, a4paper]{memoir}
\usepackage{tikz}
\usepackage[explicit]{titlesec}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont[Scale=1.1]{PGaramond}
%---------------------------------------------------------------------------------------------------
% SECTION STYLE
%---------------------------------------------------------------------------------------------------
\newcommand\sectiontriangle{%
\tikz[baseline=-0.25ex, line cap=round, line join=round] {%
\path [draw=red, very thick] (0,0) -- (30:2ex) -- (-30:2ex) -- cycle;
\path [xshift=2.2ex, draw=red!75, very thick] (0,-1ex) rectangle (0.5ex,1ex);
}
}
\newcommand\subsectiontriangle{%
\tikz[baseline=-0.25ex, scale=0.75, line cap=round, line join=round] {%
\path [draw=red, very thick] (0,0) -- (30:2ex) -- (-30:2ex) -- cycle;
\path [xshift=2.2ex, draw=red!75, very thick] (0,-1ex) rectangle (0.5ex,1ex);
\path [xshift=3.1ex, draw=red!50, very thick] (0,-1ex) rectangle (0.5ex,1ex);
}
}
\newcommand\subsubsectiontriangle{%
\tikz[baseline=-0.25ex, scale=0.5, line cap=round, line join=round] {%
\path [draw=red, very thick] (0,0) -- (30:2ex) -- (-30:2ex) -- cycle;
\path [xshift=2.2ex, draw=red!75, very thick] (0,-1ex) rectangle (0.5ex,1ex);
\path [xshift=3.1ex, draw=red!50, very thick] (0,-1ex) rectangle (0.5ex,1ex);
\path [xshift=3.3ex, draw=red!25, very thick] (0,-1ex) rectangle (0.5ex,1ex);
}
}
\titleformat{\section}{\Large}{\llap{\sectiontriangle}}{0cm}{\textcolor{red}{\textbf{#1}}}
\titlespacing*{\section}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\titlespacing*{name=\section, numberless}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\renewcommand*{\thesection}{\arabic{section}}
\titleformat{\subsection}{\large}{\llap{\subsectiontriangle}}{0cm}{\textcolor{red}{\textbf{#1}}}
\titlespacing*{\subsection}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\titlespacing*{name=\subsection, numberless}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\renewcommand*{\thesubsection}{\arabic{subsection}}
\titleformat{\subsubsection}{\normalfont}{\llap{\subsubsectiontriangle}}{0cm}{\textcolor{red}{\textbf{#1}}}
\titlespacing*{\subsubsection}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\titlespacing*{name=\subsubsection, numberless}{0cm}{3.5ex plus 1ex minus 0.2ex}{2.3ex plus 0.2ex}
\renewcommand*{\thesubsubsection}{\arabic{subsubsection}}
\begin{document}
\section{بخش}
\subsection{زیربخش}
\subsubsection{پاراگراف}
\end{document}
چگونه میتوان این مشکل را رفع کرد؟