touying-typ / touying

Touying is a powerful package for creating presentation slides in Typst.
https://touying-typ.github.io/touying/
MIT License
461 stars 10 forks source link

`fletcher-diagram` does not work in other elements #34

Closed yjcui closed 2 months ago

yjcui commented 2 months ago

It is a great feature integrating fletcher into Touying. One issue I noticed is, I can not use fletcher-diagram in other elements like grid or columns as it will display as blank. This would be a critical feature as it's common to have text on left side while some chart on the right half in presentation, if one wants to use fletcher generated diagrams.

Below is the code snippet for testing. Only the left column is visible in the compiled pdf.

#slide[
  #grid(columns: (1fr, 1fr), gutter: 0.5em, [
    - Item 1
    - Item 2
  ], [#fletcher-diagram(cell-size: 15mm, $
      G edge(f, ->) edge("d", pi, ->>) & im(f) \
      G slash ker(f) edge("ur", tilde(f), "hook-->")
    $)
  ])
]
OrangeX4 commented 2 months ago

try

#slide[
    - Item 1
    - Item 2
][
    #fletcher-diagram(cell-size: 15mm, $
      G edge(f, ->) edge("d", pi, ->>) & im(f) \
      G slash ker(f) edge("ur", tilde(f), "hook-->")
    $)
]

https://touying-typ.github.io/touying/docs/layout#page-columns

yjcui commented 2 months ago

It works! Thanks!