
次の scrreprt ドキュメントを使用すると、初期の tabularx テーブルはテキスト領域の左境界に揃えられます。
\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}
この結果、次の PDF スニペットが生成されます (xelatex と pdflatex の両方を使用)。
上記のドキュメントを次のコードに置き換えますが、ほぼ同じプリアンブルを保持します (警告を回避するために、テーブルの幅を "0.99\textwidth" に変更する必要がありました)。
\begin{document}
\extratitle{
\BTDTitleTable
\BTDSignatureAndDate{Foobar}{Foo Baz}
}
\title{Not of interest}
\author{Foo bar}
\maketitle[-1]
\end{document}
結果は次の PDF スニペットになります。
表の左側のテキスト幅の約 1% の追加インデントに注意してください。
この余分なインデントをなくすにはどうしたらいいでしょうか? また、なぜ \extratitle によって追加されるのでしょうか?
答え1
余分な空白スペース(行の変更)があります。次のように %
中括弧の直後に配置します。\extratitle
\extratitle{%
完全な例 (これで完全な を使用できます\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}
結果: