this question is about a (to me) mysterious little indent (looks like an ordinary blank...) after a custom-environment using the tabu
-environment.
Please compile this MWE:
\documentclass[a4paper, 11pt]{scrbook}
\usepackage{blindtext}
\usepackage[cm]{fullpage}
\usepackage{tabu, booktabs}
\newenvironment{texttab}[1]{
\par\centering
\begin{tabu} to 0.9\textwidth {#1} \toprule \rowfont{\bfseries}}
{\end{tabu}\par\noindent}
\begin{document}
\section{TEST}
\blindtext
%
\begin{texttab}{X[l,2] X[l,2] X[l,3]}
Test1 & Test2 & Test3 \\ \midrule
Test1 & Test2 & Test3 \\
Test1 & Test2 & Test3 \\ \bottomrule
\end{texttab}
%
HERE HAPPENS INDENT\blindtext
\end{document}
Following the answers from similar questions I put %
into the blank lines and \noindent
works fine here. However, there is this little blank-like indentation of the paragraph after the table.
I figured out that I can make it disappear when adding a %
after the \end
part in the text, so:
<table content> \\ \bottomrule
\end{texttab}% (!)
%
NOINDENT THIS TIME...
Please explain; how is this? Can I somehow include the solution into the definition of the environment or is it necessary to put that %
everytime I use this environment?