![TeXstudio 在新硬盘上全新安装后无法正确编译或下载软件包](https://linux22.com/image/449370/TeXstudio%20%E5%9C%A8%E6%96%B0%E7%A1%AC%E7%9B%98%E4%B8%8A%E5%85%A8%E6%96%B0%E5%AE%89%E8%A3%85%E5%90%8E%E6%97%A0%E6%B3%95%E6%AD%A3%E7%A1%AE%E7%BC%96%E8%AF%91%E6%88%96%E4%B8%8B%E8%BD%BD%E8%BD%AF%E4%BB%B6%E5%8C%85.png)
简而言之:我在电脑上安装了一块新硬盘,在硬盘上安装了 Win10,并将旧硬盘上的所有数据转移到新硬盘上。为了确保万无一失,我重新安装了 TeXstudio 和 MiKTeX。
从那时起,我的 .tex 文件就无法再正确编译,大多数时候都会出现错误,需要我一直摆弄。
它还会自动停止下载软件包。目前我收到错误“不幸的是,无法安装包 fancyhdr(但可以是任何包)。请检查日志文件:C:\Users\crota\AppData\Local\MiKTeX\miktex\log\pdflatex.log 进程因错误退出”
日志文件给了我以下这段文字
2022-05-02 10:17:55,061+0200 INFO pdflatex - this process (5960) started by 'texstudio' with command line: "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -synctex=1 -interaction=nonstopmode testing.tex
2022-05-02 10:17:55,069+0200 INFO pdflatex - allowing known shell commands
2022-05-02 10:17:55,069+0200 INFO pdflatex - enabling input (output) from (to) processes
2022-05-02 10:17:55,095+0200 INFO pdflatex - going to create file: pdflatex.fmt
2022-05-02 10:17:55,139+0200 INFO pdflatex.core - start process: initexmf --dump-by-name=pdflatex --engine=pdftex
2022-05-02 10:18:06,630+0200 INFO pdflatex - installing package moderncv triggered by tex/latex/moderncv\moderncv.cls
2022-05-02 10:18:06,647+0200 INFO pdflatex.packagemanager - going to download https://api2.miktex.org/hello
2022-05-02 10:18:06,831+0200 INFO pdflatex.packagemanager - going to download https://api2.miktex.org/repositories?&releaseState=Stable&orderBy=ranking&take=1
2022-05-02 10:18:06,849+0200 INFO pdflatex - mpm: starting package maintenance...
2022-05-02 10:18:06,849+0200 INFO pdflatex - mpm: installation directory: C:\Users\crota\AppData\Local\Programs\MiKTeX
2022-05-02 10:18:06,849+0200 INFO pdflatex - mpm: package repository: https://ctan.space-pro.be/tex-archive/systems/win32/miktex/tm/packages/
2022-05-02 10:18:07,108+0200 INFO pdflatex - mpm: package repository digest: 9693e41391afbcca7c929e975587eade
2022-05-02 10:18:07,108+0200 INFO pdflatex - mpm: going to download 34077 bytes
2022-05-02 10:18:07,108+0200 INFO pdflatex - mpm: going to install 39 file(s) (1 package(s))
2022-05-02 10:18:07,912+0200 INFO pdflatex.packagemanager - installing package moderncv
2022-05-02 10:18:07,913+0200 INFO pdflatex - mpm: downloading https://ctan.space-pro.be/tex-archive/systems/win32/miktex/tm/packages/moderncv.tar.lzma...
2022-05-02 10:18:07,914+0200 INFO pdflatex.packagemanager - going to download https://ctan.space-pro.be/tex-archive/systems/win32/miktex/tm/packages/moderncv.tar.lzma
2022-05-02 10:18:08,125+0200 INFO pdflatex - mpm: 0.03 MB, 1.29 Mbit/s
2022-05-02 10:18:08,129+0200 INFO pdflatex - mpm: extracting files from moderncv.tar.lzma...
2022-05-02 10:18:08,714+0200 INFO pdflatex.core - start process: initexmf --mkmaps
2022-05-02 10:18:09,256+0200 FATAL pdflatex - The executed process did not succeed.
2022-05-02 10:18:09,256+0200 FATAL pdflatex - Info: fileName="C:\Program Files\MiKTeX 2.9\miktex\bin\x64\mkfntmap.EXE", exitCode="1"
2022-05-02 10:18:09,256+0200 FATAL pdflatex - Source:
2022-05-02 10:18:09,256+0200 FATAL pdflatex - Line: 0
2022-05-02 10:18:09,489+0200 INFO pdflatex - this process (5960) finishes with exit code 1
2022-05-02 10:18:09,525+0200 WARN miktex.core - still open: testing.tex
2022-05-02 10:18:09,525+0200 WARN miktex.core - still open: C:\Users\crota\AppData\Local\Programs\MiKTeX\tex/latex/moderncv\moderncv.cls
2022-05-02 10:18:09,525+0200 WARN miktex.core - still open: C:\Users\crota\AppData\Local\Programs\MiKTeX\tex/latex/xcolor\xcolor.sty
2022-05-02 10:18:22,144+0200 INFO pdflatex - this process (23264) started by 'texstudio' with command line: "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -synctex=1 -interaction=nonstopmode testing.tex
2022-05-02 10:18:22,151+0200 INFO pdflatex - allowing known shell commands
2022-05-02 10:18:22,151+0200 INFO pdflatex - enabling input (output) from (to) processes
2022-05-02 10:18:28,074+0200 INFO pdflatex - installing package colortbl triggered by tex/latex/colortbl\colortbl.sty
2022-05-02 10:18:28,079+0200 INFO pdflatex.packagemanager - going to download https://api2.miktex.org/repositories?&releaseState=Stable&orderBy=ranking&take=1
2022-05-02 10:18:28,255+0200 INFO pdflatex - mpm: starting package maintenance...
2022-05-02 10:18:28,256+0200 INFO pdflatex - mpm: installation directory: C:\Users\crota\AppData\Local\Programs\MiKTeX
2022-05-02 10:18:28,256+0200 INFO pdflatex - mpm: package repository: https://ftp.rrze.uni-erlangen.de/ctan/systems/win32/miktex/tm/packages/
2022-05-02 10:18:28,510+0200 INFO pdflatex - mpm: package repository digest: 9693e41391afbcca7c929e975587eade
2022-05-02 10:18:28,511+0200 INFO pdflatex - mpm: going to download 607791 bytes
2022-05-02 10:18:28,511+0200 INFO pdflatex - mpm: going to install 6 file(s) (1 package(s))
2022-05-02 10:18:29,300+0200 INFO pdflatex.packagemanager - installing package colortbl
2022-05-02 10:18:29,301+0200 INFO pdflatex - mpm: downloading https://ftp.rrze.uni-erlangen.de/ctan/systems/win32/miktex/tm/packages/colortbl.tar.lzma...
2022-05-02 10:18:29,302+0200 INFO pdflatex.packagemanager - going to download https://ftp.rrze.uni-erlangen.de/ctan/systems/win32/miktex/tm/packages/colortbl.tar.lzma
2022-05-02 10:18:29,655+0200 INFO pdflatex - mpm: 0.61 MB, 13.81 Mbit/s
2022-05-02 10:18:29,660+0200 INFO pdflatex - mpm: extracting files from colortbl.tar.lzma...
2022-05-02 10:18:30,200+0200 INFO pdflatex.core - start process: initexmf --mkmaps
2022-05-02 10:18:30,619+0200 FATAL pdflatex - The executed process did not succeed.
2022-05-02 10:18:30,619+0200 FATAL pdflatex - Info: fileName="C:\Program Files\MiKTeX 2.9\miktex\bin\x64\mkfntmap.EXE", exitCode="1"
2022-05-02 10:18:30,619+0200 FATAL pdflatex - Source:
2022-05-02 10:18:30,619+0200 FATAL pdflatex - Line: 0
2022-05-02 10:18:30,910+0200 INFO pdflatex - this process (23264) finishes with exit code 1
2022-05-02 10:18:30,944+0200 WARN miktex.core - still open: testing.tex
2022-05-02 10:18:30,944+0200 WARN miktex.core - still open: C:\Users\crota\AppData\Local\Programs\MiKTeX\tex/latex/moderncv\moderncv.cls
2022-05-02 10:23:16,488+0200 INFO pdflatex - this process (11536) started by 'texstudio' with command line: "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe" -synctex=1 -interaction=nonstopmode testing.tex
2022-05-02 10:23:16,495+0200 INFO pdflatex - allowing known shell commands
2022-05-02 10:23:16,495+0200 INFO pdflatex - enabling input (output) from (to) processes
2022-05-02 10:23:16,518+0200 INFO pdflatex - going to create file: pdflatex.fmt
2022-05-02 10:23:16,564+0200 INFO pdflatex.core - start process: initexmf --dump-by-name=pdflatex --engine=pdftex
2022-05-02 10:23:26,152+0200 INFO pdflatex - installing package fancyhdr triggered by tex/latex/fancyhdr\fancyhdr.sty
2022-05-02 10:23:26,157+0200 INFO pdflatex.packagemanager - going to download https://api2.miktex.org/hello
2022-05-02 10:23:26,336+0200 INFO pdflatex.packagemanager - going to download https://api2.miktex.org/repositories?&releaseState=Stable&orderBy=ranking&take=1
2022-05-02 10:23:26,354+0200 INFO pdflatex - mpm: starting package maintenance...
2022-05-02 10:23:26,354+0200 INFO pdflatex - mpm: installation directory: C:\Users\crota\AppData\Local\Programs\MiKTeX
2022-05-02 10:23:26,354+0200 INFO pdflatex - mpm: package repository: https://ctan.kako-dev.de/systems/win32/miktex/tm/packages/
2022-05-02 10:23:26,645+0200 INFO pdflatex - mpm: package repository digest: 9693e41391afbcca7c929e975587eade
2022-05-02 10:23:26,645+0200 INFO pdflatex - mpm: going to download 838456 bytes
2022-05-02 10:23:26,645+0200 INFO pdflatex - mpm: going to install 7 file(s) (1 package(s))
2022-05-02 10:23:27,444+0200 INFO pdflatex.packagemanager - installing package fancyhdr
2022-05-02 10:23:27,445+0200 INFO pdflatex - mpm: downloading https://ctan.kako-dev.de/systems/win32/miktex/tm/packages/fancyhdr.tar.lzma...
2022-05-02 10:23:27,446+0200 INFO pdflatex.packagemanager - going to download https://ctan.kako-dev.de/systems/win32/miktex/tm/packages/fancyhdr.tar.lzma
2022-05-02 10:23:29,775+0200 INFO pdflatex - mpm: 0.84 MB, 2.88 Mbit/s
2022-05-02 10:23:29,781+0200 INFO pdflatex - mpm: extracting files from fancyhdr.tar.lzma...
2022-05-02 10:23:30,372+0200 INFO pdflatex.core - start process: initexmf --mkmaps
2022-05-02 10:23:31,006+0200 FATAL pdflatex - The executed process did not succeed.
2022-05-02 10:23:31,006+0200 FATAL pdflatex - Info: fileName="C:\Program Files\MiKTeX 2.9\miktex\bin\x64\mkfntmap.EXE", exitCode="1"
2022-05-02 10:23:31,006+0200 FATAL pdflatex - Source:
2022-05-02 10:23:31,006+0200 FATAL pdflatex - Line: 0
2022-05-02 10:23:31,255+0200 INFO pdflatex - this process (11536) finishes with exit code 1
2022-05-02 10:23:31,290+0200 WARN miktex.core - still open: testing.tex
2022-05-02 10:23:31,290+0200 WARN miktex.core - still open: C:\Users\crota\AppData\Local\Programs\MiKTeX\tex/latex/moderncv\moderncv.cls
过去几天我尝试搜索网络和不同的软件包手册以及 TeXstudio 用户手册,但就是找不到解决我的特定问题的方法。
编辑:根据@UlrikeFischer 的建议,我下载了所有打包的 MiKTeX 软件包,并在以下示例代码中添加了我遇到的几个错误之一。
\documentclass[10pt,a4paper,titlepage]{moderncv}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{graphicx}
\usepackage{fontawesome} %Paket für schönere Symbole bei den persönlichen Daten.
%\usepackage{mathptmx}
\usepackage[left=1.0cm, right=1.5cm, top=1.7cm, bottom=1.7cm]{geometry}
\author{My Name}
\moderncvtheme[green]{classic}
\moderncvicons{awesome}
%Die persönlichen Daten:
\name{My}{Name}
\title{Lebenslauf}
\address{Address}{PLZ}
\phone[mobile]{Number}
\phone[phone]{Number2}
\email{[email protected]}
%\extrainfo{Hier können extra Informaitonen stehen.}
\quote{{\footnotesize ''When a crisis
shapes up, you don't waste energy wishing for information
or skills you haven't got. You dig in and handle it
as best you can with what you've got.'' Aahz}}
\begin{document}
\makecvtitle
\section{Persönliche Daten}
\cvline{Geburtstag:}{Birthday}
\cvline{Geburtsort:}{City}
\end{document}
这给我的错误看起来像这样,我只发现它与试图用于 \mobile 和 \phone 命令的符号有关:
LaTeX3 Error: Control sequence \faAdjust already defined. ...:nnnnn{\faAdjust}{adjust}{free0}{3}{"F042}
答案1
在我的例子中,该包与加载的fontawesome
包发生冲突。不使用该包,修复了错误。fontawesome5
moderncv
答案2
虽然听起来很糟糕,但我认为最好还是下载完整的 miktex 然后安装整个,而不是按需逐个安装。有时更新的软件包甚至可能存在兼容性问题,具体取决于您安装的版本。如果您有足够的带宽,也许可以尝试一下。