1

The following code produces the image below.

\documentclass[a4paper]{article}
\usepackage{lipsum}

\begin{document}
\lipsum[1]

\hspace{-14mm}
\begin{tabular}{p{2mm}p{122mm}p{2mm}}\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
\end{tabular}

\lipsum[1]
\end{document}

Imgur

Now, I want to do the same with a longtable, however, the \hspace command seems to not cause any effect. Here is an example of it:

\documentclass[a4paper]{article}
\usepackage{longtable,lipsum}

\begin{document}
\lipsum[1]

\hspace{-14mm}
\begin{longtable}{p{2mm}p{122mm}p{2mm}}\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
\end{longtable}

\lipsum[1]
\end{document}

Imgur

Any idea of how can I do that?

  • I don't understand what you're trying to do with this \hspace{-14mm}? – Bernard Aug 4 '17 at 18:37
  • Just to move the whole table to the left. – Alejandro DC Aug 4 '17 at 18:43
  • even for a normal tabular using a negative hspace in that way is not a good way to try to align the left margin. You have a parindent (15pt by default) then a negative space of -14pt, then a word space (variably but around .3em usually) then the tabcolsep to the left of tabular (6pt by default) so this will or will not make the text in the table seem aligned depending on all kinds of accidental effects – David Carlisle Aug 4 '17 at 21:22
3

You need to set the length \LTleft, if you want to change the position of the longtable (as default it is centered).

\documentclass[a4paper]{article}
\usepackage{longtable}
\usepackage{lipsum}

\begin{document}
\lipsum[1]

\setlength\LTleft{-14mm}
\begin{longtable}{p{2mm}p{122mm}p{2mm}}\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
  &\parbox{122mm}{\lipsum[1]}& \\\hline
\end{longtable}

\lipsum[1]
\end{document}

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.