nutterb / pixiedust

Tables So Beautifully Fine-Tuned You Will Believe It's Magic.
180 stars 18 forks source link

sprinkles not working for word_document output from markdwon #24

Closed CourtneyCampany closed 9 years ago

CourtneyCampany commented 9 years ago

HI. Thanks for the great package. I create my dissertation chapters through markdown with a word output. Tables has always been an issue and pixiedust seems to be the answer. I have a simple data table and have been able to output properly and bold the column names. When I try to any sprinkles having to do with border nothing happens. The table is still produced but no borders appear. I have used to code from the examples so that should not be the issue. Thanks again!

nutterb commented 9 years ago

Unfortunately, @CourtneyCampany , one of the weak spots of Rmarkdown is that the word_document format doesn't support much formatting in word documents. It will support bold and italic, but that's about it.

The sprinkles that are applicable to each output format are described in a table in the README (https://github.com/nutterb/pixiedust; or you can view it using vignette("sprinkles", package = "pixiedust")).

So, strictly speaking, if you're outputting to a Word format, there isn't much I can do for your table borders.

However, I did some digging around and might have something useful for you. I read here(http://gforge.se/2014/07/fast-track-publishing-using-rmarkdown/) about a package called Grmd that provides a docx_document format. You should be able to format your table and use dust_sprinkle_method("html") to write to a .docx file.

You can install Grmd with devtools::install_github("gforge/Grmd"). Then put

---
output: Grmd::docx_document
---

in your YAML header. I think that might do it for you.

Please check back and let me know if it works. If it does, I'd love to put this in the documentation as a way to get formatted tables into Word.

nutterb commented 9 years ago

I should also add, Grmd::docx_document seems to produce an HTML file, but you can right-click and Open with MS Word, and it should retain all the formatting.

CourtneyCampany commented 9 years ago

Thanks for the quick reply. The fact that I can make a simple table that actually looks like a real word style table is good enough. I can always add a border or two after the word document is made anyway. I was making my dissertation chapters in latex but was asked to switch to markdown so my co-advisors could have a word document to edit. Thus, table making has been a real pain. I tested the grmd package on a simple Rmd that only produced a table and it worked fine (keeping formatting). Ill probably stay with the simple pixie dust table though because I always have to do a little post-processing of the word document anyway. Thanks for the great pacakge!!!! Cheers

On Thu, Sep 10, 2015 at 9:31 PM, Benjamin notifications@github.com wrote:

I should also add, Grmd::docx_document seems to produce an HTML file, but you can right-click and Open with MS Word, and it should retain all the formatting.

— Reply to this email directly or view it on GitHub https://github.com/nutterb/pixiedust/issues/24#issuecomment-139209489.

nutterb commented 9 years ago

As you wrap up your theis, please do check back and let me know what post-processing you did that pixiedust doesn't offer (Excepting what can't be done due to limitations of converting rmarkdown to Word). As much as possible, I'd like to remove post-processing so that the process is as reproducible as possible.

Good luck with your thesis.