You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nix环境下使用bbm LaTeX包编译失败的调试求助

Nix环境下编译含bbm包的TeX文档失败调试求助

我搭建了一个用于编译TeX文档的小型Nix环境,但未达到预期效果。由于对Nix和LaTeX了解有限,无法准确定位错误原因。

示例TeX文档

\documentclass{article}
\usepackage{bbm}
\begin{document}
$x=\mathbbm{1}_{A}$
\end{document}

使用的flake.nix配置

{
  description = "latex-test-flake";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-23.05";
  outputs = { self, nixpkgs, ... }:
  let
    system = "x86_64-linux";
  in {
    devShells.${system}.default = let
      pkgs = nixpkgs.legacyPackages.${system};
    in pkgs.mkShell {
      packages = with pkgs; [
        (pkgs.texlive.combine {
          inherit (pkgs.texlive) scheme-basic bbm bbm-macros latexmk metafont;
        })
      ];
      shellHook = ''
        export LC_ALL=C
      '';
    };
  };
}

操作步骤与错误输出

执行nix develop -i进入隔离开发环境,运行编译命令latexmk -pdf main.tex后得到如下输出:

Rc files read:                                                                                                                                                 
  NONE                                                                                                                                                         
Latexmk: This is Latexmk, John Collins, 7 Jan. 2023. Version 4.79.                                                                                             
No existing .aux file, so I'll make a simple one, and require run of *latex.                                                                                   
Latexmk: applying rule 'pdflatex'...                                                                                                                           
Rule 'pdflatex':  Reasons for rerun                                                                                                                            
Category 'other':                                                                                                                                              
  Rerun of 'pdflatex' forced or previously required                                                                                                            
                                                                                                                                                               
------------                                                                                                                                                   
Run number 1 of rule 'pdflatex'                                                                                                                                
------------                                                                                                                                                   
------------                                                                                                                                                   
Running 'pdflatex  -recorder  "main.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022/nixos.org) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./main.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-02-22>
(/nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/te
x/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class

(/nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/te
x/latex/base/size10.clo))
(/nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/te
x/latex/bbm-macros/bbm.sty)
(/nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/te
x/latex/l3backend/l3backend-pdftex.def) (./main.aux)
(/nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/te
x/latex/bbm-macros/ubbm.fd) [1{/nix/store/wgpyg8ynf9nj2fldan5j6x9vz3ccswak-texl
ive-combined-2022/share/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./main.aux)
kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 bbm10
mktexpk: /nix/store/5z8dbwcramqp6khals7x0k7z40c8q4fy-texlive-combined-2022-texmfdist/web2c/mktexdir ./.texlive2022/texmf-var/fonts/pk/ljfour/public/bbm failed.
kpathsea: Appending font creation commands to missfont.log.
 )
!pdfTeX error: /nix/store/wgpyg8ynf9nj2fldan5j6x9vz3ccswak-texlive-combined-202
2/bin/pdflatex (file bbm10): Font bbm10 at 600 not found
 ==> Fatal error occurred, no output PDF file produced!
Latexmk: Getting log file 'main.log'
Latexmk: Examining 'main.fls'
Latexmk: Examining 'main.log'
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to 'main.log' and/or above output for details

Latexmk: If appropriate, the -f option can be used to get latexmk
  to try to force complete processing.

错误信息mktexpk: [...]/mktexdir [...]/bbm failed.不够直观,希望得到调试方面的帮助。


内容的提问来源于stack exchange,提问作者aaaaaaaaaaaaaaaaaanon

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 02:47:04