Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Option to align deciamal places #2

Open
legendre6891 opened this issue Oct 9, 2017 · 2 comments
Open

[Suggestion] Option to align deciamal places #2

legendre6891 opened this issue Oct 9, 2017 · 2 comments

Comments

@legendre6891
Copy link

Could you add an option a column that aligns decimal places? This is fairly common in social sciences.

See: https://tex.stackexchange.com/questions/2746/aligning-numbers-by-decimal-points-in-table-columns

It would be nice if tably could automatically figure out:

  1. The number of places before the decimal point, i.e., the maximal number column.
  2. The number of places after the decimal point, i.e., the maximal number in a particular column.

That way, [table-format=3.2] doesn't have to be specified manually.

In addition, it would be nice if it can handle the 'header column' and automatically wrap the contents
around braces to prevent aligning the decimal point. The comment at the TeX.SX link above provides the context:

in response to a comment by daniel kullmann Nov 15 '11 at 10:31 The official way of getting siunitx to ignore bits of text, like headers, is to just wrap them in braces; i.e. {name} will work just as well as \multicolumn{1}{c}{name}. See for instance tex.stackexchange.com/questions/3709/… (would still like newbies to be able to post comments!) – Sam Mason Sep 23 '12 at 17:41

@narimiran
Copy link
Owner

Could you add an option a column that aligns decimal places?

Thank you for the suggestion! I'll see what I can do.

It would be nice if tably could automatically figure out (...) That way, [table-format=3.2] doesn't have to be specified manually.

I'm thinking maybe an option to specify it manually (something like -d 3.2) might be useful in cases where you want to have the control in your hands (e.g. specify more places before the decimal point than the biggest number has).

Thoughts?

@legendre6891
Copy link
Author

Yes, on further thought, it actually would make more sense for the [table-format=#.#] to be specified manually. The idea is that the CSV file is generated by some external program (e.g., MATLAB) and its numbers have many decimal places. Then, specifying -d 3.2 allows the user to choose how many in the decimal places there should be.

Though, when specifying -d 3.2, it would make sense for tably to directly truncate the output LaTeX source output as well, e.g. using print()'s format specifiers.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants