4

Background

I'm using Ubuntu Precise with the standard repository packages rather than a manually installed TeXLive. I'm trying to include some Cyrillic in the bibliography of a paper which I'm compiling with pdflatex, following the advice of egreg that the best option is to use

\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}

But even a very simple test case

\documentclass[a4paper]{article}

\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}

\begin{document}
Testing \foreignlanguage{russian}{Обмен шифрами}
\end{document}

gives errors:

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
entering extended mode
(./minimum.tex
LaTeX2e <2009/09/24>

  <snip>

kpathsea: Running mktextfm larm1000
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000
/usr/bin/mktextfm: 96: /usr/bin/mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000: not found
grep: larm1000.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not fo
und.
<to be read again> 
                   relax 
l.8 ...anguage{russian}{Обмен шифрами}

I think the only relevant extra information from minimum.log is

LaTeX Font Info:    Try loading font information for T2A+cmr on input line 7.

(/usr/share/texmf-texlive/tex/latex/cyrillic/t2acmr.fd
File: t2acmr.fd 2001/08/11 v1.0a Computer Modern Cyrillic font definitions
)
LaTeX Font Info:    ... okay on input line 7.
! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not fo
und.

Extra details

I don't understand all the levels of indirection, but in an attempt to track them down I ran

$ grep -rE "\blarm([^0-9]|1000)" /usr/share/tex* 2>/dev/null
Binary file /usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb matches
/usr/share/texmf/fonts/map/dvips/cm-super/cm-super-minimal-t2a.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/scripts/pkfix/pkfix.pl:#       same type 1 font, eg. (ecrm1000, larm1000) -> SFRM1000.
/usr/share/texmf-texlive/tex/latex/cyrillic/t2acmr.fd:\EC@family{T2A}{cmr}{m}{n}{larm}
/usr/share/texmf-texlive/doc/fonts/lh/fonttest/allenc0.tex:\FontPage {larm1000}
/usr/share/texmf-texlive/doc/fonts/lh/fonttest/allenc2.tex:\FontPage {larm1000}
/usr/share/texmf-texlive/doc/generic/t2/examples/example2.tex:\font\larm=larm1000    % Set the default font --- Cyrillic
/usr/share/texmf-texlive/doc/generic/t2/examples/example2.tex:\larm                  % T2A encoded Computer Modern font.
/usr/share/texmf-texlive/fonts/map/dvips/updmap/psfonts.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvips/updmap/psfonts_t1.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvips/updmap/ps2pk.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/fontname/special.map:larm            lh              lh-t2a
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex_ndl14.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/pdftex/updmap/pdftex_dl14.map:larm1000 SFRM1000 "T2AEncoding ReEncodeFont" <cm-super-t2a.enc <sfrm1000.pfb
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm_dl14.map:larm1000 cm-super-t2a sfrm1000 -r
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm_ndl14.map:larm1000 cm-super-t2a sfrm1000 -r
/usr/share/texmf-texlive/fonts/map/dvipdfm/updmap/dvipdfm.map:larm1000 cm-super-t2a sfrm1000 -r

I have /usr/share/texmf/fonts/type1/public/cm-super/sfrm1000.pfb and /usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t2a.enc from Ubuntu package cm-super-minimal, so I think that I have the source files and am just missing some files to tie it all together.

Question

I'm not too fussed about fixing the underlying problem - it's a bit late to propose a patch for Precise, because it's in support mode now. But how can I obtain or generate the files which I'm missing, and get my document to compile and display the Cyrillic text?

  • Welcome to TeX.SX! You might like to have a look at our TeX.SX starter guide to get more information about out site. – Andrew Swann Oct 9 '14 at 10:45
  • I suspect a problem with write permissions for the ~/.texmf-var directory. – egreg Oct 9 '14 at 11:07
  • @egreg, it certainly looks like a permissions issue, but it's not with ~/.texmf-var because if I run mf manually it writes to ~/.texmf-var without problem. – Peter Taylor Oct 9 '14 at 11:12
  • I think you need to determine what the user and or group of the created mf process is. It is that process that needs correct persmissions to write to ~/.texmf-var – Andrew Swann Oct 9 '14 at 12:02
  • @PeterTaylor oh, this is not TeXlive, but ubuntu's... did you read this answer tex.stackexchange.com/a/5101/36131 ? – doed Oct 11 '14 at 13:21
3

pdflatex is actually trying to create the missing files, but there's some permissions issue. I don't know how to fix the real problem, but there are two workarounds which will allow you to compile your document.

The clue

The error messages talk about mktextfm larm1000. If you try to run that command directly from the shell, you get the same errors:

mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000
/usr/bin/mktextfm: 96: /usr/bin/mktextfm: mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000: not found
grep: larm1000.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.

Workaround 1

If you sudo it, it will succeed, even though the files which it writes are in ~/.texmf-var and it shouldn't obviously need any privileges beyond those which you have.

Workaround 2

The error messages also show that mktextfm is trying to run

mf-nowin -progname=mf "\mode:=ljfour; mag:=1; nonstopmode; input larm1000"

You can run that without sudo; it will create ~/.texmf-var/fonts/source/lh/lh-t2a/larm1000.mf as well as ./larm1000.600gf, ./larm1000.log, and ./larm1000.tfm. pdflatex will now compile your document. However, it's a good idea to

mv ./larm1000.tfm ~/.texmf-var/fonts/tfm/lh/lh-t2a/

because otherwise you may run into the same problem in future if you try to compile documents with Cyrillic from a different working directory.

  • Welcome to TeX.SX! This looks more like an addition to you question rather than an "Answer". Please edit your question instead. – Andrew Swann Oct 9 '14 at 10:44
  • @AndrewSwann, I'm not sure why you think that. The question sets out a problem (with perhaps a bit more detail than necessary, but it might help people find it with Google); this answer offers two solutions with a brief explanation and discussion of which is best. – Peter Taylor Oct 9 '14 at 11:07
  • I don't understand your answer then. What you do you mean by "glue"? It has a pretty specific meaning in the tex, but does not make sense here. – Andrew Swann Oct 9 '14 at 11:27
  • @AndrewSwann, I'm using it in the generic sense of "something which connects things": in this case the config file which links together the font files included in the relevant Ubuntu packages. – Peter Taylor Oct 9 '14 at 11:48
  • OK, but confusing. However your "answer" still sounds like a step on the process to diagnosing the problem, rather than a solution. – Andrew Swann Oct 9 '14 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.