ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Title-page overlay
@ 2005-03-20 16:12 Nikolai Weibull
  2005-03-20 16:28 ` Willi Egger
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2005-03-20 16:12 UTC (permalink / raw)


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);}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Title-page overlay
  2005-03-20 16:12 Title-page overlay Nikolai Weibull
@ 2005-03-20 16:28 ` Willi Egger
  2005-03-20 17:27   ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Willi Egger @ 2005-03-20 16:28 UTC (permalink / raw)


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
> 
> [1] http://www.pragma-ade.com/pdftex/pdftex-a.pdf
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Title-page overlay
  2005-03-20 16:28 ` Willi Egger
@ 2005-03-20 17:27   ` Nikolai Weibull
  2005-03-20 18:09     ` Patrick Gundlach
  2005-03-21  1:11     ` Title-page overlay / wiki example h h extern
  0 siblings, 2 replies; 6+ messages in thread
From: Nikolai Weibull @ 2005-03-20 17:27 UTC (permalink / raw)


* 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);}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Title-page overlay
  2005-03-20 17:27   ` Nikolai Weibull
@ 2005-03-20 18:09     ` Patrick Gundlach
  2005-03-20 19:41       ` Nikolai Weibull
  2005-03-21  1:11     ` Title-page overlay / wiki example h h extern
  1 sibling, 1 reply; 6+ messages in thread
From: Patrick Gundlach @ 2005-03-20 18:09 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: Title-page overlay
  2005-03-20 18:09     ` Patrick Gundlach
@ 2005-03-20 19:41       ` Nikolai Weibull
  0 siblings, 0 replies; 6+ messages in thread
From: Nikolai Weibull @ 2005-03-20 19:41 UTC (permalink / raw)


* 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);}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Title-page overlay / wiki example
  2005-03-20 17:27   ` Nikolai Weibull
  2005-03-20 18:09     ` Patrick Gundlach
@ 2005-03-21  1:11     ` h h extern
  1 sibling, 0 replies; 6+ messages in thread
From: h h extern @ 2005-03-21  1:11 UTC (permalink / raw)


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
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-03-21  1:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-20 16:12 Title-page overlay Nikolai Weibull
2005-03-20 16:28 ` Willi Egger
2005-03-20 17:27   ` Nikolai Weibull
2005-03-20 18:09     ` Patrick Gundlach
2005-03-20 19:41       ` Nikolai Weibull
2005-03-21  1:11     ` Title-page overlay / wiki example h h extern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).