Please see the picture below. Having all text aligned with the line after the 'a.' below makes the document more structured, but how can I do this? It will probably be something very straightforward, sorry. Thanks in advance]1
3 Answers
Maybe this is what you want, with ntheorem
and enumitem
?
\documentclass{article}
\usepackage{ntheorem}
\theoremstyle{break}
\theoremheaderfont{\bfseries\upshape}
\theorembodyfont{\upshape}
\newtheorem{exercise}{Exercise}[section]
\usepackage{enumitem}
\newlist{questions}{enumerate}{1}
\setlist[questions]{label=\alph*. wide=0pt, leftmargin=*, labelsep=0.33em, font=\bfseries, topsep=2pt, before= \leavevmode\vspace*{-\baselineskip}}
\usepackage{lipsum}
\begin{document}
\section{A first section}
\begin{exercise}
\begin{questions}%
\item \lipsum[4-5]
\end{questions}
\end{exercise}
\end{document}
Assuming it's a one-off "hanging indentation" effect that you're looking to achieve, a combination of \hangindent=<length>
and \hangafter=1
should let you achieve your objective.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\subsubsection*{Exercise 1.1}
\hangindent=\parindent\hangafter=1 a. \lipsum[2]
\noindent
\lipsum[4]
\end{document}
The enumerate from Bernard's answer is perfect should you ever need to add more elements and just need to go through the letters alphabetically (a. , b. , c. , ...). However, if these get more complicated, you could also use the description structure. This allows you to easily define longer keywords but keep the same indentation on consecutive lines / paragraphs. Here's a quick wiki example for the description (note that the blindtext
package is just to generate text):
\documentclass{article}
\usepackage{blindtext}
\begin{document}
\begin{description}
\item [a.] \blindtext
\item [b.] \blindtext
\item [Something longer and quite different than a. and b.] \blindtext
\end{description}
\end{document}
By combining this with the enumitem
package, you can align text either to the left or to the right. Here's a horrendous but obvious example by using the same descriptions here:
\documentclass{article}
\usepackage{blindtext}
\usepackage{enumitem}
\begin{document}
\begin{description}[align=right, labelwidth=5cm]
\item [a.] \blindtext
\item [b.] \blindtext
\item [Something longer and quite different than a. and b.] \blindtext
\end{description}
\end{document}
enumerate
list, so load packageenumitem
and do[label=alph*]
as well.