3

In the two-column layout of iosart2c, the very next "table" after a "table*" will have its caption incorrectly flow into the second column, thus overlapping with the text there. Is this a known limitation or a bug? How can I correctly confine the caption?

Minimal Working Example for the table caption overflow bug.

\documentclass{iosart2c}

\begin{document}
\begin{table*}
\caption{This table will make the next one overflow.}
\end{table*}

\begin{table}
\caption{This caption should be broken into a single column but won't as it runs into the second column.}
\end{table}

Some text to show that we indeed have two column layout and that it overlaps.
\end{document}
2

I'm not sure why the class does a questionable definition of \@maketablecaption; fixing it and fixing also table and table*, the result is what's expected.

\documentclass{iosart2c}
\usepackage{lipsum}

\makeatletter
\long\def\@maketablecaption#1#2{%
  \begingroup
  \sbox\@tempboxa{\footnotesize #2}%
  \centering
  {\footnotesize#1\par}%
  \ifdim \wd\@tempboxa>\tablewidth
    \parbox[t]{\tablewidth}{%
      \footnotesize%
      #2\vphantom{Ay}\par
    }%
  \else
    \mbox{\box\@tempboxa\vphantom{Ay}}%
  \fi
  \vskip\belowcaptionskip
  \endgroup
}
\renewenvironment{table}
  {\let\@makecaption\@maketablecaption
   \tablewidth=\columnwidth
   \let\@floatboxreset\@tableboxreset\@float{table}}
  {\end@float}
\renewenvironment{table*}
  {\let\@makecaption\@maketablecaption%
   \tablewidth=\textwidth
   \let\@floatboxreset\@tableboxreset\@dblfloat{table}}
  {\end@dblfloat}
\makeatother


\begin{document}

\lipsum[1]

\begin{table*}
\caption{This table will make the next one overflow.}
\end{table*}

\begin{table*}
\caption{This table will make the next one overflow. This table will make the next one overflow.
  This table will make the next one overflow.}
\end{table*}

\lipsum[2-3]

\begin{table}
\caption{This caption should be broken into a single column but won't as it runs into the second column.}
\end{table}

\lipsum

\end{document}

enter image description here

0

I found a quick fix. Use \hbox inside the caption. \hbox make the text to span across the table width --- addresses the later issue. Use multiple \hbox in chain to manually split the legend --- solution for former issue.

\begin{table*}[!t]
\caption{\hbox{The table shows the number of words in the master file --- selected based on} \hbox{along with their letter count}\label{xyz} }
.
.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.