我正在写一篇论文,其中需要使用 ifacconf.cls 文档类。我似乎无法强制我的图表有中心标题。我试过:
\usepackage[justification=centering]{caption}
或者
\begin{figure*}
\centering
\includegraphics...
\caption{caption}
\end{figure}
链接到 ifacconf.cls:https://www.ifac-control.org/Members/juanp/drafts/ifacconf_latex.zip
提前致谢。
答案1
代码中有一条注释,说明它以一行标题为中心,但事实并非如此。
\documentclass{ifacconf}
\usepackage{natbib}
\makeatletter
\long\def\@makefigurecaption#1#2{\@figurecaptionsize
\vskip \@overcaptionskip
\setbox\@tempboxa\hbox{#1. #2}
\ifdim \wd\@tempboxa >\hsize % IF longer than one line THEN
\unhbox\@tempboxa\par % set as justified paragraph
\else % ELSE
\global \@minipagefalse
\hbox to\hsize{\hfil\unhbox\@tempboxa\hfil}% center single line. %make this comment true
\fi}
\makeatletter
\begin{document}
\begin{figure}
\centering
\rule{2cm}{2cm}
\caption{Zzz zzz zzz}
\end{figure}
\end{document}