0

Good afternoon

I would like to change gap between two rows (the picture below) in longtable because it doesn't look very nice and I want to save a place. I don't know how to do it.

Thanks for help.

\documentclass[10pt,a6paper]{book}

\usepackage[utf8]{inputenc}
\usepackage[main=english,slovak]{babel}
\usepackage[cm]{fullpage}
\usepackage[a6paper, top=10mm, left=10mm, right=10mm,     bottom=10mm,foot=5mm,marginparsep=0mm,showframe]{geometry}
%showframe
\usepackage{tipa}
\usepackage{tabularx,booktabs}
\usepackage{multirow}
\usepackage{rotating}
\usepackage{graphicx}
\usepackage{array}
\usepackage{color}
\usepackage[dvipsnames]{xcolor}
\usepackage{longtable}
\usepackage{lscape}

\usepackage{enumitem}
\usepackage{tabularx,booktabs}
\usepackage{enumitem}
\usepackage{mathtools}

\begin{document}
\catcode`\-=12
\sloppy

{\small 
\begin{longtable}{llp{5cm}}
  \toprule
  {\sffamily some text}   & \textsl{some text}  &                
                            \setlist{nosep,topsep=0sp,label=--}
                            \vspace{-\baselineskip}
                            \begin{itemize}
                              \item[-] some text
                              \item[-] some text
                              \item[-] some text
                            \end{itemize}\\
{\sffamily some text}   & \textsl{some text}  &                
                            \setlist{nosep,topsep=0sp,label=--}
                            \vspace{-\baselineskip}
                            \begin{itemize}
                              \item[-] some text
                              \item[-] some text
                              \item[-] some text
                            \end{itemize}\\
  \toprule
\end{longtable}}
\end{document}

enter image description here

  • 1
    Why you have used itemize inside the longtable environment? I guess the use of itemize inside the longtable creating this problem of spacing. – Mishra S Sep 1 '16 at 11:32
2

The command \setlist will apply to all lists if you put it in the preamble, so no need to call it each time (besides, in that case, you'd have to use the optional argument for the itemize environment). You can also assign names to this, by the way, like a style, so that only lists that have this name will inherit the list options.

In any case, you were setting the space before the list, but not afterwards. For this you can use the keys before= and after=:

\setlist{nosep,label=--,after=\vspace{-\baselineskip}, before=\vspace{-\baselineskip}}

And here's the result:

enter image description here

  • By the way, there are other problems or possible things to fix in your code, but I decided to focus on the issue at hand. – Alenanno Sep 1 '16 at 11:44

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.