[Tex/LaTex] Adding text to the section numbering

numberingsectioning

I wish to add some text prior to the number given to a subsection, e.g.:

Task 1.1  Blablabla
...
Task 1.2  Blablabla

How?

Best Answer

To add text before the section, you can use:

\renewcommand{\thesection}{Text \arabic{section}}

enter image description here

or for subsection you can use:

\renewcommand{\thesubsection}{Text \arabic{section}}

enter image description here

Code: section

\documentclass{article}

\renewcommand{\thesection}{Text \arabic{section}}

\begin{document}
\section{First section}
Some text.

\section{Second section}
Some more text.
\end{document}

Code: subsection:

\documentclass{article}

\renewcommand{\thesubsection}{Text \arabic{subsection}}

\begin{document}
\section{First section}
\subsection{First sub section}
Some text.
\subsection{Second sub section}
Some more text.
\end{document}