I am unable to control the line spacing between the last line of itemize and the next line as shown in the figure. Can someone suggest a solution to fix this please? I also would like to know if I can get more compact list.
\documentclass[10pt,a4paper,oneside]{article}
\usepackage[a4paper,left=0.9in,right=0.9in,top=1in,bottom=1in]{geometry}
\usepackage{longtable}
\usepackage{enumitem}
\renewcommand{\familydefault}{\sfdefault}
\begin{document}
\scriptsize
\begin{minipage}[t]{0.5\textwidth}
\begin{longtable}[t]{|p{1.0cm}|p{5.5cm}|}
\hline
\bf{Head 1} & \textbf{Head 2} \\\hline\hline
\texttt{A} & Department
\begin{itemize} \setlength{\itemsep}{0pt}
\item \texttt{A} - Apple
\item \texttt{B} - Boy
\item \texttt{C} - Cat
\item \texttt{D} - Dog
\end{itemize}\\
\texttt{E} & Elephant \\
\texttt{F} & Fan \\
\hline
\end{longtable}
\end{minipage}%
\end{document}
Best Answer
Two variations on the layout. I reduced the indent of the list and the vertical spacing w.r.t. the surrounding text.
Note an optional argument to a command or an environment, has be delimited by a pair of brackets (
[option]
), not between a pair of bracket commands (\[option\]
). Also font commands such as\bf
have been deprecated for more than 20 years. Use the\textbf{…}
command instead or the\bfseries
switch.Last, not least, as @Zarko pointed, a long table is made to break across pages, and a minipage cannot. You can use the
multicols
environment instead.