Unwanted indentations ONLY in the first row of longtable
The problem is with \label{tab:CasosDosVarHom}
. You must add a %
after the argument of \label
(at the end of the input line). Otherwise, it produces a stray space.
See What is the use of percent signs (%) at the end of lines? (Why is my macro creating extra space?)
\documentclass[a4paper]{article}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{lipsum}
\usepackage{booktabs,threeparttablex}
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}
\usepackage{caption}
\usepackage[labelfont=bf,labelsep=period]{caption}
\usepackage{array}
\usepackage[lmargin=2.5cm, rmargin=2.5cm, top=2cm, bottom=2cm]{geometry}
\begin{document}
\lipsum[2-6]
\begin{ThreePartTable}
\renewcommand\TPTminimum{\textwidth}
\setlength\LTleft{0pt}
\begin{TableNotes}[flushleft]
\footnotesize
\item[*] Footnote1
\end{TableNotes}
\begin{longtable}{| m{1.7cm} | m{2.1cm}| m{1.4cm}| m{2cm}| m{4.4cm}| m{1.7cm}|}
\caption{\textit{\textbf{It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout}}} \\
\hline
\textbf{Foo} & \textbf{Foo} & \textbf{Foo} & \textbf{Foo} & \textbf{Foo (Foo)} & \textbf{Foo\tnote{*}} \\
\hline
\endfirsthead
\multicolumn{6}{l}{\tablename\ \thetable:
\textit{It is a long established fact that a reader }(Cont\ldots)}\\
\hline
\textbf{Foo} & \textbf{Foo} & \textbf{Foo} & \textbf{Foo} & \textbf{Foo (Foo} & \textbf{Foo} \\
\hline
\endhead
\multicolumn{6}{l}{}\\
\endfoot
\noalign {\rule [-1.4ex]{6.7cm}{0.4pt}}
\insertTableNotes
\endlastfoot
\label{tab:CasosDosVarHom}% <--ADD PERCENT HERE!!
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\
& Foo & 1 & Foo & Fooooo (0.001) & F \\
& Foo & 6 & Foo & Foooo (0.001) & F \\
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\end{longtable}
\end{ThreePartTable}
\end{document}
I would reorganize your table preamble. Mowing \label
immediately after caption solve your problem:
\documentclass[a4paper]{article}
\usepackage[hmargin=2.5cm, vmargin=2cm]{geometry}
\usepackage{array, booktabs,
longtable, multirow,
threeparttablex}
\usepackage{etoolbox}
\appto\TPTnoteSettings{\footnotesize}
\usepackage{caption}
\usepackage[labelfont=bf,labelsep=period,
textfont={it,bf}]{caption}
\usepackage{lipsum}
\begin{document}
\lipsum[2-6]
\begin{ThreePartTable}
\renewcommand\TPTminimum{\textwidth}
\setlength\LTleft{0pt}
\begin{TableNotes}[flushleft]
\footnotesize
\item[*] Footnote1
\end{TableNotes}
\begin{longtable}{| m{1.7cm} | m{2.1cm}| m{1.4cm}| m{2cm}| m{4.4cm}| m{1.7cm}|}
\caption{It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout}
\label{tab:CasosDosVarHom} \\ % <---
\hline
\textbf{Foo} & \textbf{Foo} & \textbf{Foo}
& \textbf{Foo} & \textbf{Foo (Foo)} & \textbf{Foo\tnote{*}} \\
\hline
\endfirsthead
\caption[]{It is a long established fact that a reader \dots (Cont.)} \\
\hline
\textbf{Foo} & \textbf{Foo} & \textbf{Foo}
& \textbf{Foo} & \textbf{Foo (Foo)} & \textbf{Foo} \\
\hline
\endhead
\hline
\multicolumn{6}{r}{\footnotesize\textit{Continue on the next page}} \\
\endfoot
\hline
\insertTableNotes
\endlastfoot
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\multirow{4}{*}{10-343} & Foo & 2 & Foo & Foooo (0.001) & F \\*
& Foo & 1 & Foo & Fooooo (0.001) & F \\*
& Foo & 6 & Foo & Foooo (0.001) & F \\*
& Foo & 4 & Foo & Foooo (0.001) & F \\
\hline
\end{longtable}
\end{ThreePartTable}
\end{document}
Other small changes in your code make table more consistent (added lines at end of the each part of table, information that table continue on the next page, enabling table break only at begin of multirow
cells).