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

LaTeXで文章中に図を回り込ませるwrapfigの使い方

Last updated at Posted at 2024-11-26

はじめに

文章の途中に図を挿入し、テキストをその周囲に回り込ませたい場合は、wrapfigパッケージを使用する。これにより、本文中に自然に図を配置できる。
以下をプリアンブルに記述しておく。

\usepackage{wrapfig}

基本構文

wrapfigure環境は次のように記述する。

\begin{wrapfigure}[行数]{lまたはr}{幅}
  ...
\end{wrapfigure}
  • 行数:図の高さに対応するおおよその行数
  • lまたはr:図を左寄せ(left)または右寄せ(right)に配置
  • :図の幅

実装例

吾輩は猫である。名前はまだ無い。

\begin{wrapfigure}[5]{r}{8zw}
  \centering
  \vspace{-\intextsep}
  \includegraphics[width=25mm]{figure.pdf}
\end{wrapfigure}

どこで生れたかとんと見当がつかぬ。何でも薄暗い〜

このようにすることで、右側に小さな図が配置され、文章が自然に回り込む。
\vspace{-\intextsep}は、図と本文の上端をそろえるために用いる。これを入れることで、図の上にできる不要な余白が減り、全体の見た目が整う。

なお、wrapfigureは段落内に記述する必要があるため、空行を入れると正しく回り込まなくなる場合がある。配置が崩れる場合は、段落構成を確認しよう。

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