LoginSignup
2
5

More than 3 years have passed since last update.

LaTeXでスライドを作る

Posted at

LaTeXでスライドを作る

数式が多いスライドを作るとき

  • Powerpointの数式機能を使う→見た目が美しくない
  • PowerpointにLaTeXで出力した画像を貼る→面倒だし、修正も大変

ということがあると思います。

そこで、LaTeXでスライドのpdfファイルを作る方法をご紹介します。

環境構築

TeX LiveでLaTeX環境を入れていればだいたいOKです。

テンプレ

% \documentclass[dvipdfmx, 11pt]{beamer}
\documentclass[aspectratio=169, dvipdfmx, 11pt]{beamer} % aspectratio=43, 149, 169
\usepackage{here, amsmath, latexsym, amssymb, bm, ascmac, mathtools, multicol, tcolorbox, subfig}

%デザインの選択(省略可)
\usetheme{Luebeck}
%カラーテーマの選択(省略可)
\usecolortheme{orchid}
%フォントテーマの選択(省略可)
\usefonttheme{professionalfonts}
%フレーム内のテーマの選択(省略可)
\useinnertheme{circles}
%フレーム外側のテーマの選択(省略可)
\useoutertheme{infolines}
%しおりの文字化け解消
\usepackage{atbegshi}
\ifnum 42146=\euc"A4A2
\AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}}
\else
\AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
\fi
%ナビゲーションバー非表示
\setbeamertemplate{navigation symbols}{}
%既定をゴシック体に
\renewcommand{\kanjifamilydefault}{\gtdefault}
%タイトル色
\setbeamercolor{title}{fg=structure, bg=}
%フレームタイトル色
\setbeamercolor{frametitle}{fg=structure, bg=}
%スライド番号のみ表示
%\setbeamertemplate{footline}[frame number]
%itemize
\setbeamertemplate{itemize item}{\small\raise0.5pt\hbox{$\bullet$}}
\setbeamertemplate{itemize subitem}{\tiny\raise1.5pt\hbox{$\blacktriangleright$}}
\setbeamertemplate{itemize subsubitem}{\tiny\raise1.5pt\hbox{$\bigstar$}}
% color
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\green}[1]{\textcolor{green!40!black}{#1}}
\newcommand{\blue}[1]{\textcolor{blue!80!black}{#1}}

\title[Short title]{タイトル}
\subtitle{副題}
\author[著者略称]{氏名}
\institute[所属略称]{所属}
\date{\today}

\begin{document}
\maketitle

\begin{frame}{目次}
    \tableofcontents
\end{frame}

\section{Section 1}
\begin{frame}{目次}
    \tableofcontents[currentsection]
\end{frame}

\begin{frame}{ブロック環境}
    \begin{block}{block}
    block
    \end{block}
    \begin{alertblock}{alertblock}
    alertblock
    \end{alertblock}
    \begin{exampleblock}{exampleblock}
    exampleblock
    \end{exampleblock}
    \begin{tcolorbox}[colframe=green,
    colback=green!10!white,
    colbacktitle=green!40!white,
    coltitle=black, fonttitle=\bfseries,
    title=My box]
        box contents
    \end{tcolorbox}
\end{frame}

\section{Section 2}
\begin{frame}{目次}
    \tableofcontents[currentsection]
\end{frame}

\begin{frame}{箇条書き}
    \begin{itemize}
    \item アイテム1
    \item \alert{アイテム2}
        \begin{itemize}
        \item アイテム1
        \item \alert{アイテム2}
            \begin{itemize}
            \item アイテム1
            \item \alert{アイテム2}
            \end{itemize}
        \end{itemize}
    \end{itemize}
    \[
    \bm{x}^\top\bm{y}
    \]
    \begin{enumerate}
    \item abcde
    \item \structure{ABCDE}
    \item 
    \end{enumerate}
\end{frame}

\end{document}

まずはこれをパクって出力してみるとイメージがつきやすいです。

デザインのthemeで選択しているbeamerには色々なものがあるので好みのものを使ってください。

出力

初心者用に念の為シェルのコマンドも書いておきます。

$ platex main
$ dvipdfmx main
$ evince main.pdf&

evinceはLinuxでpdfを表示します。

シェルスクリプトを用意しておくとコンパイルが楽です。

参考

2
5
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
2
5