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 have recently heard the argument that "plain TeX is superior to LaTeX because TeX gets the measures right". The example given was that a \vskip 2 cm, when run in tex, would measure exactly 2 cm from baseline to baseline, whereas the same running latex would result in 2 cm from baseline to topline.

TeX MWE:

One line.
\vskip 2cm
One line.
\vskip 2cm
One line.
\vskip 2cm
\bye

LaTeX MWE:

\documentclass{article}
\usepackage{lineno}

\begin{document}

\linenumbers

One line.
\vskip 2cm
One line.
\vskip 2cm
One line.
\vskip 2cm


\end{document}

What makes the result different?

share|improve this question
    
\vspace doesn't start a new paragraph, while \vskip does, so this example is not good. –  egreg Apr 15 at 23:08
    
You should probably take a look at the definition of \vspace (and \@vspace) in latex.ltx as a start. –  Werner Apr 15 at 23:08
    
@egreg, you're right, I edited the MWE. –  Joseph Apr 15 at 23:09
    
You should almost always have a blank line before \vspace (then you'll get the result that you imply that you want) (and don't believe everything you hear, the argument that you quote makes a false conclusion from a false premise) –  David Carlisle Apr 15 at 23:10
    
You have changed the latex example to use vskip, so now I don't understand the question at all, vskip is identical in latex and plain tex (it is a tex primitive) –  David Carlisle Apr 15 at 23:11

1 Answer 1

up vote 4 down vote accepted

This is what I get from the Plain TeX file and the corresponding LaTeX file; I have used pdfcrop to crop the PDF and used the same parameters for converting to PNG.

Plain TeX file

\nopagenumbers
One line.
\vskip 2cm
One line.
\vskip 2cm
One line.
\bye

LaTeX file

\documentclass{article}
\pagestyle{empty}
\begin{document}

One line.

\vspace{2cm}
One line.

\vspace{2cm}
One line.

\end{document}

Left is Plain, right is LaTeX

PLAIN         LATEX

Conclusion: what you heard is not true.

Some more information

See What is the difference between \vskip and \vspace? for more information about \vspace and \vskip. They work in exactly the same way (except that \vspace also adds \vskip\z@skip) when \vspace is issued between paragraphs. The vertical space is in addition to the interline glue automatically inserted by TeX; since \vspace uses the same primitive \vskip, the result is identical.

share|improve this answer
    
you're right -- I didn't know I was supposed to let a blank space before \vspace. However, would that result be the same if, in Latex, you used \vskip instead of \vspace? –  Joseph Apr 15 at 23:36
    
@Joseph Yes, of course, it would be the same. Actually \vspace{2cm} in vertical mode does \vskip 2cm\vskip 0pt plus 0pt plus 0pt, but it doesn't make any difference (unless you try to unskip). –  egreg Apr 15 at 23:38
1  
@Joseph it's not that you are supposed to leave a blank line before vspace, only leave a blank line when you want to end a paragraph. The main difference between vspace and vskip is that the former is designed not to start a paragraph if used mid-line but instead to add space after the current line (so in your original version all words were on the same line, and all space was added after that line). –  David Carlisle Apr 15 at 23:41
    
@egreg, I agree with you, but I don't know how to argue with someone who just said he printed the two MWE's and "measured both with a rule" and said he obtained the following (in Latex): baseline to baseline: 2.43cm; "white space between lines" (sic): 2,18cm; "\hskip between two points" (sic): 2,13cm. All this with the goal to convince that "what Latex understands by 1cm is different from what TeX understands by 1cm", which of course sounded preposterous, but I couldn't prove him wrong. –  Joseph Apr 15 at 23:50
    
@Joseph Without seeing the two sources it's impossible to say what caused the difference. Probably a difference in the baseline skip. –  egreg Apr 15 at 23:56

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.