Github pages and rstudio

Asked

Viewed 88 times

2

I’m using the Rstudio to create my documents in the format .Rmd and address in .md with the following function:

rmarkdown::render("2016-09-07-post1.Rmd",output_format = "md_document",encoding = "UTF-8")

The archive .md generated is saved in folder _posts, do the commit and the push, and then when opening my blog my post is rendered, but the following happens:

  • Images do not appear;
  • Latex texts are not rendered correctly.

You can visualize this in fsbmat.github.io

Someone can help me solve these problems?

  • 1

    Have you tried using the HTML format in knitr (instead of markdown)? It includes the images "inline"

  • Hi @Marcelo de Andrade, I’ve tried yes, I’ll add html via knitr in Rstudio and put it in the _post folder with the same name as the file . Md, I commit and push and when it comes time to view both posts on the blog, but with the same problems! The two meet on the blog to view!

1 answer

3


image error is bizarre, the reason was the date formatting in the file preamble, before my preamble was:

title: "Post1" author: "Fernando de Souza Bastos" date: 07 de setembro de 2016 layout: post comments: true output: html_document: variant: markdown_phpextra+backtick_code_blocks

I switched to:

title: "Post1" author: "Fernando de Souza Bastos" date: "2016-09-07" layout: post comments: true output: html_document: variant: markdown_phpextra+backtick_code_blocks

And the graph rendered!

Regarding latex, just add the lines of code below in the head.html file that is in the _includes folder:

<script type="text/javascript" async
      src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">

I hope you help others!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.