我想要一个覆盖整个页面的浮动,但里面有一个表格和两个图形。来自https://tex.stackexchange.com/a/111121我认为(没有双关语缩进)我需要写(使用标题和子标题包)
\documentclass[english]{llncs}
\RequirePackage{etoolbox}
\RequirePackage{xpatch}
\RequirePackage[T1]{fontenc}
\RequirePackage[utf8]{inputenc}
\RequirePackage[allowlitunits]{siunitx}
\makeatletter
\@ifpackageloaded{xcolor}{}{\RequirePackage[usenames,dvipsnames,svgnames,table]{xcolor}}
\makeatother
\RequirePackage[demo]{graphicx}
\RequirePackage{caption}
\captionsetup[figure]{labelfont={bf},name={Fig.},labelsep=period,font={small}}
\captionsetup[table]{labelfont={bf},name={Table},labelsep=period,font={small}}
\RequirePackage[labelfont={bf},name={Fig.},labelsep=period,font={small}]{subcaption}
\begin{document}
\newcolumntype{Z}{S[
table-format=1.3,
round-mode=places,
round-precision=3]}
\begin{figure}[p]
\centering
\captionof{table}{My table text}
\label{tab:nmi}
\setlength\tabcolsep{5pt}
\begin{tabular}{lll}
this & and & that
\end{tabular}\vspace{3mm}
\includegraphics [width=\textwidth] {fig1.pdf}
\captionof{figure}{My fig 1 text}
\label{fig:nmi_alldatasets}
\includegraphics [width=\textwidth] {fig2.pdf}
\caption{figure}{My fig 2 text}
\label{fig:nmi1_perdataset}
\end{figure}
\end{document}
(请访问ftp://ftp.springernature.com/cs-proceeding/llncs/llncs2e.zip)
但现在我收到了警告
在输入行 27,标题类型已设置为“figure”(caption)
在输入行 36,标题类型已设置为“table”(caption)
否则这正是我想要的。我该怎么办?
答案1
springer 类有自己的标题处理。定义一个\captionof
不需要包的:
\documentclass[english]{llncs}
\usepackage[demo]{graphicx}
\makeatletter
\def\captionof#1{%
\begingroup
\def\@captype{#1}%
\@ifnextchar[\captionof@i{\captionof@ii}}
\def\captionof@i[#1]#2{\caption[#1]{#2}\endgroup}
\def\captionof@ii#1{\caption{#1}\endgroup}
\makeatother
\begin{document}
\begin{figure}
\centering
\captionof{table}{My table text}\label{tab:nmi}
\begin{tabular}{lll}
this & and & that
\end{tabular}
\bigskip
\includegraphics[width=\linewidth]{fig1.pdf}
\caption{My fig 1 text}\label{fig:nmi_alldatasets}
\bigskip
\includegraphics[width=\linewidth]{fig2.pdf}
\caption{My fig 2 text}\label{fig:nmil_perdatasets}
\end{figure}
\end{document}
如果在图形或表格环境中使用,它可以是一个简单的定义总是 \captionof
而不是混合\caption
和\captionof