When making a table, should number values inside of table cells be entered in the math environment? Or is that unnecessary?
Asked
Active
Viewed 413 times
1
1 Answers
0
Yes they should. Please compare:
\begin{tabular}{cc}
-1 & 1,02 \\ % bad
$-1$ & $1,02$ % good
\end{tabular}
(In some languages comma is a decimal separator).
Przemysław Scherwentke
- 37,268
-
-
If the comma is supposed to denote the decimal separator, it's a good idea to encase it in curly braces, lest TeX (mis)interpret it as a punctuation character. – Mico Dec 13 '17 at 20:23
-
Or better, if you are using a language that use comma as decimal separator, like Spanish, be sure that you have the correct preamble (
\usepackage[spanish]{babel}o whatever) and just use$1.2$. – Fran Dec 13 '17 at 20:34
$markup in each cell use a numeric column type from the dcolumn or siunitx packages, so that the numbers are aligned correctly. – David Carlisle Dec 13 '17 at 19:44