Giter Club home page Giter Club logo

Comments (8)

muzimuzhi avatar muzimuzhi commented on August 12, 2024 5

十一长假期间,曾远程桌面排查类似问题,最终也没有找到直接原因。后来对方反馈,安装发行版 proTeXt 后,问题消失。

(具体的聊天和浏览器记录已部分删除,以下叙述包含回忆部分。)

当时这个用户在终端也无法编译,甚至使用 tlmgr 也会报类似

Use of uninitialized value $ver in scalar chomp at .../TeXLive/TLWinGoo.pm line 204.

的错误。当时猜测系统环境变量有问题,因夜深而中断。该用户之前装过 CTeX 套装,新装了 TeX Live,就遇到了无法编译的问题。后来他通过再安装一个发行版绕过了问题,也就没有继续跟进。


搜到一个类似问题(12),是 R 用户在使用 TinyTeX 时遇到的。

解决方法很简单: windows 操作系统的环境变量里添加 PATH:c:\Windows\System32

from forum.

Liam0205 avatar Liam0205 commented on August 12, 2024 2

可能的原因,大概分为两类。

  • TeXstudio 找不到 TeX 相关可执行文件的路径;
  • TeXstudio 找不到适合编译的 .tex 源文件。

前者可能的原因有:

  • 没有安装 TeX 发行版,只安装了 MiKTeX TeXstudio 等编辑器。
  • 安装 MiKTeX 后,环境变量 PATH 没有更新。这两种情况,让用户在 cmd 里执行 tex --version 观察其输出即可判断。
  • TeXstudio 内,相关路径设置错误。例如 #5 (comment) 中截图所示的 txs

后者可能的原因有:

  • .tex 源文件名字中,含有 wchar

其他可能的疑难杂症包括:

  • ls-R 数据库挂了。这种情况以适当的权限执行 mktexlsr 即可。
  • format 文件挂了。这种情况重新 dump .fmt 文件即可:fmtutil-sys --all

from forum.

muzimuzhi avatar muzimuzhi commented on August 12, 2024 1

也遇到过,用户为了「把编译方式从 pdflatex 改成 xelatex」而改错了 texstudio 的设置。例如
image

from forum.

stone-zeng avatar stone-zeng commented on August 12, 2024

之前遇到的一位用的是 miktex,命令行可以编译,但在 texstudio 中却不行,检查了一下 build 设置也没有问题。后面基本放弃,希望他可以重装解决。

from forum.

stone-zeng avatar stone-zeng commented on August 12, 2024

再贴一个完整的错误 log:

Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode "document".tex

Use of uninitialized value $ver in scalar chomp at D:/texlive/2018/tlpkg/TeXLive/TLWinGoo.pm line 206. Use of uninitialized value $ver in substitution (s///) at D:/texlive/2018/tlpkg/TeXLive/TLWinGoo.pm line 207. Use of uninitialized value $ver in substitution (s///) at D:/texlive/2018/tlpkg/TeXLive/TLWinGoo.pm line 207.

fmtutil: fmtutil is using the following fmtutil.cnf files (in precedence order): fmtutil: d:/texlive/2018/texmf-dist/web2c/fmtutil.cnf fmtutil: fmtutil is using the following fmtutil.cnf file for writing changes: fmtutil: c:/users/73994/.texlive2018/texmf-config/web2c/fmtutil.cnf fmtutil [INFO]: writing formats under c:/users/73994/.texlive2018/texmf-var/web2c fmtutil [INFO]: --- remaking pdflatex with pdftex

Can't spawn "cmd.exe": No such file or directory at d:\texlive\2018\texmf-dist\scripts\texlive\fmtutil.pl line 598. fmtutil [WARNING]: inifile pdflatex.ini for pdflatex/pdftex not found. fmtutil [INFO]: Disabled formats: 6 fmtutil [INFO]: Not selected formats: 43 fmtutil [INFO]: Failed to build: 1 (pdftex/pdflatex) fmtutil [INFO]: Total formats: 50 fmtutil [INFO]: exiting with status 1

D:\texlive\2018\bin\win32\runscript.tlu:790: command failed with exit code 1: perl.exe d:\texlive\2018\texmf-dist\scripts\texlive\fmtutil.pl --user --byfmt pdflatex

Running the command D:\texlive\2018\bin\win32\fmtutil-user.exe

kpathsea: Running mktexfmt pdflatex.fmt The command name is D:\texlive\2018\bin\win32\mktexfmt

Process exited with error(s)

前面指出的解决方法「添加 C:\Windows\System32 到 PATH 环境变量」确实有效。

from forum.

zhanlaoban avatar zhanlaoban commented on August 12, 2024

十一长假期间,曾远程桌面排查类似问题,最终也没有找到直接原因。后来对方反馈,安装发行版 proTeXt 后,问题消失。

(具体的聊天和浏览器记录已部分删除,以下叙述包含回忆部分。)

当时这个用户在终端也无法编译,甚至使用 tlmgr 也会报类似

Use of uninitialized value $ver in scalar chomp at .../TeXLive/TLWinGoo.pm line 204.

的错误。当时猜测系统环境变量有问题,因夜深而中断。该用户之前装过 CTeX 套装,新装了 TeX Live,就遇到了无法编译的问题。后来他通过再安装一个发行版绕过了问题,也就没有继续跟进。

搜到一个类似问题(12),是 R 用户在使用 TinyTeX 时遇到的。

解决方法很简单: windows 操作系统的环境变量里添加 PATH:c:\Windows\System32

解决就我的问题,感谢老哥!

from forum.

SainoNamkho avatar SainoNamkho commented on August 12, 2024

texstudio有两种报错,一种在消息窗口
https://github.com/texstudio-org/texstudio/blob/e85190d8d0837bedad6636586b986dc088d93e29/src/buildmanager.cpp#L2506-L2517

另一种是弹窗
https://github.com/texstudio-org/texstudio/blob/d6f13e06fa06ddbc506fa7b2bb96e692f1e0b038/src/texstudio.cpp#L6079-L6084

弹窗说明可执行文件能找到、运行失败、没有文件名对应的log

from forum.

SainoNamkho avatar SainoNamkho commented on August 12, 2024

texstudio有两种报错,一种在消息窗口 https://github.com/texstudio-org/texstudio/blob/e85190d8d0837bedad6636586b986dc088d93e29/src/buildmanager.cpp#L2506-L2517

另一种是弹窗 https://github.com/texstudio-org/texstudio/blob/d6f13e06fa06ddbc506fa7b2bb96e692f1e0b038/src/texstudio.cpp#L6079-L6084

弹窗说明可执行文件能找到、运行失败、没有文件名对应的log

排查的话要求提问者texstudio全窗口截图(包括消息窗口的错误)、命令行编译并查看是否有log产生。
如果命令行与texstudio窗口编译结果不同,可能是texstudio进程启动后更改了环境变量,重启texstudio可解决。
另外可临时将texstudio编译命令设为cmd /c "where pdflatex"与命令行运行where pdflatex结果对比。

不产生log的情况,总结了一下大概有:

  1. 文件路径含有特殊字符,导致编译出的log文件路径跟texstudio拼装出的log文件路径不同,根据 https://github.com/texstudio-org/texstudio/blob/8c898844d87d4ba640f5c7684c0180cc463c49af/src/latexdocument.cpp#L2016-L2026 magic comment 也有影响
  2. fmt不匹配,导致没有产生log就直接报错退出,这种情况命令行编译可排查出问题
  3. texstudio自身问题,同时打开已保存的文件跟临时文件以及root comment之类,可能导致识别错当前文件名
  4. 编译成 cls 或 sty 文件,全窗口截图可从标签页发现错误。

from forum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.