tuna / thuthesis

LaTeX Thesis Template for Tsinghua University
https://www.ctan.org/pkg/thuthesis
LaTeX Project Public License v1.3c
4.58k stars 1.08k forks source link

在mac环境下编译,\textsc无法实现小型大写 #784

Closed qinyuxian closed 2 years ago

qinyuxian commented 2 years ago

目前使用的版本是7.2.3,在mac环境下编译,\textsc不起作用。在overleaf上没问题。 请问有什么方法可以解决?这个比较重要,涉及的符号要求比较严格。论文即将上传,非常着急。万分感谢。

zepinglee commented 2 years ago

macOS 的 Times New Roman 字体版本比较旧,没有 small caps 的 feature。你可以调用 windows 的字体。

qinyuxian commented 2 years ago

我手上没windows电脑。还进不了学校。

zepinglee commented 2 years ago

如果有 mac 版 Microsoft Word,可以把 /Applications/Microsoft Word.app/Contents/Resources/DFonts/times*.ttf 拷贝一份到 ~/Library/Fonts;或者在 TeX 文档中设置

\setmainfont{Times New Roman}[Path = /Applications/Microsoft Word.app/Contents/Resources/DFonts/]
\setsansfont{Arial}[Path = /Applications/Microsoft Word.app/Contents/Resources/DFonts/]

如果没有 Microsoft Word 就只能使用 Times 的克隆版 TeX Gyre Termes 了(\thusetup{font = termes}),也就是 Overleaf 上编译使用的字体。

qinyuxian commented 2 years ago

明明安装有word,但是报错。 Package fontspec Error: The font "Times New Roman" cannot be found. ...soft Word.app/Contents/Resources/DFonts/]

stone-zeng commented 2 years ago

先看看这个路径对不对,然后去这个路径下看看是不是有字体、字体名对不对(似乎此处应该填文件名?)

qinyuxian commented 2 years ago

ls /Applications/Microsoft\ Word.app/Contents/Resources/DFonts

有一堆的.ttf

yzlnew commented 2 years ago

ls /Applications/Microsoft\ Word.app/Contents/Resources/DFonts

有一堆的.ttf

参考这个链接,可以试试文件名调用

qinyuxian commented 2 years ago

Package fontspec Error: The font "Times New Roman" cannot be found. }

qinyuxian commented 2 years ago

\setmainfont{Times}[Path = /Applications/Microsoft Word.app/Contents/Resources/DFonts/] \setsansfont{Arial}[Path = /Applications/Microsoft Word.app/Contents/Resources/DFonts/]

改成这样,但是又出不了斜体了。

zepinglee commented 2 years ago

我的失误,应该用字体文件名的。

\setmainfont{times}[
  Path           = /Applications/Microsoft Word.app/Contents/Resources/DFonts/,
  Extension      = .ttf,
  BoldFont       = *bd,
  ItalicFont     = *i,
  BoldItalicFont = *bi,
]
\setsansfont{arial}[
  Path           = /Applications/Microsoft Word.app/Contents/Resources/DFonts/,
  Extension      = .ttf,
  BoldFont       = *bd,
  ItalicFont     = *i,
  BoldItalicFont = *bi,
]