3

I was filling some tables for my progress report and noticed something were odd. The following text/tables are indented. MWE:

\documentclass[12pt, oneside]{book}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tabularx}
\usepackage[paper = a4paper, margin = 1in, headheight = 12pt, includehead, showframe]{geometry}

\begin{document}
 \section*{Section 1}
  \subsection*{Subsection 1}
   \begin{tabular}{ l l p{0.5cm} l l }
    TextText: & TextText & & TextText & TextText\\
    TextText & TextText & & TextText & TextText
   \end{tabular}
   \vspace{12pt}
   {\scriptsize{\bfseries{Little note!}}}
   \vspace{12pt}
   \begin{tabularx}{\textwidth}{| X |}
    \hline
    \bfseries{Tabletitle}\\
    \hline
    \\ \\ \\
    \hline      
   \end{tabularx}
\end{document}

Is that really the normal behaviour and is there any other way as \begin{flushleft} ... \end{flushleft} to remove the indentation a get the right alignment?

6

You can turn off indentation globally by adding \setlength{\parindent}{0pt} or if you only want to turn it of for the table add a \noindent before\begin{..}. Compare also this post: How to disable automatic indentation on new paragraphs?

  • Yeah I just remembered that I already used \parindent0em in one of my previous documents. -.- – Chris.V Jul 9 '13 at 9:12
  • 2
    \parindent0em has a bad effect on your document layout; at the least you need to set a non-zero \parskip, but that has its difficulties too. personally, i would use \noindent before each thing whose indentation you need to suppress. – wasteofspace Jul 9 '13 at 10:30
6

The second table is in a new paragraph, so it gets indented. Putting \noindent before \begin{tabularx} well prevent its indentation.

  • Ahh, thanks a lot. Sometimes I'm really daft. -.- I don't know, how I could miss that. – Chris.V Jul 9 '13 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.