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 realize this is probably a really simple issue but I'm a complete beginner.

I am auto-generating code very similar to the LaTeX code below. However no matter what I do I can't get space between the two tables - vspace just doesn't seem to work.

However, if I have a figure after these tables vspace then works fine between the tables and the figure.

Does anyone have any advice please? I added

\usepackage{parskip}

today as I don't want paragraph formatting.

THANKS a lot for any help,

Tom.

%% WriteReport.m method created this file.
\documentclass[english]{article}
\usepackage{avant}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\geometry    {verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm,headheight=1cm,headsep=1cm,footskip=1cm}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{color}
\usepackage{babel}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage[bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
{hyperref}
\hypersetup{pdftitle={MyOutput},
pdfauthor={Autogenerated by MyOutput}}
\providecommand{\tabularnewline}{\\}
\usepackage{color}
\lhead{MyOutput}
\begin{document}
\section{\textsf{Section title}}
\begin{tabular}{|r|l|}
   \hline
   one & two \\
   \hline
   one & two \\
   \hline
   one & two \\
   \hline
   one & two \\
   \hline
   one & two \\
   \hline
\end{tabular}
\newline
\vspace*{1 cm}
\begin{tabular}{|r|l|}
   \hline
   three & four \\
   \hline
   three & four \\
   \hline
   three & four \\
   \hline
   three & four \\
   \hline
   three & four \\
   \hline
\end{tabular}
\end{document}
share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

You need a \newline after the \vspace as well.

So

\newline
\vspace*{1 cm}
\newline

instead.

share|improve this answer
    
Duh, told you I was a beginner :) Just out of interest, why do I need the new line afterwards? I know what I was doing was wrong but wouldn't the vspace just insert the space and then the new table would start from there? –  Tom Dec 20 '11 at 11:01
    
@Tom: from what I understand the \vspace inserts a 0 width vertical space. Without the newline after the \vspace the tabular is set next to the 0 width vspace. If you put a \newline after the last tabular and then place something there, you should see the vspace there. You shouldn't really need the \newline before the \vspace, you can just move ti after and it should be fine. The \vspace is then set next to the first tabular then you get a newline and TeX will respect the verical space and place the next line that amount lower. –  Roelof Spijker Dec 20 '11 at 11:16
1  
I'd leave an empty line before \vspace, rather than \newline; a \newline after \vspace is definitely wrong. –  egreg Dec 20 '11 at 17:14
    
@egreg: A \par token before would do as well indeed. why is a \newline after wrong exactly? –  Roelof Spijker Dec 20 '11 at 18:37
    
@wh1t3 Underfull \hbox (badness 10000) detected? So it's wrong (and useless if you put \par or an empty line, which is exactly the same). –  egreg Dec 20 '11 at 18:46
show 1 more comment

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.