7

Background

Relatively new LaTeX user going mad here.

All I want to do is use the Day Ramon S font, but it seems nigh on impossible to do so.

Question

What is the secret to using fonts in (La)TeX? Is there any rhyme, reason, or rules of thumb to follow? Or do I need to just keep trying random combinations of the patterns I have found until something works?

note

Although all I really want to do is use Day Roman S, I have intentionally kept the question focused on fonts in general as there doesn't seem to be any bullet-proof advice on working with fonts. I see a lot of solutions for specific problems, and even fonts in general, but as can be seen in the next section, it's all a jumble.

note 2

Yes, I have RTFM for the Day Roman S font in question, it is installed, and has been reinstalled several times. It's still a pain to figure out a consistent and reliable way to use different fonts in a document.

Previous research

In trying to figure this out, I have looked at many of the samples from FontCatalogue archive that did compile and found that there seem to be a wide variety of ways of specifying fonts. I'm not sure which to use when.

Sometimes you need to just load a package with the same name as the font and add \normalfont\normalfont twice (why?) before the text:

\usepackage{bookman}
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\normalfont

Other times you need to add \normalfont\<font-name> before the text:

\usepackage{calligra}
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\calligra

Still other times you need to remove ic from the font name and add family, creating \normalfont\<font-name-minus-ic>family before the text:

\usepackage{egothic}
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\egothfamily

And sometimes the second command after \normalfont doesn't appear to be related to the package name at all:

\usepackage{yfonts}
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\swabfamily

Sometimes you also need to use \renewcommand* after loading the font package and before loading fontenc:

\usepackage{PTSansCaption} 
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\normalfont

And sometimes you can do that without loading the font package first and after loading fontenc (all other examples are before):

\usepackage[T1]{fontenc}
\renewcommand*\familydefault{\ttdefault} %% Only if the base font of the document is to be typewriter style
\begin{document}
\normalfont\normalfont

Sometimes you use \renewcommand* to set other defaults such as \rmdefault (previous two examples were \familydefault:

\renewcommand*\rmdefault{cmfib}
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\normalfont

And sometimes you have to set various defaults:

\renewcommand*\ttdefault{lmvtt}
\renewcommand*\familydefault{\ttdefault} %% Only if the base font of the document is to be typewriter style
\usepackage[T1]{fontenc}
\begin{document}
\normalfont\normalfont

Finally, some appear to require loading an .fd file (font definition?) directly rather than through the \usepackage command, set up a \newcommand* (rather than \renewcommand*), skip loading fontenc, and change the duplicated \normalfont\normalfont before the text to something more complex:

\input Carrickc.fd
\newcommand*\initfamily{\usefont{U}{Carrickc}{xl}{n}}
\begin{document}
\normalfont\initfamily
\fontsize{12mm}{12mm}\selectfont 
  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Speravir Mar 19 '14 at 03:26
  • 1
    Do you plan to change your name for every question? Then think of one: In my eyes you should ask the part “Previous research” as new question. This would also make this question here shorter and a bit more readable. – Speravir Mar 19 '14 at 03:29
  • 1
    edit it if you don't like it. nothing's stopping you. – Want to use Day Roman S Mar 19 '14 at 03:33
  • I do not know TeX Live in Ubuntu (do you know How to install "vanilla" TeXLive on Debian or Ubuntu?), but perhaps this helps: Manual font installation. – Speravir Mar 19 '14 at 03:35
  • @Speravir Usually solutions are proposed by clicking Post Your Answer rather in the comments, but anyway This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2014.3.3) 19 MAR 2014 03:09 fails as well: https://www.writelatex.com/read/yyxvzjgdzgmb – Want to use Day Roman S Mar 19 '14 at 03:45
  • 2
    First: You misunderstood me (maybe because English is not my natural language), I wanted to say, I cannot say anything about some possible special behahiour of TL in Ubuntu. Second: In TeX.SX the manners are different (also the frequent use of SX instead of SE), see Why do people answer in comments?, but I even didn’t intend to give an answer. – Speravir Mar 19 '14 at 03:52
  • texlive-full will not contain all of TeX Live. There will be some things in other packages. I don't use Ubuntu so I don't know how things are packaged. (Also, I don't know how they are packaged for my own distribution because I use TeX Live from upstream - 'vanilla' in terms of the link @Speravir gave you above.) I realise that you are very frustrated but @Speravir is trying to help you both with this particular problem and with asking your questions effectively. I agree that your question would be more manageable if split up. Also, try to reduce your MWE to the essentials. – cfr Mar 19 '14 at 03:59
  • 3
    By the way, I cannot think of any purpose which would be served by \normalfont\normalfont which would not be equally well served by \normalfont. Resetting the default font series, shape and family twice is no better than doing so once. Sometimes, however, \normalfont\normalsize can be helpful. (But that is not your problem here.) – cfr Mar 19 '14 at 04:16
  • \familydefault is the font used by default in the document, usually it's defined as \rmdefault, that is, the roman family. If you change that, you are just telling Latex which font to use by default. Now, if you change the \rmdefault, \sfdefault or \ttdefault you are changing the font for roman, serif or monospaced. Any other name such as \swabfamily, \egothfamily, or \calligra just means that the package didn't redefine some of those three standard families but rather created a new one (and there's no restriction of the name in relation to the package name—written by humans). – Manuel Mar 19 '14 at 07:51
  • 1
    You shouldn't need to use \normalfont hardly ever (and never straight after \begin{document} where it does nothing useful) – David Carlisle Mar 19 '14 at 09:47
  • Note that using Xe/LuaTeX with the truetype version will not mitigate the restricted features offered by the font itself. The lack of bold/italic etc. is a characteristic of the font design - not the packaging for TeX. – cfr Mar 19 '14 at 22:58
  • @jon I didn't know fontspec could do that but you are right. Weight can, I think, be faked at document level but I don't think slant can. As far as I know, you need virtual fonts for this. However, I never seriously consider using faked versions after some contact with a font designer and a bit of experimentation so I would not personally consider this a disadvantage. I think slanted Day Roman would look especially awful given its historical character. You could do substitutions with (ps)nfss but I agree they are easier with fontspec (though probably not for me). – cfr Mar 20 '14 at 02:52
  • @jon Agreed. Some more characters... – cfr Mar 20 '14 at 03:58
  • @jon, your discussion is irrelevant. I need to replicate a piece of text in its original font, which is very close to Day Roman, so hypothesising on how it may look for use in another context is immaterial to the question at hand. I was using Day Roman as an example, but apparently most replies are interested in solving a minor issue and ignore the larger issue of why it's such a pain to use more than one font in a single document and why there are so many ways it can fail. This is why I have revised the question to put less emphasis on the example, but guess I need to do more. – Want to use Day Roman S Mar 20 '14 at 06:25
  • (Summary of earlier comments.) [1] For many reasons, there is no magic bullet to use any/all available Type 1 and bit mapped fonts, unfortunately. Some packages are better designed than others & share common means of deploying the font; others aren't, & this is especially true for some of the more estoteric choices (e.g. Day Roman S) or ones that were probably designed only for use in part of a document. [2] LuaTeX and XeTeX (in LaTeX format) make deploying .otf and .ttf fonts much easier & in a standardized way; also, they let you manipulate letter forms (e.g. fake bold) at the doc level. – jon Mar 20 '14 at 16:02

2 Answers2

3

Here is a working (almost) MWE:

\documentclass[danish]{article}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\renewcommand\rmdefault{dayroms}

\begin{document}
\section*{Dayrom S}
For mange Aar siden levede en Keiser, som holdt saa uhyre meget af
smukke nye Kl\ae der, at han gav alle sine Penge ud for ret at blive
pyntet. Han br\o d sig ikke om sine Soldater, br\o d sig ei om Comedie
eller om at kj\o re i Skoven, uden alene for at vise sine nye Kl\ae
der. Han havde en Kjole for hver Time paa Dagen, og ligesom man siger
om en Konge, han er i Raadet, saa sagde man altid her: >>Keiseren er i
Garderoben!<<~--

\end{document}

Dayrom S

I am almost certain this example will fail for you because I am almost certain you do not have the font installed. The font is not part of TeX Live. Three possibilities:

  • Ubuntu provides a package which you can install.
  • You install the package from CTAN manually, perhaps following the instructions in the link Speravir provided in the comments on your original question.
  • You install the font using the getnonfreefonts script which will automate the process for you. This is part of TeX Live but probably not packaged by Ubuntu. Two possibilities:
    • It is packaged by Ubuntu (despite my pessimism).
    • You install TeX Live from upstream using the instructions in the link Speravir provided in the comments. In this case it would be best to remove the installation you currently have to avoid future confusion.
cfr
  • 198,882
  • As additional information: The example works fine in TeX Live for Windows, as well. – Speravir Mar 19 '14 at 04:14
  • @Speravir Are you sure? It ought not do so unless you have installed the font either manually or using getnonfreefonts. – cfr Mar 19 '14 at 04:17
  • Oh, yes, you are right, I once have executed getnonfreefonts! – Speravir Mar 19 '14 at 04:20
  • @cfr I tried that approach and still get a warning: Font shape T1/dayroms/bx/n undefined using T1/dayroms/m/n instead on input line 8. Judging from your screen-shot, which looks the same to me, you probably have the same warning. Could you comment on that? – Martin - マーチン Mar 19 '14 at 05:18
  • 1
    @Martin That's because in the \section Latex looks for a bold series, which seems not to exist (dayroms is only available in one weight, and shape). – Manuel Mar 19 '14 at 07:40
  • @Martin As Manuel says, the font is only available in the upright shape and in medium weight. The warning is perfectly normal. LaTeX tries to use the bold extended series (bx) for the section heading. When that isn't available, it tries an alternative and uses the medium series (m) instead. – cfr Mar 19 '14 at 14:15
  • @Manuel cfr Thank you for commenting. I figured that out from the warning. I just thought that it would be wise mentioning, as if anyone who wants to reproduce this example should know, that the warning unavoidable with the given example. – Martin - マーチン Mar 20 '14 at 11:35
3

There’s no “secret”; fonts in TeX systems started simple, with no choice for the user -- everyone used computer modern, and as a result, the tools for handling fonts, written using Metafont, reached a stable state in the 90s, and haven't needed much extra support.

When it became possible to use Adobe Type 1 fonts, with TeX, the complications hit us, pretty hard. No longer could we just make the font sources available, and let TeX deal with compiling the fonts (and so on) behind the scenes. Which is why you have found it so hard: even if someone has created the files, you need to get them into their rightful places and to conduct some magic to make sure the system notices them. It's not exactly difficult, but finding documentation might not be simple.

It seems we’re getting back to where we started, with TrueType and OpenType fonts. You need an alternative TeX engine (XeTeX or LuaTeX), but those engines are set up to find your system fonts, without much soul-searching by you.

Note that I'm not solving your problems, merely showing how they arose. Your best bet is to ask about individual fonts, as and when you want to use them.

imo

wasteofspace
  • 5,352
  • It isn't true that everyone used Computer Modern before type1 was a possibility. Other fonts were created using Metafont - some by Knuth, many by others. These still needed to be installed, selected etc. Of course, it was simpler because there was at least only one type of font and obviously this limited user choice. But to suggest that there was no choice at all is just wrong. fonts/source/public/ alone contains 128 sub-directories in my installation of TeX Live, and there are some under jknappen etc., too. Obviously some are newer but not all are. – cfr Mar 19 '14 at 22:51
  • @cfr i said “started ... with no choice”, which wording i chose specifically to avoid your misinterpretation. however, i've only been using tex since the 1980s, so i don't actually know (at first hand) what it was all like for users of tex-in-sail (for example). – wasteofspace Apr 30 '14 at 12:11