I need to create a new environment that will add a heading with an indented paragraph (the indentation applies to the entire paragraph excluding the heading). This is the desired effect:
So far I've come up with this. The problem is that the indentation includes the heading as well:
\documentclass{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\newcounter{task}
\newenvironment{task}[1][]{\refstepcounter{task}\par\medskip
{\noindent\textbf{Task~\thetask #1: }}\leftskip=2em\rightskip=2em \itshape}{\par\medskip}
\begin{document}
\blindtext
\begin{task}
\blindtext
\end{task}
\end{document}
Is there any way to exclude the heading from the paragraph indentation? Thanks!





align=parleftand labelindent to make it indent inside. – Oxdeadbeef Nov 01 '17 at 03:31