I'm trying to generate a quarto document in pdf (and word later). I'm meeting an issue with the mermaid graph. Please find bellow a sample .qmd file to illustrate the issue.
So first it's supposed to support the {mermaid}
tag but when i do that, I can't "run" the cell in rstudio, but also my document doesn't actually generated and the "background jobs" in rstudio gets stuck on "output file: testmermaid.knit.md"
So I use DiagrammeR::mermaid
to encapsulate this, then the document is indeed generated but the size is too small and if I resize the figure generated then it becomes all blurry.
I made many attempts but none of them worked so if someone would have a simple solution where the diagram would go Xcm from the left to Ycm to the right, and be generated correctly in pdf and word?
EDIT:
After @Shafee's comment, I've noticed I didn't have the quarto package installed, I have now installed the latest R package quarto 1.0.36 and reinstalled RStudio (2022.07.1 build 554) for the sake of it, but the problem is unchanged.
I've also noticed my personal computer (same version of RStudio and quarto) doesn't have these issues (still can't run a mermaid chunk in Rstudio IDE though)
EDIT2:
after a full reinstall on the local hard drive (instead of windows network drive) I get this:
output file: testmermaid.knit.md
ERROR: Couldn't find open server
my version is now:
quarto::quarto_version() 1 ‘1.1.189’
---
title: "TestMermaid"
format: pdf
---
```{r libimport}
library(quarto)
library(DiagrammeR)
knitr::opts_chunk$set(echo = F)
```
## Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
Attempt #1
```{mermaid attempt1}
flowchart LR
A[Hard edge] --> B(Round edge)
B --> C{Decision}
C --> D[Result one]
C --> E[Result two]
```
Attempt #2
```{r attempt2}
mermaid("
sequenceDiagram
participant ParticipantA
participant ParticipantB
participant ParticipantC
ParticipantA->>ParticipantB: I want something
ParticipantB->>ParticipantC: he want something
ParticipantC->>ParticipantB: here is something
ParticipantB->>ParticipantA: he got something for you
", height = '100%', width = '100%')
```