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

Allow for column alignment for org table export #2391

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mclements
Copy link

For table export to Org Mode, (i) the column alignment is currently lost and (ii) the output table includes colons which are not part of the Org Mode table specification. To address these issues, I have added some code to keep the column alignment and cleaned up the output table format.

I hope that this is helpful.

Sincerely, Mark.

@CLAassistant
Copy link

CLAassistant commented Jan 29, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Owner

@yihui yihui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can this be achieved by the align.fun argument of kable_mark()? Manipulating the strings via regex feels like an ad hoc hack. Perhaps a custom align.fun function will be much more straightforward.

@mclements
Copy link
Author

mclements commented Jan 30, 2025

I have now updated this to use kable_mark(), with one call to gsub().

What is the expected behaviour when there are no column names? Specifically, should we include a top line? The current implementation removes both the blank column names (index=1) and the line (index=3):

if (is_null_colnames) res = res[-c(1,3)]

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

Successfully merging this pull request may close these issues.

3 participants