LaTeX forum ⇒ Document ClassesAdjust vertical spaces with \lineskip instead of \parskip

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

Adjust vertical spaces with \lineskip instead of \parskip

Postby itsmenow » Tue May 27, 2008 8:39 am

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
  1. \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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue May 27, 2008 5:04 pm

Hi Jan,

you could set \beselineskip with glue, for example:
  1. \setlength{\baselineskip}{12pt plus 2pt minus 1pt}

Perhaps try to vary \lineskiplimit (dimen) and \lineskip (glue) too.

Stefan
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

itsmenow
Posts: 3
Joined: Tue May 27, 2008 8:28 am

Postby itsmenow » Wed May 28, 2008 1:16 pm

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
  1. \setlength{\parskip}{1pt plus 1pt minus 1pt}

but I appreciate to use something like
  1. \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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed May 28, 2008 1:31 pm

Hi Jan,

  1. \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
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

itsmenow
Posts: 3
Joined: Tue May 27, 2008 8:28 am

Postby itsmenow » Wed May 28, 2008 2:56 pm

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

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed May 28, 2008 3:08 pm

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
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

noematic.logos
Posts: 19
Joined: Thu May 15, 2008 8:31 pm

Postby noematic.logos » Thu Jun 12, 2008 9:00 pm

Quick follow-up:

Stefan suggested the following code:
  1. \setlength{\parskip}{1pt plus 1pt minus 0.5pt}


Where is there an explanation of this syntax?
  1. 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,

Link:
BBcode:
HTML:
Hide post links
Show post links

User avatar
Stefan Kottwitz
Site Admin
Posts: 7801
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Thu Jun 12, 2008 9:41 pm

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
Site admin

Link:
BBcode:
HTML:
Hide post links
Show post links

noematic.logos
Posts: 19
Joined: Thu May 15, 2008 8:31 pm

Postby noematic.logos » Thu Jun 12, 2008 10:09 pm

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

cheers,

Link:
BBcode:
HTML:
Hide post links
Show post links

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

Postby zvonsully » Sun Jan 09, 2011 5:00 am

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:
  1. \setlength{\lineskip}{3pt plus 6pt minus 0pt}
  2. \lineskiplimit=\baselineskip
  3.  
  4. begin{document}...

Link:
BBcode:
HTML:
Hide post links
Show post links


Return to “Document Classes”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests