Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
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 '10 at 12:23

2 Answers 2

up vote 11 down vote accepted

Some lines in the preamble should do the trick.

\makeatletter
\renewcommand{\fps@figure}{!ht}
\renewcommand{\fps@table}{!ht}
\makeatother
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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