我在 Win10 中安装了便携式 texlive 2019,并将 bin\win32 添加到系统 $PATH 变量中。Cmd 命令tex --version
给出
TeX 3.14159265 (TeX Live 2019/W32TeX)
kpathsea version 6.3.1
Copyright 2019 D.E. Knuth.
There is NO warranty. Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
但latex sample2e.tex
让我陷入
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=latex)
restricted \write18 enabled.
kpathsea: Running mktexfmt latex.fmt
The command name is D:\Program Files\texlive\2019\bin\win32\mktexfmt
Running the command D:\Program Files\texlive\2019\bin\win32\fmtutil-user.exe
fmtutil [ERROR]: -user mode but path setup is -sys type, bailing out.
D:\Program Files\texlive\2019\bin\win32\runscript.tlu:907: command failed with exit code 1:
perl.exe "d:\Program Files\texlive\2019\texmf-dist\scripts\texlive\fmtutil.pl" --user --byfmt latex
I can't find the format file `latex.fmt'!
任何帮助都将受到赞赏。
答案1
解决方法:
Administrator:Windows Powershell
从打开cmd
。输入命令:
PS C:\WINDOWS\system32>D:\texlive2019\2019\bin\win32\fmtutil-sys.exe --all
从 Windows 10 复制
C:\VTRoot\HarddiskVolume2\texlive2019\2019\texmf-var\web2c
到D:\texlive2019\2019\texmf-var\web2c
。运行
.tex
源文件,应该没问题。