nomnoml icon indicating copy to clipboard operation
nomnoml copied to clipboard

no svg figure displayed in xaringan presentation

Open rcst opened this issue 2 years ago • 1 comments

Great package, I love it.

However, when using the nomnoml knitr engine, the diagram will not be displayed as svg, when I use the option svg = TRUE Example

---
title: "Example"
author: "For Instance"
date: '`r format(Sys.Date(), format = "%d. %B %Y")`'
output:
  xaringan::moon_reader:
    lib_dir: lib
    seal: true
    nature:
      ratio: "16:9"
---

```{nomnoml, svg=TRUE}
[Hello]-[World]
```

(I save this as index.Rmd)

When I run xaringan::inf_mr("index.Rmd"), I see the slide as expected, however, it's not an svg-file, which you can see when I try to save it by right-click → "Save Image As ...". It gets saved as "canvas.png". Why? Bildschirmfoto_2021-10-18_20-45-37

Changing to svg=FALSE seems to have no effect.

rcst avatar Oct 18 '21 18:10 rcst

Yes, that does seem to be the case.

Try using an R chunk instead, since this seems to work correctly:

```{r}
nomnoml::nomnoml("[Hello]-[World]", svg = TRUE)
```

andrie avatar Feb 16 '22 18:02 andrie