Latex 使用常见报错

在上篇文章 Ubuntu 使用 latex,我们介绍了如何在ubuntu中使用latex。这篇文章记录一些latex的使用报错(可能并不常见 “😓”)。

  • pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \end{document}

    pdftex-error-font-expansion-auto-expansion-is-only-possible-with-scalable

    \usepackage{lmodern}
    
  • dpkg: error processing package tex-common (–configure)
    在我安装了 latex-cjk-chinese 时报的这个错误,因为我发现安装 cjk 字体会比较麻烦所以选择用 sudo apt-get install latex-cjk-chinese。但突然就报这个错误。不知道是不是以往手动安装字体导致的问题。用了 failing-to-configure-tex-common-on-ubuntu-20-04-2-lts sudo dpkg-reconfigure locales 但还是无法解决。最后只能根据 error-installing-tex-common-on-16-04-lts,卸载之后重新安装

    sudo apt remove --purge tex-common '^texlive'
    sudo rm -rf /etc/texmf/
    sudo apt install tex-common texlive-base texlive-latex-recommended \
                 texlive-latex-extra texlive-fonts-recommended latex-cjk-all
    
  • With CJKutf8 package, any bold or italic fonts stop working in LaTeX.
    这是由于apt安装导致的,可以手动安装似乎就可以解决。但目前太麻烦了,暂时搁置,结果还是不能使用中文字体 😢
    With CJKutf8 package, any bold or italic fonts stop working in LaTeX

  • Critical Package ctex Error: CTeX fontset `fandol’ is unavailable in current(ctex) mode.
    为了能够使用中文,我选择了下载 ctex,手动安装也可以,但它又依赖于其它包,所以直接(关于下载包可以看上篇文章)

    sudo apt install texlive-lang-chinese
    

    然后用 pdflatex 编译的时候就报了上述的错误。查找了下发现是 pdflatex 不支持 fandol。主流的解决方案是用xelatex,但我之前的文档都是pdflatex,不想换其它的了。因此查看了下 ctex.dtx 文件,结合现有的回答,发现换windows字体就可以了。详细的回答见 critical package ctex error:ctex fontset"fandol" is unavailable in current

    \documentclass[10pt, fontset=windows]{article}
    
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值