So I created a md file, a css file, a Rmd file and a R file.
All saved in the same directory.
Scenario 1 use R file
the R file used markdownToHTML to convert the md file into HTML file with the CSS code embedded from the css file. It has nice formatting such as borders and colors in its headers for tables. However I wanted to do the same to PDF with the same css code embedded but wasn't successful or know the code that would do that. Does anyone have any idea ?
To convert from md to html I use markdownToHTML("md file", "html file", stylesheet = "cssfile")
Scenario 2 use file.Rmd
with the file.Rmd tab or code I can Knit to html but the css codes are not embedded or apply (not sure why or how I can apply it), it however applies the file.md html codes giving it some table structures. I also Knit to PDF, however the table (md file) that works for knit to HTML doesn't apply to it, while I get a PDF file, it's not structure at all (css codes from the css file are not embedded either). I like to be able to Knit to PDF with the css codes embeded from the CSS file and apply any html codes giving it better formatting.
The md file has some html structure giving it a table like, which is why Knit to hmtl gives table structure but doesn't embed the css file which has better table formatting. Unfortunately the Knit to PDF doesn't apply any html (md file) or css (css file) so there is no table format at all.
Or since the first scenario has nice formatting, I can convert the html output to PDF from a browser ?
Can you advise for the two scenarios ?
(In short, I wanted to use two scenarios to convert or Knit to PDF with the nice html formatting onto PDF)