summaryrefslogtreecommitdiff
path: root/Master/texmf/asymptote/annotate.asy
blob: aba9309cb6581986f2e3ec49880ebc3b6206c485 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void annotate(picture pic=currentpicture, string title, string text,
              pair position)
{
  pic.add(new void(frame f, transform t) {
      position=t*position;
      label(f,"\special{!/pdfmark where
                 {pop} {userdict /pdfmark /cleartomark load put} ifelse
                 [/Rect["+(string) position.x+" 0 0 "+(string) position.y+"]
                 /Subtype /Text
                 /Name /Comment
                 /Title ("+title+")
                 /Contents ("+text+")
                 /ANN pdfmark}");
    },true);
  draw(pic,position,invisible);
}