TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My current section numbering format is something like this:


But I want it to be like this:


What should I do?

share|improve this question
As I said in a comment to my answer, you have redefined the wrong commands; it is not \renewcommand\section{\arabic{section}--} \renewcommand\subsection{\section\arabic{subsection}--} \renewcommand\subsubsection{\subsection\arabic{subsubsection}--} but \renewcommand\thesection{\arabic{section}--} \renewcommand\thesubsection{\section\arabic{subsection}--} \renewcommand\thesubsubsection{\subsection\arabic{subsubsection}--}. – Gonzalo Medina Jul 4 '14 at 15:11
up vote 11 down vote accepted

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




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


enter image description here

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:


% Use either the next line or the \renewcommand lines below



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

share|improve this answer
It is my thesis file, I did this by the codes bellow; but everything went to a simple text. No bold text, etc. \renewcommand\section{\arabic{section}--} \renewcommand\subsection{\section\arabic{subsection}--} \renewcommand\subsubsection{\subsection\arabic{subsubsection}--} – Enthusiastic Student Jul 4 '14 at 14:53
@Parsa Ah, I see the problem; notice that you are redefining the wrong commands; it is not \renewcommand\section{\arabic{section}--} but \renewcommand\thesection{\arabic{section}--} (notice the prefix "the" that you omitted in your code) and analogously fot the other commands. – Gonzalo Medina Jul 4 '14 at 14:58
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.