Hi, I am trying to create a fletcher diagram. It includes a box which encloses two other boxes. These boxes should be inset from the enclosing box at 1em. Now I want to also set some text at the top-left corner of the enclosing box. This text should not be inset.
Is there a solution to this?
This is what I have come up with:
#import "@preview/fletcher:0.5.8" as fletcher: diagram, node, edge
#diagram(
node-stroke: 0.5pt,
spacing: 1em,
node(enclose: (<2>, <3>), inset: 1em, align(top+left,
text(size:8pt)[A short description]), name: <1>),
node((0,4), [Some box], name: <2>),
edge("-|>"),
node((0,5), [Some other box], name: <3>),
)
#let node = node.with(shape: rect, corner-radius: 4pt)
#diagram(
node-stroke: 0.5pt,
spacing: 1em,
node(enclose: (<2>, <3>), inset: 1em, name: <1>),
node((rel: (0, 0), to: <1.north-west>), align(left, text(size:8pt)[A
description]), inset: 0.1em),
node((0,4), [Some box], name: <2>),
edge("-|>"),
node((0,5), [Some other box], name: <3>),
)
But you can see, both are not ideal. Basically I want the description to just be placed at the top-left of the enclosing box, with no inset.