简体   繁体   English

Rmarkdown中带有self_contained的重音错误:FALSE和小部件(图表和其他)

[英]Error in accentuation in Rmarkdown with self_contained: FALSE and widgets (dygraphs and others)

I'm trying to make a html Rmarkdown with a dygraphs and using a source file. 我正在尝试使一个dygraphs和使用源文件的html Rmarkdown。 When I use self_contained: TRUE I don't have a problem, but when I use self_contained: FALSE , the legend accentuation goes wrong. 当我使用self_contained: TRUE我没有问题,但是当我使用self_contained: FALSE ,图例的强调错误。

带有自包含的音标:FALSE。正确的是“Orgânico”

If I use without the source, that's OK, but I need to use sources in my case. 如果我不使用源代码就可以,但是我需要使用源代码。

Here I put a reproducible code: 我在这里放了一个可复制的代码:

the source (tilemaker.R) 来源(tilemaker.R)

ptcolsumm <-  c("Usuários", "Sessões", "Pageview Único", "Pageviews",  "Tempo Médio", "Rejeição", "Taxa de Rejeição", "Taxa de Saída", "não sei", "ACENTUAÇÃO", "Teste")

organic <- data.frame(organic = as.numeric(c(186,640,278,11,267,117,41,17,38)))
organic <- as.ts(organic)

# Facebook impressions by type
teste <- dygraph(organic) %>%
  dySeries("organic", label = "Orgânico") %>%
  dyLegend(width = 400, show = "always") %>%
  dyOptions(fillGraph = TRUE, fillAlpha = 0.2, drawGrid = FALSE, drawPoints = TRUE, pointSize = 2)

The Rmd: Rmd:

---
title: "Habits"
output:
  html_document:
    theme: flatly
    highlight: tango
    self_contained: FALSE
---
```{r source}
require(magrittr)
require(dygraphs)
source("tilemaker.R", encoding = "UTF-8")
```
<style> /* CSS style to solve the problem with the sparkline tooltip */
.jqstooltip {
  -webkit-box-sizing: content-box;
  -moz-box-sizing: content-box;
  box-sizing: content-box;
}
</style>

## Quarterly Results {.tabset}

### By Region

```{r3}

teste

```

### BLOH BLOH 3
TESTE DE 3 DIVISÕES

If I don't use the tabs, it's works too, but I need it too. 如果我不使用选项卡,它也可以使用,但我也需要它。

@Yihui solved the problem. @Yihui解决了这个问题。 The problem was in the html tools package. 问题出在html工具包中。

To solve the problem immediately: 立即解决问题:

devtools::install_github('rstudio/htmltools@bugfix/utf8-preserved-chunks')`

I think they will merge the chunk in the next release of the htmltools package and the problem would be solved for all new instalations. 我认为他们将在htmltools软件包的下一个版本中合并该块,所有新安装的问题都将得到解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM