2

I've got in a longtable with one column split into two by multicol. Somehow multicol adds a white line before starting with the text. example of white line

My MWE:

\documentclass{article}
\usepackage{longtable}
\begin{document}
.
.
.
\begin{longtable}{|l|X|}
1 & \begin{multicols}{2}1. text \newline 2. text \newline 3. text \newline 4. text \newline 5. text \newline 6. text  \end{multicols} \\
\end{longtable}
\end{filecontents}
\LTXtable{\textwidth}{longtable.tex}

\end{document}
  • 2
    your mwe is not working and I'm not sure how to complete it. – sheß Jul 29 '13 at 15:10
2

First of all, your MWE is missing several critical packages and commands, I tried the following fix so it works for me:

\documentclass{article}
\usepackage{multicol,ltxtable,filecontents}

\begin{document}

\begin{filecontents}{longtable.tex}
\begin{longtable}{|l|X|}
1 & \begin{multicols}{2}
1. text \newline 
2. text \newline 
3. text \newline 
4. text \newline 
5. text \newline 
6. text  
\end{multicols}
\end{longtable}
\end{filecontents}

\LTXtable{\textwidth}{longtable.tex}

\end{document}

Then, to fix your problem, simply add:

\setlength\multicolsep{-\baselineskip}

to your preamble. Check the result: enter image description here

For more detail about spacing, check the package document.

0

Removing the white line above the text, I was annoyed by the white line under the text. My question didn't include this one, but the solution for this extra problem is by adding \vspace{-\baselineskip} after \end{multicols}.

MWE:

\documentclass{article}
\usepackage{multicol,ltxtable,filecontents}
\setlength\multicolsep{-\baselineskip}
\begin{document}

\begin{filecontents}{longtable.tex}
\begin{longtable}{|l|X|}
\hline
1 &
\begin{multicols}{2}
1. text \newline 2. text \newline 3. text \newline 4. text \newline 5. text \newline 6. text
\end{multicols} \vspace{-\baselineskip}\\
\hline
\end{longtable}
\end{filecontents}
\LTXtable{\textwidth}{longtable.tex}

\end{document}

It looks like this now: solution

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.