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 a label that references what is currently section 1.4. Can I tweak either the \ref or \label so that it appears as 4 (i.e. only the subsection number) when reffed?

share|improve this question
up vote 7 down vote accepted

Assuming you're sure that your reference have the form m.n, then the following code

  \ifnum0=\temp ??\else

will do: call \subsecref{label}.

It's more complicated if the form of the references is different (say if they are chapter.section.subsection, but not conceptually more difficult.

A less efficient implementation that works also in expansion context is

share|improve this answer

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.