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
suggest: align on a character #139
Comments
This is a very good suggestion! I'd have to see how well it would work across the different output types and between fixed-width and variable fonts. |
If by "output types" you mean HTML, LaTeX, and RTF, I was thinking the same thing. I personally would prioritize the first two over the third, since LaTeX is very academically motivated/used, and the second for blogs and such (and perhaps Fixed-Width would likely be the simplest, to be honest, since all you do is find the first such character and space-pad the rest. LaTeX:
HTML:
RTF: sorry, I've never really used RTF, and though I could google it, I'm not certain how good a solution it might be. Would it be acceptable (if not feasible) to support it in 2-of-3 and warn when attempting to use it here? |
For fixed fonts, I wrote some code below
For variable fonts, could we split the string by char to two columns. Then display the first column right adjusted and the second column left adjusted with no column border? I can test this idea in RTF if you agreed it is a proper way to handle this. |
For RTF, decimal alignment can be solved by using https://groups.google.com/forum/#!topic/comp.soft-sys.sas/ATYKvb30z64 |
I would love to have this feature as I use align on decimal place all the time in tables to ensure clarity of what may be different orders of magnitude being represented. One important thing to ensure is handled consistently is when there is more than one of the character in the input data. I assume that an option to align on first or last occurrence would be needed (or at least to ensure documentation clarity if the alignment will only occur on the first or last occurrence). |
Has there been any progress on using something like |
Nice presentation at rstudio::conf2019.
Is it possible to align by decimal point (period or comma, by locale)? That is, your output rendered something like the left, where it might be nice to see it aligned as on the right:
It might be nice to generalize a little so that we may align on, say,
=
:This might be something like
cols_align(align=".")
orcols_align(align="=")
.The text was updated successfully, but these errors were encountered: