Suggestion: Add $ to numbers in LaTeX export

holgerflick's profile image holgerflick posted 4 years ago in General Permalink

Numbers in LaTeX tables are usually formatted in Math mode. This should either be an option in the dialog or by default.

If I have an output from HeidiSQL like this:

\begin{tabular}{ c  c  c  c  c  c }
date & county & state & fips & cases & deaths\\ 
2020-06-01 & Autauga & Alabama & 1001 & 234 & 5\\ 
\end{tabular}

I change it to:

\begin{tabular}{ c  c  c  c  c  c }
date & county & state & fips & cases & deaths\\ 
2020-06-01 & Autauga & Alabama & $1001$ & $234$ & $5$ \\ 
\end{tabular}

Note the $ around the numbers.

ansgar's profile image ansgar posted 4 years ago Permalink

I suppose you know something about LaTeX, which I don't, so I will overtake these dollars for numbers.

By the way, I'm scratching my head why I disabled the "NULL value" input field for LaTeX export:

Description

Wouldn't that be a nice thing here too?

holgerflick's profile image holgerflick posted 4 years ago Permalink

After my Master and Phd thesis, I have written all my Delphi books in Delphi (Link) . So, yes, I do know quite a lot about it as I've been using it for over 20 years.

Yeah, NULL could simply be written as NULL or left empty.

I helped myself by using this query, for example:

select STATE,County, '$' || Lat || '$' AS Lat,'$' || Lon || '$' AS Lon from coordinates LIMIT 10

LateX is so complex, you can only deliver a starting point. You export is still VERY helpful. This is what the table looks like in the end:

\begin{tabular}{ l  l  l  l  r  r }
\textbf{Date} & \textbf{County} & \textbf{State} & \textbf{Fips} & \textbf{Cases} & \textbf{Deaths}\\ \toprule
2020-06-01 & Autauga & Alabama & $ 1001 $ & $ 234 $ & $ 5 $\\ 
2020-06-01 & Baldwin & Alabama & $ 1003 $ & $ 306 $ & $ 9 $\\ 
2020-06-01 & Barbour & Alabama & $ 1005 $ & $ 173 $ & $ 1 $\\ 
2020-06-01 & Bibb & Alabama & $ 1007 $ & $ 79 $ & $ 1 $\\ 
2020-06-01 & Blount & Alabama & $ 1009 $ & $ 65 $ & $ 1 $\\ 
2020-06-01 & Bullock & Alabama & $ 1011 $ & $ 210 $ & $ 6 $\\ 
2020-06-01 & Butler & Alabama & $ 1013 $ & $ 416 $ & $ 18 $\\ 
2020-06-01 & Calhoun & Alabama & $ 1015 $ & $ 172 $ & $ 3 $\\ 
2020-06-01 & Chambers & Alabama & $ 1017 $ & $ 370 $ & $ 25 $\\ 
2020-06-01 & Cherokee & Alabama & $ 1019 $ & $ 39 $ & $ 3 $\\ 
\end{tabular}

BTW: Hands-on 1 mentions HeidiSQL as a database tool ...

Description

holgerflick's profile image holgerflick posted 4 years ago Permalink

...not after my theses... including my theses.

holgerflick's profile image holgerflick posted 4 years ago Permalink

This is what the table looks like:

Description

Code modification/commit b3bdbf2 from Ansgar Becker <anse@heidisql.com>, 4 years ago, revision 11.0.0.6031
Wrap numeric values in LaTeX export with $. See https://www.heidisql.com/forum.php?t=36530
ansgar's profile image ansgar posted 4 years ago Permalink

Oh well, thanks for mentioning Heidi in your book then! I really appreciate that. I suppose you meant you wrote these Delphi books in LaTeX, or? I hope these books sell good. It's some time ago when I read Delphi books, but I loved to read code on paper. I wrote a few Turbo Pascal tests on paper, back in 1991. However.

I just added the dollars around numbers. I guess it's correct to do that not only for integers, but also for floats. If not, please shout.

holgerflick's profile image holgerflick posted 4 years ago Permalink

Correct. The thinking behind it is that kerning and spaces between numbers should be different than text. For example, you put more distance after a period and the next character in prose compared to a number with a decimal.

  1. 5 would look ridiculous.

LaTeX is a type setting system and abides by all professional rules. That is why most people struggle with it. People who want to make custom changes get frustrated. Type the text, LaTeX will do the rest. Simple. But many people think they are smarter or know better than the rules that exist in the industry and make the product look bad because it follows a standard :-)

Please login to leave a reply, or register at first.