# Another section numbering format

My current section numbering format is something like this:

1
1.2
1.2,3

But I want it to be like this:

1-
1-2-
1-2-3-

What should I do?

-

Redefine \thesection, \thesubsection and \thesubsubsection (the representation for the counters):

\documentclass{article}

\renewcommand\thesection{\arabic{section}--}
\renewcommand\thesubsection{\thesection\arabic{subsection}--}
\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}--}

\begin{document}

\section{Test section}
\subsection{Test subsection}
\subsubsection{Test subsubsection}

\end{document}


Based on a comment, it seems that the bidi package is being used; in this case, the change can be made using simply \SepMark, as in the following example:

\documentclass{book}
\usepackage{bidi}

% Use either the next line or the \renewcommand lines below
\SepMark{--}

%\renewcommand\thesection{\arabic{section}--}
%\renewcommand\thesubsection{\thesection\arabic{subsection}--}

\begin{document}

\chapter{Test chapter}
\section{Test section}
\subsection{Test section}

\end{document}

-
I used them with 'the' and nothing happened, the output was the same. – Enthusiastic Student Jul 4 '14 at 15:10
@Parsa No, the output should not be the same. In case it is not working provide a complete little test document like the one in my answer (but complete, not just useless code snippets) showing the undesired result. – Gonzalo Medina Jul 4 '14 at 15:13
@Parsa It seems then that you are using xelatex and the bidi package (you should have mentioned this in your question). In that case, the redefinitions I suggested must be added after loading the package, or you can use \SepMark as you mentioned in your comment. I added a remark about this to my answer. – Gonzalo Medina Jul 5 '14 at 1:21