4

I would like to create a list of tasks using LaTeX. Therefore I created a theorem called task. For some tasks I would like to create additional subtheorems using alphabetic numbering. Currently my document is:

\documentclass[11pt, british, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage{amsthm}

\newtheorem{task}{Task}
\newtheorem{subtask}{Task}[task]

\begin{document}

\section{Tasks} % (fold)
\label{sec:number_1}

\begin{task}
    Task 1
\end{task}

\begin{subtask}
    Subtask 1
\end{subtask}

\begin{subtask}
    Subtask 2
\end{subtask}

% section number_1 (end)

\end{document}

This produces:

  • Task 1.
  • Task 1.1.
  • Task 1.2.

My aim is an output like:

  • Task 1.
  • Task 1.a)
  • Task 1.b)

and subsubtasks (I do not know whether this word exists or not):

  • Task 1.a.a)
  • Task 1.a.b)

How can I achieve this? Is it possible to achieve this with amsthm because I started with this package.

1 Answer 1

3

You have to redefine the way the counter of the subtask or subsubtask is output. I used your specifiation \thetask.\alph{subtask}) where \alph outputs the letter correspondence to the counter value, say 1->a

Similarly, \thesubsubtask is defined. The commands of \the... are always defined, when a new counter is registered, normally, it defaults to \arabic{counter}, i.e. arabic number output of the counter value.

Edit 06/05/2014: Added the task-theoremstyle to remove the trailing dot of the theorem number, i.e. the 7th. argument to \newtheoremstyle must be set to {} to remove that dot.

\documentclass[11pt, british, a4paper]{article}

\usepackage[utf8]{inputenc}
\usepackage[UKenglish]{babel}
\usepackage{amsthm}

\newtheoremstyle{tasks}{3pt}{3pt}{}{}{\bfseries}{}{.5em}{}
\theoremstyle{tasks}

\newtheorem{task}{Task}
\newtheorem{subtask}{Task}[task]

\newtheorem{subsubtask}{Subtask}[subtask]

% Store for later usage, if needed.
\let\OriginalTheSubTask\thesubtask%
\let\OriginalTheSubSubTask\thesubsubtask%

\renewcommand{\thesubtask}{\thetask.\alph{subtask})}

\renewcommand{\thesubsubtask}{\thetask.\alph{subtask}.\alph{subsubtask})}


\begin{document}

\section{Tasks} % (fold)
\label{sec:number_1}

\begin{task}
    Task 1
\end{task}

\begin{subtask}
    Subtask 1
\end{subtask}

\begin{subsubtask}
    Subsubtask 1
\end{subsubtask}


\begin{subtask}
    Subtask 2
\end{subtask}

\begin{subsubtask}
    Subsubtask 1
\end{subsubtask}


% section number_1 (end)

\end{document}

enter image description here

2
  • 1
    Thank you for your fast answer. There is still a very small discrepancy: the dot at the end of the theorem head. Fortunately this is easily corrected by adding a new theoremstyle and removing the punctation. Jun 4, 2014 at 10:49
  • @NickLehmann: I just noted it too: this wrong dot ;-)
    – user31729
    Jun 4, 2014 at 10:50

You must log in to answer this question.

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