I am trying to create a package that will use grid typesetting (in the humanities, so not much of a problem) but that should allow the user to freely set the \baselinestretch. I am using the memoir class as a basis.

In order to do so, I have defined some font sizes, and calculated the amount of space which I should add, for instance after a \Large heading, so as to preserve the vertical alignment; then I am setting the lengths accordingly. So, for instance:



It works so far, but I would like to be able to change \baselinestretch at will. In order to do that, I basically need to define my \addto@Large command for a stretch factor of one (so that would be 7pt here), and then multiply it by the \baselinestretch factor.

Is it possible, and if so, how can I do that?

  • 1
    It is not really clear for me but to calculate length you can use dimexpr or glueexpr provide by e-TeX. – Marco Daniel Jan 1 '12 at 23:08
  • The \addto@Large length seems to assume single-line headings. So, why not define a variant of \Large with "normalsized" line spacing (tex.stackexchange.com/questions/38613/…) and add multiples of \baselineskip before and after headings? – lockstep Jan 1 '12 at 23:09
  • @lockstep Yes, I have seen this question and implemented the answer on some of the lengths I commonly use (for footnotes, e.g.), but thank you for mentioning it. – ienissei Jan 1 '12 at 23:35

You have several choices. For example define \addto@Large as a dimen parameter:



You can also do in one swoop, by using \dimexpr:


In this case \addto@Large can also be defined as you did; but it's best to have it as a dimen parameter.

  • Thank you for your answer. It works as described generally speaking, but it seems to break the vertical alignment by a small amount – both solutions seem to alter it, though differently. EDIT — My mistake, the problem comes from my code (probably). I got it to work eventually. – ienissei Jan 1 '12 at 23:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.