I'm trying to write a module that will mimick the behavior of crop.sty in LaTeX (providing fancier cropmarks than the ones given by the ConTeXt \setuplayout command). I'm done with the code for the cropmarks, and this is working fine. Now I want to have a status line in between the two top marks. How can I give an absolute position for a layer that will put this line midaligned and exactly, say 0.5cm above the level of the upper corners of the page? What I tried so far is: \composedlayer and something like \setlayer[y=2cm] - will only be on the first page, not repeated; \framed - I can give the frame a height like 1.3\textheight, but then the position will not be fixed, but change with the textheight I guess there must be a trivial solution, but I haven't found it yet... Best Thomas
Hi Thomas, Thomas A. Schmitz wrote:
I'm trying to write a module that will mimick the behavior of crop.sty in LaTeX (providing fancier cropmarks than the ones given by the ConTeXt \setuplayout command). I'm done with the code for the cropmarks, and this is working fine. Now I want to have a status line in between the two top marks. How can I give an absolute position for a layer that will put this line midaligned and exactly, say 0.5cm above the level of the upper corners of the page? What I tried so far is: \composedlayer and something like \setlayer[y=2cm] - will only be on the first page, not repeated;
\setuplayer[LAYERNAME][repeat=yes] \setlayer[LAYERNAME][x=??, y=20mm, location=c]{your status line} x should be (CROPLeftX+CROPrightX)/2 not tested.... Greetings, Peter
\framed - I can give the frame a height like 1.3\textheight, but then the position will not be fixed, but change with the textheight
I guess there must be a trivial solution, but I haven't found it yet...
Best
Thomas _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Thanks for your suggestion, but I didn't get it to work. In the end, I had recourse to some low-level stuff (caution, ugly code ahead!): \defineoverlay[info][{\getbuffer[info]}] \setupbackgrounds[page][background={info}] \startbuffer[info] \vbox to \paperheight \bgroup \vskip -1 cm \framed[frame=off,align=high]{\tt \txx "\jobname" - \currentdate [y,/,mm,/,dd]\ - \currenttime\ - \realfolio\ of \lastpage} \egroup \stopbuffer (code adapted from construction of Thumb index on the wiki) Which seems to be doing exactly what I want. Thanks, and best Thomas On Oct 5, 2005, at 1:12 PM, Peter Rolf wrote:
\setuplayer[LAYERNAME][repeat=yes]
\setlayer[LAYERNAME][x=??, y=20mm, location=c]{your status line}
x should be (CROPLeftX+CROPrightX)/2
not tested....
Thomas A. Schmitz wrote:
Thanks for your suggestion, but I didn't get it to work. In the end, I had recourse to some low-level stuff (caution, ugly code ahead!):
:))
this time tested:
% interface=en output=pdftex
% Time-stamp:
\defineoverlay[info][{\getbuffer[info]}]
\setupbackgrounds[page][background={info}]
\startbuffer[info] \vbox to \paperheight \bgroup \vskip -1 cm \framed[frame=off,align=high]{\tt \txx "\jobname" - \currentdate [y,/,mm,/,dd]\ - \currenttime\ - \realfolio\ of \lastpage} \egroup \stopbuffer
(code adapted from construction of Thumb index on the wiki)
Which seems to be doing exactly what I want.
Thanks, and best
Thomas
On Oct 5, 2005, at 1:12 PM, Peter Rolf wrote:
\setuplayer[LAYERNAME][repeat=yes]
\setlayer[LAYERNAME][x=??, y=20mm, location=c]{your status line}
x should be (CROPLeftX+CROPrightX)/2
not tested....
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Wonderful, this looks much better and is exactly what I wanted! [y=-20mm, if I want something on top of the logical paper] Thanks a lot! Thomas On Oct 5, 2005, at 3:55 PM, Peter Rolf wrote:
\definelayer[markings][width=\paperwidth, height=\paperheight, repeat=yes]
\setupbackgrounds[page][background={markings}]
\starttext
\setlayer[markings][x=.5\paperwidth, y=20mm, location=c]% {\tt \txx "\jobname" - \currentdate [y,/,mm,/,dd]\ - \currenttime\ - \realfolio\ of \lastpage}
Hi All, how to write the word "DRAFT" (big and transparent) on every page of a document using ConTeXt? Thanks! -- // Jilani KHALDI http://jkhaldi.oltrelinux.com
Try this code: \startuseMPgraphic{draft} draw "DRAFT" infont "phvb" scaled 9 rotated 57 withcolor .85white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft] HTH Thomas On Oct 6, 2005, at 10:20 PM, Jilani Khaldi wrote:
Hi All, how to write the word "DRAFT" (big and transparent) on every page of a document using ConTeXt? Thanks!
\startuseMPgraphic{draft} draw "DRAFT" infont "phvb" scaled 9 rotated 57 withcolor .85white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft]
I can't get it working, could you please give me more information how to use this code? Thank you. -- // Jilani KHALDI http://jkhaldi.oltrelinux.com
On Thu, 06 Oct 2005 23:49:22 +0200, Jilani Khaldi
\startuseMPgraphic{draft} draw "DRAFT" infont "phvb" scaled 9 rotated 57 withcolor .85white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft]
I can't get it working, could you please give me more information how to use this code? Thank you.
Please give the appropriate extracts from the log file, including ConTeXt version and where the error occurs. Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523
Please give the appropriate extracts from the log file, including ConTeXt version and where the error occurs.
This is pdfeTeX, Version 3.141592-1.21a-2.2 (MiKTeX 2.4) (preloaded
format=cont-en 2005.9.28) 7 OCT 2005 11:52
entering extended mode
**draft1.tex
(draft1.tex
ConTeXt ver: 2005.08.31 fmt: 2005.9.28 int: english mes: english
language : language en is active
13->2:2 cz->il2:il2->14->2:2 cz->ec:ec->15->2:2 sk->il2:il2->16->2:2 sk->ec:ec ->17->2:2 pl->pl0:pl0->18->2:2 pl->ec:ec->19->2:2 loaded specials : tex,postscript,rokicki loaded system : draft1.top loaded (./draft1.top specials : loading definition file tpd (C:\texmf\tex\context\base\spec-tpd.tex specials : loading definition file fdf (C:\texmf\tex\context\base\spec-fdf.tex) specials : fdf loaded ) specials : fdf,tpd loaded )
color : system rgb is global activated (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) (./draft1.tuo) systems : begin file draft1 at line 14 chapter : 1 Integrali da 1 a 10 section : 1.1 I-001 section : 1.2 I-002 (C:\texmf\tex\context\base\pdfr-ec.tex) fonts : resetting map file list fonts : using map file: original-base fonts : using map file: ec-public-lm fonts : using map file: ec-base fonts : using map file: original-ams-base fonts : using map file: original-public-lm systems : randomizer starts with 836731516 [MP to PDF] (./draft1-mpgraph.4000) [1.1{original-empty.map}{original-base.map} {ec-public-lm.map}{ec-base.map}{original-ams-base.map}{original-public-lm.map}] section : 1.3 I-003 section : 1.4 I-004 [MP to PDF] (./draft1-mpgraph.3999) [2.2] section : 1.5 I-005 section : 1.6 I-006 section : 1.7 I-007 [MP to PDF] (./draft1-mpgraph.3998) [3.3] section : 1.8 I-008 section : 1.9 I-009 [MP to PDF] (./draft1-mpgraph.3997) [4.4] section : 1.10 I-010 [MP to PDF] (./draft1-mpgraph.3996) [5.5] systems : end file draft1 at line 211 [flush and process draft1-mpgraph.mp afterwards] ) Here is how much of TeX's memory you used: 1499 strings out of 61144 24008 string characters out of 647757 525593 words of memory out of 1080614 37208 multiletter control sequences out of 60000 81098 words of font info for 39 fonts, out of 1000000 for 2000 182 hyphenation exceptions out of 4999 44i,21n,61p,410b,655s stack positions out of 5000i,500n,10000p,200000b,32768s PDF statistics: 41 PDF objects out of 300000 0 named destinations out of 300000 5 words of extra memory for PDF output out of 65536 {cmrm.enc}<C:\texmf\fonts\typ e1\public\lm\lmr7.pfb><C:\texmf\fonts\type1\bluesky\cm\cmmi9.pfb><C:\texmf\font s\type1\bluesky\cm\cmsy10.pfb><C:\texmf\fonts\type1\public\lm\lmr9.pfb><C:\texm f\fonts\type1\bluesky\cm\cmex10.pfb><C:\texmf\fonts\type1\public\lm\lmr12.pfb>< C:\texmf\fonts\type1\bluesky\cm\cmmi12.pfb>{ec-lm.enc}<C:\texmf\fonts\type1\pub lic\lm\lmr12.pfb> Output written on draft1.pdf (5 pages, 102920 bytes). %%%%%%%%%%%% E N D %%%%%%%%%%%%%
As you can see, the PDF file has been normaly created, but without any "DRAFT". Ciao! -- // Jilani KHALDI http://jkhaldi.oltrelinux.com
You'll need to do 2 things: in your texmf.cnf, you have to set shellescape to "t" (don't ask me where that is located on a windows system, I have no idea). In cont-sys.tex, uncomment these two lines: \runMPgraphicstrue \runMPTEXgraphicstrue Good luck Thomas On Oct 7, 2005, at 12:03 PM, Jilani Khaldi wrote:
As you can see, the PDF file has been normaly created, but without any "DRAFT".
Ciao!
On Fri, 7 Oct 2005, Thomas A. Schmitz wrote:
You'll need to do 2 things:
in your texmf.cnf, you have to set shellescape to "t" (don't ask me where that is located on a windows system, I have no idea).
In cont-sys.tex, uncomment these two lines:
\runMPgraphicstrue \runMPTEXgraphicstrue
Perhaps a bit simpler: \setupcolors[state=start] \defineoverlay[Draft][{\lightgray \scale[factor=max]{\rotate[rotation=60]{~DRAFT~}}}] \setupbackgrounds[page][background=Draft] \starttext \input tufte \stoptext Cheers, Peter -- http://pmrb.free.fr/contact/
Perhaps a bit simpler:
\setupcolors[state=start] \defineoverlay[Draft][{\lightgray \scale[factor=max]{\rotate[rotation=60]{~DRAFT~}}}] \setupbackgrounds[page][background=Draft] \starttext \input tufte \stoptext
It works! Thank You :-) -- // Jilani KHALDI http://jkhaldi.oltrelinux.com
works properly here on macosx with texshop -a- On 6 Oct 2005, at 23:49, Jilani Khaldi wrote:
\startuseMPgraphic{draft} draw "DRAFT" infont "phvb" scaled 9 rotated 57 withcolor .85white ; currentpicture := currentpicture ysized (\overlayheight-3cm) ; \stopuseMPgraphic \defineoverlay[draft][\uniqueMPgraphic{draft}] \setupbackgrounds[page][background=draft]
I can't get it working, could you please give me more information how to use this code? Thank you.
-- // Jilani KHALDI http://jkhaldi.oltrelinux.com
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Andrea Valle Laboratorio multimediale "G. Quazza" Facoltà di Scienze della Formazione Università degli Studi di Torino andrea.valle@unito.it
Hi to all, I'm including in a set of slides some ASCII ART. Actually I'm using start-stoptyping. E.g. \starttyping || knight || | | + \ \\.G_.*=. `(H'/.\| .>' (_--. _=/d ,^\ ~~ \)-' ' / | ' ' a:f \stoptyping Works fine, but obviously text remains text (--> large figures are splitted among different pages). I'd like to treat the ascii text lines as a unique block, just like a figure. What's the best way? Thanks a lot Best -a-
andrea valle wrote:
Hi to all, I'm including in a set of slides some ASCII ART. Actually I'm using start-stoptyping. E.g. \starttyping
|| knight ||
| | + \ \\.G_.*=. `(H'/.\| .>' (_--. _=/d ,^\ ~~ \)-' ' / | ' ' a:f \stoptyping
Works fine, but obviously text remains text (--> large figures are splitted among different pages). I'd like to treat the ascii text lines as a unique block, just like a figure. What's the best way?
Would \framed[frame=off,...]{... your figure ...} or \vbox{... your figure ...} solve the problem? (\startyping ... \stoptyping inside \framed caused some problems here, but \vbox worked OK.) Mojca
thanks! Ok with \vbox -a- On 9 Oct 2005, at 11:38, Mojca Miklavec wrote:
andrea valle wrote:
Hi to all, I'm including in a set of slides some ASCII ART. Actually I'm using start-stoptyping. E.g. \starttyping
|| knight ||
| | + \ \\.G_.*=. `(H'/.\| .>' (_--. _=/d ,^\ ~~ \)-' ' / | ' ' a:f \stoptyping
Works fine, but obviously text remains text (--> large figures are splitted among different pages). I'd like to treat the ascii text lines as a unique block, just like a figure. What's the best way?
Would \framed[frame=off,...]{... your figure ...} or \vbox{... your figure ...} solve the problem?
(\startyping ... \stoptyping inside \framed caused some problems here, but \vbox worked OK.)
Mojca _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Andrea Valle Laboratorio multimediale "G. Quazza" Facoltà di Scienze della Formazione Università degli Studi di Torino andrea.valle@unito.it
On Thu, 06 Oct 2005 22:20:34 +0200, Jilani Khaldi
Hi All, how to write the word "DRAFT" (big and transparent) on every page of a document using ConTeXt? Thanks!
For one approach, see the following http://archive.contextgarden.net/search/20061201.070000.00000000@sb:draft.en... Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523
participants (7)
-
andrea valle
-
Idris Samawi Hamid
-
Jilani Khaldi
-
Mojca Miklavec
-
Peter Münster
-
Peter Rolf
-
Thomas A. Schmitz