On Wed, May 23, 2007 at 02:47:10PM +1000, Darren Freeman wrote: > On Tue, 2007-05-22 at 16:52 +0000, Angus Leeming wrote: > > Darren Freeman <[EMAIL PROTECTED]> writes: > > > enter the following: "10 keV" , {"10", C-' ', "keV"}. Now convert both > > > to mathed with C-m after highlighting. > > > > I think that you need to investigate the SIUnits package: > > http://www.math.upenn.edu/tex_docs/latex/SIunits/SIunits.pdf > > > > There's no direct support for it in LyX, but you can use math macros to > > have > > something that looks reasonable in LyX and *fantastic* in your printed > > output. > > I'm brimming with appreciation at this recommendation - I've had a > fiddle and I think not only is this the right way to go but LyX needs > direct support for it! At the very least, there needs to be a section in > the advanced user guide about this package, with helpful hints like the > ones you gave. > > My original bug still stands but I guess I'm less concerned now :) > > I'm not using your suggested macro yet. I'm using the mathed equivalent > of "\unit{10}{\kilo\electronvolt}" which is taking up a fair amount of > on-screen real estate. This is because I want the SIunits package to > handle the spacing between the number and the units too. I would go so > far as to use the \power command for entering scientific notation as > well, leading to even larger formulas. > > Can you suggest a good way to macro-ise this or otherwise allow it to > take up less real estate? (I don't know much about the macros, even how > to set them up..) I will be RTFMing shortly as I'm curious now, but if > you had something worked out already please tell!
Just write an InsetMathSIUnit and be done. Should be straight forward. > One thing that I noticed is it's hard to distinguish the following two > possibilities on-screen: "\kiloelectronvolt" and "\kilo\electronvolt". > Only the second one will work, but there is no gap to let you know these > are two different tokens. Last time I added a bit of space around 'unknown' tokens, people complained about _that_. Andre'