21

I want to reduce the vertical space between the first line text and the start of the table.

I also want to remove the indent on the table, so that all three lines start at exactly the same vertical point.

\documentclass[final,a4paper,notitlepage,10pt]{report}

\usepackage[utf8]{inputenc} % inputenc for encoding to utf8

\setlength\parindent{0pt}

\begin{document}
\thispagestyle{empty}   % this page does not have a header

Testing some text on the first line.\\
\begin{tabular}{l l}\\
Lorem ipsum & dolor sit amet
\end{tabular}\\
Why was the table above indented? and how can I reduce the space between first line and start of the table?

\end{document}

I couldn't find any table indent command that I could simply reduce to 0. I am open to using a different tabular environment if it gets the job done easily.

This currently gives something similar to:

Table vertical space and indent MWE

  • Also how can I easily upload a picture of just the surrounding text instead of a full page pdf image? – dan2k3k4 Feb 28 '12 at 20:24
  • I usually generate a PNG when uploading pictures. – Peter Grill Feb 28 '12 at 20:28
  • Using dvipng or similar after you compile to dvi? – dan2k3k4 Feb 28 '12 at 20:40
  • I personally just capture the image form the screen on a Mac, but see this on how to convert TeX to image over command line – Peter Grill Feb 28 '12 at 20:45
29

I eliminated the \\ and replaced it with a blank line as it is a new paragraph. The \vspace*{-\baselineskip} eliminates the space between the first line and the table. You can replace the size with some other value to adjust the vertical spacing, for example \vspace*{-5mm}.

Also, use @{} to eliminate the the column spacing on the left hand side.

enter image description here

The \usepackage[showframe]{geometry} was used to show the margins.

\documentclass[final,a4paper,notitlepage,10pt]{report}
\usepackage[showframe]{geometry}
\usepackage[utf8]{inputenc} % inputenc for encoding to utf8

\setlength\parindent{0pt}

\begin{document}
\thispagestyle{empty}   % this page does not have a header

Testing some text on the first line.

\vspace*{-\baselineskip}
\begin{tabular}{@{}l l}\\
Lorem ipsum & dolor sit amet
\end{tabular}\\
Why was the table above indented? and how can I reduce the space between first line and start of the table?
\end{document}
  • Perfect that worked, thanks! Is \par generally better to use rather than \\? – dan2k3k4 Feb 28 '12 at 20:37
  • My preference is usually to leave a blank line (I will adjust this example). I think a blank line is easier to read than a \\ – Peter Grill Feb 28 '12 at 20:40
  • \vspace{-5cm} or muliple of \baselineskip is a manipulation. There should be some logical way... – user80990 Jun 28 '15 at 17:46
  • How can I do this for an itemize. I mean reduce spaces between bullet points – Tessaracter Oct 30 '18 at 19:33
  • 1
    @41041729: That is totally unrelated to this question and I suggest you ask a new question so that you (and others) can find it in the future. – Peter Grill Oct 30 '18 at 20:12

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.