General ⇒ titlesec | Custom Headings
Re: titlesec | Custom Headings
Ah - yes, that works - thanks a ton!
NEW: TikZ book now 40% off at Amazon.com for a short time.

titlesec | Custom Headings
You can also define the new counter with an optional argument to reset at increment.
Have you seen what this section definition does to the table of contents? It smashes all the WP and Taskr sections on one line. Does anyone know how to fix this?
MWE
Code: Select all
\newcounter{Taskr}[WP]
MWE
Code: Select all
\documentclass{article}
\usepackage{titlesec}
\titleclass{\WP}{straight}[\section]
\titleformat{\WP}[hang]{\normalfont\scshape}
{\S\,Work Package\,\oldstylenums{WP}.}{.5em}{}[]
\titlespacing{\WP}{0pt}{*1.5}{*0}
\newcounter{WP}
\renewcommand\theWP{\thesection.\arabic{WP}}
\titleclass{\Taskr}{straight}[\WP]
\titleformat{\Taskr}[hang]{\normalfont}
{Bingo\,\arabic{Taskr}.}{.5em}{}[]
\titlespacing{\Taskr}{0pt}{*1.5}{*0}
\newcounter{Taskr}[WP]
\renewcommand\theTaskr{\theWP.\arabic{Taskr}}
\begin{document}
\tableofcontents
\section{section}
\WP{wp}
\Taskr{taskr}
\Taskr{taskr}
\Taskr{taskr}
\Taskr{taskr}
\WP{wp}
\Taskr{taskr}
\Taskr{taskr}
\Taskr{taskr}
\Taskr{taskr}
\end{document}