I have numbers I need to put into my text in latex. The only possibility I know is using \input
. So I put every single number in its own file. E.g. the file foo.dat
contains 6.062843465325870040e-01
(I checked for trailing white spaces).
The first problem that appears is, that latex apparently puts a space after \input
. So My number is \input{foo.dat}.
yields
My number is 6.062843465325870040e-01 .
Note the unwanted space before the dot .
.
The next problem is, that I obviously want properly formatted numbers. So I use siunits
' \num
. But \num{\input{foo.dat}}
yields an error.
How can I fix this, or are there better solutions (without generating the properly formatted latex code as a file).
I considered https://stackoverflow.com/questions/29078107/insert-values-from-a-file-in-a-latex-document for my solution so far.