有些文字换行,有些不在表格中

有些文字换行,有些不在表格中

我使用创建了一个非常大的表https://www.tablesgenerator.com/latex_tables并且需要换行以使表格适合页面。在咨询了这个问题后https://stackoverflow.com/questions/790932/how-to-wrap-text-in-latex-tables,我已成功将部分但不是全部文本换行到表格中。我查看了这个问题,看看我还需要做什么(表格列文字超出列宽)但由于我缺乏经验,我无法弄清楚我的情况需要做什么。谢谢!

这是该表代码的开头:

% Please add the following required packages to your document preamble:
% \usepackage{booktabs}
% \usepackage{multirow}
% \usepackage{lscape}
% \usepackage{longtable}

\begin{landscape}
\begin{longtable}{p{0.15\linewidth} p{0.25\linewidth} p{0.25\linewidth} p{0.25\linewidth}}
\caption{Summary of Searing's Backbench Preference Roles}
\label{Searing Summary}\\
\toprule
\textbf{(Sub-)Role   (\% in House of Commons or \% of parent role)} &
  \textbf{(Absence of) Activity} &
  \textbf{Trends (and cause(s))} &
  \textbf{Role Choice Influenced by:} \\* \midrule
\endhead
%
\cmidrule(lr){2-2}
\endfoot
%
\endlastfoot
%
\multirow{6}{*}{Policy Advocate (40)} &
  \multirow{6}{*}{} &
  \multirow{6}{*}{·   Increasing prevalence over time (linked to professionalisation of MPs and decrease in working class Labour MPs and Conservative Knights of   the Shire, rise of professional lobbying, new facilities and changes to committee system).} &
  ·   Age (too old to gain a ministerial position); \\
 &
   &
   &
  ·   Demand among electorate   for constituency service (Proportion of policy advocates decreases as   constituency class composition becomes increasingly heterogenous); \\
 &
   &
   &
  ·   Electoral security   (especially important for Specialists; the safer the seat, the more likely an   MP is to be a Policy Advocate); \\

答案1

像这样吗?注意:没用\multirow

在此处输入图片描述

\documentclass{article}  % or some other suitable document class
\usepackage[english]{babel}
\usepackage{pdflscape,longtable,booktabs,array,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight}p{#1\linewidth}} % handy shortcut macro
% Create a bespoke itemize-like list environment:
\usepackage{enumitem}
\newlist{myitemize}{itemize}{1}
\setlist[myitemize,1]{label=\textbullet,nosep,wide=0pt,
                      before={\begin{minipage}[t]{\hsize}},
                      after={\end{minipage}}}

\begin{document}
\begin{landscape}
\begin{longtable}{@{} P{0.15} P{0.25} P{0.25} P{0.25} @{}}
\caption{Summary of Searing's Backbench Preference Roles}
\label{Searing Summary}\\
\toprule
\textbf{(Sub-)Role (\%~in House of Commons or \%~of parent role)} &
\textbf{(Absence of) Activity} &
\textbf{Trends (and cause(s))} &
\textbf{Role choice influenced by} \\ 
\midrule
\endhead
%
\cmidrule(lr){2-2}
\endfoot
%
\bottomrule
\endlastfoot
%
Policy Advocate (40) & 
\dots &
\begin{myitemize}
\item Increasing prevalence over time (linked to professionalisation of 
  MPs and decrease in working class Labour MPs and Conservative Knights of   
  the Shire, rise of professional lobbying, new facilities and changes to 
  committee system). 
\end{myitemize} &
\begin{myitemize}
\item Age (too old to gain a ministerial position)
\end{myitemize} \\
\dots &
\dots &
\dots &
\begin{myitemize}
\item Demand among electorate for constituency service (Proportion of 
  policy advocates decreases as constituency class composition becomes 
  increasingly heterogenous); 
\item Electoral security (especially important for Specialists; the 
  safer the seat, the more likely an MP is to be a Policy Advocate);
\end{myitemize} \\
\end{longtable}
\end{landscape}
\end{document}

相关内容