I'd like to use Metapost to format my titles like this (not exactly like this, so no need to complain about design issues :)):
The problem is that when I try to use the following macro I get an error:
tex error > error on line 4 in file
/------------/minimal-mpgraph.tex: ! Undefined control sequence
<argument> \setstrut \begstrut \getheadtitle
\endstrut
\MPLIBgraphictext ...\startTEXpage [scale=10000]#1
\stopTEXpage
l.4 ...\setstrut \begstrut \getheadtitle \endstrut }
1 \starttext
2 \def\MPLIBgraphictext#1{\startTEXpage[scale=10000]#1\stopTEXpage}
3
4 >> \MPLIBgraphictext{\setstrut \begstrut \getheadtitle \endstrut }
5 \stoptext
I'm guessing here that the problem is internally the \getheadtitle. I'm quite clueless how to solve this though. Is there something wrong with my macro or is it just impossible to pass section titles to macros using Metapost? Any help is appreciated. Code:
\define[1]\DashedText%
{%
\startuseMPgraphic{dashed_number}
graphictext "#1" % the part "#1" does not work :(
scaled 5
dashed evenly
withdrawcolor (0.1,0.4,0.1)
withfillcolor (0.6,0.8,0.9)
withpen pencircle scaled 3.0pt
\stopuseMPgraphic
\useMPgraphic{dashed_number}{}%
}
\setuphead [section]
[
number=no,
textcommand=\DashedText,
]
\starttext
\startsection [title={Fancy Title}]
\input knuth
\stopsection
\stoptext