Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2024/09/03 20:25:59.812 (台灣標準時)

LuaTeX での fontspec を使ったフォントの設定の方法

LuaTeX において、 fontspec を使ったフォントの設定は、以下のように調べ ればよいようでござる。

まず The LaTeX Font Catalogue というウェブページがあるので、そこで使いたいと思っている フォントを探すでござる。

例えば、 New Computer Modern Roman を使うことを考えてみるでござる。 The LaTeX Font Catalogue で、 Serif Fonts へのリンクがあるので、それをクリックするでござる。すると、 Serif fonts の一覧が表示されるでござる。 New Computer Modern Roman へのリンクがあるので、それを探してクリックす るでござる。

Usage のところを見ると、どのようにすれば New Computer Modern Roman が 使えるようになるのかわかるでござる。以下のように書かれているでござる。


\usepackage{fontspec}
\usepackage{unicode-math}

\setmainfont[%
ItalicFont=NewCM10-Italic.otf,%
BoldFont=NewCM10-Bold.otf,%
BoldItalicFont=NewCM10-BoldItalic.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCM10-Regular.otf}

\setsansfont[%
ItalicFont=NewCMSans10-Oblique.otf,%
BoldFont=NewCMSans10-Bold.otf,%
BoldItalicFont=NewCMSans10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMSans10-Regular.otf}

\setmonofont[ItalicFont=NewCMMono10-Italic.otf,%
BoldFont=NewCMMono10-Bold.otf,%
BoldItalicFont=NewCMMono10-BoldOblique.otf,%
SmallCapsFeatures={Numbers=OldStyle}]{NewCMMono10-Regular.otf}

\setmathfont{NewCMMath-Regular.otf}

このような設定で New Computer Modern Roman を使うには、 NetBSD の場合 は、 pkgsrc で fonts/tex-newcomputermodern, math/tex-unicode-math, math/tex-lualatex-math をインストールする必要があるようでござる。



Frequently accessed files

  1. Computer___Python/20220518_0.html
  2. Computer___Network/20230726_00.html
  3. Computer___Network/20230516_00.html
  4. Computer___FreeBSD/20220621_0.html
  5. Misc___Taiwan/20240207_00.html
  6. Computer___Python/20220715_0.html
  7. Food___Taiwan/20220429_0.html
  8. Computer___Network/20230508_00.html
  9. Computer___NetBSD/20220817_3.html
  10. Computer___Python/20220410_0.html
  11. Computer___Debian/20210223_1.html
  12. Computer___Python/20210124_0.html
  13. Computer___NetBSD/20220818_1.html
  14. Computer___NetBSD/20220428_0.html
  15. Computer___Python/20221013_0.html
  16. Science___Math/20220420_0.html
  17. Computer___NetBSD/20230119_00.html
  18. Science___Astronomy/20220503_0.html
  19. Computer___TeX/20230503_00.html
  20. Computer___NetBSD/20220808_0.html
  21. Computer___Network/20240130_00.html
  22. Computer___NetBSD/20230515_00.html
  23. Computer___Network/20240416_00.html
  24. Computer___NetBSD/20240101_02.html
  25. Travel___Taiwan/20220809_2.html
  26. Computer___NetBSD/20210204_0.html
  27. Computer___Python/20220816_1.html
  28. Science___Astronomy/20220420_1.html
  29. Food___Taiwan/20230526_00.html
  30. Computer___Python/20240101_00.html


HTML file generated by Kinoshita Daisuke.