Hi I usually use tabular to create my table. However I am currently in the process of creating a unavoidable huge multi-page table in landscape more. I am using TeXstudio 2.12.10. However I am having several issues with landscape longtable that after many hours of trying, I can to seem to fix. I was hoping that something can advice me with the following issues I am currently facing:
Prob 2: when I write long sentences on "samples" (column 4) "notes" (column 5), the text just keeps on going outside of the page border rather than wrapping around. Which brings us to problem number 2,
Prob 1: I cannot set the width of the table to \textwidth to limit the size of the table
Prob 3: \shortstack option that I implemented perfectly on tabular does not appear to work here as it is not dividing up the lines.
I am happy for the first 3 rows to be smalls as they will contain only a few words, but the last 2 columns must be able to wrap text around with the use of something like shortstack so I can write in different lines. Any advice. I have attempted the following 1, 2, 3 advice without a solution. Please do let me know if you have questions. With the codes provided below I get something like this:
%%%%%%%%%%%% latex code %%%%%%%%%%%%
\begin{landscape}
\begin{center}
\begin{longtable}{lcccl}
\caption{A simple longtable example} \\
\hline
reference & technique & geometry & suspension & notes \\
\hline
\endfirsthead
\multicolumn{5}{c}%
{\tablename\ \thetable\ -- \textit{continued from previous page}} \\
\hline
reference & technique & geometry & suspension & notes \\
\hline
\endhead
\hline \multicolumn{5}{r}{\textit{continued on next page}} \\
\endfoot
\hline
\endlastfoot
\citet{AbbottEtAl_Experimental_1991} & MR & Couette
& \shortstack{particles: PMMA // $ \bar{\phi} = 39, 45, 50, 55, 60\% $}
& \shortstack{sample contained both unimodal and un-sieved particles \\ shows migration time scale is independent of $ \eta_f $ \\ presents transient concentration profiles of $ \bar{\phi} = 50\%$ \\ presents steady state migration profiles of $ \bar{\phi} = 45, 50 , 55\%$}\\
\end{longtable}
\end{center}
\end{landscape}
Following the advice provided below I have amended
\begin{longtable}{lcccl}
with
\begin{longtable}{ p{3cm} p{1cm} p{2cm} p{3cm} p{5cm} }
While this DOES limit the table size, it does still does not wrap the text around.



tabularreplace yourcandlcolumns (which are one-line cells) byp{3cm}or whatever width you need. Also (unrelated) don't putlongtablein acenterenvironment. – David Carlisle Oct 07 '18 at 23:11\\where you have//in the shortstack? – David Carlisle Oct 07 '18 at 23:13\begin{longtable}{lcccl} with
\begin{longtable}{ p{3cm} p{1cm} p{2cm} p{3cm} p{5cm} }
However that still does not wrap the texts to fit the column width. I have attached a picture with the original post.
– J. Doe Oct 07 '18 at 23:28\shortstackworks in longtable exactly as it works outside longtable, each cell in the stack is one line, so that's not really a longtable issue. But you have not provided an example that anyone can run so hard to debug your code. You should edit the question to fix the example code so it is a complete small document that shows the issue. (as Bernard did in his answer) – David Carlisle Oct 08 '18 at 09:00