在 Texlive 文件再打开编译时遇到 'ctex.sty' not found

2021-01-11 20:01:05 +08:00
 loadhe

如题,今天第一次使用 Texlive 选择了完整安装。
谁知所有的文件在第一次新建打开编译的时候没问题,关闭再打开编译的时候就会报错如下:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./ps2_sol.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-10-27> xparse <2020-03-03>
(c:/Users/19122/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(c:/Users/19122/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `ctex.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
Process interrupted by user

文档如下

\documentclass{article}
\usepackage[space]{ctex}
\begin{document}
\section{Insurance}
\paragraph{1.}
Expected income is $$\bar{Y} = pY_H + (1-p)Y_L = 7$$

Expected Utility is $$u(\bar{Y}) = 7^{0.5}$$

Expected utility:
$$Y_0 = pu(Y_H)+(1-p)u(Y_L) = 2.5 \leq u(\bar{Y}) = 7^{0.5} = u(\bar{Y} - q)$$ 
$$\bar{M} = q = 0.75$$

你好,こんにちは、LaTeX


\end{document}

Package Manager 中也能搜索到确认有 ctex 这个包,不知道有没有朋友也遇到这样的问题,求解。

1788 次点击
所在节点    问与答
7 条回复
xlzpx
2021-01-11 20:06:42 +08:00
看起来像是文件编码问题

声明 utf-8 试下?
loadhe
2021-01-11 20:10:05 +08:00
@xlzpx 我也试过,但是没用
loadhe
2021-01-11 20:17:19 +08:00
难道是和 R studio 的 tinytex 冲突了?如果是那样的话要怎么解决呢
zvl0reqglvd
2021-01-11 20:25:53 +08:00
应该是第二句的问题,不行重装哈试试。
yzbythesea
2021-01-11 20:30:29 +08:00
编译用的是 tinytex,不是 texlive 。修改 PATH 让你的 pdflatex 用 texlive 的
loadhe
2021-01-11 20:36:39 +08:00
@yzbythesea 谢大佬解惑!在设置里直接把 tinytex 的 path 删除掉就搞定了。
loadhe
2021-01-11 20:36:49 +08:00
@zvl0reqglvd 下面已经解决了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/743973

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX