Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I get the number of the current subsection in a report, without the chapter number? What I'm wanting to do is produce a requirements list as follows using the enumitem package:

\documentclass[a4paper, 11pt]{report}

\usepackage{enumitem}

\newlist{requirements}{enumerate}{1}
\setlist[requirements]{label=\textbf{R\thesubsection.\arabic*}}

\begin{document}
\chapter{Requirements}
\section{Functional Requirements}
\subsection{Requirements Category}
Some information about ``requirements category'' goes here.
\begin{requirements}
    \item First Requirement
    \item Second Requirement
\end{requirements}
\subsection{Different Requirements Category}
Foo bar baz. Herpeddy Derpeddy.
\begin{requirements}
    \item This is a first requirement
    \item This is a second requirement
\end{requirements}
\section{Non-functional Requirements}
\subsection{Category}
Category category category.
\begin{requirements}
    \item First NFR
    \item Another NF-Requirement
\end{requirements}
\end{document}

This produces lists of the R1.1.1.1, R1.1.1.2, etc.

What I'd like is lists of the form R1.1.1, R1.1.2, with the list in the next subsection being R1.2.1, R1.2.2 and so on.

share|improve this question
    
Is it worth me generalising this question a bit and removing my particular example of wanting to use the value in a list, or should I leave the question as is? –  Edd Apr 29 '12 at 12:05

1 Answer 1

up vote 11 down vote accepted

Change \thesubsection to \arabic{section}.\arabic{subsection} .

share|improve this answer
    
Perfect, thanks. I knew it'd be something obvious, I just didn't know how to search for it! –  Edd Apr 29 '12 at 12:05

Your Answer

 
discard

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.