Closed HelenaEdlund closed 6 years ago
You have a real knack for finding weak spots in packages! :)
I know what causes this. The HTML code gets wrapped by htmltools::htmlPreserve
. I've had problems with certain characters, usually <
and >
being translated to HTML entities when I didn't want them to be. To try and address your specific case, I made a branch with an experimental method to disable the preservation. Feel free to try
devtools::install_github("nutterb/pixiedust", ref = "noPreservatives")
and then use
data.frame(
Characteristics = c("Age ($years$)",
"Body weight ($kg$)",
"Body height ($cm$)",
"Body mass index ($kg/m^{2}$)",
"eGFR ($mL/min/1.73m^{2}$)",
"Serum creatinine ($mg/dL$)"),
stringsAsFactors = FALSE) %>%
dust(float = FALSE,
html_preserve = FALSE) %>%
medley_bw()
It's working with just the one column. I don't know what else is in your table, and I honestly have no idea what other side effects this might have on the HTML output.
This will be included in 0.8.2. currently available via
devtools::install_github("nutterb/pixiedust", ref = "devel")
I am using dust to print data frames to latex and rmarkdown. The first column is a text column for which I want to have some formating instructions included. E.g. c("Age ($years$)", "Body weight ($kg$)", "Body height ($cm$)", "Body mass index ($kg/m^{2}$)", "eGFR ($mL/min/1.73m^{2}$)", "Serum creatinine ($mg/dL$)")
When pushing to latex I get what I expected:
But when using rmarkdown (to html) the formatting instructions are ignored and it prints as is. I tried using rmarkdown notation for the superscript to see if that was causing the issue but get the same result:
Any suggestions?
Thanks, Helena