3

I am stuck on what seems to be a very weird problem within the longtable environment. What I'm trying to do is setting the column widths using the p{width} command. In practice, it works for every column but the third one. Apparently, LateX seems to completely ignore the command for that particular column, while everything runs smoothly for the others. Following you can find the code I'm using:

\documentclass[a4paper,12pt]{Thesis}
\usepackage{booktabs, multicol, multirow}
\usepackage{tabularx, array}
\usepackage{subfigure}
\usepackage{bigstrut}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{latexsym}
\usepackage[table]{xcolor}
\usepackage[english]{babel}
\usepackage[section]{placeins}
\usepackage{longtable}


\begin{document}
\begin{center}
\small
\begin{longtable}{p{10pt} p{100pt} p{10pt} p{100pt} p{10pt} p{100pt}}

\caption[caption]{caption} \label{grid_mlmmh} \\

\hline \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} & \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} &        \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  \\ \hline 
\endfirsthead

\multicolumn{3}{c}%
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  & \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} &    \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  \\ \hline 
\endhead

\hline \multicolumn{3}{r}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot

 & & & & & \\ 
1     & Clubs \& Nightlife & 61    & Car Electronics & 121   & Immigration Policy \&  Border Issues \\
2     & Ticket Sales & 62    & TV \& Video Equipment & 122   & Visa \& Immigration \\
3     & Autos \& Vehicles & 63    & Electronics \& Electrical & 123   & Legal \\
4     & Automotive Industry & 64    & Enterprise Technology & 124   & Military \\
5     & Commercial Vehicles & 65    & Open Source & 125   & Crime and Justice \\
6     & Hybrid \& Alternative Vehicles & 66    & Finance & 126   & Counseling Services \\


\end{longtable}
\end{center}
\end{document}

For the sake of simplicity, I cut the rows in the table from 7 to 60, but the concept remains the same. Does anyone know why it seems impossible to resize the third column?

Thank you in advance

3

The third column was too wide because the first 3 columns are to narrow for

... -- continued from previous page.

In this case 5 colums are enough.

%\documentclass[a4paper,12pt]{Thesis}
\documentclass[12pt]{article}
\usepackage{booktabs, multicol, multirow}
\usepackage{tabularx, array}
\usepackage{subfigure}
\usepackage{bigstrut}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{latexsym}
\usepackage[table]{xcolor}
\usepackage[english]{babel}
\usepackage[section]{placeins}
\usepackage{longtable}


\begin{document}
\begin{center}
\small
\begin{longtable}{p{10pt} p{100pt} p{10pt} p{100pt} p{10pt} p{100pt}}

\caption[caption]{caption} \label{grid_mlmmh} \\

\hline \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} & \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} &        \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  \\ \hline 
\endfirsthead

%\multicolumn{3}{c}% % old (PS)
\multicolumn{5}{c}% % new (PS)
{{\bfseries \tablename\ \thetable{} -- continued from previous page}} \\
\hline \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  & \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}} &    \multicolumn{1}{c}{\textbf{N}} & \multicolumn{1}{c}{\textbf{Google Categories}}  \\ \hline 
\endhead

\hline \multicolumn{3}{r}{{Continued on next page}} \\ \hline
\endfoot

\hline \hline
\endlastfoot

 & & & & & \\ 
1     & Clubs \& Nightlife & 61    & Car Electronics & 121   & Immigration Policy \&  Border Issues \\
2     & Ticket Sales & 62    & TV \& Video Equipment & 122   & Visa \& Immigration \\
3     & Autos \& Vehicles & 63    & Electronics \& Electrical & 123   & Legal \\
4     & Automotive Industry & 64    & Enterprise Technology & 124   & Military \\
5     & Commercial Vehicles & 65    & Open Source & 125   & Crime and Justice \\
6     & Hybrid \& Alternative Vehicles & 66    & Finance & 126   & Counseling Services \\


\end{longtable}
\end{center}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.