Math Expression in RMarkdown and Markdown (RStudio) - html

I was trying to create a technical note in R Markdown with Knit in RStudio. If I output an html file, it works well. However, if I output a Markdown (to be uploaded as a post in blog) file, some formulas cannot be shown correctly. Does anyone know why? Thanks in advance.
This is the .rmd file
This is the html output (works)
This is the .md file (some formula breaks)

Related

Rmarkdown only saves figures, no html

It seems that after knitting my rmarkdown file, only the figures are saved in my working directory. I cannot find any html file.
Running the file takes a long time and somehow Rstudio closes right before finishing the knit.
Could someone help solving this problem? Thanks
Trying to knit a Rmarkdown file, but it didn’t save. Only figures were saved

Flexdashboard doesn't display text in one of the tabs, but works perfect as .html file

Rmarkdown after knit the Flexdashboard .doc doesn't display the content in a tab, but it will display the output from .html generated file. I don't know what the issue is.
Here is a link to code on Pastebin and dataset on Easyupload
Thanks in advance for any tips.
.html generated file output
flexdashboard file

RMarkdown - HTML generated files without markdown styling

I have installed RMarkdown package in my R-Studio and I want to knit into HTML format. After knitting any .rmd file (including the default code created after starting a new Rmd file), the output html file does not include any markdown styling. See the picture of the generated html file on my computer here:
As you can see for example, the font is set as plain Times New Roman and also the way the dataframes are displayed does not look like the usual markdown-style.
Please, how can I get the HTML file styled as an usual markdown file?
Note: I did not modify the markdown.css file in the library's folder.
Thanks in advance!

Exporting Markdown to HTML While Updating Links

I have two markdown documents; A.md and B.md. The A document includes a link to B using the tag (B)[B.md]. That link works great when navigating markdown documents.
Now I want to export all my markdown files to HTML as part of a release documentation package. The issue is that in the exported HTML the link points to B.md when what I really want it to point to is the newly exported B.html.
Anyone have any ideas on how to automatically update links?
I am currently using pandoc to export to html because it has a command line interface and therefore I can script its execution.
Right now my workaround is to update A so that it links to the html version of B, [B](b.html). This allows my html exported documents to work but breaks navigation within the original markdown files. Alternatively I could replace the links myself as part of the script but that sounds painful.
What I am really looking for is a way to export a collection of markdown files as a standalone documentation package.
You can use a simple Lua filter to change the link from .md to .html:
-- file: change-links.lua
function Link (link)
link.target = link.target:gsub('.md$', '.html')
return link
end
Adding the parameter --lua-filter=change-links.lua to your call to pandoc should be all that is needed.
See also this related question.

How to convert a DOCX file with figures to a standalone HTML file using base64 using Pandoc?

The following question (and there're a few more places where this issue has been discussed and resolved) discusses how to convert an .html file with base64 images to a .docx file.
Posiible to use pandoc with HTML containing base64 inline images?
I want to go the other way — convert .docx which has images to a standalone .html file with base64 code which reproduces (not necessarily with the same quality) the images present in the .docx file. For starters, I tried:
pandoc -s -o chapter1.html cc.docx
as well as
pandoc -o chapter1.html cc.docx
In both cases the .html file generated contains lines like img src="media/image1.png" which indicate that Pandoc tried to create (or thinks it has created) a folder named media where the figures from the .docx file are placed. But there is no such folder created by Pandoc. In any case I want the .html file to be a standalone document (just like the .docx file) and I don't need the folder.
I tried looking this up on the web, but the only solutions I get, pertain to the problem of converting base64 images in .html to .docx and not the other way round.
Maybe it didn't work two years ago (March 2013) when you asked. Now it does, with the latest version of Pandoc (v1.13.2.1):
pandoc -o out.html --self-contained in.docx