【问题标题】:LATEX skips numbers in numbering when putting several figures in the same figure environmentLATEX 在同一图形环境中放置多个图形时会跳过编号
【发布时间】:2014-10-29 09:15:51
【问题描述】:

这是我正在使用的包:

\documentclass[twocolumn,showpacs,preprintnumbers,amsmath,amssymb,superscriptaddress]{revtex4}
\usepackage{graphicx}
\usepackage{bm} 
\usepackage{subcaption}
\usepackage{SIunits} 
\captionsetup{justification=raggedright, singlelinecheck=false}
\bibliographystyle{approve}  

为了将两个图形并排放置,即使使用 twocolumn 选项,也要使用页面的全宽,我使用以下语法:

\begin{figure*}
\centering
    \begin{subfigure}[b]{0.5\textwidth}
            \includegraphics[width=\textwidth]{mfploglog_A.eps}
    \end{subfigure}%
    \begin{subfigure}[b]{0.5\textwidth}
            \includegraphics[width=\textwidth]{mfploglog.eps}
    \end{subfigure}
    \caption{XXX}\protect\label{Eloglog}
\end{figure*}   

问题是使用这个编号是不正确的。对于每个图形,都会跳过一个数字,就好像子图形环境将其计为一个图形一样。例如,如果我在代码中只输入这个数字,它将被标记为数字 2。

有人遇到过这种问题吗?

【问题讨论】:

    标签: latex figure


    【解决方案1】:

    不要将caption package(或subcaption)与revtex4-1 一起使用。您会在.log 中注意到包和类之间存在兼容性问题。相反,使用subfigure 环境将两个图像并排放置在同一个figure* 而不中:

    \documentclass[twocolumn,showpacs,preprintnumbers]{revtex4-1}
    
    \usepackage{graphicx}
    
    \begin{document}
    
    \begin{figure*}
      \centering
      \includegraphics[width=.3333\linewidth]{example-image-a} \qquad
      \includegraphics[width=.3333\linewidth]{example-image-b}
      \caption{XXX}
    \end{figure*}
    
    \end{document}
    

    如果您想为子图添加标题,请将构造设置在 tabular 内并手动枚举它们:

    \documentclass[twocolumn,showpacs,preprintnumbers]{revtex4-1}
    
    \usepackage{graphicx}
    
    \begin{document}
    
    \begin{figure*}
      \centering
      \begin{tabular}{c @{\qquad} c }
        \includegraphics[width=.3333\linewidth]{example-image-a} &
        \includegraphics[width=.3333\linewidth]{example-image-b} \\
        \small (a) Left & \small (b) Right
      \end{tabular}
      \caption{XXX}
    \end{figure*}
    
    \end{document}
    

    【讨论】:

    • 但是如果你想要每个子图上的标题怎么办?我有 3 个数字,每个数字都有子图。它们在我的文档中显示为图 1、3 和 5,而不是图 1、2 和 3。
    猜你喜欢
    • 1970-01-01
    • 2011-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-12
    • 2020-10-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多