Discussion:
[O] Exponential numbers in latex table export
Günter Lichtenberg
2018-03-27 17:49:10 UTC
Permalink
Hi

I have a document with many automatically generated tables that contain
numbers in exponential Format, e.g. 2e09. When I export the tables to LaTeX
and pdf I get something like 2 (-09) in the pdf, if there is no character
after the number in the table

Minimal Example:
|--------------|
| 1.2e09 (abs) |
| 2.3e-09 |
| 3.4e09 |
|--------------|

exports to a latex table as

\begin{center}
\begin{tabular}{r}
\hline
1.2e09 (abs)\\
2.3\,(-09)\\
3.4\,(09)\\
\hline
\end{tabular}

Note that in the first line the number is an exponential, the following 2 are
not. I could not find anything in the documentation. What am I missing?

orgmode version is 9.1.4, but the same happens with emacs 25.3 built-in
version 8.3.

gl
Nicolas Goaziou
2018-03-28 11:55:01 UTC
Permalink
Hello,
Post by Günter Lichtenberg
I have a document with many automatically generated tables that contain
numbers in exponential Format, e.g. 2e09. When I export the tables to LaTeX
and pdf I get something like 2 (-09) in the pdf, if there is no character
after the number in the table
|--------------|
| 1.2e09 (abs) |
| 2.3e-09 |
| 3.4e09 |
|--------------|
exports to a latex table as
\begin{center}
\begin{tabular}{r}
\hline
1.2e09 (abs)\\
2.3\,(-09)\\
3.4\,(09)\\
\hline
\end{tabular}
Note that in the first line the number is an exponential, the following 2 are
not. I could not find anything in the documentation. What am I missing?
orgmode version is 9.1.4, but the same happens with emacs 25.3 built-in
version 8.3.
See `org-latex-table-scientific-notation'. I also find the default value
a bit surprising. I believe it is what Carsten uses.

Regards,
--
Nicolas Goaziou
Günter Lichtenberg
2018-03-28 16:37:31 UTC
Permalink
Post by Nicolas Goaziou
Post by Günter Lichtenberg
\begin{center}
\begin{tabular}{r}
\hline
1.2e09 (abs)\\
2.3\,(-09)\\
3.4\,(09)\\
\hline
\end{tabular}
See `org-latex-table-scientific-notation'. I also find the default value
a bit surprising. I believe it is what Carsten uses.
Hi

thanks, setting that variable to nil solves my problem.

It was a bit puzzling to me, because of the fact that once a string is
somewhere in the column the exponential number came out as is (I guess because
then the table entry is no longer interpreted as a number but as a string).
It was also confusing because HTML export is different and just puts out what
is in the orgmode table.

Maybe one should change the default of the variable to nil?
Just a suggestion, as I said, my problem is solved.

Thanks again
gl
Carsten Dominik
2018-03-29 08:37:22 UTC
Permalink
Post by Nicolas Goaziou
Hello,
Post by Günter Lichtenberg
I have a document with many automatically generated tables that contain
numbers in exponential Format, e.g. 2e09. When I export the tables to
LaTeX
Post by Günter Lichtenberg
and pdf I get something like 2 (-09) in the pdf, if there is no character
after the number in the table
|--------------|
| 1.2e09 (abs) |
| 2.3e-09 |
| 3.4e09 |
|--------------|
exports to a latex table as
\begin{center}
\begin{tabular}{r}
\hline
1.2e09 (abs)\\
2.3\,(-09)\\
3.4\,(09)\\
\hline
\end{tabular}
Note that in the first line the number is an exponential, the following
2 are
Post by Günter Lichtenberg
not. I could not find anything in the documentation. What am I missing?
orgmode version is 9.1.4, but the same happens with emacs 25.3 built-in
version 8.3.
See `org-latex-table-scientific-notation'. I also find the default value
a bit surprising. I believe it is what Carsten uses.
Hi,

I believe I ended up using this because I wanted something that is not
dependent on having math-mode in the table column. What I would have
really preferred is "%s\times10^{%s}", but that is less stable because you
need then to know if the column will have math-mode or not.

I agree that it is a bit odd and non-standard - so maybe using nil as
default would be fine.

Carsten
Post by Nicolas Goaziou
Regards,
--
Nicolas Goaziou
Julius Dittmar
2018-03-29 15:51:33 UTC
Permalink
Post by Carsten Dominik
I believe I ended up using this because I wanted something that is not
dependent on having math-mode in the table column.  What I would have
really preferred is "%s\times10^{%s}", but that is less stable because
you need then to know if the column will have math-mode or not.
How about \ensuremath{%s\times10^{%s}} ?

Julius
Carsten Dominik
2018-03-29 17:29:44 UTC
Permalink
Post by Julius Dittmar
Post by Carsten Dominik
I believe I ended up using this because I wanted something that is not
dependent on having math-mode in the table column. What I would have
really preferred is "%s\times10^{%s}", but that is less stable because
you need then to know if the column will have math-mode or not.
How about \ensuremath{%s\times10^{%s}} ?
That would do the trick, yes.

Carsten
Post by Julius Dittmar
Julius
Nicolas Goaziou
2018-03-29 20:14:10 UTC
Permalink
Hello,
Post by Carsten Dominik
Post by Julius Dittmar
Post by Carsten Dominik
I believe I ended up using this because I wanted something that is not
dependent on having math-mode in the table column. What I would have
really preferred is "%s\times10^{%s}", but that is less stable because
you need then to know if the column will have math-mode or not.
How about \ensuremath{%s\times10^{%s}} ?
That would do the trick, yes.
So, what should be the default value :

\ensuremath{%s\times10^{%s}}

or

nil

I don't mind either way.

Regards,
--
Nicolas Goaziou
Carsten Dominik
2018-03-30 17:52:56 UTC
Permalink
Hi Nicolas,

let's make it nil.

- Carsten
Post by Nicolas Goaziou
Hello,
Post by Carsten Dominik
Post by Julius Dittmar
Post by Carsten Dominik
I believe I ended up using this because I wanted something that is not
dependent on having math-mode in the table column. What I would have
really preferred is "%s\times10^{%s}", but that is less stable because
you need then to know if the column will have math-mode or not.
How about \ensuremath{%s\times10^{%s}} ?
That would do the trick, yes.
\ensuremath{%s\times10^{%s}}
or
nil
I don't mind either way.
Regards,
--
Nicolas Goaziou
Nicolas Goaziou
2018-03-30 20:21:06 UTC
Permalink
Hello,
Post by Carsten Dominik
Hi Nicolas,
let's make it nil.
Done.

Regards,
--
Nicolas Goaziou 0x80A93738
Loading...