General ⇒ titlesec | Custom Headings
Re: titlesec | Custom Headings
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
titlesec | Custom Headings
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}