V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
loadhe
V2EX  ›  问与答

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

  •  
  •   loadhe · 2021-01-11 20:01:05 +08:00 · 1757 次点击
    这是一个创建于 1173 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如题,今天第一次使用 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 这个包,不知道有没有朋友也遇到这样的问题,求解。

    第 1 条附言  ·  2021-01-11 20:40:01 +08:00
    编译时引用了 tinytex 的路径,在设置里去掉就好了
    xlzpx
        1
    xlzpx  
       2021-01-11 20:06:42 +08:00
    看起来像是文件编码问题

    声明 utf-8 试下?
    loadhe
        2
    loadhe  
    OP
       2021-01-11 20:10:05 +08:00
    @xlzpx 我也试过,但是没用
    loadhe
        3
    loadhe  
    OP
       2021-01-11 20:17:19 +08:00
    难道是和 R studio 的 tinytex 冲突了?如果是那样的话要怎么解决呢
    zvl0reqglvd
        4
    zvl0reqglvd  
       2021-01-11 20:25:53 +08:00
    应该是第二句的问题,不行重装哈试试。
    yzbythesea
        5
    yzbythesea  
       2021-01-11 20:30:29 +08:00 via iPhone
    编译用的是 tinytex,不是 texlive 。修改 PATH 让你的 pdflatex 用 texlive 的
    loadhe
        6
    loadhe  
    OP
       2021-01-11 20:36:39 +08:00
    @yzbythesea 谢大佬解惑!在设置里直接把 tinytex 的 path 删除掉就搞定了。
    loadhe
        7
    loadhe  
    OP
       2021-01-11 20:36:49 +08:00
    @zvl0reqglvd 下面已经解决了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2863 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:51 · PVG 21:51 · LAX 06:51 · JFK 09:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.