Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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).

share|improve this question
    
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
    
\usepackage[spanish,es-nodecimaldot]{babel} should do. –  egreg Nov 8 '12 at 23:41
    
Yes it did, thanks. I wish I could accept your comment as a right answer. –  FPP Nov 8 '12 at 23:45
    
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

2 Answers 2

up vote 9 down vote accepted

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}
share|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

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/latex/spanish/spanish.pdf

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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