13

It seems, that there is a problem with font sizes in memoir class.

In the manual of the memoir class, p. 48, it is written that for example using class option 14 pt we'll get \normalsize = 14 pt.

However actually, using commands \normalsize \f@size the output is 14,4 pt. Using Adobe Acrobat Pro one can also check the font size. For this case it is 14,35 pt.

How to set precise font size in memoir class?

In particular, I need to get the size of the text 14,0 bp in pdf, i.e. this size should be observed by Adobe Acrobat Pro or, at least, by command \f@size, for \normalsize text style. I guess I need to establish in memoir class the value of \normalsize about 13,5--13,8 Tex pt.

The output with some highlighted strange values.

enter image description here

UPD1: actually as alephzero explained in comments, there is a difference between abbreviations of point values and real point values in TeX.

UPD2: Explanation given in comments by daleif: \huge, \Huge and \HUGE commands print the same value as \LARGE without extrafontsizes option.

And, of cause, I need a way how to get 14,0 bp in pdf, i.e. this size should be observed by Adobe Acrobat Pro or, at least, by command \f@size, for \normalsize text style.

MWE

    \documentclass[14pt]{memoir}
    \begin{document}
    %https://tex.stackexchange.com/a/20452/44348
    Class option value versus real size.
    \makeatletter

    8pt VS \verb+\miniscule+ \miniscule \f@size

    9pt VS \verb+\tiny+ \tiny \f@size

    10pt VS \verb+\scriptsize+ \scriptsize \f@size

    11pt VS \verb+\footnotesize+ \footnotesize \f@size

    12pt VS \verb+\small+ \small \f@size

    14pt VS \verb+\normalsize+ \normalsize \f@size

    17pt VS \verb+\large+ \large \f@size

    20pt VS\verb+\Large+ \Large \f@size

    25pt VS \verb+\LARGE+ \LARGE \f@size

    30pt VS \verb+\huge+ \huge \f@size

    36pt VS \verb+\Huge+ \Huge \f@size

    48pt VS \verb+\HUGE+ \HUGE \f@size
    \makeatother
    \end{document}
  • 2
    the table is misleading: you're typesetting the 14 pt in 12pt, since you miss braces around the previous line; nevertheless the fonts are geometrically scaled, and that 0.4pt is really around 0.1mm, is really that important? – Moriambar Jun 03 '17 at 20:24
  • 1
    The difference between TeX's "14.4 points" and Adobe's "14.35 points" is because TeX uses traditional printer's point sizes where 72.27 points = 1 inch, but Adobe uses "computer points" where 72 points (exactly) = 1 inch. If you want to match Adobe-sized points in TeX, measure them in "big points" with units bp not pt. – alephzero Jun 03 '17 at 20:41
  • @Moriambar, thank you for the comment. Yes, it would be better to write braces. 0.1 mm is not important for me, however I've tried to follow formal requirements for my paper submission. I guess, nobody will notice the difference. – Vladimir Parkhomenko Jun 03 '17 at 20:45
  • 1
    it's not a bug just your misunderstanding of the difference between tex and postscript points, we have several answers explaining the units used by tex. – David Carlisle Jun 03 '17 at 20:48
  • @alephzero, thank you so much for the explanation about Adobe's points. – Vladimir Parkhomenko Jun 03 '17 at 20:51
  • 2
    In TeX (before LaTeX) Knuth made the typographic decision that fonts should be scaled in increments of 20% exactly. That's where the sizes 10, 12, 14.4, 17.28, 20.736, 24.8832, 29.85984, 35.831808 originally came from. Rounding them to 10, 12, 14, 17, 20, 25, 30, 36 is a mostly about making the names easier to use and remember - but one could quibble about whether "20" should really be "21". – alephzero Jun 03 '17 at 20:51
  • 1
    @Moriambar "0.4pt is really around 0.1mm, is really that important?" If you have 40 lines of text per page, those 0.1mm increments change the total height of the text block by 4mm, which is important if you care about such things! 4mm is about the same height as an extra line of text on the page. – alephzero Jun 03 '17 at 20:53
  • @DavidCarlisle, thank you, I'll search information about postscript points. However, perhaps, there is a bug at least in \huge, \Huge and \HUGE values. The general problem is how to set the arbitrary font size in PDF using memoir class. – Vladimir Parkhomenko Jun 03 '17 at 20:58
  • 1
    @VladimirParkhomenko hmm yes cuts off at 25pt which the manual seems to say explicitly isn't the case, hmmmm – David Carlisle Jun 03 '17 at 21:06
  • 1
    @VladimirParkhomenko see this on bp/pt units https://tex.stackexchange.com/questions/200934/why-does-a-tex-point-differ-from-a-desktop-publishing-point/200968#200968 – David Carlisle Jun 03 '17 at 21:12
  • 1
    I have pinged the memoir maintainer in chat to ask that he look at the font sizes... – David Carlisle Jun 03 '17 at 21:13
  • 1
    I'll have a look when time permits (not at pc), feel free to send me an email so I don't forget. All information related to 14pt is in mem14.clo – daleif Jun 03 '17 at 21:30
  • 1
    Had a dig through the dtx. By default in 14pt, huge, Huge and HUGE are equal to LARGE, unless the extrafontsizes option is used. – daleif Jun 03 '17 at 21:37
  • @daleif, many thanks, I'll update the question according to your explanations. So, I'll have only one problem how to set 14 bt instead of 14 TeX pt. – Vladimir Parkhomenko Jun 03 '17 at 21:41
  • 1
    You'll have to roll your own clo file (I think that is the easiest) . There is an option for specifying what that external file is named. Though I do not remember the details. It is in the manual – daleif Jun 03 '17 at 22:40

1 Answers1

12

First of you will need the extrafontsizes class option to activate the very large huge data. It is not well described in the manual. I've added that to my TODO list.

To change the font sizes to something more specific, create your own clo file. Say myfont14.clo, then start the document with

\providecommand*{\anyptfilebase}{myfont}
\providecommand*{\anyptsize}{14} 
\documentclass[extrafontsizes,*pt]{memoir}

Copy the contents of mem14.clo to myfont14.clo and adjust it accordingly. Note that you can use

   \@setfontsize\normalsize{14bp}{17.5bp}%

instead of the syntax used in mem14.clo which assumes pt.

With 14bp \f@size says 14.05249, which should be the pt equivalent of the bp value.

daleif
  • 54,450
  • 1
    thank you for the explanations. I'll try to implement your recommendations on Sunday and perhaps, ask some extra questions (if nobody presents more detailed answer). – Vladimir Parkhomenko Jun 06 '17 at 09:05
  • your method works very well. Futhermore, it helps to run for example this example https://tex.stackexchange.com/a/310065/44348. Why that example does not work without \providecommand*? I would be very grateful if you explain the meaning of the following options: {17.5bp} from your explanation, \@xipt, \@xviipt etc and the general logic how to set this values to get a success. – Vladimir Parkhomenko Jun 23 '17 at 15:15
  • 1
    @VladimirParkhomenko which example are you referring to? Here providecommand is just useful, it defined the macro if it does not already exist. \@xipt is probably the same as {11pt} might also be just {11} as the macro will use pt if no unit is give (AFAIR). The actual value of 17.5 is the baselineskip, it is an arbitrary value, I think I just too the pt value from mem14 and used that. The \@xipt macros stem from a period of history where computers did not have a lot of memory, to latex \@xipt us one token {11pt} is at least 4. – daleif Jun 23 '17 at 15:23
  • I meant that somehow this example https://tex.stackexchange.com/a/310065/44348 does not work without your hint. Thanks for explanation. I think we should use the baselineskip according to the memoir class options. It seems that 17,5 leads to the larger vertical skip before 14pt VS \verb+\normalsize+ \normalsize \f@size, than after this line. I found, that e.g. \@setfontsize\footnotesize{11bp}{13.6bp} gives good vertical skips. Do you have an idea how to set baselineskip options in MWE? – Vladimir Parkhomenko Jun 23 '17 at 15:46
  • 1
    @VladimirParkhomenko again you need to be more specific. The baselineskip refers to the font size, each time you set a font size and a baselineskip. AFAIR memoir cannot load just any memX.clo for a given x, they are hard-coded into memoir (not sure that is true) thus you need to tell it exactly what to load. This does that. – daleif Jun 23 '17 at 15:53
  • 1
    @VladimirParkhomenko what exactly are you saying it not working without what. – daleif Jun 23 '17 at 15:54
  • your approach is working excellent!) Good explanations! I've just spent some time to tune .clo – Vladimir Parkhomenko Jun 23 '17 at 22:00