Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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

1 Answer 1

up vote 6 down vote accepted

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}
share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.