Using siunitx with LyX

2011-03-30 Thread Andrew Steele
I am trying to use the package siunitx for correct typesetting of SI
units with LyX. However, I run into a problem when attempting to enter
a number with units in math mode.

In LaTeX, one would enter

$a = \SI{50}{\metre\per\second\squared}$

However, in LyX, the second set of curly braces does not seem to be
associated with the initial command, which leads to them being escaped
with backslashes, thus:

$a = \SI{50}   \{   \metre\per\second\squared   \}   $

This does not render correctly.

Is there any way around this?

I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
is possible in 1.6!

Thanks!

-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
sta...@andrewsteele.co.uk wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

Have you tried to enter this in ERT (ctrl+l)?
Liviu


 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes, thus:

 $a = \SI{50}   \{   \metre\per\second\squared   \}   $

 This does not render correctly.

 Is there any way around this?

 I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
 is possible in 1.6!

 Thanks!

 --
 Andrew Steele
 http://andrewsteele.co.uk/




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)

On 30 March 2011 12:48, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
 sta...@andrewsteele.co.uk wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

 Have you tried to enter this in ERT (ctrl+l)?
 Liviu


 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes, thus:

 $a = \SI{50}   \{   \metre\per\second\squared   \}   $

 This does not render correctly.

 Is there any way around this?

 I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
 is possible in 1.6!

 Thanks!

 --
 Andrew Steele
 http://andrewsteele.co.uk/




 --
 Do you know how to read?
 http://www.alienetworks.com/srtest.cfm
 http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
 Do you know how to write?
 http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail




-- 
Andrew Steele
http://andrewsteele.co.uk/
+44 (0) 7763 942 262


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
sta...@andrewsteele.co.uk wrote:
 Yes, that does work, but it seems to be impossible to start an ERT box
 within math mode, and this rather defeats the object of the visual
 equation editor!

 Is there a better workaround? :)

Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View  Source.

Regards
Liviu


newfile1.lyx
Description: Binary data


newfile1.pdf
Description: Adobe PDF document


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
 sta...@andrewsteele.co.uk wrote:
 Yes, that does work, but it seems to be impossible to start an ERT box
 within math mode, and this rather defeats the object of the visual
 equation editor!

 Is there a better workaround? :)

 Hmm, here in both cases I get the same result (see attached). I assume
 that you include the dollar signs in math mode, something that you
 shouldn't do. To make sure that the math representation conforms to
 your LaTeX code expectations, try View  Source.

 Regards
 Liviu




-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Julien Rioux

On 30/03/2011 8:02 AM, Andrew Steele wrote:

It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Androniclandronim...@gmail.com  wrote:

On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
sta...@andrewsteele.co.uk  wrote:

Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)


Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View  Source.

Regards
Liviu







It should work in 1.6, too, doesn't it?

A neat approach is to define a fake math macro: Insert  Math  Macro, 
then put a % in a TeX Code right in front of it, on the same line.


Define your SI math macro to take two arguments and LyX will know what 
to do with it each time you type \SI in math mode.


--
Julien



Re: Using siunitx with LyX

2011-03-30 Thread Guenter Milde
On 2011-03-30, Andrew Steele wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes

There are two ways around this problem:

a) Write a = \SI{50}{\metre\per\second\squared}, highlight and press
   Ctrl-M.
   
b) Write \{ when you want a non-escaped {
   (LyX switches the input convention of literal and grouping bracket).
   
Günter   



Using siunitx with LyX

2011-03-30 Thread Andrew Steele
I am trying to use the package siunitx for correct typesetting of SI
units with LyX. However, I run into a problem when attempting to enter
a number with units in math mode.

In LaTeX, one would enter

$a = \SI{50}{\metre\per\second\squared}$

However, in LyX, the second set of curly braces does not seem to be
associated with the initial command, which leads to them being escaped
with backslashes, thus:

$a = \SI{50}   \{   \metre\per\second\squared   \}   $

This does not render correctly.

Is there any way around this?

I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
is possible in 1.6!

Thanks!

-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
sta...@andrewsteele.co.uk wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

Have you tried to enter this in ERT (ctrl+l)?
Liviu


 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes, thus:

 $a = \SI{50}   \{   \metre\per\second\squared   \}   $

 This does not render correctly.

 Is there any way around this?

 I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
 is possible in 1.6!

 Thanks!

 --
 Andrew Steele
 http://andrewsteele.co.uk/




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)

On 30 March 2011 12:48, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
 sta...@andrewsteele.co.uk wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

 Have you tried to enter this in ERT (ctrl+l)?
 Liviu


 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes, thus:

 $a = \SI{50}   \{   \metre\per\second\squared   \}   $

 This does not render correctly.

 Is there any way around this?

 I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
 is possible in 1.6!

 Thanks!

 --
 Andrew Steele
 http://andrewsteele.co.uk/




 --
 Do you know how to read?
 http://www.alienetworks.com/srtest.cfm
 http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
 Do you know how to write?
 http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail




-- 
Andrew Steele
http://andrewsteele.co.uk/
+44 (0) 7763 942 262


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
sta...@andrewsteele.co.uk wrote:
 Yes, that does work, but it seems to be impossible to start an ERT box
 within math mode, and this rather defeats the object of the visual
 equation editor!

 Is there a better workaround? :)

Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View  Source.

Regards
Liviu


newfile1.lyx
Description: Binary data


newfile1.pdf
Description: Adobe PDF document


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
 sta...@andrewsteele.co.uk wrote:
 Yes, that does work, but it seems to be impossible to start an ERT box
 within math mode, and this rather defeats the object of the visual
 equation editor!

 Is there a better workaround? :)

 Hmm, here in both cases I get the same result (see attached). I assume
 that you include the dollar signs in math mode, something that you
 shouldn't do. To make sure that the math representation conforms to
 your LaTeX code expectations, try View  Source.

 Regards
 Liviu




-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Julien Rioux

On 30/03/2011 8:02 AM, Andrew Steele wrote:

It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Androniclandronim...@gmail.com  wrote:

On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
sta...@andrewsteele.co.uk  wrote:

Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)


Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View  Source.

Regards
Liviu







It should work in 1.6, too, doesn't it?

A neat approach is to define a fake math macro: Insert  Math  Macro, 
then put a % in a TeX Code right in front of it, on the same line.


Define your SI math macro to take two arguments and LyX will know what 
to do with it each time you type \SI in math mode.


--
Julien



Re: Using siunitx with LyX

2011-03-30 Thread Guenter Milde
On 2011-03-30, Andrew Steele wrote:
 I am trying to use the package siunitx for correct typesetting of SI
 units with LyX. However, I run into a problem when attempting to enter
 a number with units in math mode.

 In LaTeX, one would enter

 $a = \SI{50}{\metre\per\second\squared}$

 However, in LyX, the second set of curly braces does not seem to be
 associated with the initial command, which leads to them being escaped
 with backslashes

There are two ways around this problem:

a) Write a = \SI{50}{\metre\per\second\squared}, highlight and press
   Ctrl-M.
   
b) Write \{ when you want a non-escaped {
   (LyX switches the input convention of literal and grouping bracket).
   
Günter   



Using siunitx with LyX

2011-03-30 Thread Andrew Steele
I am trying to use the package siunitx for correct typesetting of SI
units with LyX. However, I run into a problem when attempting to enter
a number with units in math mode.

In LaTeX, one would enter

$a = \SI{50}{\metre\per\second\squared}$

However, in LyX, the second set of curly braces does not seem to be
associated with the initial command, which leads to them being escaped
with backslashes, thus:

$a = \SI{50}   \{   \metre\per\second\squared   \}   $

This does not render correctly.

Is there any way around this?

I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
is possible in 1.6!

Thanks!

-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
 wrote:
> I am trying to use the package siunitx for correct typesetting of SI
> units with LyX. However, I run into a problem when attempting to enter
> a number with units in math mode.
>
> In LaTeX, one would enter
>
> $a = \SI{50}{\metre\per\second\squared}$
>
Have you tried to enter this in ERT (ctrl+l)?
Liviu


> However, in LyX, the second set of curly braces does not seem to be
> associated with the initial command, which leads to them being escaped
> with backslashes, thus:
>
> $a = \SI{50}   \{   \metre\per\second\squared   \}   $
>
> This does not render correctly.
>
> Is there any way around this?
>
> I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
> is possible in 1.6!
>
> Thanks!
>
> --
> Andrew Steele
> http://andrewsteele.co.uk/
>



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)

On 30 March 2011 12:48, Liviu Andronic  wrote:
> On Wed, Mar 30, 2011 at 1:43 PM, Andrew Steele
>  wrote:
>> I am trying to use the package siunitx for correct typesetting of SI
>> units with LyX. However, I run into a problem when attempting to enter
>> a number with units in math mode.
>>
>> In LaTeX, one would enter
>>
>> $a = \SI{50}{\metre\per\second\squared}$
>>
> Have you tried to enter this in ERT (ctrl+l)?
> Liviu
>
>
>> However, in LyX, the second set of curly braces does not seem to be
>> associated with the initial command, which leads to them being escaped
>> with backslashes, thus:
>>
>> $a = \SI{50}   \{   \metre\per\second\squared   \}   $
>>
>> This does not render correctly.
>>
>> Is there any way around this?
>>
>> I am using LyX 2.0.0RC1 on Windows XP, but please let me know if this
>> is possible in 1.6!
>>
>> Thanks!
>>
>> --
>> Andrew Steele
>> http://andrewsteele.co.uk/
>>
>
>
>
> --
> Do you know how to read?
> http://www.alienetworks.com/srtest.cfm
> http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
> Do you know how to write?
> http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail
>



-- 
Andrew Steele
http://andrewsteele.co.uk/
+44 (0) 7763 942 262


Re: Using siunitx with LyX

2011-03-30 Thread Liviu Andronic
On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
 wrote:
> Yes, that does work, but it seems to be impossible to start an ERT box
> within math mode, and this rather defeats the object of the visual
> equation editor!
>
> Is there a better workaround? :)
>
Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View > Source.

Regards
Liviu


newfile1.lyx
Description: Binary data


newfile1.pdf
Description: Adobe PDF document


Re: Using siunitx with LyX

2011-03-30 Thread Andrew Steele
It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Andronic  wrote:
> On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
>  wrote:
>> Yes, that does work, but it seems to be impossible to start an ERT box
>> within math mode, and this rather defeats the object of the visual
>> equation editor!
>>
>> Is there a better workaround? :)
>>
> Hmm, here in both cases I get the same result (see attached). I assume
> that you include the dollar signs in math mode, something that you
> shouldn't do. To make sure that the math representation conforms to
> your LaTeX code expectations, try View > Source.
>
> Regards
> Liviu
>



-- 
Andrew Steele
http://andrewsteele.co.uk/


Re: Using siunitx with LyX

2011-03-30 Thread Julien Rioux

On 30/03/2011 8:02 AM, Andrew Steele wrote:

It seems to work if you press ctrl-L or type a backslash before typing
the second set of curly braces.

Thanks for nudging me in the right direction!

On 30 March 2011 12:56, Liviu Andronic  wrote:

On Wed, Mar 30, 2011 at 1:51 PM, Andrew Steele
  wrote:

Yes, that does work, but it seems to be impossible to start an ERT box
within math mode, and this rather defeats the object of the visual
equation editor!

Is there a better workaround? :)


Hmm, here in both cases I get the same result (see attached). I assume
that you include the dollar signs in math mode, something that you
shouldn't do. To make sure that the math representation conforms to
your LaTeX code expectations, try View>  Source.

Regards
Liviu







It should work in 1.6, too, doesn't it?

A neat approach is to define a fake math macro: Insert > Math > Macro, 
then put a % in a TeX Code right in front of it, on the same line.


Define your SI math macro to take two arguments and LyX will know what 
to do with it each time you type \SI in math mode.


--
Julien



Re: Using siunitx with LyX

2011-03-30 Thread Guenter Milde
On 2011-03-30, Andrew Steele wrote:
> I am trying to use the package siunitx for correct typesetting of SI
> units with LyX. However, I run into a problem when attempting to enter
> a number with units in math mode.

> In LaTeX, one would enter

> $a = \SI{50}{\metre\per\second\squared}$

> However, in LyX, the second set of curly braces does not seem to be
> associated with the initial command, which leads to them being escaped
> with backslashes

There are two ways around this problem:

a) Write a = \SI{50}{\metre\per\second\squared}, highlight and press
   Ctrl-M.
   
b) Write \{ when you want a non-escaped {
   (LyX switches the input convention of literal and grouping bracket).
   
Günter