Document ClassesAdjust vertical spaces with \lineskip instead of \parskip

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
itsmenow
Posts: 3
Joined: Tue May 27, 2008 8:28 am

Adjust vertical spaces with \lineskip instead of \parskip

Post by itsmenow »

Hello everyone and sorry for the complicated title, didn't know how to say it better.

My problem:
I wrote a class file for a scientific journal using a two-column layout. But testing showed that there is a problem with the adjustment of vertical space as the spaces between paragraphs sometimes simply get too large. Different settings for \parskip (e.g. \setlength{\parskip}{0.1ex \@plus.01ex \@minus.005ex}) didn't help. If I insert

Code: Select all

\setlength{\parskip}{0.1ex}
the space between the paragraphs is always the same (as it should be) but I get different positions for the bottom of the page which doesn't look nice with two columns. Is there a possibility to adjust the vertical spaces with the lineskip instead of the parskip?

I hope someone has a solution.

Thanks in advance,
Jan

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

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Adjust vertical spaces with \lineskip instead of \parskip

Post by Stefan Kottwitz »

Hi Jan,

you could set \beselineskip with glue, for example:

Code: Select all

\setlength{\baselineskip}{12pt plus 2pt minus 1pt}
Perhaps try to vary \lineskiplimit (dimen) and \lineskip (glue) too.

Stefan
LaTeX.org admin
itsmenow
Posts: 3
Joined: Tue May 27, 2008 8:28 am

Adjust vertical spaces with \lineskip instead of \parskip

Post by itsmenow »

I have already tested \baslineskip and tried the other two but there was no effect in the document.

I had some success using for example

Code: Select all

\setlength{\parskip}{1pt plus 1pt minus 1pt}
but I appreciate to use something like

Code: Select all

\setlength{\parskip}{1pt plus 1pt minus 0.5pt}
but the use of decimal numbers or 0s leads to bad results (large paragraph skips, uneven bottomline of text).

Anybody has an idea why?

Regards,
Jan
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Adjust vertical spaces with \lineskip instead of \parskip

Post by Stefan Kottwitz »

Hi Jan,

Code: Select all

\setlength{\parskip}{1pt plus 1pt minus 0.5pt}
does not show that strange behaviour in my code. You could try .5pt instead of 0.5pt but probably it will be the same result.
Perhaps you could show a minimal working example for the board reader to reproduce/test it.

Stefan
LaTeX.org admin
itsmenow
Posts: 3
Joined: Tue May 27, 2008 8:28 am

Re: Adjust vertical spaces with \lineskip instead of \parskip

Post by itsmenow »

Already tested that.

Hmm, seems to work when simply using it in a document but not in the class file.

I have another question regarding a problem with different references of figure and figure* environments. Should I post it in another thread?

Regards,
Jan
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Adjust vertical spaces with \lineskip instead of \parskip

Post by Stefan Kottwitz »

itsmenow wrote: I have another question regarding a problem with different references of figure and figure* environments. Should I post it in another thread?
Yes, feel free to open a new thread with an appropriate title, that makes it easier to find the topic later, especially by other people looking for information concerning similar problems.

Stefan
LaTeX.org admin
noematic.logos
Posts: 19
Joined: Thu May 15, 2008 8:31 pm

Adjust vertical spaces with \lineskip instead of \parskip

Post by noematic.logos »

Quick follow-up:

Stefan suggested the following code:

Code: Select all

\setlength{\parskip}{1pt plus 1pt minus 0.5pt}
Where is there an explanation of this syntax?

Code: Select all

1pt plus 1pt minus 0.5pt
I have the latex companion and have found the setlength reference (p.855), but this is not explained as far as I could tell.

cheers,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Adjust vertical spaces with \lineskip instead of \parskip

Post by Stefan Kottwitz »

Hi,

you will find explanation for instance in "TeX by Topic", the systematic tex reference manual by Victor Eijkhout, freely available online in pdf format. See chapter 8, Dimension and Glue, especially 8.3 More about glue. Or take the TeXbook by Donald Knuth of course.
You may find shorter explanations by using a search engine for tex and glue.

Above ist just a length of 1pt that may be stretched to 2pt or shrinked to 0.5pt.

Stefan
LaTeX.org admin
noematic.logos
Posts: 19
Joined: Thu May 15, 2008 8:31 pm

Re: Adjust vertical spaces with \lineskip instead of \parskip

Post by noematic.logos »

Perfect, I'll grab these ebooks and get to reading!

cheers,
zvonsully
Posts: 3
Joined: Sun Jan 09, 2011 4:50 am

Adjust vertical spaces with \lineskip instead of \parskip

Post by zvonsully »

Because "you can say \lineskiplimit=1.5in, after that TeX computes the vertical skip between two lines of text as follows: the baselines of the boxes are separated by \baselineskip, but is this would make the distance between the bottom of one box and the top of the other less than \lineskiplimit, then \lineskip is used as interline glue", setting \lineskiplimit to \baselineskip forces tex to use \lineskip (rubber length) instead of \baselineskip:

Code: Select all


\setlength{\lineskip}{3pt plus 6pt minus 0pt}
\lineskiplimit=\baselineskip

begin{document}...
Post Reply