fig.align='center'不会使Diagrammer绘图在Xaringan演示文稿中居中。有什么想法吗?
参见下面的reprex。
---
title: "Title"
encoding: "UTF-8"
output:
xaringan::moon_reader:
self_contained: true
lib_dir: libs
css: [default]
nature:
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
ratio: "16:9"
---
exclude: true
```{r setup, include=FALSE}knitr::opts_chunk$set(
echo = FALSE,
warning=FALSE,
message=FALSE,
注释= NA)
---
# TITLE
.center[Some text]
```{r title, out.height='50%', fig.align='center'}DiagrammeR::grViz(“
有向图{
'graph‘语句
图形布局= twopi,重叠= false
几个'node‘语句
节点[形状=圆形,
fontname = 'Century Gothic', style = filled, color = white, fontcolor = white]节点填充颜色=钢蓝色
Hello;How;You;You
节点[标签=
‘我是reprex']
reprex1
节点[标签=
‘我也是个reprex']
reprex2
节点[填充颜色=珊瑚,
label =“这很奇怪,
我也是个reprex!‘]
reprex3
边缘颜色=灰色
reprex1 -> {Hello;How;You;Doing;reprex2;reprex3}
reprex3 -> reprex1
}
")
.center[yet another text]发布于 2020-07-12 10:46:10
我刚刚试过了: HTML <center>标签可以工作,并且应该是一个可行的解决方案。
只需将其添加到R代码之前,并在末尾以结束。这可能并不优雅(在CSS术语中),但它是有效的!
# TITLE
.center[Some text]
<center>
```{r title, out.height='50%', fig.align='center'}等。
https://stackoverflow.com/questions/62855840
复制相似问题