I'm writing a program to parse wikimarkup to LaTeX, and I've run into a bit of an issue when it comes to creating tables. For some reason, the right vertical edge of the table is getting pushed way over into the right margin, and some of the center borders are also getting duplicated.
I tried removing the text from the rightmost cells to see if the text was somehow pushing the border over, but that seemed to make no difference. I also tried setting \textwidth
to the correct value manually, but still had no luck.
This is the full LaTeX code:
\documentclass[letterpaper]{article}
\pagestyle{empty}
\usepackage[utf8]{inputenc}
\usepackage[margin=4cm]{geometry}
\usepackage{libertine, parskip, setspace, tabularx, tikz, ulem, wasysym}
\usepackage[T1]{fontenc}
\setlength\parindent{0pt}
\newcommand{\hfline}[3]{%
\par\medskip\noindent
\makebox[\textwidth][s]{\rlap{#1}\hfill#2\hfill\llap{\footnotesize{#3}}}%
\par\medskip}
\begin{document}
\begin{spacing}{0.7}
\begin{center}
\begin{scriptsize}\textbf{Declassified} per Executive Order 13526, Section 3.3\\NND Project Number: NND 63316.By: NWD Date: 2011
\end{scriptsize}
\end{center}
\end{spacing}
\begin{center}
\begin{large}
FINAL REPORT OSD \\
\end{large}
\begin{large}
Vietnam Task Force \& Index \\
\end{large}
\end{center}
\newpage
\begin{spacing}{0.7}
\begin{center}
\begin{scriptsize}\textbf{Declassified} per Executive Order 13526, Section 3.3\\NND Project Number: NND 63316.By: NWD Date: 2011
\end{scriptsize}
\end{center}
\end{spacing}
\begin{center}
\begin{Large}
EXECUTIVE SECRETARIAT \\
\end{Large}
\end{center}
\begin{tabularx}{0.7\textwidth}{X X X X X}
TLE & JJ & RMM & KDA & \fbox{ S/S-A} \\
& & & & \\
RHM & AL & LA & NP & S/S-I \\
& & & & S/S-O \\
RTC & HHB & BF & PW & S/S-S \\
& & & & \\
JC & TMT & JM & \fbox{ HCB} & S/S-EX \\
\end{tabularx} \\
\rule{\textwidth}{2px} \\
\begin{tabularx}{\textwidth}{X X}
\begin{large}\Square~ ACTION\end{large} & \begin{large}\Square~ INFORMATION\end{large} \\
\begin{large}\Square~ COMMENTS PLEASE\end{large} & \begin{large}\Square~ YOUR FILES\end{large} \\
\begin{large}\Square~ FOLLOW UP\end{large} & \begin{large}\Square~ PER CONVERSATION\end{large} \\
\begin{large}\CheckedBox~ PLEASE SEE/\sout{CALL ME}\end{large} & \begin{large}\Square~\end{large} \\
\end{tabularx} \\
\rule{\textwidth}{2px} \\
\begin{large}
REMARKS \\
\end{large}
\begin{center}
\begin{large}
Any S/S involvement? \\
\end{large}
\end{center}
\begin{flushright}
RTC
\end{flushright}
\rule{\textwidth}{2px} \\
\begin{tabularx}{\textwidth}{X X X}
T. L. ELIOT, JR. & R. H. MILLER & R. T. CURRAN \\
X22540 & X23126 & X28448 \\
\end{tabularx} \\
\newpage
\begin{spacing}{0.7}
\begin{center}
\begin{scriptsize}\textbf{Declassified} per Executive Order 13526, Section 3.3\\NND Project Number: NND 63316.By: NWD Date: 2011
\end{scriptsize}
\end{center}
\end{spacing}
\begin{flushright}
SecDef/CCS Regrading Action \#35---71
\end{flushright}
\begin{tabularx}{\textwidth}{*{4}{|p{0.25\textwidth}|}}
\hline
\multicolumn{2}{|p{0.5\textwidth}|}{\textbf{OFFICE OF THE SECRETARY OF DEFENSE REGRADING ACTION}} & \multicolumn{2}{|p{0.5\textwidth}|}{\textbf{\begin{footnotesize}DATE\end{footnotesize}} \newline \newline 23 June 1971} \\ \hline
\multicolumn{4}{|p{1.0\textwidth}|}{\textbf{\begin{footnotesize}FROM:\end{footnotesize}} \newline Top Secret Control Officer, SecDef/Classified Control Section, Room 31948, The Pentagon, Washington, D. C. 20301} \\ \hline
\multicolumn{4}{|p{1.0\textwidth}|}{\textbf{\begin{footnotesize}TO:\end{footnotesize}} \newline State Department, ATTENTION: Document Control/Security Officer, Washington, D. C. 20520} \\ \hline
\textbf{\begin{footnotesize}DOCUMENT\end{footnotesize}} \newline \textbf{\begin{footnotesize}(Type, Office of Origin, Date, Subject)\end{footnotesize}} & \textbf{\begin{footnotesize}CONTROL NUMBER\end{footnotesize}} & \textbf{\begin{footnotesize}CLASSIFICATION\end{footnotesize}} & \textbf{\begin{footnotesize}REGRADED TO\end{footnotesize}} \\ \hline
Memorandum for the Secretary of Defense, Thru: ASD/ISA and DASD(Policy Planning and Arms Control), OASD(ISA), From Chairman, OSD Task Force /s/ Leslie H. Gelb, dated 15 January 1969, Subject: Final Report, OSD Vietnam Task Force (U) w/1 Inclosure::::::::: & SecDefControl\#X-0295/69 & CONFIDENTIAL & UNCLASSIFIED WHEN SEPARATED FROM INCLOSURE \\ \hline
\textit{INCLOSURE \# 1:} \newline Document, Subject: OSD Vietnam Task Force Outline of Studies (U), dtd 10 January 1969----------------------- & " & CONFIDENTIAL & REMAINS CONFIDENTIAL \\ \hline
\multicolumn{4}{|p{1.0\textwidth}|}{////////NOTHING FOLLOWS//////////// \newline \newline \newline Document was forwarded to both Mr. Bundy and Mr. Katzenback in 1969 \newline If you have any questions concerning this regrading action please contact SFC William C. Holzer, US Army, Chief Clerk, SecDef/Classified Control Section, Rm3A948, The Pentagon, Phone: OX-76131 \newline \newline \newline Done 7/19/71 \newline Copy in EA/Bundy file \newline Copy in 8/1-file 7512 \newline \newline \newline } \\ \hline
\multicolumn{4}{|p{1.0\textwidth}|}{\begin{footnotesize}The document(s) listed above has/have been regraded and action should be taken to mark copies furnished your office. It is requested that you notify all recipients to whom additional distribution was furnished.\end{footnotesize} \newline \newline \newline } \\ \hline
\multicolumn{2}{|p{0.5\textwidth}|}{\textit{T. B. EDWARDS, MAJ, USA, Top Secret Control Officer} \newline \begin{footnotesize}Printed or typed name of official\end{footnotesize}} & \multicolumn{2}{|p{0.5\textwidth}|}{\begin{footnotesize}Signature\end{footnotesize}} \\ \hline
\end{tabularx} \\
\end{document}
The table in question spans lines 97-108. The table (on page 4), looks like this: