quarto-dev / quarto-dev/quarto-cli

mermaid diagram is cropped in PDF outputs

Open
#2,438 6 comments 2 reactions 2 assignees View on GitHub

@cderv is already working on this.

Since Sep 14, 2022.

bug diagrams-mermaid windows
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Bug description

From https://stackoverflow.com/questions/73684948/how-to-prevent-mermaid-flow-charts-overflowing-in-quarto

---
title: "Workflow"
authors: "Satya P"
format: pdf
---

```{mermaid}
%%| fig-height: 9

flowchart TB
1(Available Data)

1 --> 2(aaaaaaaaa)

1 --> 3(bbbbbbbbbb)
1 --> 4(cccccccccc)
1 --> 5(ddddddddddd)
1 --> 7(eeeeeeeeee)
1 --> 8(fffffffffff)
1 --> 9(ggggggggggg)

7 --> 10(hhhhhhhhh)
8 --> 10(hhhhhhhhh)
9 --> 10(hhhhhhhhh)


3 --> 11(iiiiiiiii)
4 --> 11(iiiiiiiii)
5 --> 11(iiiiiiiii)

10 --> 12(jjjjjjjjj)
11 --> 12(jjjjjjjjj)

12 --> |kkkkkkkkk| 13(lllllllll)

13 --> |"mmmmmmmmmmm"| 14(nnnnnnnnnnn)

14 --> 15(oooooooooo)
2 -.-> 15
```

This gives a crop output
image

Possibly due to sizing when we do the screenshot.

Opening an issue to track if we can do something for wide diagrams like this

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.