Beamerを使ってプレゼンテーション用PDFファイルを作る 2020年5月13日

実は、プレゼンテーションに使う訳ではないのですが、 \( \LaTeX \) Beamer を使って PDFファイルを作ってみました。

と初めから腰を折るような書き出しですが、 目的は、コンピュータ(ブラウザを使って)の作業マニュアルを作るのに \( \LaTeX \) Beamer を使ったのです。



前段階では:

そして、 多数(50枚超)のスクリーンショットを貼り込み、 簡単な説明を付けて作業マニュアルを作るのが目標。 そのため、Microsoft PowerPoint を使うのが簡単ではあるのですが、 面倒でもある。

Microsoft PowerPoint は繰り返し作業のバッチ処理の仕組みは簡単ではない。 簡単ではないと書いてはみたものの、出来るのかどうかさえ知らない VBA(Visual Basic for Applications)を使ったマクロを作成すると、 もしかしたら出来るのかもしれないけれども、 マイクロソフトの製品にそれほと入れ込む必要はないので……。
という状況でした。

だったら、\( \LaTeX \) を使えばいい。
そこで、Beamer の登場です。

Beamer とは

CTAN の Beamer のところ には、 A \( \LaTeX \) class for producing presentations and slides とあります。つまり、
\( \LaTeX \) を使って プレンゼンテーション用ポスターやスライドを作るクラス

使い慣れた*1 \( \LaTeX \) でスライド(PDFファイル)が作れるのがメリットです。

TeX Live には元から入っているので、そのまま使えます。 が、テーマを使うと面白いスライドが作れるかもしれません。
ということで、今回は内部利用でもあるので、 ちょっとかわいらしいテーマ (こんな感じ↓のスライドが作れる)を使ってみました。
filetest.pdf

公式ユーザガイドは↓*2
http://tug.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf

テーマ

デフォルトのテーマは、 都市名(ベースのテーマ)と動物名(色合い)の組合せで 選ぶことができます。 サンプルは例えばこちら↓
https://hartwork.org/beamer-theme-matrix/

\usetheme{Madrid}  
\usecolortheme{crane} 

のような感じで。ほかにも色々指定できるらしい。

今回は、Kazuki Maeda (aka kmaeda) さん作成の kmbeamer (Beamer theme collection for kmaeda) の中の NoteBook を使ってみました。

https://github.com/kmaed/kmbeamer からコードをダンロードし(zipファイルとして全て)、解凍後、

/usr/share/texmf-dist/tex/latex ← cygwin で、です

にディレクトリ(kmbeamer-master)毎コピー。

https://texwiki.texjp.org/?TeX のディレクトリ構成 に従って

$ mktexlsr

これにてインストール完了。(一体何年振りにこんなことをしたんだろう……)

プリアンブルに

\usetheme{Notebook} % kmbeamer (Beamer theme collection for kmaeda)

と書けばおっけい

残念ながら、kmbeamer NoteBook は 16:9 ではなく 4:3 です。

LaTeX source file

\( \LaTeX \) source file の本体部分の書き方の作法は、
1枚のスライドは \begin{frame} と \ end{frame} で囲む
(本当は バックスラッシュと end の間には空白は不要ですが、 pukiwiki がヘンなことをするので入れています)

ほかは、だいたいの \( \LaTeX \) の技法が使えます。 とはいえ、制限というか、癖はあるようです。

スライドを左右のふたつに書き込む

columns/column を使う
ふたつ以上にも対応できますが、とりあえずは、ふたつで十分かと

\begin{columns}[T] % ← T は上が揃うようです
 \begin{column}{0.7\textwidth}
  \includegraphics[width=\textwidth]{○○.png}
 \end{column}
 \begin{column}{0.28\textwidth}
  こんなことや\\
  あんなことをやってみる
 \end{column}
\end{columns}

タイトル

\title{スライドを作ってみた} 
\subtitle{パワーポイントではないぞ}
\author[Tomaru Masatoshi]{都丸雅敏}
\institute{ショウジョウバエ遺伝資源研究部門}

テーマによっては色々なところにこの情報が利用されるようです。

\begin{frame}
\titlepage 
% \maketitleに替わるタイトル情報
\end{frame}
% https://www.isc.meiji.ac.jp/~mizutani/tex/link_slide/beamer.html

目次

\begin{frame}{目次}
\tableofcontents
\end{frame}
% http://math.shinshu-u.ac.jp/~hanaki/beamer/beamer.html

目次には、\section{見出し1} の内容が集められます。
これは、\begin{frame}{○○} の前に配置すると、 それ以降の見出しとして (テーマにもよるようですが)各スライドに表示もされます。

\section{中身がない見出し}
\begin{frame}
中身がない
\end{frame}

source file サンプル

\documentclass[dvipdfmx]{beamer}
%\documentclass[dvipdfmx,12pt]{beamer}
%\documentclass[dvipdfmx,12pt,aspectratio=169]{beamer}
% aspectratio=169 で 16:9 これを入れないと 4:3 
\usepackage{pxjahyper}%しおりの文字化けを防ぐ
\usetheme{Notebook} % kmbeamer (Beamer theme collection for kmaeda)
% aspectratio=169 に対応していない!
%\usetheme{Madrid}  
%\usecolortheme{crane}
%\beamerdefaultoverlayspecification{<+->}% 箇条書きを段階的にみせたいとき
%\setbeamercovered{transparent}%隠してるアイテムを半透明で表示
\renewcommand{\kanjifamilydefault}{\gtdefault}%日本語フォントをゴシックに
\usepackage{graphicx}% 各種画像の張り込み
\usepackage{amsmath,amssymb}%標準数式表現を拡大する
% https://www.isc.meiji.ac.jp/~mizutani/tex/link_slide/beamer.html
%
% san serif 体の指定
% I(大文字のアイ)、l(小文字のエル)、1(数字のイチ)が区別できるもの!
%
% Chivo Regular
%\usepackage[regular]{Chivo} 
% カーブに癖がある
%
% GoSans  
\usepackage{GoSans} 
% ゼロに斜線が入る
%
\usepackage[T1]{fontenc}
%
\usepackage{hyperref}
\hypersetup{%
 colorlinks=true,% 
 citecolor=blue,% % default = green
 linkcolor=blue,% % default = red % footnote へのリンクもこれで指定
 urlcolor=blue% % default = magenta 
}
% ハイパーリンクが作成される
% http://www.ic.daito.ac.jp/~mizutani/tex/link_slide/hyperlink.html
% https://texwiki.texjp.org/?hyperref
%
\setbeamertemplate{navigation symbols}{}
% 下の方にある変なアイコン(ナビゲーションシンボル)を消す
% https://www.opt.mist.i.u-tokyo.ac.jp/~tasuku/beamer.html
%
%\setbeamertemplate{footline}[frame number]
% フッターをスライド番号だけにする
% https://www.opt.mist.i.u-tokyo.ac.jp/~tasuku/beamer.html
% テーマによっては出ない
% テーマ NoteBook ではデフォルトで右上に ○/○ 表示されるので設定不要
%
\title{ショウジョウバエ遺伝資源研究部門\\ウェブサイト記事追加方法}
\title{スライドを作ってみた} 
\subtitle{パワーポイントではないぞ}
\author[Tomaru Masatoshi]{都丸雅敏}
\institute{ショウジョウバエ遺伝資源研究部門}
\date{\today}
%
\begin{document}
%
\begin{frame}
\titlepage 
% \maketitleに替わるタイトル情報
\end{frame}
% https://www.isc.meiji.ac.jp/~mizutani/tex/link_slide/beamer.html
%
\begin{frame}{目次}
\tableofcontents
\end{frame}
% http://math.shinshu-u.ac.jp/~hanaki/beamer/beamer.html
%
\section{中身がない見出し}
\begin{frame}
中身がない
\end{frame}
%
\begin{frame}
やっぱり中身がない
\end{frame}
%
\section{まだまだ中身がない見出し}
\begin{frame}
中身がなくていいのだろうか
\end{frame}
%
\begin{frame}
中身はないものなのだ
\end{frame}
%
 \begin{frame}
\begin{columns}[T] % ← T は上が揃うようです
 \begin{column}{0.7\textwidth}
  \includegraphics[width=\textwidth]{○○.png}
 \end{column}
 \begin{column}{0.28\textwidth}
  こんなことや\\
  あんなことをやってみる
 \end{column}
\end{columns}
\end{frame}
%
\end{document}

↓は、上の \( \LaTeX \) source file から作った PDFファイル
filetest.pdf

参考サイト

Beamer

LaTeX

Today:1Yesterday:6Total:8854 since 13 May 2020

*1 え!、あなたは使い慣れてはいないですって?!
*2 長い……

添付ファイル: filetest.pdf 1277件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 13 May 2020 (水) 22:36:32 (1443d)