![](https://secure.gravatar.com/avatar/de231c8f10866e1ade625f00d831d359.jpg?s=120&d=mm&r=g)
I would like to put a rather large and complicated regular expression into the title-page of a document I'm writing. So far, I haven't had much luck defining an overlay that uses \starttyping ... \stoptyping. Basically, what I figured I should do was to write \defineoverlay [TitleGraphic] [{ \starttyping ... \stoptyping }] and then \setupbackgrounds[page][background=TitleGraphic] But that doesn't work: ! Argument of \copyverbatimline has an extra }. Have any suggestions on what I might try? Basically, what I want is a background with some arbitrary text, more or less like the pdfTeX user manual document does it [1], nikolai [1] http://www.pragma-ade.com/pdftex/pdftex-a.pdf -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: minimalistic.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
![](https://secure.gravatar.com/avatar/6af06dcf5f958fe4ec149408292d6acd.jpg?s=120&d=mm&r=g)
Hi Nikolai, May be you should try a buffer to put the typing in. In the overlay you can call the buffer with \typebuffer[...] Willi Nikolai Weibull wrote:
I would like to put a rather large and complicated regular expression into the title-page of a document I'm writing. So far, I haven't had much luck defining an overlay that uses \starttyping ... \stoptyping.
Basically, what I figured I should do was to write
\defineoverlay [TitleGraphic] [{ \starttyping ... \stoptyping }]
and then
\setupbackgrounds[page][background=TitleGraphic]
But that doesn't work:
! Argument of \copyverbatimline has an extra }.
Have any suggestions on what I might try? Basically, what I want is a background with some arbitrary text, more or less like the pdfTeX user manual document does it [1], nikolai
![](https://secure.gravatar.com/avatar/de231c8f10866e1ade625f00d831d359.jpg?s=120&d=mm&r=g)
* Willi Egger (Mar 20, 2005 18:00):
May be you should try a buffer to put the typing in. In the overlay you can call the buffer with \typebuffer[...]
\startbuffer[title] ... \stopbuffer \defineoverlay [TitleGraphic] [{\startcolor[titlegraphic]\typebuffer[title]\stopcolor}] \setupbackgrounds[page][background=TitleGraphic] The problem with that is that everything winds up on one line for some reason, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: minimalistic.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
![](https://secure.gravatar.com/avatar/62c54476729274ddfefd6b1f53e311dc.jpg?s=120&d=mm&r=g)
Hello Nicolai, put your \typebuffer stuff in \framed[align=lohi] you can use width=\overlaywidth and height=\overlayheight if you need. Patrick (or.... post a complete but minimal example) -- ConTeXt wiki: http://contextgarden.net
![](https://secure.gravatar.com/avatar/de231c8f10866e1ade625f00d831d359.jpg?s=120&d=mm&r=g)
* Patrick Gundlach (Mar 20, 2005 19:20):
Hello Nicolai,
k, please.
put your \typebuffer stuff in \framed[align=lohi]
That was a very good suggestion, thank you. It worked out fine. This is what I do now: \defineoverlay [TitleGraphic] [{\framed [align=middle,width=\overlaywidth,height=\overlayheight,top=\vss,bottom=\vss,foregroundcolor=titlegraphic] {\typebuffer[titlebackground]}}] Thanks, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: minimalistic.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
Nikolai Weibull wrote:
* Willi Egger (Mar 20, 2005 18:00):
May be you should try a buffer to put the typing in. In the overlay you can call the buffer with \typebuffer[...]
\startbuffer[title] ... \stopbuffer
\defineoverlay [TitleGraphic] [{\startcolor[titlegraphic]\typebuffer[title]\stopcolor}]
\setupbackgrounds[page][background=TitleGraphic]
The problem with that is that everything winds up on one line for some reason,
a good reason: it's a hbox, so you need ...[\vbox{...}]... alternative regexp title page (nice example for wiki) % \startbuffer[title] % /(.*?)testexpr/io % /t(.*?)estexpr/io % /te(.*?)stexpr/io % /tes(.*?)texpr/io % /test(.*?)expr/io % /teste(.*?)xpr/io % /testex(.*?)pr/io % /testexp(.*?)r/io % /testexpr(.*?)/io % \stopbuffer \definetype[ytyp][color=yellow] \startbuffer[title] \type{/(}\ytyp{h}\type{*?)testexpr/io}\par \type{/t(}\ytyp{a}\type{*?)estexpr/io}\par \type{/te(}\ytyp{n}\type{*?)stexpr/io}\par \type{/tes(}\ytyp{s}\type{*?)texpr/io}\par \type{/test(}\ytyp{h}\type{*?)expr/io}\par \type{/teste(}\ytyp{a}\type{*?)xpr/io}\par \type{/testex(}\ytyp{g}\type{*?)pr/io}\par \type{/testexp(}\ytyp{e}\type{*?)r/io}\par \type{/testexpr(}\ytyp{n}\type{*?)/io}\par \stopbuffer \setupcolors[state=start] \definelayer [TitleGraphic] [width=\paperwidth, height=\paperheight] \setlayer [TitleGraphic] [preset=lefttop] {\scale [width=\paperwidth, height=\paperheight] {\framed [frame=off, offset=overlay, background=color, backgroundcolor=blue, foregroundcolor=red, align=normal] % {\setuptyping[before=,after=]\typebuffer[title]}}} {\getbuffer[title]}}} \setupbackgrounds[page][background=TitleGraphic] \starttext \startstandardmakeup \stopstandardmakeup \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (4)
-
h h extern
-
Nikolai Weibull
-
Patrick Gundlach
-
Willi Egger