Friday 12 December 2014

LaTeX Font Sizes

22 Comments

  1. Rob
    Very interesting post, but I think you are missing something: Every once in a while if you change font sizes, the line height is not adjusted – resulting in large space between two lines. Maybe you could comment on that as well in this post? It would fit nicely…
      • Rob
        Sure!
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        \documentclass{article}
         
        \usepackage[utf8]{inputenc}
        \usepackage[english]{babel}
        \usepackage{blindtext}
         
        \begin{document}
        % Normalsize text
        \blindtext
         
        % Scriptsize text with normalsize line spacing
        {\scriptsize
        \blindtext}
         
        % Scriptsize text with scriptsize line spacing
        {\scriptsize
         
        \blindtext
         
        }
         
        % \par does the trick as well
        {\scriptsize
        \blindtext
        \par}
        \end{document}
  2. Humberto Munoz
    Hi Tom, How I can change the font type in LaTeX for parts/elements of a document?
    Thanks Humberto Munoz
  3. Juan Luis Varona
    The line height is assigned at the end of the paragraph.
    So perhaps the solution for your doubt is to use
    {\tiny Foo foo foo ... foo \par}
    or
    {\Huge Foo foo foo ... foo \par}
  4. Smufos
    Thanks a lot for this article and especially for the hint to use \par to adjust line spacing. Could you please add a short explanation on *why* this fixes the spacing?
    • Hi Smufos,
      Thanks for your question! The command \par ends the paragraph, that’s for sure. Now why \par does the trick, I’m not entirely sure. Apparently, TeX reads the whole paragraph first for optimal space adjustment between words. And manually ending the paragraph seems to also adjust \baselineskip when the font size is changed, whereas standard paragraph ending (blank line) does not. “The TeXbook” by Donald E. Knuth would be the right place to look for an answer :-).
      Cheers, Tom.
  5. Homa
    Thanks for the article, but how can one adjust font size of all equations globally? I mean a global math size which differs from global text font size?
    II seems ridiculous to change the math font size in big projects manually!
  6. Michael A. Peters
    Hi, I’m dealing with a monospace type 1 font that is not part of CTAN, I used the fontinst instructions and they work well but it is a little too big when used inline with another font.
    I noticed some fonts have a scale option that can be passed to their usepackage command that corrects this issue but I have no clue how to go about adjusting my .sty for that.
    This is the extent of my lucimono.sty file:
    1
    2
    3
    4
    5
    6
    \NeedsTeXFormat{LaTeX2e}
    \ProvidesPackage{lucimono}[2007/01/31 v.0.3 lucimono (Lucida Mono) package]
    \RequirePackage[T1]{fontenc}
    \RequirePackage{textcomp}
    \renewcommand*{\ttdefault}{2lm}
    \endinput
    and it has worked well for years when used with lucida bright (I don’t like the monospace font that comes with lucida bright – I think it’s Lucida Typewriter, different than Lucida Mono) but when I use it with Times – it just is a little too big.
    Any clue on where I need to look to find out how to add a scale option to my lucimono.sty file?
    Thank you.
    • Hi,
      Thanks for your question. I’m not an expert on fonts really. However, what I read while trying to better understand your problem is that people recommend using luximono instead, which supports scaling through an optional parameter (see code below). You can download and install the luximono font as described here. In case you really need to use lucimono fonts, take a look at the luximono style file and how the scaling is done.
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      \documentclass[11pt]{article}
      \usepackage[scaled=0.87]{luximono}
      \renewcommand*\familydefault{\ttdefault}
      \usepackage[T1]{fontenc}
      \usepackage{textcomp}
      \usepackage{blindtext}
       
      \begin{document}
       
      \blindtext
      {
      \fontencoding{T1}\fontfamily{cmr}\selectfont
      \blindtext
      }
       
      \end{document}
      Best, Tom
  7. Abhik
    I want to write my Ph. D. Thesis in Gulliver font of latex. What should be the document class and commands for the font?
    • tom
      Hi Abhik,
      Thanks for this interesting question! You can find an informative discussion on the Gulliver font here. Briefly, the Gulliver font is proprietary and no similar free font exists. In case using this particular font for your thesis is a university requirement, they should have a license and be able to tell you how to install it on your system. Otherwise, you might want to take a look at the LaTeX font catalogue and pick another font you like. Sorry for the “bad” news.
      Cheers, Tom
Leave a Reply

No comments:

Post a Comment