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?

LaTeXでpng画像が出力されない(diagbox使用)

Posted at

状況

画像のchaptionは出力されており,おそらく画像が位置しているのだろうと確認できるが白抜けしている.
またコンパイルは通る.

コンパイルがそもそもエラーになる方は画像のパスなどを確認してください.

考えられる原因

1. graphicx, colorをインポートしていない

一般的な原因はこれらしいです.
なのでtexファイルの上部に

\usepackage[dvipdfmx]{color}
\usepackage[dvipdfmx]{graphicx}

を追加しましょう.一般的にはこれで解決するみたいです.
(https://qiita.com/ganyariya/items/2dcb900bb04069408e14)
を参考にしました.

2. diagboxを使用しているから

私は1番については元々できていたのに画像が出力されませんでした.色々試したらdiagboxをインポートする順番が悪かったみたいです.diagboxはLaTeX内で表を作成する際に利用していました.diagboxがgraphicxの上に来ていれば画像が出力されるみたいです.

\usepackage{diagbox}
\usepackage[dvipdfmx]{color}
\usepackage[dvipdfmx]{graphicx}

以上のような順番でインポートすれば画像が出力されるはずです.

ぼやき

インポートの順番が影響するのは結構衝撃です.他にもエラーが発生したら,こういう細かいところを確認した方がいいかもですね.皆さん卒論・修論の時期だと思ったので簡単に共有しました.

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?