xaringan - 幻灯片在 R 4.0.3 中无法正确渲染
问题描述
我已经升级到 R 4.0.3,我在 xaringan 中遇到了一些渲染问题。具体来说,我得到以下输出:
版本信息:平台 x86_64-apple-darwin17.0
arch x86_64
os darwin17.0
system x86_64, darwin17.0
status
major 4
minor 0.3
year 2020
month 10
day 10
svn rev 79318
language R
version.string R version 4.0.3 (2020- 10-10) 昵称 Bunny-Wunnies Freak Out
<!DOCTYPE html>
<html lang="" xml:lang="">
<head>
<title>Algorithmic trading and investment</title>
<meta charset="utf-8" />
<meta name="author" content="Barry Quinn" />
<meta name="date" content="2021-01-14" />
<link href="libs/remark-css/default.css" rel="stylesheet" />
<link href="libs/panelset/panelset.css" rel="stylesheet" />
<script src="libs/panelset/panelset.js"></script>
<script src="libs/xaringanExtra-webcam/webcam.js"></script>
<script id="xaringanExtra-webcam-options" type="application/json">{"width":"200","height":"200","margin":"1em"}</script>
<link rel="stylesheet" href="css/sfah.css" type="text/css" />
<link rel="stylesheet" href="css/fonts.css" type="text/css" />
</head>
<body>
<textarea id="source">
layout: true
<div class="my-footer"><span>quinference.com</span></div>
```{=html}
<div>
<style type="text/css">.xaringan-extra-logo {
width: 110px;
height: 128px;
z-index: 0;
background-image: url(img/redlogo.png);
background-size: contain;
background-repeat: no-repeat;
position: absolute;
top:1em;right:1em;
}
</style>
<script>(function () {
let tries = 0
function addLogo () {
if (typeof slideshow === 'undefined') {
tries += 1
if (tries < 10) {
setTimeout(addLogo, 100)
}
} else {
document.querySelectorAll('.remark-slide-content:not(.title-slide):not(.inverse):not(.hide_logo)')
.forEach(function (slide) {
const logo = document.createElement('div')
logo.classList = 'xaringan-extra-logo'
logo.href = null
slide.appendChild(logo)
})
}
}
document.addEventListener('DOMContentLoaded', addLogo)
})()</script>
</div>
```
---
name: ATL-title
class: inverse,left, middle
background-image: url(img/markus-spiske-466ENaLuhLY-unsplash.png)
background-size: cover
# Algorithmic Trading and Investing (FIN7030)
# .fancy[Lecture 2: High performance cloud computing in finance]
.large[Barry Quinn PhD CStat | Queen's Management School | 2021-01-14]
<!-- this ends up being the title slide since seal = FALSE-->
---
class:inverse
# Outline
- .salt[What is cloud computing?]
- .fat[Your Turn: Introduction to the QMS_HPCC]
- .salt[Taxonomy of parallel computing]
- .fat[Performance computing in Python]
- .salt[Financial applications in the cloud]
- .salt[Economics of the cloud computing]
- .salt[Some case studies]
---
</textarea>
<style data-target="print-only">@media screen {.remark-slide-container{display:block;}.remark-slide-scaler{box-shadow:none;}}</style>
<script src="https://remarkjs.com/downloads/remark-latest.min.js"></script>
<script src="https://platform.twitter.com/widgets.js"></script>
<script>var slideshow = remark.create({
"highlightStyle": "github",
"highlightLines": true,
"countIncrementalSlides": true,
"ratio": "16:9"
});
if (window.HTMLWidgets) slideshow.on('afterShowSlide', function (slide) {
window.dispatchEvent(new Event('resize'));
});
(function(d) {
var s = d.createElement("style"), r = d.querySelector(".remark-slide-scaler");
if (!r) return;
s.type = "text/css"; s.innerHTML = "@page {size: " + r.style.width + " " + r.style.height +"; }";
d.head.appendChild(s);
})(document);
(function(d) {
var el = d.getElementsByClassName("remark-slides-area");
if (!el) return;
var slide, slides = slideshow.getSlides(), els = el[0].children;
for (var i = 1; i < slides.length; i++) {
slide = slides[i];
if (slide.properties.continued === "true" || slide.properties.count === "false") {
els[i - 1].className += ' has-continuation';
}
}
var s = d.createElement("style");
s.type = "text/css"; s.innerHTML = "@media print { .has-continuation { display: none; } }";
d.head.appendChild(s);
})(document);
// delete the temporary CSS (for displaying all slides initially) when the user
// starts to view slides
(function() {
var deleted = false;
slideshow.on('beforeShowSlide', function(slide) {
if (deleted) return;
var sheets = document.styleSheets, node;
for (var i = 0; i < sheets.length; i++) {
node = sheets[i].ownerNode;
if (node.dataset["target"] !== "print-only") continue;
node.parentNode.removeChild(node);
}
deleted = true;
});
})();
(function() {
"use strict"
// Replace <script> tags in slides area to make them executable
var scripts = document.querySelectorAll(
'.remark-slides-area .remark-slide-container script'
);
if (!scripts.length) return;
for (var i = 0; i < scripts.length; i++) {
var s = document.createElement('script');
var code = document.createTextNode(scripts[i].textContent);
s.appendChild(code);
var scriptAttrs = scripts[i].attributes;
for (var j = 0; j < scriptAttrs.length; j++) {
s.setAttribute(scriptAttrs[j].name, scriptAttrs[j].value);
}
scripts[i].parentElement.replaceChild(s, scripts[i]);
}
})();
(function() {
var links = document.getElementsByTagName('a');
for (var i = 0; i < links.length; i++) {
if (/^(https?:)?\/\//.test(links[i].getAttribute('href'))) {
links[i].target = '_blank';
}
}
})();
(function(time) {
var d2 = function(number) {
return ('0' + number).slice(-2); // left-pad 0 to minutes/seconds
},
time_format = function(total) {
var secs = Math.abs(total) / 1000;
var h = Math.floor(secs / 3600);
var m = Math.floor(secs % 3600 / 60);
var s = Math.round(secs % 60);
var res = d2(m) + ':' + d2(s);
if (h > 0) res = h + ':' + res;
return res; // [hh:]mm:ss
},
slide_number_div = function(i) {
return document.getElementsByClassName('remark-slide-number').item(i);
},
current_page_number = function(i) {
return slide_number_div(i).firstChild.textContent; // text "i / N"
};
var timer = document.createElement('span'); timer.id = 'slide-time-left';
var time_left = time, k = slideshow.getCurrentSlideIndex(),
last_page_number = current_page_number(k);
setInterval(function() {
time_left = time_left - 1000;
timer.innerHTML = ' ' + time_format(time_left);
if (time_left < 0) timer.style.color = 'red';
}, 1000);
slide_number_div(k).appendChild(timer);
slideshow.on('showSlide', function(slide) {
var i = slide.getSlideIndex(), n = current_page_number(i);
// reset timer when a new slide is shown and the page number is changed
if (last_page_number !== n) {
time_left = time; last_page_number = n;
timer.innerHTML = ' ' + time_format(time); timer.style.color = null;
}
slide_number_div(i).appendChild(timer);
});
})(120000);
// adds .remark-code-has-line-highlighted class to <pre> parent elements
// of code chunks containing highlighted lines with class .remark-code-line-highlighted
(function(d) {
const hlines = d.querySelectorAll('.remark-code-line-highlighted');
const preParents = [];
const findPreParent = function(line, p = 0) {
if (p > 1) return null; // traverse up no further than grandparent
const el = line.parentElement;
return el.tagName === "PRE" ? el : findPreParent(el, ++p);
};
for (let line of hlines) {
let pre = findPreParent(line);
if (pre && !preParents.includes(pre)) preParents.push(pre);
}
preParents.forEach(p => p.classList.add("remark-code-has-line-highlighted"));
})(document);</script>
<script>
slideshow._releaseMath = function(el) {
var i, text, code, codes = el.getElementsByTagName('code');
for (i = 0; i < codes.length;) {
code = codes[i];
if (code.parentNode.tagName !== 'PRE' && code.childElementCount === 0) {
text = code.textContent;
if (/^\\\((.|\s)+\\\)$/.test(text) || /^\\\[(.|\s)+\\\]$/.test(text) ||
/^\$\$(.|\s)+\$\$$/.test(text) ||
/^\\begin\{([^}]+)\}(.|\s)+\\end\{[^}]+\}$/.test(text)) {
code.outerHTML = code.innerHTML; // remove <code></code>
continue;
}
}
i++;
}
};
slideshow._releaseMath(document);
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML';
if (location.protocol !== 'file:' && /^https?:/.test(script.src))
script.src = script.src.replace(/^https?:/, '');
document.getElementsByTagName('head')[0].appendChild(script);
})();
</script>
</body>
</html>
解决方案
推荐阅读
- c# - 如何从 C# 中的特定 Excel 工作表中进行选择
- c# - SMS 提供商的 WebAPI 和异步问题
- java - 无法在 Azure 门户进行身份验证
- jquery - 检查列表中的每个href是否包含问号(?)并添加&符号(&) - jquery
- typescript - 将对象元组合并为一种对象类型
- java - Hibernate 未在新线程 {org.hibernate.exception.GenericJDBCException: could not extract ResultSet} 中从数据库加载数据
- javascript - 添加多个选中的默认值选择 2 jQuery 选择框
- c++ - 为什么 int arr[]={0,3,2,4,5,6,7}; 给出错误和 int arr[7]={0,3,2,4,5,6,7}; 不是
- .net-core - 读取 dotnet core 上的用户配置文件相关文件
- objective-c - iOS - 无法将 .MOV 和 .jpg 保存为 LivePhoto - 显示错误 NSCocoaErrorDomain Code=-1 [目标 C]