在 LMDE2 上安装 texlive 后,pdfcrop 出现错误。错误输出与我从终端运行 updmap 时得到的错误相同:
/usr/local/texlive/2015/bin/i386-linux/updmap: kpsewhich -var-value=TEXMFROOT failed, aborting early.
BEGIN failed--compilation aborted at /usr/local/texlive/2015/bin/i386-linux/updmap line 28.
我绝对不是程序员,但我能够遵循指令。有人知道这个问题的解决方案吗?我以前使用 pdfcrop(更不用说 latex)多年,从未出现过此类错误。
这是我通过选项得到的--debug --verbose
:
PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Oberdiek.
* Restricted mode: disabled
* Option `pdfversion': auto
* Perl executable: /usr/bin/perl
* Perl version: v5.20.2
* Pointer size: 4
* Pipe support: yes
* Fork support: yes
* OS name: linux
* Arch name: i586-linux-gnu-thread-multi-64int
* System: unix
* Not found (gs): /usr/local/bin/gs
* Found (gs): /usr/bin/gs
* Autodetected ghostscript command: gs
* Input file: natural.pdf
* Output file: naturalcrop.pdf
* Margins: 0 0 0 0
* PDF header: %PDF-1.4
* Using PDF minor version: 4
* Running ghostscript for BoundingBox calculation ...
* Ghostscript call: gs -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f natural.pdf
GPL Ghostscript 9.06 (2012-08-08)
Copyright (C) 2012 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
%%BoundingBox: 0 0 4 21
%%HiResBoundingBox: 0.162000 0.756000 3.816000 20.807999
* Page 1: 0.162000 0.756000 3.816000 20.807999
* Running pdfTeX ...
* pdfTeX call: pdftex -no-shell-escape -interaction=nonstopmode tmp-pdfcrop-3685
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) (preloaded format=pdftex)
kpathsea: Running mktexfmt pdftex.fmt
/usr/local/texlive/2015/bin/i386-linux/mktexfmt: kpsewhich -var-value=TEXMFROOT failed, aborting early.
BEGIN failed--compilation aborted at /usr/local/texlive/2015/bin/i386-linux/mktexfmt line 25.
I can't find the format file `pdftex.fmt'!
* Cleanup
* Temporary files: tmp-pdfcrop-3685.tex tmp-pdfcrop-3685.log
!!! Error: pdfTeX run failed with value 1!
答案1
错误是,pdfTeX
没有找到格式文件:
kpathsea: Running mktexfmt pdftex.fmt
/usr/local/texlive/2015/bin/i386-linux/mktexfmt: kpsewhich -var-value=TEXMFROOT failed, aborting early.
BEGIN failed--compilation aborted at /usr/local/texlive/2015/bin/i386-linux/mktexfmt line 25.
I can't find the format file `pdftex.fmt'!
解决方法
pdfcrop
--ini
当使用选项时,也可以在没有格式文件的情况下工作。
找到真正原因的一些提示
格式生成失败的错误原因似乎更加复杂。也许,手动生成格式会有所帮助(第一个格式作用于整个系统,第二个格式仅作用于当前用户):
sudo fmtutil-sys --byfmt pdftex
fmtutil --byfmt pdftex
但是当TEXMFROOT
无法找到时,这也可能会失败。通常它配置在texmf.cnf
:
% Kpathsea sets SELFAUTOLOC (the directory with the binary),
% SELFAUTODIR (its parent), and SELFAUTOPARENT (its grandparent).
TEXMFROOT = $SELFAUTOPARENT
kpsewhich
应该与 位于同一目录中pdftex
,可能
$ which kpsewhich
/usr/local/texlive/2015/bin/i386-linux/kpsewhich