Gunnar wrote:
If you want to use decimal comma instead of a decimal point, then
write decimal commas instead of writing points. That way you get what
you want, and the math looks good.
If I write 4,5 in math environment, I get them separated (space between comma
and 5)
The strange thing is, that this happens if I just write a decimal number,
but it does not happen if I write the number inside a fraction.
Looks like latex is set to make everybody unhappy - whether they
want the space or not. (Try making a fraction with 12,34 divided by 12.34
it lines up perfectly.) So writing commas works in some cases, at least.
If I was writing coordinates, then I want that, if I was writing ordinary
numbers "four and a half" then I want no space between comma and the five.
So my idea was to write ordinary numbers with decimals as 4.5 (with a dot)
and have the dot automatically transformed to a comma.
The keyboard have both comma and point, and the numeric keypad
may be programmed to make one or the other depending on
what you want.
Is it possible to make lyx insert \{,} (which seems to give me a
no-space-after comma in mathmode when I press numeric keypad comma but it
should display an ordinary comma with no space?
Yes, you can do this. In math mode, press \ followed by {
Then you get a pair of red braces, type the comma between them.
The result looks good in the output, a comma without spacing.
Another way of removing the unwanted space is to insert a negative
space ( \! ) after the comma. But be careful, as you don't want this in
the cases
where no extra space is added. The {,} always works.
If you write a lot of these decimal numbers, then you don't want to
type \{ all the time. It is then better to take Herbert Voss' advice,
and put \usepackage{icomma} in the preamble.
This way, spacing is removed from the commas in an intelligent way.
If you find that spacing were lost where you wanted it, such as
in coordinates, just insert spacing yourself from the math menu.
Or use the keyboard shortcuts \, (small space) or \: (normal space)
Helge Hafting