Text Formattingbaselineskip?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
LaTexLearner
Posts: 139
Joined: Tue Mar 10, 2015 11:06 am

baselineskip?

Post by LaTexLearner »

What is the "baselineskip" part for in the \vspace command?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

baselineskip?

Post by Johannes_B »

\baselineskip is a length, the space from one baseline to the next. The baseline is the imaginary length, that the letters sit on. Some letters, like g and y descend the baseline. A picture that give some visual aid can be found in the german wikipedia, Zeilenabstand.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

baselineskip?

Post by Stefan Kottwitz »

And by the way, you can also use a factor, such as

\vspace{2\baselineskip}

for skipping two lines, or

\vspace{.5\baselineskip}

for skipping half of a line. Of course it respects font size, which determines the line height, so it automatically scales when you change the font size.

Furthermore, at the beginning and at the end of a page, this space would be omitted, since it's mainly a distance between elements. That's usually desired. The starred version \vspace* produces the space also at page start or end, such as for a specific fixed page design.

Stefan
LaTeX.org admin
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

baselineskip?

Post by Johannes_B »

A few more things on spacing, that i wanted to add to the above post, but Stefan already posted some more detail.

The following example includes some snippets concerning linespacing and fontsize, which correspond as already mentioned. I already covered parts of this in another answer of me, that was also covering parts of the [/url=http://latex-community.org/forum/viewtopic.php?p=89372#p89372]latest macro question[/url].

Code: Select all

\documentclass{article}
\usepackage{blindtext}
\usepackage{printlen}
\uselengthunit{pt}
\makeatletter
\newcommand{\showdetail}{%
	current \texttt{baselineskip}: \printlength{\baselineskip}
	current \texttt{fontsize}: \f@size pt}
\makeatother
\begin{document}
\blindtext\showdetail

texte {\Huge ogee, text \showdetail} text

{\Huge Some more text which should at least yield two different
lines of text \par\showdetail}


\clearpage
{\fontsize{12}{15}\selectfont \blindtext more text \showdetail\par}
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply