3

I finally found a case where adding ! to a float actually did something. Specifically, it allowed a fourth top float to appear on a page (with topnumber=3).

So, is that it?

\documentclass{article}
%\setcounter{topnumber}{4}

\makeatletter
\newcommand{\bitflags}{\def\showbitflag{\space\number\count}%
  \let\@elt=\showbitflag
  \@toplist}
\makeatother

\begin{document}
\begin{figure}[t]
\caption{created first}
\end{figure}

\begin{table}[t]
\caption{created second}
\end{table}

\begin{figure}[t!]
\caption{created third}
\end{figure}

\begin{table}[t!]
\caption{created fourth}
\end{table}

{\bitflags}
\end{document}
3

Normally a top [t] float is only added if some numeric constraints such as topnumber (the number of floats allowed at top of a page) are not violated. The ! tells latex to ignore these constraints (that is, for this one float act as if they had their most permissive values)

0

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.