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?

Beamerのテーマをカスタマイズする方法

Posted at

beamerを使ってスライドを作る際に様々なテーマが配布されており、自分好みのものをインストールして扱うことができる。
今までは、ちょっとしたところをいじる際にスライドのソースコードに直接設定していたが、細かい変更部分が多くなると、ソースコードが見づらくなるため、ダウンロードしたテーマのstyファイルを直接編集を行うことで改善したいと思う。

なお、扱うlatexのエンジンとしてはLuaLatexとして進めていく。

テーマのインストール

今回はFocusというシンプルなテーマを例として行う。まずはgithubからcloneを下記で行う。

git clone https://github.com/pcafrica/focus-beamertheme

ファイルの移動

インストールしたファイルの中でstyファイルのものをlatexのディレクトに移動させる。ここで、Latexのコマンドラインツールであるkpsewhichを使うことでディレクトリやパスを確認できる。以下のコマンドでLualatexが参照する検索パスを確認できる。

kpsewhich -var-value TEXMFHOME

以下のコマンドの出力のフォルダへファイルを移動させる。

~/texmf/tex/latex/beamer/beamerthemefocus-modify.sty

最終的には以下のような構造になります。

~/texmf/tex/latex/beamer/focus-modify$ tree
.
├── beamercolorthemefocus-modify.sty
├── beamerfontthemefocus-modify.sty
├── beamerinnerthemefocus-modify.sty
├── beamerouterthemefocus-modify.sty
└── beamerthemefocus-modify.sty

ファイルが認識されているか確認。ファイルのフルパスが表示されれば、LuaLatexが認識できています。

kpsewhich "移動したstyファイル名"

ファイルデータベースの更新

ファイルを適切な場所に移動したら、データベースを更新します。

texhash ~/texmf

これで直接インストールしたstyファイルを編集することでスタイルや自作のブロックなどを追加することができます

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?