I want to write a class for a thesis and I get stuck when defining the
figure environment. I used the book class as basis and the goal is to
have all figure environments centred.
I have tried this:
\renewenvironment{figure}
{\@float{figure} \centering}
{\end@float}
but now the argument [htb] used to give a hint on the figure position
is not taken into account any more.
Any idea?
Thank you
The trick is not to redefine figure but to mess with some internals.
\let\orig@floatboxreset\@floatboxreset
\def\@floatboxreset{%
\centering
\orig@floatboxreset
}
(If the floatrow package is going to be used, instead use its
objectset=centering setting.)
--
Joseph Wright
> On Oct 29, 8:19ÔøΩam, Lynda Metref <lynda.met...@gmail.com> wrote:
> > Hello,
> >
> > I want to write a class for a thesis and I get stuck when defining the
> > figure environment. I used the book class as basis and the goal is to
> > have all figure environments centred.
> >
> > I have tried this:
> > \renewenvironment{figure}
> > ÔøΩ ÔøΩ ÔøΩ ÔøΩ {\@float{figure} \centering}
> > ÔøΩ ÔøΩ ÔøΩ ÔøΩ {\end@float}
> > but now the argument [htb] used to give a hint on the figure position
> > is not taken into account any more.
> >
> > Any idea?
> >
> > Thank you
>
> The trick is not to redefine figure but to mess with some internals.
>
> \let\orig@floatboxreset\@floatboxreset
> \def\@floatboxreset{%
> \centering
> \orig@floatboxreset
> }
It's easier with
\g@addto@macro\@floatboxreset{\centering}
which is mostly equivalent to your solution, but avoids a new
command. I'd put \centering last anyway, after \@setminipage,
but I don't actually know if this makes a difference. :)
Both approaches have the drawback that also table environments
will be centered.
Ciao
Enrico
I'd call that a good thing :-)
--
Joseph Wright
On Oct 29, 10:46 am, Joseph Wright <joseph.wri...@morningstar2.co.uk>
wrote:
> On Oct 29, 9:10ÔøΩam, Enrico Gregorio <grego...@math.unipd.it> wrote:
> > Both approaches have the drawback that also table environments
> > will be centered.
> >
> > Ciao
> > Enrico
>
> I'd call that a good thing :-)
One never knows what self-made publishers like to do. :)
Ciao
Enrico