我正在使用 TexStudio 2.12.6 和 MiKteX 2.9.6100
\documentclass[11pt,a4paper,fleqn]{article}
\usepackage[T1]{fontenc}% Must be loaded for proper fontencoding when using pdfLaTeX
\usepackage[utf8]{inputenc}
\input{ix-utf8enc.dfu}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage{makeidx}
\usepackage[pdftex]{graphicx}
\usepackage{lscape}
\usepackage{natbib}
\usepackage{dsfont}
\usepackage{gensymb}
\usepackage{textcomp}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[titletoc]{appendix}
\usepackage{xcolor}
\usepackage[colorlinks]{hyperref}
\usepackage{cleveref}
\usepackage{longtable}
\usepackage{multirow}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{array}
\usepackage{siunitx}
\usepackage{tipa}
\usepackage{fancyref}
\usepackage{fixltx2e}
\usepackage{subcaption}
\newcommand\rd{\mathrm{d}}
\begin{document}
\begin{figure}[h]
\centering
\subcaptionbox{Socio--political instability and Inflation -- average over time}
{\includegraphics[height=60mm, width=60mm]{spi_inflation_ave_t2.pdf}
\subcaptionbox{Socio--political instability and Inflation -- average over countries}
{\includegraphics[height=60mm, width=60mm]{spi_inflation_ave_i.pdf}
\caption{SPI vs CPI}
\label{fig:fig1}
\end{figure}
\end{document}
這給我「掃描 \caption@iiibox 的使用時文件結束」。錯誤以及“2015 年之後的版本不需要 fixltx2e(fixltx2e) 所有修復現在都在 LaTeX 內核中。”警告。
雖然對 LaTeX 不陌生,但我對程式設計不熟悉,也不知道問題出在哪裡。即使我取消註釋“fixltx2e”包,我仍然收到錯誤並且沒有 pdf 編譯。
答案1
你的 es 沒有右大括號\subcaptionbox
:
\begin{figure}[h]
\centering
\subcaptionbox{Socio--political instability and Inflation -- average over time}
{\includegraphics[height=60mm, width=60mm]{spi_inflation_ave_t2.pdf}}
\subcaptionbox{Socio--political instability and Inflation -- average over countries}
{\includegraphics[height=60mm, width=60mm]{spi_inflation_ave_i.pdf}}
\caption{SPI vs CPI}
\label{fig:fig1}
\end{figure}
是的,您可以fixltx2e
從您的集合中刪除\usepackage
。
雖然這不是當前的問題(從表面上看),但您應該考慮加載hyperref
你的序言已經很晚了。看hyperref
哪些包應該在之後而不是之前加載?