Simple use case, I have a counter for requirements, R1, R2, etc like the one below:


However, when I refer to a counter instance (i.e. \requirement{req:a} by \ref{req:a}) then the \ref{} will only contain the counter value, rather than the custom label in the format of R.value

How can I format the counter reference label?

  • Welcome to TeX.SE. Does your code provide a \label instruction for req:a?
    – Mico
    Jun 25, 2020 at 12:24

2 Answers 2


It is sufficient to redefine macro \the<counter>. Then the \label/\ref system will pick it up automatically:



Here's a small snippet that can do this:

  R\ref*{#1} \refstepcounter{reqcount}\label{#1}

Example usage:

Here is req: \reqitem{reqi:a}

Here is req: \reqitem{reqi:b}

Here is reference: \descref{reqi:a}, \descref{reqi:a}, \descref{reqi:b}


enter image description here

  • What are you trying to demonstrate with the duplicate \descref{reqi:a} directives?
    – Mico
    Jun 25, 2020 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .