Add X-UA-Compatible in rmarkdown html output

℡╲_俬逩灬. 提交于 2019-12-04 07:02:46

I just ran into this issue too. As people have said in the comments, editing the template html file used by rmarkdown works. I copied and edited the template saved at approximately "C:\Users\ProfileX\Documents\R\win-library\3.4\rmarkdown\rmd\h\default.html" (thanks @visu-l)

You want to add the tag as the first one within <head>:

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"$if(lang)$ lang="$lang$" xml:lang="$lang$"$endif$>

<head>

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Then save the html template, and point to it within YAML:

---
title: "xxx"
output:
  html_document:
    template: path/to/custom/template.html
---
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!