2

I am trying to change the teletype font in my thesis document to Bera Mono. I downloaded the beramono CTAN package and unzipped it in my ~/texmf folder (where I've already installed a few dozen packages).

Here is all of the preamble I have direct control over

% template .tex preamble
\documentclass[11pt,a4paper]{report}
\usepackage{warwickthesis,setspace,graphicx}
\usepackage{enumerate}

% my code starts here

\usepackage[utf8]{inputenc} \usepackage{pdfpages} \usepackage{import} \usepackage{amsmath,amssymb,siunitx} \usepackage{hyperref} \usepackage{cleveref} \usepackage{glossaries} \usepackage{minted} \usepackage{babel} \usepackage{csquotes} \usepackage{biblatex}

\usepackage{mathpazo} \usepackage[scaled]{beramono} % this command breaks the \tt font on its own \usepackage[T1]{fontenc} % so does this

\usepackage{tikz}

Example of the problem:

{\ttfamily Hi there} Hi there:

tt font compared to normal

This is also how minted source code listings appear.

Instead of using Bera Mono, it seems to start rendering CM as a bitmap as the teletype font. I have tried a few other examples from the internet, e.g. courier, with the same effect.

Unless I've made a mistake in my package inclusion or ordering, I expect that the thesis template I'm using is causing the problem (I initially copied this out of a known working example using courier).

So, my question is: Have I made a mistake, and if not, is there a way I can absolutely force the use of the font?


Edit

Following Ulrike Fischer's advice, I minimised the packages and found the following telling error:

(/dcs/pg14/phulgm/texmf/tex/latex/bera/t1fvm.fd) [1{/var/lib/texmf/fonts/map/pd
ftex/updmap/pdftex.map}] (./test.aux) ) </dcs/pg14/phulgm/.texlive2007/texmf-va
r/fonts/pk/ljfour/jknappen/ec/ecrm1095.600pk>kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+57/600 --dpi 657 fvmr8r
mktexpk: don't know how to create bitmap font for fvmr8r.
kpathsea: Appending font creation commands to missfont.log.

pdfTeX warning: pdflatex (file fvmr8r): Font fvmr8r at 657 not found Output written on test.pdf (1 page, 2989 bytes).

Full log

Qualia
  • 123
  • Welcome to TeX.SX! I'm not able to reproduce the issue. Can you add the \documentclass line? Also \{tt Hi there} is wrong input. – egreg Aug 27 '15 at 20:22
  • Try \ttfamily instead of \tt – Ulrike Fischer Aug 27 '15 at 20:26
  • @egreg I've added the preamble that came with the template. – Qualia Aug 27 '15 at 20:26
  • Sorry, but it's the same. You probably have installed wrongly Bera mono; just unzipping a font package is not sufficient. What TeX distribution are you using? – egreg Aug 27 '15 at 20:31
  • @egreg I'm using probably some redhat distribution from eons ago - I'm on a university computer. pdfTeX using libpoppler 3.14159201.40.3-2.2. I've manually installed up-to-date versions of most packages to my ~/texmf folder. I followed the instructions in the README: the first bera.zip contained a second bera.zip which it instructed me to unzip in my tekmf folder. I also moved the .afm files to ~/texmf/fonts/afm/public/bera and the .pfb files to ~/texmf/fonts/type1/public/bera. However, I did not take any steps beyond this - did I miss something? – Qualia Aug 27 '15 at 20:36
  • @UlrikeFischer I have tried \ttfamily to no avail. I've updated my question to clarify that other environments which should automatically invoke teletype fonts (minted) suffer the same problem. – Qualia Aug 27 '15 at 20:38
  • Was a fd-file in the zip and where did put it? – Ulrike Fischer Aug 27 '15 at 20:47
  • @UlrikeFischer tex/latex/bera. Six .fd files: t1fv{e,m,s} and ts1fv{e,m,s} – Qualia Aug 27 '15 at 20:50
  • 1
    Comment all packages in your preamble with the exception of beramono, fontenc and inputenc. Then try a small text with \ttfamily. If the font is wrong show the log-file. – Ulrike Fischer Aug 27 '15 at 20:54
  • 1
    What about .tfm files? The .afm files can't be used directly by TeX. Was there a .map file? Where did you put it? Did you run updmap? Note that running this is NOT generally recommended but, in this case, you have no choice. – cfr Aug 27 '15 at 21:08
  • @UlrikeFischer I've added the log to my answer - definitely looks meaningful, but I don't know how to fix it. – Qualia Aug 27 '15 at 21:18
  • @cfr there are plenty of .tfm files in fonts/tfm/public/bera. There are two .map files: fonts/map/dvips/bera.map and dvips/config/bera.map. I've never used updmap, but it seems to be being used: [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] – Qualia Aug 27 '15 at 21:18
  • Run updmap-sys --enable Map=bera.map – Ulrike Fischer Aug 27 '15 at 21:23
  • 1
    Yes, but that file won't have information about fonts installed by you for your own personal use. Try updmap --enable Map=bera.map. You should take a look at this question so that you are aware of the issues which are associated with doing this, though. – cfr Aug 27 '15 at 21:24
  • @UlrikeFischer The OP is on a university machine. I doubt they have rights allowing them to update the .map files for the entire university. – cfr Aug 27 '15 at 21:25
  • @cfr ah could be. well then updmap or \pdfmapfile{=bera.map} in the document. – Ulrike Fischer Aug 27 '15 at 21:29
  • Thanks everyone - running updmap --enable Map=bera.map solved the problem. "Luckily" for me, I don't think these computers are going to be updated any time soon. – Qualia Aug 27 '15 at 21:35
  • @Qualia That's what I figured. But I thought you should know about the reasons not to do it in case you are tempted to do something similar on your own installation of TeX at some point ;). – cfr Aug 27 '15 at 22:28

1 Answers1

3

When you install fonts into a TEXMF tree, TeX needs various things in order to use them:

  1. The various files must end up in the directories TeX expects. In your case, this is already all in order.

  2. TeX must be able to find the various files when it looks. Since you installed into your personal tree, TEXMFHOME, this is straightforward: TeX will find them so long as they are in the right places. (So if condition 1 is met, so is this one.)

  3. TeX must know about the relationship between font names and fonts. For this, it uses a series of .map files (a different file for each method of compilation roughly). For example, for pdfTeX, pdftex.map. So these files need to include information about any new fonts. These files are managed by updmap or updmap-sys.

In general, you should NOT run the following command. If you would like to know why - or if you have run the command already - please see my question concerning this.

In the specific case of the OP, however, updmap-sys is not an option. Moreover, it is highly unlikely that the system-wide .map files will change at anything other than snails' pace. Hence, (1) the OP has no other option, and (2) this option will not, probably, have the side-effects which it typically does. At least, not very soon ;).

In this case, and given an understanding of the reasons for which this should NOT generally be done, the following command will add information about the new fonts to a custom copy of pdftex.map, enabling them to be used in documents.

Again, do NOT do this if you are not the OP and you are not in the OP's situation. And do not do it without reading - and understanding - my answer on this topic.

updmap --enable Map=bera.map

Alternatively, if the system-wide installation is being regularly updated, or if you don't want to use the font in many documents or whatever, you can add this to your preamble to add the .map on a document-by-document basis:

\pdfmapfile{+bera.map}

Note that the + adds the mappings from bera.map file to those pdfTeX gets from pdftex.map etc.

cfr
  • 198,882