- os << "\\begin{" << floatType << "}";
- if (!floatPlacement.empty()
- && floatPlacement != floatList.defaultPlacement(floatType))
- os << "[" << floatPlacement << "]";
+ string const tmptype = (wide_ ? floatType_ + "*" : floatType_);
+ // Figure out the float placement to use.
+ // From lowest to highest:
+ // - float default placement
+ // - document wide default placement
+ // - specific float placement
+ string placement;
+ string const buf_placement = buf->params.float_placement;
+ string const def_placement = floatList.defaultPlacement(floatType_);
+ if (!floatPlacement_.empty()
+ && floatPlacement_ != def_placement) {
+ placement = floatPlacement_;
+ } else if (!buf_placement.empty()
+ && buf_placement != def_placement) {
+ placement = buf_placement;
+ }
+
+ os << "\\begin{" << tmptype << "}";
+ // We only output placement if different from the def_placement.
+ if (!placement.empty()) {
+ os << "[" << placement << "]";
+ }
+