1

I am trying to remove the indenting of some table entries under a section.

Yesterday I posted this question, where the solution was quite simple.

However, when I try to apply that solution to a different table, I get an errer: Extra alignment tab has been changed to \cr. Test Sentence D &

The markup I am using:

\documentclass[letterpaper,11pt]{article}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage[
top    = 0.608cm,
bottom = 0.664cm,
left   = 1.20cm,
right  = 2.10cm]{geometry}
\begin{document}
\begin{tabular}{@{}p{15.5cm} p{4cm}}
Test sentence 1 & Test sentence 2
\end{tabular}\\
lorem ipsum etc etc etc
\vspace{-9mm}
\begin{itemize} 
    \item[--] asdasd
    \item[--] dsfsdf
\end{itemize}
\vspace{-6mm}
\section*{Section heading}
\begin{tabular*}{7.5in}{l@{\extracolsep{\fill}}r}

Test Sentence A  &  Test Sentence B\\
Test Sub-sentence A  &

\end{tabular*}              
\vspace{3mm}\vspace{1mm}
\begin{tabular*}@{}{7.5in}{l@{\extracolsep{\fill}}r}

Test Sentence D  &  Test Sentence E\\
Test Sub-sentence D  &

\end{tabular*}

\end{document}

I have made a screenshot demonstrating the output:

enter image description here

Additionally, it seems the table entries in the different tables don't align with each other (as shown with the shorter red line), and I would like to understand why.

1 Answers1

2

You have the @{} in the wrong place

\begin{tabular*}@{}{7.5in}{l@{\extracolsep{\fill}}r}

the @{} should be part of the column specification

\begin{tabular*}{7.5in}{@{}l@{\extracolsep{\fill}}r}

or more simply

\begin{tabular*}{7.5in}{@{\extracolsep{\fill}}lr}

You are adding space tokens before the second tabular, as you have no blank line before the \vspace so the ends of lines count as inter-word spaces.

Adding a blank line

\documentclass[letterpaper,11pt]{article}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\usepackage[
top    = 0.608cm,
bottom = 0.664cm,
left   = 1.20cm,
right  = 2.10cm]{geometry}
\begin{document}
\begin{tabular}{@{}p{15.5cm} p{4cm}}
Test sentence 1 & Test sentence 2
\end{tabular}\\
lorem ipsum etc etc etc
\vspace{-9mm}
\begin{itemize} 
    \item[--] asdasd
    \item[--] dsfsdf
\end{itemize}
\vspace{-6mm}
\section*{Section heading}
\begin{tabular*}{7.5in}{@{}l@{\extracolsep{\fill}}r}

Test Sentence A  &  Test Sentence B\\
Test Sub-sentence A  &

\end{tabular*}              

\begin{tabular*}{7.5in}{@{}l@{\extracolsep{\fill}}r}

Test Sentence D  &  Test Sentence E\\
Test Sub-sentence D  &

\end{tabular*}

\end{document}

enter image description here

David Carlisle
  • 757,742
  • Thank you for your answer David. Is there a simple way to reduce the 'height' of the line? I was using vspace as this was given as an answer in another question, but this affects the indenting due to the reason you gave, so isn't working as a solution for me. If this problem warrants a separate question please let me know. – Jake Rankin Dec 19 '19 at 20:16
  • @JakeRankin you can use vspace if you want, just always leave a blank line before \vspace (but simpler would be to make it a single table) – David Carlisle Dec 19 '19 at 20:18
  • Perfect, thank you for all your help. – Jake Rankin Dec 19 '19 at 20:20