On Wednesday 12 February 2003 9:31 am, Andre Poenitz wrote: > On Wed, Feb 12, 2003 at 09:21:12AM +0000, Angus Leeming wrote: > > > And I believe '4.5 Cm' and '4.5 cM' are valid as well... > > > > Geeez. > > Someone should check it first....
That's why I gave you a little program to run, you noodle ;-) > > Would this suffice do you think? > > > > $LatexLength =~ s/^\s*([+-]?)\s*(\d+)[.,]?(\d*)\s*/$1$2.$3/; > > # Now ensure that 'Cm', 'cM' are output as 'cm'. > > # This does not act on \macro > > $LatexLength =~ s/(\d+\.?\d*)([a-z]*)/$1\L$2/i; > > [a-z]* does not match CM, does it? Yes. That's what the 'i' on the end does --- case insensitive matching. The '\L' forces $2 to be lower case. Should I write the equivalent of this as a function for tex2lyx using the boost regex library? Angus