35

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

4
  • Also how can I easily upload a picture of just the surrounding text instead of a full page pdf image?
    – dan2k3k4
    Feb 28, 2012 at 20:24
  • I usually generate a PNG when uploading pictures. Feb 28, 2012 at 20:28
  • Using dvipng or similar after you compile to dvi?
    – dan2k3k4
    Feb 28, 2012 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 Feb 28, 2012 at 20:45

1 Answer 1

46

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}
6
  • 1
    Perfect that worked, thanks! Is \par generally better to use rather than \\?
    – dan2k3k4
    Feb 28, 2012 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 \\ Feb 28, 2012 at 20:40
  • 2
    \vspace{-5cm} or muliple of \baselineskip is a manipulation. There should be some logical way...
    – user80990
    Jun 28, 2015 at 17:46
  • How can I do this for an itemize. I mean reduce spaces between bullet points
    – Trect
    Oct 30, 2018 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. Oct 30, 2018 at 20:12

You must log in to answer this question.

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