[ESS] Difficulty pointing to .css file for markdown html rendering

Brian Hobbs rebdh @end|ng |rom ch@nn|ng@h@rv@rd@edu
Tue Nov 17 19:14:08 CET 2015


Lionel,

I appreciate your response. Indeed, the YAML header is ignored by knitr; so
your method worked.

That being said, I prefer the look of the HTML from knit2html() which calls
markdowntoHTML() from the markdown package. I discovered that in order to
point to a custom stylesheet for this rendering, you can set the option in
R: options(markdown.HTML.stylesheet = 'custom.css').

Sorry that this question was only peripherally related to ESS, but I thank
you for your help.

Brian

On Tue, Nov 17, 2015 at 12:16 PM, Lionel Henry <lionel.hry using gmail.com> wrote:

> Hello,
>
> I think the YAML header is handled by the rmarkdown package, not by knitr.
> So maybe try with rmarkdown::render().
>
> Lionel
>
>
> > On 17 nov. 2015, at 17:26, Brian Hobbs <rebdh using channing.harvard.edu>
> wrote:
> >
> > Hello all,
> >
> > I am currently using ESS with polymode to edit .Rmd files, which I render
> > into .html files using knitr and the knit2html('file.Rmd') command in R.
> >
> > I am having difficulty pointing to a custom.css file using the YAML
> header
> > in my .Rmd file. This is my current .Rmd YAML header:
> >
> > ---
> > title: "title"
> > author: author
> > output:
> >  html_document:
> >    css: custom.css
> > ---
> >
> > When I use this header, the default .css file (and thus default html
> > rendering options) are still used.
> >
> > As most of the online help with custom.css files are centered on
> assumption
> > that rstudio is being used, I wanted to see if anyone here has had
> success
> > with using custom.css files for html rendering through knitr while using
> > ESS.
> >
> > Thanks,
> > Brian
> >
> >       [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > ESS-help using r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/ess-help
>
>

	[[alternative HTML version deleted]]




More information about the ESS-help mailing list