4

I wish to know how to set the following:

  • height of a text line in paragraph (is it fontsize?)
  • height of space between text lines in paragraph (\baselineskip - fontsize?)
  • height of space before and after a paragraph
  • height of a text line in section/chapter/part name
  • height of space between text lines in section/chapter/part name
  • height of space before and after a section/chapter/part name
  • height of space before and after an environment (equation, figure, itemize)

I know how to add \vspace{<value>}, but I don't know where, I don't know how to overwrite defaults. I prefer to define all those values in one place (at the beginning of the document) and use them by own environments/commands (\mysection{}) or even better by standard environments/commands (\section{}). Can someone show me how to do it?

Post Scriptum: It is easy to close question and say: it is duplicate. In a previous question How to align lines on facing pages? I asked about putting text lines on grid, it was closed, although there is no good answer on this forum. Grid System in LaTeX - is useless, because grid package doesn't work well. I badly need to align text on grid. If there is no good automatic solution I want to do it manually by setting heights and all spaces (after and before) between elements of documents. Please answer, don't close!

novice
  • 41
  • 2
  • 3
    Welcome (again) to TeX.SE! The values of virtually all parameters you mention in your posting depend on (i) the document class you use and (ii) the default font size that's in effect. There are three possible default font sizes -- 10pt, 11pt, and 12 pt -- in the basic LaTeX document classes article, report, and book, but many more sizes in classes such as memoir. Please advise on your setup. – Mico Oct 10 '13 at 09:19
  • By the way, have you read Removing vertical stretch --mimicking traditional typesetting with TEX by Bazargan and Radhakrishnan, TUGBoat, 2007? – Mico Oct 10 '13 at 09:25
  • I use memoir and different fonts size. I also use grid package, but it sometime doesn't work. So I want to try to set all heights and spaces (before and after) of all elements. In Scribus (DTP program) I can do it easy and have everything on grid. But I want grid in Latex because of math. Can you show me how to set all vertical dimensions related with paragraphs, pictures, tables section/chapter/part names? – novice Oct 10 '13 at 09:37
  • I think that this >>stretching glue<< is very stupid idea. I know that you think about Knuth as about the God, but he did it wrong. – novice Oct 10 '13 at 09:51
  • 3
    @novice Many TeX users admire Knuth's work, but those of us who have worked with TeX a lot certainly know he's fallable. There are lots of things that one might do differently with hindsight. – Joseph Wright Oct 10 '13 at 10:19
  • 2
    To quote the author of the memoir manual (p. 431): "TeX is designed to handle arbitrary sized inserts, like those for maths, tables, sectional divisions and so forth, in an elegant manner. It does this by allowing vertical spaces on a page to stretch and shrink a little so that the actual height of the type block is constant. ... Generally speaking, TeX is not designed to typeset on a fixed grid ... Attempts have been made to tweak LaTeX to typeset on a fixed grid but as far as I know nobody has been completely successful." That said, there are reportedly some ConTeXt-based grid solutions. – Mico Oct 10 '13 at 11:53
  • 1
    @novice You are very stupid if you think that stretching glue is a very stupid idea. This is a solution that does not fit your requirements but this does not make it stupid. – Paul Gaborit Oct 10 '13 at 12:05
  • @JosephWright I heard a lot of good things about Latex and some of them were true - I like this all automation, it is fast - but no one told me that simple (with Scribus) things are impossible with Latex. – novice Oct 10 '13 at 12:51
  • @Mico I'm reading memoir manual right now! It is very interesting. I hoped that this glue-mistake can be turn off by some tricky package or option. I heard (from this forum) about Context, but I have almost everything in Latex. I don't want to rewrite it. And I'm not sure, perhaps in Context another easy issue will be impossible to fix. If I must change program I probably pick Scribus - it is not as fast as Latex and math is more difficult to type but works. – novice Oct 10 '13 at 12:57
  • @PaulGaborit OK then I'm stupid because I see that this gluing thing is good only for math, for publishing different stuff it is very bad. Maybe because of that Latex is used only for publishing math and physics and other unpopular/boring things? Or maybe because its users like to say "You are very stupid" if you don't follow our gluing religion. I want to obey Bringhurst's guides, that's all. – novice Oct 10 '13 at 12:59
  • 1
    Hi @novice, and Welcome again to TeX.SX! We really pride ourselves of our friendliness here and I'm sure I speak for all of us, we're very sorry if you felt unwelcomed. (BTW, I'm the one who flagged your first post, for the reason pointed out by Tobjørn T. in a comment to your post on Grid System in LaTeX). I'd suggest you to follow jon's advice in your closed question and to give ConTeXt a try (take a look at some of the highest voted questions with the {context} flag). – henrique Oct 10 '13 at 14:14

1 Answers1

15

height of a text line in paragraph (is it fontsize?)

You don't set it, it depends on what's in the line. In general it's not the font size.

height of space between text lines in paragraph (\baselineskip - fontsize?)

The distance between baselines is fixed according to the value of the parameter \baselineskip, but it may be increased if the lines are too close to each other. This means that \baselineskip - dp - ht < \lineskiplimit, where dp is the depth of the line above and ht is the height of the line below. When this happens, the distance between the baselines will be dp + ht + \lineskip.

height of space before and after a paragraph

Before a paragraph, TeX inserts glue in the amount of \parskip. No vertical space is added at the end, in addition to the interline glue determined as above.

height of a text line in section/chapter/part name

This depends on the font size of the title.

height of space between text lines in section/chapter/part name

This depends on the settings established by the document class.

height of space before and after a section/chapter/part name

This depends on the settings established by the document class.

height of space before and after an environment (equation, figure, itemize)

Before a one line equation TeX may insert \abovedisplayskip or \abovedisplayshortskip; after it it will insert \belowdisplayskip or \belowdisplayshortskip. It will choose the “short” parameters if the length of the line preceding the display is short, according to rather complex rules you find in the TeXbook. For multiline displays, always the non “short” parameters will be used.

LaTeX defines various parameters for float placement, in particular \intextsep above or below the float (only one place if it's a top or bottom float).

For lists such as itemize, the parameters to look at are \topsep and \partopsep.

This said, I'd not be surprised if this question will be closed as “Too broad”.

egreg
  • 1,121,712
  • Thank you! You put some light on my question, but can you write how to set specific heights instead of writing "This depends on..."? I need to know, how this depends and how to change it. I see now that Latex do many things without user's knowledge, but also without control. I'm sure that most of users (mathematicians, physicists, other similar) are happy, they don't need to thing about layout and typography. They don't care, but truly I care and want to make decisions how my book will look like. Is it possible with Latex? – novice Oct 10 '13 at 13:13
  • @novice Describing how the various lengths are determined would require a couple of chapters of a book. – egreg Oct 10 '13 at 13:14
  • It is impossible. I don't believe you. Complicated things are easy in Latex, this why I'm interested in! So this can't be true that such simple thing like changing heights is complicated. Sorry! Even in such primitive program like Word you can change distances between elements of book, you define styles, apply it and you have. – novice Oct 10 '13 at 13:24
  • 3
    @novice Please, have a look at the LaTeX companion, the LaTeX manual and the commented source of LaTeX. You'll find plenty of material about your problems. Your statement that “complicated things are easy in LaTeX” is, unfortunately, too bold. – egreg Oct 10 '13 at 13:30
  • I learn Latex from wikibooks and memoir manual. I can't buy books like Latex companion. They are too expensive for me. Never mind. I changed my mind, I don't have plenty math in my book, Scribus will do. And I can put things on grids. And I can design beautiful book:) But I keep my statement that “complicated things are easy in Latex”, it is not too bold - check how easy/automatically you can make tables of contents, references, start every chapter on odd page, draw simple pictures, and much more... - unfortunately simple things are sometime impossible with latex:( – novice Oct 10 '13 at 13:47
  • 4
    @novice Grid typesetting is not simple, that's the reason. – egreg Oct 10 '13 at 13:51
  • in Scribus Grid layouts are simple like eat one cookie by another, It's difficult to stop:) So it can't be as hard to implement as you said. As for the rest, those all heights are easy to define in Scribus, but even in Word you can do it and you don't need to read "couple of chapters of a book", you simply do it. But not in Latex, instead of this you can simply do things that are difficult or even impossible in Scribus/Word. It is like schizophrenia? – novice Oct 10 '13 at 14:01
  • 3
    @novice The point with those lengths, etc., is that they are defined by a document class, equivalent to say a tempalte in Word. Thus there is no 'general' answer: you have to check what that particular class uses. LaTeX2e (current LaTeX) doesn't make this as simple as having a file with a big list of lengths, so you do need to look at the class you use. – Joseph Wright Oct 10 '13 at 14:13
  • 4
    @novice No, it's not as you think. TeX has been designed for typesetting mathematics and grid typesetting with mathematics is really hard. The model is completely different than the one of Scribus or the most common word processors. Why can't you trust my 25 year experience with TeX? – egreg Oct 10 '13 at 14:14
  • 3
    @novice It has been already discussed here many times about the ease of use. What you call easy and beautiful are terrible standards introduced by MS Word, Scribus etc. as if they were right. But they are not. Same holds for book desing by InDesign etc. typograhy is extremely difficult and if you check the font prices you will see why it is so. There are so many things you need to consider and TeX provides ways to most! of them. Grid typesetting involves many moving parts and those suites discard most of them as fixed quantities. Hence the mismatch in perception. – percusse Oct 10 '13 at 14:21
  • @novice, taking control over LaTeX is not as easy as taking control over DTP soft. Many things can't be well controlled in LaTeX, for example: floats in multicolumn layout and grids. And if you wrote a book and want to publish it by yourself, stay with Scribus - it's not as good as InDesign, but it's free and allows for LaTeX input. I guess, you picked digital printing over offset printing (which has sens only when you print a lot of copies). But still you need to remember about preflight (you don't want surprises, do you?), as far as I know Adobe Acrobat is the best choice. Good luck! – random.nick Oct 12 '13 at 14:28