ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to assign \MPstring before creating page?
@ 2007-04-26 15:46 Zhichu Chen
  2007-04-27  0:34 ` Zhichu Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Zhichu Chen @ 2007-04-26 15:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1458 bytes --]

Hi, everybody

I want to use my titles as water marks. I've tried this small test file:
=================================

\setupcolors[state=start]
\setuppagenumbering[location=]

\setMPtext{titleentry}{xxx}

\setuphead
  [title]
  [textcommand=\TITLE,
   page=right,
   before=,
   after=\blank,
   inbetween=,
   header=,
   textstyle=,
   style=]

\def\TITLE#1%
  {#1\setMPtext{titleentry}{#1}}

\setupbackgrounds
   [page]
   [background=page]

\defineoverlay[page] [\useMPgraphic{page}]

\startuseMPgraphic{page}
  StartPage;
    save r;
    picture r;
    r := textext.rt(\MPstring{titleentry});
    r := r shifted (.5Hsize[Text],.5Vsize[Text]);
    draw r withcolor darkred;
  StopPage;
\stopuseMPgraphic

\starttext

\title{Some Title}

Some texts.

\page[yes]

Some texts.

\stoptext
=================================
It seems it did not get the correct parameter. So I guess the \setMPtext
inside \TITLE was not executed when the page was created. I also want to get
chapter titles as water marks as well. What can I do?

Thank you.

-- 
Best Regards
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 2425 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: How to assign \MPstring before creating page?
  2007-04-26 15:46 How to assign \MPstring before creating page? Zhichu Chen
@ 2007-04-27  0:34 ` Zhichu Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Zhichu Chen @ 2007-04-27  0:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2103 bytes --]

Thanks anyway. \getmarking works fine, interesting

On 4/26/07, Zhichu Chen <zhichu.chen@gmail.com> wrote:
>
> Hi, everybody
>
> I want to use my titles as water marks. I've tried this small test file:
> =================================
>
> \setupcolors[state=start]
> \setuppagenumbering[location=]
>
> \setMPtext{titleentry}{xxx}
>
> \setuphead
>   [title]
>   [textcommand=\TITLE,
>    page=right,
>    before=,
>    after=\blank,
>    inbetween=,
>    header=,
>    textstyle=,
>    style=]
>
> \def\TITLE#1%
>   {#1\setMPtext{titleentry}{#1}}
>
> \setupbackgrounds
>    [page]
>    [background=page]
>
> \defineoverlay[page] [\useMPgraphic{page}]
>
> \startuseMPgraphic{page}
>   StartPage;
>     save r;
>     picture r;
>     r := textext.rt(\MPstring{titleentry});
>     r := r shifted (.5Hsize[Text],.5Vsize[Text]);
>     draw r withcolor darkred;
>   StopPage;
> \stopuseMPgraphic
>
> \starttext
>
> \title{Some Title}
>
> Some texts.
>
> \page[yes]
>
> Some texts.
>
> \stoptext
> =================================
> It seems it did not get the correct parameter. So I guess the \setMPtext
> inside \TITLE was not executed when the page was created. I also want to get
> chapter titles as water marks as well. What can I do?
>
> Thank you.
>
> --
> Best Regards
> Chen
> ----------------------------------------------------------------
>
>           Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
>          No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
>              tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
>                                                | www.sinap.ac.cn
> ----------------------------------------------------------------
>



-- 
Best Regards
Chen
----------------------------------------------------------------

          Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
         No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
             tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
                                               | www.sinap.ac.cn
----------------------------------------------------------------

[-- Attachment #1.2: Type: text/html, Size: 3871 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2007-04-27  0:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 15:46 How to assign \MPstring before creating page? Zhichu Chen
2007-04-27  0:34 ` Zhichu Chen

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