0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

久しぶりに LaTeX を使いたくて、今時ならウェブサービスになってるだろうと ShareLaTeX を触り始めて気に入り始めたところ、Overleaf v2 と統合されるというお知らせが目に入りました(参考)。なので Overleaf v2 を中心に。

v2.overleaf のデフォルトは pdfLaTeX で、ドキュメントにあるように CJKutf8 パッケージを使うと、日本語が出力できます。できるのですが、しばらく使っていると、どうもフォントが気に入らない……。

実は同じドキュメントに「外部フォントが使えないので、pdflatex より XeLaTeX がおすすめ」と書かれていますし、pdflatex は避けるべしという記事も見かけました。やはり日本語を使いたい場合は、デフォルトの pdflatex から切り替えたほうがよさそうです。「コンパイラ」設定で切り替えます。選択肢がいくつかありますが、意味はこの記事を読むとよく理解できました。私は今は LuaLatex を常用するようになりました。

LuaLatex / v2.overleaf で日本語を使う例:

\documentclass[a4paper, 12pt]{article}
\usepackage{fancybox}
\usepackage{amsmath}
\usepackage{fullpage}
\setlength{\parindent}{0em}
\usepackage{luatexja-fontspec}
\setmainjfont{IPAexMincho}
\begin{document}
ほげほげ
\end{document}

See also:

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?