1

I've created a very big table using https://www.tablesgenerator.com/latex_tables and need to wrap text so that the table fits on the page. After consulting this question https://stackoverflow.com/questions/790932/how-to-wrap-text-in-latex-tables, I've managed to wrap some but not all of text in the table. I've had a look at this question to see what else I need to do (Table column text exceeds column width) but, due to my inexperience, I can't work out what I need to do in my case. Thanks!

Here's the beginning of the code for the table:

% 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); \

Stephen
  • 13
  • rather than upping everything I suggest a few rows which are troublesome -- it would be easier to understand – js bibra Aug 16 '21 at 14:57
  • Sorry - have edited the above. The first entry in the table that is problematic is "Increasing prevalence over time..." in the third table, even though everything is wrapping is at should in the fourth column. – Stephen Aug 16 '21 at 15:50

1 Answers1

1

Something like this? Note: no use for \multirow.

enter image description here

\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}

Mico
  • 506,678