Take the 2-minute tour ×

I read couple of suggestions about setting exact font size and leading in LaTeX and XeLaTeX, so my question is, simply put, the following: is it the correct way to use LaTeX's method to XeLaTeX too, like in this example:

\setmainfont{Minion Pro}


  \chapter{A chapter}
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo.
share|improve this question

3 Answers 3

\fontsize works in XeLaTeX like in LaTeX and should/can be used in the same way.

Edit: Looking at the discussion I obviously misunderstood the question. I thought you knew how and when to use \fontsize in LaTeX. So here some additions:

  1. If you want to spread all lines a bit apart use \linespread{..} or the equivalent \renewcommand\baselinestretch{..} or the packages leading or setspace (the later will reset \baselinestretch eg. in footnotes). http://www.tex.ac.uk/cgi-bin/texfaq2html?label=linespace

  2. If you want to change one specific font size, e.g. \normalsize, you should redefine the size command. The original definitions of the size commands are in the sizeXX.clo and bookXX.clo-files.

  3. If you want to change the font size in headings use a package or a class that allows to change the style of headings http://www.tex.ac.uk/cgi-bin/texfaq2html?label=secthead

share|improve this answer

You seem to be trying to set the font size for the whole document, in which case this isn't the right way to do it, since things like chapter headings won't be affected by the size change. (But using \fontsize is indeed the correct way to do a local size change, say for a single environment.)

There are other answers on this site about setting the document font size to a non-canonical size (ie, not 10, 11, or 12pt). For setting the leading in points, I guess the leading package (disclaimer: mine) is the most convenient method.

Update: here's an example using leading:

share|improve this answer
Yes, I'd like to set the font size for the whole document, except for headings which I usually set manually anyway. I tried leading package but what confuses me is that it produced a different spacing comparing to \fontsize. –  Aqua Nov 18 '10 at 1:03
@Aqua: \leading will be more of a global change that \fontsize, but you shouldn't see differences in the output. See added example. –  Will Robertson Nov 18 '10 at 1:43
with \leading{28pt} your example is more revealing... ;-) –  jfbu Oct 31 '12 at 21:07

OK, I guess the problem was that I put \leading{14pt} in the Preamble instead of after \begin{document}, which caused almost double leading (I made some corrections to my first post which show that behaviour). To conclude:

  • Both commands, \leading and \fontsize, do work and apply to the text from the point on which they are set, with the difference (the only one?) that \fontsize doesn't apply to sectioning units, while \leading is global.

  • Both commands should be set after \begin{document}, and not in the Preamble, as I mistakenly did (and, of course, may be used in custom commands and environments in any place).

If these are true, and if nobody has anything to add, this question may be considered answered. Thanks.

share|improve this answer
I don't understand, exactly: \leading should be fine in the preamble; just be aware that it will change the baselineskip from that point forward. But \fontsize can only be used within the document itself. –  Will Robertson Nov 18 '10 at 3:07
If you compile the code from my first post, then comment out \fontsize, uncomment \leading and compile again, you'll notice that the spacing is much larger. But, if I put \leading command after \begin{document}, it works as expected. –  Aqua Nov 18 '10 at 3:52
Ah. Two problems: fontspec has some sort of baselineskip bug that I've yet to attempt to debug. Second, turns out that because \leading uses \linespread internally it affects the behaviour of \fontsize. I therefore don't recommend using the two together. –  Will Robertson Nov 18 '10 at 10:01
OK, thanks for the info, Will. @Ulrike, I'm aware of \linespread and \baselineskip, as well as setspace and leading packages, of course. Using Will's leading package is definitely most convenient way for this purpose since there's no need for calculations and values may be given explicitly. –  Aqua Nov 18 '10 at 12:37

Your Answer

