Overleaf 加载自定义字体

fontspec

  1. 上传字体到 Overleaf 项目。

    • 如果字体有 static 和 variable 两种版本,上传 static 版本。
    • 建议按照字体系列创建字体目录。
  2. 配置 fontspec:

    \usepackage{fontspec}
    
    \setmainfont{Brygada1918}[
        Path=./BrygadaFontFiles/,
        Extension = .ttf,
        UprightFont=*-Regular,
        BoldFont=*-Bold,
        ItalicFont=*-Italic,
        BoldItalicFont=*-BoldItalic
        ]
    
    % \setsansfont{xxx}[xxx]
    % \setmonofont{xxx}[xxx]
    

参考:Using fonts not installed on Overleaf's servers: Google Fonts example | Overleaf

ctex

需要设置 ctex-fontset-xxx.def 文件指向本地字体。

参见:

posted @ 2025-06-22 07:26  Undefined443  阅读(99)  评论(0)    收藏  举报