1

I'm running pandoc in a docker container based on the FROM pandoc/ubuntu-latex image, and it's working fine. However, each time it runs, I get the kpathsea: Running mktexpk ... step which seems to take extra time, every time I run that pandoc command.

Here's what the output looks like...

kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tcrm1095
mktexpk: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1+0/600; nonstopmode; input tcrm1095
This is METAFONT, Version 2.7182818 (TeX Live 2020) (preloaded base=mf)

(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/tcrm1095.mf
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/exbase.mf)
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/tcrm.mf
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txsymb.mf
 Ok (/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/exaccess.mf
 Ok) (/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txpseudo.mf
 Ok) (/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txaccent.mf
 Ok [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [27] [29])
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txgen.mf
 Ok [100] [109] [98] [99] [108])
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txsymbol.mf
 Ok [13] [18] [21] [22] [23] [24] [25] [26] [28] [31] [32] [36] [39] [44]
[45] [46] [42] [47] [60] [61] [62] [77] [79] [87] [110] [91] [93] [94] [95]
[96] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137]
[138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149]
[150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161]
[162] [163] [164] [165] [166] [167] [168] [169] [171] [172] [173] [174]
[175] [177] [176] [180] [181] [182] [183] [184] [187] [191] [214] [246])
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txromod.mf
 Ok [48] [49] [50] [51] [52] [53] [54] [55] [56] [57])
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txrsuper.mf
 Ok [185] [178] [179] [170] [186])
(/opt/texlive/texdir/texmf-dist/fonts/source/jknappen/ec/txrfract.mf
 Ok [188] [189] [190]) ) ) )
(some charht values had to be adjusted by as much as 0.06952pt)
Font metrics written on tcrm1095.tfm.
Output written on tcrm1095.600gf (128 characters, 25592 bytes).
Transcript written on tcrm1095.log.
mktexpk: /root/.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk: successfully generated.

In my Dockerfile I tried to run the same command kpathsea generates in the log output:

# create the fonts to save time each time a user will use them?
RUN mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 tcrm1095

which appears to run fine during the creation of the image, but it doesn't seem to change anything in the pandoc result -- kpathsea runs again.

How can I set up the docker image so that the existing tcrm1095.tfm files will be seen (or to avoid the mktexpk step each time)?

Edit I verified in a shell of the running docker container that /root/.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk exists.

Edit 2 A search in the docker container with a shell shows there are /opt/texlive/texdir/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm and /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm, yet pandoc is still generating them. Perhaps I'm missing an environment variable in the image?

7
  • it seems to create missing tfm-files, so you should add these tfm to your docker. May 16 at 16:06
  • @UlrikeFischer Yes, I added an edit to show they are indeed there. At least, the /root/.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk is there. It's the result of the RUN ... command I added. May 16 at 16:10
  • a file ending with 600pk is not a tfm, tfm end with .tfm. May 16 at 16:11
  • @UlrikeFischer I thought from the output that the mktexpk makes the .tfm files? The output log doesn't show anything about them specifically. Where do you think they are being created when pandoc runs? Where should they normally be so that mktexpk doesn't remake them? May 16 at 16:17
  • 1
    well your log-files says Font metrics written on tcrm1095.tfm. And normally they should be in in some texmf in /fonts/tfm/jknappen/ec May 16 at 16:39
0

I partially have an answer. My pandoc makefile was not using the updated docker image, with the RUN command to generate the tfm file. Once I fixed the makefile to use the newer docker image, the kpathsea command is not repeated.

However, I'm still not sure why the default image isn't finding the .tfm files installed in the ec (tlmgr) package, for example.

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.