
Si uso el siguiente documento scrreprt, la tabla tabularx inicial está alineada con el límite izquierdo del área de texto:
\documentclass[draft=true]{scrreprt}
\usepackage{tabularx}
\usepackage{xifthen}
\usepackage{showframe}
\newcommand*{\BTDTitleTable}{%
\noindent%
\begin{tabularx}{\textwidth}{|p{0.14\textwidth}|p{0.14\textwidth}|X|p{0.14\textwidth}|p{0.14\textwidth}|}%
\hline%
a%
& b%
& c%
& d%
& f \\%
\hline%
1%
& 2%
& 3%
& 4%
& 5 \\%
\hline%
\end{tabularx}%
\par\vspace{0.6cm}%
}%
\newcommand*{\BTDSignatureAndDate}[3][Foobar]{%
\par\noindent\vspace{1.4cm}%
\par\noindent\makebox[0cm][l]{{\large {#1}:}}%
\par\noindent\vspace{0.6cm}%
\par\noindent\makebox[0.224\textwidth][l]{\hrulefill} \hfill\makebox[0.67\textwidth][l]{\hrulefill}%
\ifthenelse{\isempty{#3}}%
{\par\noindent\makebox[0.224\textwidth][l]{\small Date} \hfill\makebox[0.67\textwidth][l]{\small #2}}%
{\par\noindent\makebox[0.224\textwidth][l]{\small Date} \hfill\makebox[0.67\textwidth][l]{\small #2, #3}}%
}%
\KOMAoption{twoside}{true}
\begin{document}
\pagestyle{empty}
\BTDTitleTable
\BTDSignatureAndDate{Foobar}{Foo Baz}
\end{document}
Esto da como resultado el siguiente fragmento de pdf (tanto con xelatex como con pdflatex):
Reemplazar el documento anterior por el siguiente código manteniendo casi (tuve que cambiar el ancho de la tabla a "0.99\textwidth" para evitar una advertencia) el mismo preámbulo:
\begin{document}
\extratitle{
\BTDTitleTable
\BTDSignatureAndDate{Foobar}{Foo Baz}
}
\title{Not of interest}
\author{Foo bar}
\maketitle[-1]
\end{document}
da como resultado el siguiente fragmento de pdf:
Tenga en cuenta la sangría adicional de aproximadamente el 1% del ancho del texto en el lado izquierdo de la tabla.
¿Cómo puedo deshacerme de esta sangría adicional? ¿Y por qué lo agrega \extratitle de todos modos?
Respuesta1
Hay un espacio en blanco extra espurio (un cambio de línea). Colóquelo %
justo después de la llave \extratitle
como en \extratitle{%
:
El ejemplo completo (ahora puedes usar el completo \textwidth
):
\documentclass[draft=true]{scrreprt}
\usepackage{tabularx}
\usepackage{xifthen}
\usepackage{showframe}
\newcommand*{\BTDTitleTable}{%
\noindent%
\begin{tabularx}{\textwidth}{|p{0.14\textwidth}|p{0.14\textwidth}|X|p{0.14\textwidth}|p{0.14\textwidth}|}%
\hline%
a%
& b%
& c%
& d%
& f \\%
\hline%
1%
& 2%
& 3%
& 4%
& 5 \\%
\hline%
\end{tabularx}%
\par\vspace{0.6cm}%
}%
\newcommand*{\BTDSignatureAndDate}[3][Foobar]{%
\par\noindent\vspace{1.4cm}%
\par\noindent\makebox[0cm][l]{{\large {#1}:}}%
\par\noindent\vspace{0.6cm}%
\par\noindent\makebox[0.224\textwidth][l]{\hrulefill} \hfill\makebox[0.67\textwidth][l]{\hrulefill}%
\ifthenelse{\isempty{#3}}%
{\par\noindent\makebox[0.224\textwidth][l]{\small Date} \hfill\makebox[0.67\textwidth][l]{\small #2}}%
{\par\noindent\makebox[0.224\textwidth][l]{\small Date} \hfill\makebox[0.67\textwidth][l]{\small #2, #3}}%
}%
\KOMAoption{twoside}{true}
\begin{document}
\extratitle{%
\BTDTitleTable
\BTDSignatureAndDate{Foobar}{Foo Baz}
}
\title{Not of interest}
\author{Foo bar}
\maketitle[-1]
\end{document}
El resultado: