4

I want to get very compact lists in table cells, but there is still a vertical space before the first list item (see screenshot below). How can I remove this vertical space?

example screenshot

LaTeX code for example

\documentclass{scrbook}

\usepackage{array} 
\usepackage{tabularx} 
\usepackage{longtable}
\usepackage{booktabs} 
\usepackage{paralist}

\newenvironment{tcitem}{%
  \setdefaultleftmargin{1em}{1em}{1em}{1em}{1em}{1em}%
  \vspace{-\topsep}%
  \compactitem[-]
}{\raggedright
  \vspace*{-\ht\strutbox}%
  \endcompactitem
}


\begin{document}

\begin{tabularx}{\textwidth}{XXX }
\toprule
Column 1 & Column 2 & Column 3 \\
\midrule
Text in Col 1 
& \begin{tcitem}
\item First item
\item Second item
\item Third item
\end{tcitem}
& \begin{tcitem}
\item Forth item
\item Fifth item
\item Sixth item
\item Seventh item
\end{tcitem}
\\ 
\midrule
Text in second row & no items, no vertical space & no items, no vertical space  \\
\bottomrule
\end{tabularx}

\end{document}

File List

 *File List*
 scrbook.cls    2014/10/28 v3.14 KOMA-Script document class (book)
scrkbase.sty    2014/10/28 v3.14 KOMA-Script package (KOMA-Script-dependent basics and keyval usage)
 scrbase.sty    2014/10/28 v3.14 KOMA-Script package (KOMA-Script-independent basics and keyval usage)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
scrlfile.sty    2014/10/28 v3.14 KOMA-Script package (loading files)
tocbasic.sty    2014/10/28 v3.14 KOMA-Script package (handling toc-files)
scrsize11pt.clo    2014/10/28 v3.14 KOMA-Script font size class option (11pt)
typearea.sty    2014/10/28 v3.14 KOMA-Script package (type area)
   array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
tabularx.sty    2014/10/28 v2.10 `tabularx' package (DPC)
longtable.sty    2014/10/28 v4.11 Multi-page Table package (DPC)
booktabs.sty    2005/04/14 v1.61803 publication quality tables
paralist.sty    2013/06/09 v2.4 Extended list environments
 ***********
  • 2
    I get no vertical space when compiling your code (on a TL2014, last updated a few weeks ago). – user4686 Mar 11 '15 at 7:37
  • @jfbu: thanks a lot. So I'll make a backup and update my TeXLive 2014. – MostlyHarmless Mar 11 '15 at 7:39
  • 1
    The main dates from \listfiles are 2015/02/07 v3.16 (KOMA-Script document class), booktabs.sty 2005/04/14 v1.61803, and array.sty 2014/10/28 v2.4c and longtable.sty 2014/10/28 v4.11 and tabularx.sty 2014/10/28 v2.10and paralist.sty 2013/06/09 v2.4. – user4686 Mar 11 '15 at 7:42
  • 3
    you only need to add \listfiles to your preamble and then check the log file after compilation for the list which will start with ` *File List*` and end with ` ***********` – user4686 Mar 11 '15 at 7:50
  • 1
    confirmed about KOMA 3.14. But with the earlier KOMA 3.12, the space doesn't show either. – user4686 Mar 11 '15 at 8:44
2

The space doesn't show with current KOMA 3.16 files, and it doesn't show either with the latest KOMA from TL2013 (KOMA 3.12). It shows with KOMA 3.14.

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.