---
title: "Margin Figure Caption Above Test"
papersize: us-letter
format:
  html: default
  typst:
    keep-typ: true
_quarto:
  tests:
    typst:
      ensureTypstFileRegexMatches:
        - ['#notefigure\(', 'position: top']
        - []
      ensurePdfTextPositions:
        - # Caption in margin, right of body
          - subject: "CAP-ABOVE"
            relation: rightOf
            object: "This tests"
          # Plot content (★ marker) in margin, right of body
          - subject: "★"
            relation: rightOf
            object: "This tests"
          # Caption ABOVE plot (cap-location: top)
          - subject: "CAP-ABOVE"
            relation: above
            object: "★"
        - []
      noErrors: default
---

This tests a margin figure with caption positioned above the figure content using `cap-location="top"`.

![CAP-ABOVE](test-plot.svg){#fig-cap-above .column-margin cap-location="top" width=100%}

See @fig-cap-above for the figure with caption above.

More text in the main column to show the layout.
