32

Warning

If you're looking for advice how to make your document look like it's been written in Word, this is most likely not the question you're looking for. This question is mostly of theoretical nature, as it results in tiny differences, which will most likely not be noticed by someone who doesn't allow the use of LaTeX.

Questions that might be more helpful for this matter are:


Question

I learned that MS Word uses a slightly different version of the unit "point" (pt) than TeX does:

The 12 point of Word will be PostScript point, which in TeX would be called 12bp. A TeX pt is slightly smaller: it's 1/72.27 inch, while a bp/PostScript point is 1/72 inch. See also http://en.wikipedia.org/wiki/Point_%28typography%29

(Martin Schröder in Latex commands for a specific page format)

I'm writing a paper that would usually be expected to be "typeset" in MS Word, thus I want to use the same font size as Word would.

How do I set a document e.g. in the "12pt" font size that MS Word would use?

In case it matters, I'm using the article document class, Latin Modern (lmodern) as a font with the T1 font encoding and compile with pdfLaTeX, but input on different set-ups is more than welcome.

doncherry
  • 54,637
  • 4
    Bonus question: Which "point" is preferable if I have a too high / too low page requirement to fulfill? ;) – doncherry Nov 07 '11 at 20:42
  • 2
    The MWE \documentclass{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \begin{document} \fontsize{12bp}{14bp}\selectfont foo \fontsize{12pt}{14pt}\selectfont foo \end{document}​ produces a document with 2 different font sizes for foo: the first is 12bp and the second is 12pt. lmodern has this modification by default. Is this what you're after? – Werner Nov 07 '11 at 20:55
  • 1
    @CountZero: Not that using Latin Modern (or any particular font instead of Times New "old 'n' boring" Roman) and TeX's hyphenation wouldn't make a bigger difference than the font sizes ... It's more a theoretical question. I've actually come up with an answer already, I'm just curious if the pros here would do the same; I'll add it in a couple days if it hasn't appeared yet. Plus this whole thing might be helpful if someone's really doing a "Use LaTeX but must be just like Word". – doncherry Nov 07 '11 at 20:58
  • @Werner: I assume the way I worded my question, it is. If there were strict requirements regarding the font sizes of section titles, block quotes etc., I could just always use bp. What I actually had in mind (i.e. how I solved it) is telling LaTeX to always use Word's point instead of its own. – doncherry Nov 07 '11 at 21:06
  • No, it's not possible to tell LaTeX to use bp instead of pt. But I don't think the difference can be appreciated by the naked eye. An "A" at 12pt is 8.13588pt high, while it is 8.1664pt at 12bp. The difference is 0.01 millimeters. – egreg Nov 07 '11 at 21:19
  • @egreg: Are you referring to \makeatletter \p@=1bp \makeatother in the document preamble? – Werner Nov 07 '11 at 21:23
  • @Werner: That's about what I did, I used \setlength{\p@}{1bp}. It does end up in a few different hyphenations, but it'd be a coincidence if they added up to an extra line or the like. – doncherry Nov 07 '11 at 21:26
  • 3
    @Werner That might work, but not all lengths are expressed in terms of \p@. What I was saying is that it's almost impossible that somebody can spot the difference between 12pt and 12bp size. Particularly if they require MS Word documents. :) – egreg Nov 07 '11 at 21:32
  • @egreg: I agree that the difference is negligible. So you're saying there are other dimensions not expressed in terms of \p@ but chosen relative to 12pt that would "get out of relation" (on a negligible scale as well) if we redefined \p@ only? – doncherry Nov 07 '11 at 21:44
  • LaTeX tries hard to define things in terms of multiples of \p@ and not of pt. But one never knows. Remember, on the contrary, that 17 point size is, for LaTeX, 17.28. I wouldn't worry at all. – egreg Nov 07 '11 at 21:50
  • @egreg: I had thought of these slightly off sizes as well, yes; my question remains mainly hypothetical. In the end, all the interesting (relative) definitions can be found in size12.clo, right? If a dimension isn't altered because of the 12pt option, it won't need altering if we use bp instead of pt. I looked into that file but I don't understand all of it. – doncherry Nov 07 '11 at 22:01
  • @doncherry: In agreeance with @ egreg, a definition like \p@=1bp relies on anything other than the document class to use \p@ rather than pt. Even ltplain specifies the use of \p@ as an "abbreviation" for 1pt (or more specifically, "this saves macro space and time"). Perhaps it's enough to assume that the cases where some other package uses pt instead of p@ is negligible. – Werner Nov 07 '11 at 22:16
  • @Werner: And there's no way of redefining pt directly? Then I guess if one of you guys wants to, you could write up an answer with our gathered findings. – doncherry Nov 07 '11 at 22:21
  • 3
  • 1
    Plain TeX has a command \magnification, which was disabled in LaTeX. The magnification produced this way is not really a 'typographically correct' resizing of the font, but for such subtle differences, it should do a perfect job. Other than that, I think nobody would guess it is not a 12bp font, unless an actual 12bp font is placed next to it. (This may happen in documents where some pages are typeset with LaTeX and others in MS Word... but then again, probably other features/elemets will differ much more spectacularly.) :) – Count Zero Nov 08 '11 at 00:23

3 Answers3

18

As per the discussion, one way of achieving this goal is to redefine the "shorthand" length dimension used throughout the standard document classes. Here's an extract of the relevant code snippets from ltxplain.dtx containing the abbreviated definition:

\newdimen\p@ \p@=1pt % this saves macro space and time

As such, issuing

\makeatletter\p@=1bp\makeatother% or \setlength{\p@}{1bp}

modifies the default 1pt reference to 1bp. Looking at article.cls (although other document classes are similar), many related lengths are set using \p@. Here's an excerpt:

\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
...
\setlength\parskip{0\p@ \@plus \p@}
...
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
...
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
...
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
...
\renewcommand\footnoterule{%
  \kern-3\p@
  \hrule\@width.4\columnwidth
  \kern2.6\p@}
...
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}

including some macros like \maketitle and things associated with indexing. So, issue the size change before \documentclass in order to let the effect filter through. You would still "miss" some \p@-related definitions though, as may be seen by viewing latex.ltx.

As a quick way to check the difference in the default pt and modified bp measurements (in lmodern) is using printlen. Here's a brief example with focus on the character X:

enter image description here

\documentclass[12pt]{article}
\usepackage{lmodern}% http://ctan.org/pkg/lmodern
\usepackage{printlen}% http://ctan.org/pkg/printlen
\begin{document}
\uselengthunit{pt} \renewcommand{\arraystretch}{1.5}%
\setbox0=\hbox{\fontsize{12pt}{14pt}\selectfont X}% pt measurement
\setbox1=\hbox{\fontsize{12bp}{14pt}\selectfont X}% bp measurement
\begin{tabular}{ccc}
  X & width & height \\ \hline
  \verb!pt! & \printlength{\wd0} & \printlength{\ht0} \\
  \verb!bp! & \printlength{\wd1} & \printlength{\ht1} \\ \hline
\end{tabular}
\end{document}

The difference in width is around 0.04pt and 0.03pt in height, which translates to about 0.01mm - a roughly 0.3% increase (~ 72.27/72-1). This is virtually negligible to the naked eye at regular font sizes.

Paragraph construction is altered using 12bp rather than 12pt, and therefore also hyphenation. Here's an example showing the effect:

enter image description here

\documentclass[12pt]{article}
\usepackage[margin=0.5in]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lmodern}% http://ctan.org/pkg/lmodern
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\renewcommand{\arraystretch}{1.5}%
\begin{tabular}{p{0.4\linewidth}p{0.4\linewidth}}
  \verb!12pt! font & \verb!12bp! font \\ \hline
  %\fontsize{12pt}{14pt}\selectfont% pt measurement
  \lipsum[1] &
  \fontsize{12bp}{14pt}\selectfont% bp measurement
  \lipsum[1]
\end{tabular}
\end{document}
Moriambar
  • 11,466
Werner
  • 603,163
  • 2
    If you resize in bp, it is better to keep the ratio to baseline the same i.e., \fontsize{12bp}{14bp}. Loading babel with [english,latin]{babel} will improve the examples. The real word will be much longer due to bad hyphenation. – yannisl Nov 08 '11 at 06:45
  • Thanks; I wanted to keep the baseline reference the same across the examples to highlight the effect of 12bp over 12pt, hence the use of \fontsize{12bp}{14pt}. – Werner Nov 08 '11 at 07:18
  • With Latin hyphenation on the two paragraphs are typeset in exactly the same way. If microtype is loaded, there are some differences, but the number of lines is the same. – egreg Nov 08 '11 at 07:41
  • @egreg Now try and hyphenate Latin using Word:) – yannisl Nov 08 '11 at 08:31
  • @YiannisLazarides Well, Italian would give the same result. – egreg Nov 08 '11 at 08:48
  • @egreg Thanks! Word has patterns for Latin, but is not easy to be set as a language. Tried the example, it does not look too bad actually. – yannisl Nov 08 '11 at 08:55
  • 9
    Changing a such generic command \p@ has severe side effects. \p@ is also used in calculations completely independent from font size/spacing stuff. For example, \usepackage[pdftex]{color}...\textcolor[RGB]{255,0,0}{...} will break with an error message, because 255/255 is now 1.00374 and larger than the allowed maximum value 1. – Heiko Oberdiek Sep 04 '14 at 02:37
  • 3
    See http://tex.stackexchange.com/questions/352580/package-color-error-argument-1-01125-no-in-range-0-1 for a case where changing the value of \p@ makes for spectacular failure. – egreg Feb 07 '17 at 21:23
  • 1
    Werener it would be best to delete the suggestion to redefine \p@ (I already have problems wih some journal classes doing this), it completly breaks any packages such as graphicx using tex dimen arithmetic – David Carlisle Apr 04 '22 at 07:27
15

Every KOMA-Script class has build in support for every font size you want. If you don't like to switch to a KOMA-Script class, this feature is one of the features KOMA-Script package scrextend provides for other classes:

\documentclass[fontsize=12bp]{article}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{scrextend}% provides several KOMA-Script features to other classes
\usepackage[english]{babel}
\usepackage{blindtext}

\begin{document}

\blinddocument

\end{document}

You need a scalable font or a font with support for this font size. Latin Modern is a scalable font.

Schweinebacke
  • 26,336
  • Does this change e.g. the title font size to 17bp? (To be precise, it's 17.28pt/bp, cf. egreg's comment to the question.) – doncherry Nov 08 '11 at 09:04
  • 3
    @doncherry: It changes all font commands (and several lengths), e.g., \huge, \LARGE, \Large relative to 12bp/10bp. Example: At 10pt (predefined font size at article) \LARGE is \@xviipt, that is 17.28pt. With scrextend and fontsize=12bp it will be 17.28pt12bp/10pt = 17,281,2bp=20.736bp=20.8137pt (try \LARGE\csname f@size\endcsname to see this). Alternative: You may define your own font size file scrsize12bp.clo. In this case this file will be used instead of calculated sizes by scrextend. Use scrsize12pt.clo as template and simply change all lengths from pt to bp. – Schweinebacke Nov 08 '11 at 09:14
  • @Schweinebacke I'm a little bit confused there. I always used KOMA-Script with pt. I tried using fontsize=12bp and got less pages than with fontsize=12pt. Should't it be opposite according to @Werner's answer? – Thorsten Nov 08 '11 at 12:57
  • 2
    @Thorsten: 1in = 72bp = 72,27pt. So a pt is smaller than a bp, but: With a4paper there's a DIV default for 12pt but not for 12bp. So DIV=calc will be used with 12bp. If I try a document with DIV=9 and \lipsum[1-100] almost nothing changes if I use fontsize=12bp instead of fontsize=12pt. Additionally remember: There's a file scrsize12pt.clo with optimized (not only horizontal) lengths. KOMA-Script may use an optimized scrsize12bp.clo too, but it does not provide it. – Schweinebacke Nov 08 '11 at 13:06
  • @Schweinebacke Ah, that's a good point. I didn't think of DIV. Thank you for pointing this out. – Thorsten Nov 08 '11 at 13:24
  • With your MWE, I get a warning Package scrextend Warning: Using fallback calculation to setup font sizes for basic size12bp' on input line 12.` -- what's that telling me? – doncherry Nov 11 '11 at 15:38
  • @doncherry: scrextend tries to use font size files for every wanted font size. I've already explained how to use the font size file scrsize12pt.clo to write such a file scrsize12bp.clo (see my comment to Thorsten). If is does not find a font size file, is it able to calculate all font size depending sizes from internally 10pt template. The result should be acceptable but maybe is not optimal (but at least as good as the results of Word). To tell you, that the calculation instead of a file has been used, you get the warning. – Schweinebacke Nov 12 '11 at 12:13
5

There is a package / style by Juergen Fenn which addresses this situation in whole (rather than in part by adjusting the font size): wordlike

I never used it, so I can't speak to its usefulness & friendliness with other classes, packages etc. A first glance at the documentation, however, looks «promising». If you can't get away with «only» the font size adjustment, it may be worth a try.

Martin Scharrer
  • 262,582
Amy
  • 221
  • Since my goal right now isn't imitating the entire Word set-up as closely as possible but just the font size, I don't think this solves the problem. The documentation says: "No attempt is made to set the default font size to 12pt because this is typically done when loading a document class. So, font size is left to the users’ preferences. If you use article.cls your preamble should start like this: \documentclass[12pt]{article} \usepackage{wordlike}" – doncherry Nov 07 '11 at 21:40
  • What I meant to say with above comment, the package wordlike doesn't seem to deal with the pt vs bp difference (nonwithstanding its other potential benefits). – doncherry Nov 07 '11 at 21:58