22

I'm using Babel for writing a document in spanish. However, it uses a comma instead of a period as a decimal marker (i.e. 3,14 instead of 3.14).

Is there any way to reverse the behaviour? I prefer the period, as it's done in english.

Also, I'd prefer it if it's something that can just be added to the preamble, instead of having to do it each time I want to write a number with a decimal part (like putting the period between brackets, for instance).

  • Should say I've seen a lot of related questions, but none actually like this one (or none that I could find). Most are about changing the period to a comma instead. – FPP Nov 8 '12 at 23:33
  • 4
    \usepackage[spanish,es-nodecimaldot]{babel} should do. – egreg Nov 8 '12 at 23:41
  • And in fact, currently the RAE (Spanish Academy) recommends the dot as decimal separator. See tex-tipografia.com/marca_decimal.html – Javier Bezos Nov 9 '12 at 9:47
26

By dafault, spanish changes to a comma as decimal separator; to change to a dot, you can use \decimalpoint:

\usepackage[spanish]{babel}
\decimalpoint

This gives the possibility to revert at any moment to a comma, using \decimalcomma or even to select a different symbol with \spanishdecimal{<symbol>}

The package option es-nodecimaldot disbales completely this decimal separator mechanism and uses a dot,leaving without effect \spanishdecimal{<symbol>}, and \decimalcomma:

\usepackage[spanish,es-nodecimaldot]{babel}
|improve this answer|||||
  • Does the fact that it "disables completely the decimal separator mechanism" have any drawbacks? I.e. what else does it do, besides changing the comma to a dot? – FPP Nov 9 '12 at 0:00
  • 1
    @FPP It leaves without effect \decimalcomma and \spanishdecimal<symbol> that could otherwise be used (if required) to revert to the comma or to select a different <symbol> as separator. Since you only want the dot, then it has no drawbacks. – Gonzalo Medina Nov 9 '12 at 0:07
7

The Spanish module does tricks to accommodate for traditional Spanish typesetting rules. One is to transform periods followed by digits into a comma in math mode. You can disable this behavior with

\usepackage[spanish,es-nodecimaldot]{babel}

There are many other options, you can find them by

texdoc spanish

or going to http://texdoc.net/texmf-dist/doc/generic/babel-spanish/spanish.pdf

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.