4

In this minimal working example:

\documentclass{article}
\begin{document}
\begin{description}
\item [{a)}] \begin{flushleft} test1 test1 test1 test1
test2 test2 test2 test2 
\[
x^2+x+1=0
\]
%
\noindent test3 test3 test3 test3
\par\end{flushleft}
\item [{b)}] test4 test4 test4 test4
test5 test5 test5 test5
\end{description}
\end{document}

I don't want the

test3 test3 test3 test3

line, after the equation indented. But neither using \noindent nor the trick with the "%" from this question worked. Do you have any ideas how I could stop the indentation? (It is preferable, to keep everything inside the

\begin{description}..

block and not to use a different command - or if I have to use a different command, than I would like to use one that allows me to put the "a)" and "b)" at the beginning of each line and handles spacing, like the \begin{description} automatically.)

l7ll7
  • 2,267
  • 3
    The indent you see derives from the fact that you're in a description environment, where all lines after the first are indented. – egreg Mar 18 '12 at 12:06
  • 3
    The alignment (or indentation) is "as expected" within a list environment like description. Do you want the text3... to be flush with the left margin of the text block, or flush left with the description item label? – Werner Mar 18 '12 at 12:06
  • ah, ok I see. @Werner flush left with description item label – l7ll7 Mar 18 '12 at 15:25

1 Answers1

8

As egreg and Werner have hinted, the observed indentation is not caused by a paragraph, but is a feature of any but the first lines of your description items. You can see this by placing additional "test2" strings before the equation in your first item.

\documentclass{article}
\begin{document}
\begin{description}
\item [{a)}] \begin{flushleft} test1 test1 test1 test1
test2 test2 test2 test2 
test2 test2 test2 test2 
test2 test2 test2 test2 
test2 test2 test2 test2 
test2 test2 test2 test2 
test2 test2 test2 test2 
\[
x^2+x+1=0
\]
%
\noindent test3 test3 test3 test3
\par\end{flushleft}
\item [{b)}] test4 test4 test4 test4
test5 test5 test5 test5
\end{description}
\end{document}

enter image description here

I suggest to use an enumerate environment instead (and to load the enumitem package to customize the environment's label).

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\textbf{\alph*)}]
\item test1 test1 test1 test1
test2 test2 test2 test2 
\[
x^2+x+1=0
\]
%
test3 test3 test3 test3
\item test4 test4 test4 test4
test5 test5 test5 test5
\end{enumerate}
\end{document}

enter image description here

lockstep
  • 250,273