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


The following screenshot shows "the left part of section title" and "the left part of subsection number" have different vertical alignment lines.

For 12pt option passed to \documentclass, I can make they have the same vertical alignment lines by using \setlength{\cftsecnumwidth}{26pt}.

For other font sizes, I need a manual trial and error adjustment.

alt text


Is it possible to get an exact & automatic adjustment value to be passed to \setlength{\cftsecnumwidth}{} instead of using the magic number obtained by trial and error?

share|improve this question
Use 'em' instead of 'pt'. It roughly the width of an 'M' in the current font, which will automatically change as the font does. Also, 'ex' is available, which is roughly the height of an 'x' in the current font. – user21324 Oct 24 '12 at 15:16
up vote 2 down vote accepted

From the \cftsecnumwidh command, I infer you are using the tocloft package. As shown in my minimal example, tocloft produces correct alignments ("Variant A"). One may also use the (alpha) package tocstyle (part of KOMA-Script) for automatic calculation of number widths ("Variant B"). If none of this works for you, please provide a minimal example.


% Variant A

% Variant B
% \usepackage{tocstyle}
% \usetocstyle{standard}






P.S.: Page 4 of the tocloft documentation lists the standard values for ToC indent and numwidth of the various heading levels.

share|improve this answer
thank you. I like type A. :-) – xport Jan 21 '11 at 10:05

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.