
다음 scrprt 문서를 사용하면 초기 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}
결과: