Дополнительное пространство между текстом первой и второй строк в табличной среде LaTex - PullRequest
1 голос
/ 01 августа 2020

Как убрать лишний пробел между текстом первой и второй строк? Заранее спасибо!

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}

\begin{document}
\begin{tabular}{m{13em}m{1cm}m{1cm}m{1cm}m{13em}m{1cm}m{1cm}m{1cm}}  \hline
    & A & B & C & & D & E & F \\ \hline
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & & \\ 
\hspace{3mm} Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\hspace{3mm} Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\

\end{tabular}
\end{document}

введите описание изображения здесь

1 Ответ

2 голосов
/ 01 августа 2020

Ваша таблица определена с 9 столбцами, но во второй строке вы используете 10. Вы получите сообщение об этом, поэтому вам даже не следует смотреть на то, что может быть или не может быть правильным pdf.

Если ошибка исправлена, таблица будет выглядеть так:

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}

\begin{document}
\begin{tabular}{m{13em}m{1cm}m{1cm}m{1cm}m{13em}m{1cm}m{1cm}m{1cm}}  \hline
    & A & B & C & & D & E & F \\ \hline
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & \\ 
\hspace{3mm} Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\hspace{3mm} Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\

\end{tabular}
\end{document}

enter image description here

Instead of hard-coding the widths of all columns, it might be easier to use the tabularx package (and maybe the booktabs package for better spacing):

\documentclass[jou]{apa7}
\usepackage{siunitx}
\usepackage{textcomp}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{tabularx}{\linewidth}{XlllXlll}  
\toprule
    & A & B & C & & D & E & F \\ 
\midrule
Model 1: Name of the first model inserted here & & & & Model 2: Name of the second model inserted here & & & \\ 
\quad Integration strategies & .03 & .10 & .000 & Integration strategies & .34 & .08 & .000 \\
\quad Integration strategies & .12 & .03 & .56 & Integration strategies & .12 & .19 & .404\\
\bottomrule
\end{tabularx}
\end{document}

введите описание изображения здесь

Обычно я также предлагаю использовать @{}XlllXlll@{} для удаления пробелов перед и после столбцов, но для этого конкретного примера c это приводит к действительно плохому разрыву строки

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...