On Sep 12, 2012, at 9:21 AM, Rainer M Krug wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 12/09/12 15:15, Rainer M Krug wrote:
>> On 12/09/12 14:19, Stephen Buonopane wrote:
>>> You can add something like this to your preamble (does not affect how they
>>> appear in LyX
>>> preview of course)…
>>
>>> \renewenvironment{figure}[1][]{ \@float{figure} \centering \singlespacing}
>>> {\end@float}
>>> \renewenvironment{table}[1][]{ \@float{table} \centering \singlespacing}
>>> {\end@float}
>>
>> Now this is a neat idea - haven't thought about that. Saves me quite some
>> work.
>
> But I was to fast. I get an error:
>
> ! Undefined control sequence.
> \\figure ...at {figure} \centering \singlespacing
>
> l.177 \begin{figure}[H]
>
> The control sequence at the end of the top line
> of your error message was never \def'ed. If you have
> misspelled it (e.g., `\hobx'), type `I' and the correct
> spelling (e.g., `I\hbox'). Otherwise just continue,
> and I'll forget about whatever was undefined.
>
> Any suggestions?
>
> Rainer
>
I have not used it recently, but I get the same error you do.
I copied it from Herbert Voss' tips and tricks page many years ago.
It worked then, but I am not sure what has changed.
Actually…it looks like the /singlespacing command is causing the problem.
Delete that and the centering still works.
Steve
>>
>> Thanks,
>>
>> Rainer
>>
>>
>>> On Sep 12, 2012, at 7:23 AM, Liviu Andronic wrote:
>>
>>>> On Wed, Sep 12, 2012 at 12:58 PM, Rainer M Krug <[email protected]> wrote:
>>>>> There are (at least) two ways of centering a single figure / graphic
>>>>> horizontally in a
>>>>> figure float:
>>>>>
>>>>> 1) using paragrahh properties - alignment - center
>>>>>
>>>> I'm no expert, but this is what I usually do. And to me this seems the
>>>> less hacky
>>>> approach.
>>>>
>>>> Liviu
>>>>
>>>>
>>>>> 2) using a \hfill left and right of the figure
>>>>>
>>>>> What is the better / more robust / more LaTeX way of doing this?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Rainer
>>>>>
>>>>> - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
>>>>> Biology, UCT),
>>>>> Dipl. Phys. (Germany)
>>>>>
>>>>> Centre of Excellence for Invasion Biology Stellenbosch University South
>>>>> Africa
>>>>>
>>>>> Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax
>>>>> : +33 -
>>>>> (0)9 58 10 27 44
>>>>>
>>>>> Fax (D): +49 - (0)3 21 21 25 22 44
>>>>>
>>>>> email: [email protected]
>>>>>
>>>>> Skype: RMkrug
>
>>
>
> - --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
> UCT), Dipl. Phys.
> (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel : +33 - (0)9 53 10 27 44
> Cell: +33 - (0)6 85 62 59 98
> Fax : +33 - (0)9 58 10 27 44
>
> Fax (D): +49 - (0)3 21 21 25 22 44
>
> email: [email protected]
>
> Skype: RMkrug
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
>
> iEYEARECAAYFAlBQjD8ACgkQoYgNqgF2egrUSACfapSbOg4k++TnoErSLBpLA3Hq
> Yf8AmwUh5HpGyGw+nRPkTRyqYToGwqYl
> =caSn
> -----END PGP SIGNATURE-----