避免使用 kpathsea:运行 mktexpk

避免使用 kpathsea:运行 mktexpk

我正在基于FROM pandoc/ubuntu-latex镜像的 docker 容器中运行 pandoc,它运行良好。但是,每次运行时,我都会得到kpathsea: Running mktexpk ...似乎需要额外时间的步骤,每次我运行该 pandoc 命令时。

输出内容如下...

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.

在我的Dockerfile尝试中,我运行了 kpathsea 在日志输出中生成的相同命令:

# 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

在创建图像期间它似乎运行良好,但它似乎并没有改变 pandoc 结果中的任何内容——kpathsea 再次运行。

我如何设置docker镜像以便tcrm1095.tfm可以看到现有文件(或者避免mktexpk每次都执行该步骤)?

编辑我在正在运行的docker容器的shell中验证了它的/root/.texlive/texmf-var/fonts/pk/ljfour/jknappen/ec/tcrm1095.600pk存在。

编辑2使用 shell 在 docker 容器中搜索显示有 /opt/texlive/texdir/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm/usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1095.tfm,但 pandoc 仍在生成它们。也许我在图像中缺少环境变量?

答案1

我部分找到了答案。我的 pandoc makefile 没有使用更新docker image,使用RUN命令生成tfm文件。一旦我修复了 makefile 以使用较新的 docker 镜像,该kpathsea命令就不会重复。

但是,我仍然不确定为什么默认映像找不到.tfm安装在ec(tlmgr)包中的文件。

答案2

我也遇到了类似的问题,但仅限于引擎pdflatex

使用时--pdf-engine=xelatex--pdf-engine=lualatex它工作正常。

相关内容