LoginSignup
12
4

More than 3 years have passed since last update.

LaTeX の ref で図 ?? のようになってしまうエラー

Last updated at Posted at 2019-11-17

執筆動機

日本語で解説しているサイトがすぐに見つからなかった.

問題

LaTeX を使用していて,正しいスペルで label と ref を入力しているのに,図?? となってしまう.

原因

main.log 等のログを閲覧してください.
そして,うまくいかなかった label や ref の名前でサーチしてください.
下記のようなログはありませんか?

Package caption Warning: \label without proper reference on input line 6.
See the caption package documentation for explanation.
LaTeX Warning: Reference `fig:soft_arch' on page 9 undefined on input line 21.

これは label, ref の使い方が悪いことが原因です.

解決策

キャプションは図番号を更新するため,キャプションの前にラベルを挿入してはいけません,
・キャプションの中
・キャプションの後
いずれかにラベルを挿入すべきです.

ダメな例 :

\label{hoge}
\caption{hoge}

良い例 :

\caption{hoge}
\label{hoge}

参考

12
4
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
12
4