3

I'm trying to add extra horizontal space in one particular cell within a longtable using \hspace.

In the example below I'd like to indent "(1) be great" and "(2) be even more great" a bit, but the \hspace is being ignored when I compile. hspace seems to work with a regular table, but it doesn't seem to do anything with longtable. Thanks for any suggestions or workarounds.

\begin{longtable}{|p{0.15\linewidth}|p{0.15\linewidth}|p{0.6\linewidth}|}

Hawaii & 1997 & 
(a) In January 1997, Hawaii will \newline
\hspace{1cm} (1) be great \newline
\hspace{1cm} (2) be even more great

\end{longtable}
1
  • this should be marked up as a list rather than numbering and adding space "by hand" Mar 30, 2018 at 20:10

2 Answers 2

2

It won't work in a regular tabular either. You are in a p-column and spaces at the begin of lines are ignored. Use \hspace*:

\documentclass{article}
\usepackage{longtable}
\begin{document}

\begin{longtable}{|p{0.15\linewidth}|p{0.15\linewidth}|p{0.6\linewidth}|}

Hawaii & 1997 &
(a) In January 1997, Hawaii will \newline
\hspace*{1cm} (1) be great \newline
\hspace*{1cm} (2) be even more great

\end{longtable}

\end{document}

enter image description here

2

As suggested by @David Carlisle, a solution using nested enumerates , with suitable parameters:

\documentclass{article}
\usepackage{enumitem}
\usepackage{longtable}

\begin{document}

\begin{longtable}{|p{0.15\linewidth}|p{0.15\linewidth}|p{0.6\linewidth}|}
Hawaii & 1997 & \begin{enumerate}[label=(\alph*), wide=0pt, labelsep=0pt, leftmargin=*, nosep, before = \vspace*{-\baselineskip}]
\item In January 1997, Hawaii will
\begin{enumerate}[label = (\arabic*), wide=0.25cm, leftmargin=*, labelsep=4pt, nosep]
\item be great
\item be even more great
\end{enumerate}
\end{enumerate}
\end{longtable}

\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .