22

I have a document with many floats (figures, specifically). I want to be able to change the global floats positioning policy from htbp to just h (or even H with the floats package). For my-own reasons, I don't want to do this by appending the [h] argument to each float env.

One option that I can think of is using a macro:

\newcommand{\mypos}{h} % or htbp
\begin{figure}[\mypos]...

I also prefer not to do that - It is cumbersome.

Is there a way to set the global float positioning argument globally?

1
  • 3
    If you accept an answer, it would be nice to also upvote it. (This is also true for my answer to your question abour listings and subfigure. ;-))
    – lockstep
    Dec 3, 2010 at 12:23

2 Answers 2

20

Some lines in the preamble should do the trick.

\makeatletter
\renewcommand{\fps@figure}{!ht}
\renewcommand{\fps@table}{!ht}
\makeatother
7

You may use the floatrow package and its \floatplacement macro:

\usepackage{floatrow}
\floatplacement{figure}{!ht}
\floatplacement{table}{!ht}

Example:

\documentclass{article}

\usepackage{floatrow}
\floatplacement{figure}{!ht}

\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{figure}
% \centering% default with "floatrow"
\rule{1cm}{1cm}
\caption{A figure}
\end{figure}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .