LaTeX:表格中的重叠文本

LaTeX:表格中的重叠文本

我正在为论文的附录制作一个大表格,但我遇到了列重叠的问题。我查看了多篇帖子,但解决方案并没有帮助解决我的问题。希望您能提出任何建议来解决这个问题。

我使用以下代码:

\begin{table}[]
\centering
\footnotesize
\caption{My caption}
\label{my-label}
\rotatebox{90}{
\begin{tabular}{p{4cm}|p{4cm}|p{4cm}|p{4cm}|p{4cm}}
\hline
{\color[HTML]{000000} \textbf{Target group}}                                   & \textbf{First approach}                                                                           & \textbf{Second approach}                                                                                                                     & \textbf{Third approach}                                                                                       & \textbf{Fourth approach}                                                                                                                                         \\ \hline
\textbf{Rotterdam}                                                             &                                                                                                   &                                                                                                                                              &                                                                                                               &                                                                                                                                                                  \\
{\color[HTML]{000000} 17-24 year}                                              & \begin{tabular}[c]{@{}l@{}}Letter in ‘jij-vorm’ with login code for digital\\ survey\end{tabular} & Letter with login code digital survey and paper survey                                                                                       & Reminder letter with login code for digital survey                                                            & Reminder card (only the men)                                                                                                                                     \\
24-65 year                                                                     & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            & \begin{tabular}[c]{@{}l@{}}Reminder card (only the men of 24-35 year). \\ In the 6 target districts unannounced\\ telephone interviews (35-65 year)\end{tabular} \\
65+                                                                            & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter with login code for digital survey and\\ paper survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}In the 6 target districts unannounced\\ telephone interviews\end{tabular}                                                             \\
\begin{tabular}[c]{@{}l@{}}Turks 1st generation\\ 24-65 year\end{tabular}      & \begin{tabular}[c]{@{}l@{}}Letter NL and Turks with login code for digital\\ survey\end{tabular}  & Letter NL and Turkish with login,code digital survey and paper survey NL and,Turkish translation                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter NL and Turks with login code for digital\\ survey\end{tabular}     & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}                                                                \\
\begin{tabular}[c]{@{}l@{}}Turks 1st generation\\ 65+\end{tabular}             & Letter NL and Turks with login code for digital survey                                            & \begin{tabular}[c]{@{}l@{}}Letter NL and Turkish with login code digital survey and\\ paper survey NL and Turkish\\ translation\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Turks with login code for digital\\ survey\end{tabular}              & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}                                                                \\
Moroccans 1st generation 24-65 year                                            & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code digital survey and\\ paper survey\end{tabular}                               & \begin{tabular}[c]{@{}l@{}}Invitation for telephone\\ interview or interview at home\end{tabular}             &                                                                                                                                                                  \\
Moroccans 1st,generation 65+                                                   & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter NL and Arabic with login code digital survey and\\ paper survey\end{tabular}                               & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
\begin{tabular}[c]{@{}l@{}}Surinamers 1st\\ generation 24-65 year\end{tabular} & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
Surinamers 1st,generation 65+                                                  & Letter with login code for digital survey                                                         & Letter with login code digital survey and paper survey                                                                                       & \begin{tabular}[c]{@{}l@{}}Invitation for telephone interview\\ or interview at home\end{tabular}             &                                                                                                                                                                  \\
\textbf{Region Rijnmond excluding Rotterdam}                                   &                                                                                                   &                                                                                                                                              &                                                                                                               &                                                                                                                                                                  \\
17-24 year                                                                     & \begin{tabular}[c]{@{}l@{}}Letter in ‘jij-vorm’ with login code for digital\\ survey\end{tabular} & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            &                                                                                                                                                                  \\
24-65 year                                                                     & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & Reminder letter with login code for digital survey                                                            &                                                                                                                                                                  \\
65+                                                                            & Letter with login code for digital survey                                                         & \begin{tabular}[c]{@{}l@{}}Letter with login code digital\\ survey and paper survey\end{tabular}                                             & \begin{tabular}[c]{@{}l@{}}Reminder letter with login code for digital survey and\\ paper survey\end{tabular} &                                                                                                                                                                  \\ \hline
\end{tabular}}
\end{table}

这带来了以下问题:

在此处输入图片描述

非常感谢您的帮助!

答案1

这是一个解决方案。使用环境sidewaystable*和更简单tabularx。我删除了垂直线,\hline用 中的规则替换了 s booktabs,这些规则周围有一些垂直填充,并使用了一些来自 的命令makecell。此外,由于大多数单元格内容都是重复的,我引入了一些宏来简化输入:

\documentclass[a4paper, twocolumn]{article}%
\usepackage[utf8]{inputenc}%
\usepackage[T1]{fontenc}%
\usepackage{lmodern}%
\usepackage{array, tabularx, caption, booktabs, makecell}%
\usepackage[a4paper]{geometry} %
\usepackage{amsmath}%
\usepackage{rotating}%
\usepackage[table]{xcolor}%
\usepackage{ragged2e}%
\newcommand\nl{\newline}%
%% some abbreviations%
\def\interview{Invitation for telephone interview or interview at home}%
\newcommand\DS[1][]{Letter #1 with login code for digital survey}%
\newcommand\DSP[1][]{Letter #1 with login code digital survey and paper survey}%
\newcommand\RDS[1][]{Reminder letter #1 with login code for digital survey}%
\newcommand\RDSP[1][]{Reminder letter #1 with login code for digital survey and paper survey}%

\begin{document}%


\begin{sidewaystable*}%
  \footnotesize
  \setlength\tabcolsep{4pt}
  \setcellgapes{1ex}\makegapedcells
  \renewcommand\theadfont{\bfseries}
  \renewcommand\theadalign{lc}%
  \caption{My caption} \label{my-label}
  \begin{tabularx}{\linewidth}{l*{4}{ >{\RaggedRight\arraybackslash}X}}
    \toprule
    \thead{Target group} & \thead{First approach} & \thead{Second approach} & \thead{Third approach} & \thead{Fourth approach} \\%
    \midrule%
    \textbf{Rotterdam} \\%
    {17--24 year} & \DS[in ‘jij-vorm’] & \DSP & \RDS & Reminder card (only the men) \\%
    24--65 year & \DS & \DSP & \RDS & Reminder card (only the men of 24-35 year). In the 6 target districts unannounced telephone interviews (35--65 year) \\
    65\,$ + $ & \DS & \DSP & \RDSP & In the 6 target districts unannounced telephone interviews \\
    \makecell[tl]{Turks 1st generation & & & & \\ 24--65 year} & \DS[NL and Turks] & \DSP[NL and Turkish] NL and Turkish translation & \RDS[NL and Turks] & \interview \\
    \makecell[tl]{Turks 1st generation & & & & \\ 65\,$ + $} & \DS[NL and Turks] & \DSP[NL and Turkish] NL and Turkish translation & \DS[NL and Turks] & \interview \\
    \makecell[tl]{Moroccans 1st generation & & & & \\ 24--65 year} & \DS[NL and Arabic] & \DSP[NL and Arabic] & \interview & \\%
    \makecell[tl]{Moroccans 1st generation & & & & \\ 65\,$ + $} & \DS[NL and Arabic] & \DSP[NL and Arabic] & \interview & \\
    \makecell[tl]{Surinamers 1st generation & & & & \\ 24--65 year} & \DS & \DSP & \interview & \\
    \makecell[tl]{Surinamers 1st generation & & & & \\ 65\,$ + $} & \DS & \DSP & \interview & \\
    \addlinespace[3ex]
    \multicolumn{5}{l}{\textbf{Region Rijnmond excluding Rotterdam}} \\
    17--24 year & \DS[in ‘jij-vorm’] & \DSP & \RDS & \\
    24--65 year & \DS & \DSP & \RDS & \\
    65\,+ & \DS & \DSP & \RDSP & \\
    \bottomrule
  \end{tabularx}%
\end{sidewaystable*}

\end{document} 

在此处输入图片描述

相关内容