Code Monkey home page Code Monkey logo

Comments (5)

LaureatePoet avatar LaureatePoet commented on June 2, 2024

求助 @zepinglee 大佬。

此外我们看到 Liam大佬的博客 :CTeX 2.4.14:macOS 字体配置升级,感觉改为fontset=macnew 问题不大。

但比较疑虑 会不会对模板预设字体造成影响
image

from hfut_thesis.

sikouhjw avatar sikouhjw commented on June 2, 2024

这里改不改 macnew 都不是关键,ctex 宏集会自动检测。

from hfut_thesis.

sikouhjw avatar sikouhjw commented on June 2, 2024

找不到字体估计是 mac 的问题。

但比较疑虑 会不会对模板预设字体造成影响

%<*macold>
    \setCJKmainfont { STSong     }
      [ BoldFont = STHeiti, ItalicFont = STKaiti ]
    \setCJKsansfont { STXihei    } [ BoldFont = STHeiti ]
    \setCJKmonofont { STFangsong }
    \setCJKfamilyfont { zhsong } { STSong     }
    \setCJKfamilyfont { zhhei  } { STHeiti    }
    \setCJKfamilyfont { zhfs   } { STFangsong }
    \setCJKfamilyfont { zhkai  } { STKaiti    }
%</macold>
%<*macnew>
    \setCJKmainfont { Songti~SC~Light }
      [
        BoldFont       = Songti~SC~Bold,
        ItalicFont     = Kaiti~SC,
        BoldItalicFont = Kaiti~SC~Bold
      ]
    \setCJKsansfont { PingFang~SC }
    \setCJKmonofont { STFangsong  }
    \setCJKfamilyfont { zhsong } { Songti~SC~Light } [ BoldFont = Songti~SC~Bold ]
    \setCJKfamilyfont { zhhei  } { Heiti~SC~Light  } [ BoldFont = Heiti~SC~Medium ]
    \setCJKfamilyfont { zhpf   } { PingFang~SC     }
    \setCJKfamilyfont { zhfs   } { STFangsong      }
    \setCJKfamilyfont { zhkai  } { Kaiti~SC        } [ BoldFont = Kaiti~SC~Bold ]
    \setCJKfamilyfont { zhli   } { Baoli~SC        }
    \setCJKfamilyfont { zhyou  } { Yuanti~SC~Light } [ BoldFont = Yuanti~SC~Regular ]
%</macnew>

1可以看出,old 和 new 相对于你现在模板里的设置是有影响的,所以这里建议手动设置一下字体

\cs_new_protected:Npn \__gdut_load_cjk_font_mac:
  {
    \__gdut_setCJKmainfont:nn   { STSongti-SC }
      {
        UprightFont    = *-Light,
        BoldFont       = *-Bold,
        ItalicFont     = *-Light,
        BoldItalicFont = *-Bold
      }
    \__gdut_setCJKsansfont:nn   { STHeitiSC   }
      {
        UprightFont    = *-Medium,
        AutoFakeBold   = true,
        ItalicFont     = *-Medium,
        BoldItalicFont = *-Medium
      }
    \__gdut_setCJKmonofont:n    { STFangsong  }
    \__gdut_set_cjk_font_kai:nn { STKaitiSC   }
      {
        UprightFont    = *-Regular,
        BoldFont       = *-Bold,
        ItalicFont     = *-Regular,
        BoldItalicFont = *-Bold
      }
  }

2

Footnotes

  1. https://github.com/CTeX-org/ctex-kit/blob/a8907eefdd8b69a609f94c016d017fa96dd5f146/ctex/ctex.dtx#L10624-L10650

  2. https://github.com/sikouhjw/gdutthesis/blob/c3cc2de5bfa47f7bf1b88c0884cca60119d6fd82/gdutthesis.cls#L732-L756

from hfut_thesis.

zepinglee avatar zepinglee commented on June 2, 2024

这个问题应该是因为 github action 的 macOS 系统中没有 Kaiti SC 导致的。

设置 fontset = macnew 不能解决问题。用户设置的 fontset 是在模板中处理的,并没有 macnew 的选项,也没有传递给 ctex。这是因为有段时间 ctex-kit 更新不及时,导致在当时最新的 macOS 10.15 无法配置正确的字体,同时也是为了在 Overleaf 平台自动调用 Noto CJK 字体(见 tuna/thuthesis#498)。实际上传给 ctex 的总是 fontset = none

\LoadClass[UTF8,a4paper,scheme=plain,zihao=-4,fontset=none]{ctexbook}[2017/04/01]

个人建议没必要配置 macOS 的 CI。模板在不同平台编译只有字体的差异,而 github action 的 Windows 和 macOS 又没有对应的中文字体,所以 CI 的意义不大。

from hfut_thesis.

l1teng avatar l1teng commented on June 2, 2024

Thanks for the valuable advice, we decide deprecate ci testing on macOS.

Close this issue.

from hfut_thesis.

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.