【问题标题】:Latex: warning with caption乳胶:带有标题的警告
【发布时间】:2021-11-05 17:44:56
【问题描述】:

我在 Overleaf 上使用以下设置:

\documentclass[%
 aip,
 jmp,%
 amsmath,amssymb,
%preprint,%
 reprint,%
 nofootinbib,
 nobibnotes,
%author-year,%
%author-numerical,%
10pt
]{revtex4-2}

\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage{tabularx}

\usepackage[a4paper, total={6.5in, 9in}]{geometry}

\usepackage{microtype}
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
\usepackage{bm}
\usepackage{amsbsy}
\usepackage{fixmath}
\usepackage{commath}
\usepackage{float}
\usepackage{siunitx} % notazione \num{e-}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{xcolor}
%\usepackage{subcaption}

\usepackage{hyperref}

\usepackage{curve2e}
%\usepackage{caption}
\usepackage{subcaption}
%\usepackage{silence}
%\WarningFilter{caption}{Unsupported document class}
%\usepackage[center]{subfigure}
\usepackage{comment}
%\usepackage[mathlines]{lineno}% Enable numbering of text and display math
%\linenumbers\relax % Commence numbering lines

我收到以下警告:

Package caption Warning: Unknown document class (or package), standard defaults will be used. See the caption package documentation for explanation.

问题是我已经评论了标题包(它应该不再处于活动状态),试图用 subcaption 替换它。

有没有办法解决这个警告?

【问题讨论】:

    标签: latex caption


    【解决方案1】:

    subcaption 自动加载caption 包。如果您也删除此软件包,警告就会消失:

    \documentclass[%
     aip,
     jmp,%
     amsmath,amssymb,
    %preprint,%
     reprint,%
     nofootinbib,
     nobibnotes,
    %author-year,%
    %author-numerical,%
    10pt
    ]{revtex4-2}
    
    \usepackage{graphicx}% Include figure files
    \usepackage{dcolumn}% Align table columns on decimal point
    \usepackage{bm}% bold math
    \usepackage{tabularx}
    
    \usepackage[a4paper, total={6.5in, 9in}]{geometry}
    
    \usepackage{microtype}
    \usepackage[english]{babel}
    \usepackage[utf8]{inputenx}
    \usepackage{bm}
    \usepackage{amsbsy}
    \usepackage{fixmath}
    \usepackage{commath}
    \usepackage{float}
    \usepackage{siunitx} % notazione \num{e-}
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{xcolor}
    %\usepackage{subcaption}
    
    \usepackage{hyperref}
    
    \usepackage{curve2e}
    %\usepackage{caption}
    %\usepackage{subcaption}
    %\usepackage{silence}
    %\WarningFilter{caption}{Unsupported document class}
    %\usepackage[center]{subfigure}
    \usepackage{comment}
    %\usepackage[mathlines]{lineno}% Enable numbering of text and display math
    %\linenumbers\relax % Commence numbering lines
    
    
    \begin{document}
    content...
    \end{document}
    

    【讨论】:

    • 但是如果我需要 subcaption 包来为 subfigure 环境绘制字幕呢?
    • @PWillms 然后要么接受警告,要么使用标题包已知的文档类
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多