Sự cố khi chạy pdflatex

Sep 30 2020

Tôi mới sử dụng latex và tôi gặp một số vấn đề khi chạy mã latex trong TexStudio.
Tôi đã viết chương trình latex sau trong TexStudio:

\documentclass{article}
\begin{document}
    Hello world
\end{document}

và khi tôi cố gắng chạy nó, TexStudio hiển thị cho tôi lỗi sau:

Could not start Build & View:PdfLatex:
pdflatex.exe -synctex=1 -interaction=nonstopmode
"<FileName>".tex

Tôi đang sử dụng TexLive trong Windows.
Tôi đã thêm C: \ texlive \ 2020 \ bin \ win32 vào PATH
và trong TexStudio -> Options -> Configure TexStudio -> Commands -> PdfLatex, tôi đã viết:

pdflatex.exe -synctex=1 -interaction=nonstopmode %.tex

Khi tôi chạy thử nghiệm pdflatex trong cmd, tôi nhận được:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:\texlive\2020\bin\win32\mktexfmt
Running the command C:\texlive\2020\bin\win32\fmtutil-user.exe
C:\texlive\2020\bin\win32\runscript.tlu:935: C:\texlive\2020\bin\win32\runscript.tlu:858: no appropriate script or program found: fmtutil
I can't find the format file `pdflatex.fmt'!

Ai đó có thể vui lòng giúp tôi ?

Trả lời

Freud Sep 30 2020 at 19:11

Tôi đã thử sử dụng MikTex thay vì TexLive và nó hoạt động ngay bây giờ.