0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LuaLaTeXでフォントをいじる。

Last updated at Posted at 2024-09-24

はじめに

メモ書き程度なのであまり重要視しないでください。

フォントの更新とリスト

fonts_list.txt にフォント名のリストを生成します。

# データベースの更新
$ luaotfload-tool --update

# インストールされているフォントの一覧を出す
$ luaotfload-tool --list=* > fonts_list.txt

使い方

游書体とTimes New RomanとArialで組んでみましょう。

\documentclass[fontsize=10.5bp]{jlreq}

\usepackage{luatexja-fontspec}
\setmainjfont[BoldFont=Yu Gothic Bold]{Yu Mincho Regular}
\setmainfont[BoldFont=Arial]{Times New Roman}
\setsansjfont{Yu Gothic Bold}
\setsansfont{Arial}

\begin{document}

\section{はじめに}
テストだよ~

\end{document}

なぜこうなるか

和文は伝統的に本文と題名は明朝体で、章題と強調はゴシック体で組まれます。そのときセリフ体とサンセリフ体を合わせて組むとこうなります。setmainjfontBoldFont は本文の強調書体、setsansjfont は章題の書体になります。

コンパイル

main.tex ファイルがあったら、以下のようにコンパイルします。

$ latexmk -lualatex main

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?