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

I have created the following custom sectioning using the titlesec package.

% in the preamble



% within the document

\phase{Target selection and testbed preparation} % outputs Phase 1: Target selection and testbed preparation


\task{Identification of target systems} % outputs Task 1.1: Identification of target systems

% later on in the document (ISSUE!)

Task~\ref{sec:phase-selection:task-identification} % outputs Task 1 rather than Task 1.1

Why doesn't the label contain the correct counter?

share|improve this question
up vote 4 down vote accepted

I think you need to say:

share|improve this answer
... of course, the titleformat for task will also have to be changed to reflect that. – Willie Wong Oct 12 '10 at 23:18
\titleformat{\task}{\bfseries\itshape}{Task~\thetask:}{1mm}{} \renewcommand{\thetask}{\arabic{task}} - worked like a charm - thanks. – phretor Oct 13 '10 at 10:29
@phretor: if the answer solved your problem, it would be nice of you if you mark the answer as "accepted" by clicking on the checkmark on the left of the question. – Stefan Kottwitz Nov 25 '10 at 19:51

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.