# Question about typesetting decimal numbers in LaTeX

I can't seem to make this decimal number appear correctly.

My code is like this:

$S=bK^1,09$


I would like it to write S = bK^(1,09) , but instead it writes the 1 in the exponent position and then ,09 on the same baseline as bK.

Is there a way to fix this?

• Welcome to TeX - LaTeX! By default only one character is placed in the superscript. Bracketing is the correct idea, but the type of bracket tex uses for grouping is curly not round. So writing $S = bK^{1.09}$ will work. For comma decimals you generally need to write 1{,}09 for correct spacing. – Andrew Swann Sep 30 '17 at 11:07

## 3 Answers

In addition to encasing the number 1,09 in curly braces -- like so: {1,09} -- I would like to suggest that you add a layer of abstraction to the numeric input material, by (a) loading the siunitx package and (b) encasing numbers in \num{...} directives. By default, the \num macro recognizes both , and . as input decimal markers; by setting the package option output-decimal-marker={,}, you can direct num to use , as the decimal marker in the typeset output.

That way, should you one fine day decide to switch the notation convention from , to . as the decimal marker in the typeset output, all you would need to change in the document is the siunitx option, to output-decimal-marker={.}.

The \num macro is extremely versatile. For a thorough presentation of its capabilities, please see section 4.2, "Numbers", as well as sections 5.4 thru 5.8 of the user guide of the siunitx package.

\documentclass{article}
\usepackage[output-decimal-marker={,}]{siunitx}

\begin{document}
$S=\num{2.818}K^{\num{1,09}}$
\end{document}


Observe that the spacing around the decimal marker is automatically correct, without any need to encase the , symbol in curly braces to change its status from math-punct to math-ord.

Try to put whatever want to be superscripted in curly brackets.

$S=bK^{1,09}$

• It should also be 1{,}09 or there would be a space after the comma. – egreg Sep 30 '17 at 11:22
• @egreg I have no space in my compiled document – Nikos Sep 30 '17 at 11:25
• Just because it's at the exponent. Otherwise there would be: better being consistent. – egreg Sep 30 '17 at 11:29

Use braces to isolate the exponent:

$S=bK^{1,09}$

• It should also be 1{,}09 or there would be a space after the comma. – egreg Sep 30 '17 at 11:22