Re: [NTG-context] help with facing page image
Special thanks to Sreeram, Wolfgang, Bruce, Hraban for help with this issue, ranging from the simplest 'manual' approach (Bruce) to one that I must confess I could never have thought of using: definepageinjection (Wolfgang). Needless to say, all contributions work, with a bit of adjustment in each case for my particular situation. The one common factor in all four contributions is the use of setups, so a light has begun flashing for me: setups are such an important feature of ConTeXt for solving many problems! Thanks to all, Julian On 7/3/22 18:01, śrīrāma wrote: On Monday, March 7, 2022 11:50 AM jbf wrote: All ten images are different, though, in my case (Chapter1.jpg, Chapter2.jpg... Chapter10.jpg all in a pics directory, so I'd point \setupexternalfigures to that). I wonder if there is a way to list them so that they get called in order as chapters proceed. A kind of "if such and such then \setlayer 1,2,3" I think that should be easy. Suppose you have images {chap-cover-1.jpg, chap-cover-2.jpg, ... chap-cover-10.jpg} each of which appear at the ends of their respective chapters, then the following achieves what you want (once you point ConTeXt to the right directory for figures of course): % kate: hl ctx %%% SOF \setuppagenumbering[alternative=doublesided] \definelayer [chapCover] [x=0mm, y=0mm, width=\paperwidth, height=\paperheight,repeat=yes] \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-cover-\currentheadnumber] [width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups \startsetups chapter:after \doifoddpageelse{} {\page[empty]} \stopsetups \setuphead [chapter] [page=yes, before=\directsetup{chapter:before}, aftersection=\directsetup{chapter:after}] \starttext \dorecurse{10}{ \startchapter[title={Chapter \convertnumber{word}{\recurselevel}}] \input knuth \ifnum\headnumber[chapter]=5 {\bfd five} \fi \blank \input tufte \blank \input ward \blank \ifnum\recurselevel=5 \page \input zapf \input zapf \fi \stopchapter } \stoptext %%% EOF So we figure out which chapter we are in and then set the layer to the corresponding picture. Personally, I much prefer to collect all the images into a separate PDF with: %%% chap-covers.tex \starttext \dorecurse{10}{\startTEXpage \externalfigure[chap-cover-\recurselevel] \stopTEXpage} \stoptext %%% EOF [and get 'chap-covers.pdf' from context] ... and then modify the 'before' setup to read as below %%% \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-covers] [page=\currentheadnumber,width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups %%% Sreeram ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] help with facing page image
Appreciate your assistance. I'll do my best with what you offer here. Of course, I've always said these images are at the beginning, not "the end of their respective chapters" and I've already indicated how the images are named, simply as Chapter1.jpg and so on, so I'll need to work around these differences in your example. But with trial and error, let's hope I get there! Thank you, Julian On 7/3/22 18:01, śrīrāma wrote: On Monday, March 7, 2022 11:50 AM jbf wrote: All ten images are different, though, in my case (Chapter1.jpg, Chapter2.jpg... Chapter10.jpg all in a pics directory, so I'd point \setupexternalfigures to that). I wonder if there is a way to list them so that they get called in order as chapters proceed. A kind of "if such and such then \setlayer 1,2,3" I think that should be easy. Suppose you have images {chap-cover-1.jpg, chap-cover-2.jpg, ... chap-cover-10.jpg} each of which appear at the ends of their respective chapters, then the following achieves what you want (once you point ConTeXt to the right directory for figures of course): % kate: hl ctx %%% SOF \setuppagenumbering[alternative=doublesided] \definelayer [chapCover] [x=0mm, y=0mm, width=\paperwidth, height=\paperheight,repeat=yes] \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-cover-\currentheadnumber] [width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups \startsetups chapter:after \doifoddpageelse{} {\page[empty]} \stopsetups \setuphead [chapter] [page=yes, before=\directsetup{chapter:before}, aftersection=\directsetup{chapter:after}] \starttext \dorecurse{10}{ \startchapter[title={Chapter \convertnumber{word}{\recurselevel}}] \input knuth \ifnum\headnumber[chapter]=5 {\bfd five} \fi \blank \input tufte \blank \input ward \blank \ifnum\recurselevel=5 \page \input zapf \input zapf \fi \stopchapter } \stoptext %%% EOF So we figure out which chapter we are in and then set the layer to the corresponding picture. Personally, I much prefer to collect all the images into a separate PDF with: %%% chap-covers.tex \starttext \dorecurse{10}{\startTEXpage \externalfigure[chap-cover-\recurselevel] \stopTEXpage} \stoptext %%% EOF [and get 'chap-covers.pdf' from context] ... and then modify the 'before' setup to read as below %%% \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-covers] [page=\currentheadnumber,width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups %%% Sreeram ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] help with facing page image
On Monday, March 7, 2022 11:50 AM jbf wrote: > All ten images are different, though, in my case (Chapter1.jpg, > Chapter2.jpg... Chapter10.jpg all in a pics directory, so I'd point > \setupexternalfigures to that). I wonder if there is a way to list them > so that they get called in order as chapters proceed. A kind of "if such > and such then \setlayer 1,2,3" I think that should be easy. Suppose you have images {chap-cover-1.jpg, chap-cover-2.jpg, ... chap-cover-10.jpg} each of which appear at the ends of their respective chapters, then the following achieves what you want (once you point ConTeXt to the right directory for figures of course): % kate: hl ctx %%% SOF \setuppagenumbering[alternative=doublesided] \definelayer [chapCover] [x=0mm, y=0mm, width=\paperwidth, height=\paperheight,repeat=yes] \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-cover-\currentheadnumber] [width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups \startsetups chapter:after \doifoddpageelse{} {\page[empty]} \stopsetups \setuphead [chapter] [page=yes, before=\directsetup{chapter:before}, aftersection=\directsetup{chapter:after}] \starttext \dorecurse{10}{ \startchapter[title={Chapter \convertnumber{word}{\recurselevel}}] \input knuth \ifnum\headnumber[chapter]=5 {\bfd five} \fi \blank \input tufte \blank \input ward \blank \ifnum\recurselevel=5 \page \input zapf \input zapf \fi \stopchapter } \stoptext %%% EOF So we figure out which chapter we are in and then set the layer to the corresponding picture. Personally, I much prefer to collect all the images into a separate PDF with: %%% chap-covers.tex \starttext \dorecurse{10}{\startTEXpage \externalfigure[chap-cover-\recurselevel] \stopTEXpage} \stoptext %%% EOF [and get 'chap-covers.pdf' from context] ... and then modify the 'before' setup to read as below %%% \startsetups chapter:before \doifoddpageelse{} {\pushbackground[page] \resetlayer[chapCover] \setlayer [chapCover] {\determineheadnumber[chapter] \externalfigure [chap-covers] [page=\currentheadnumber,width=\paperwidth]} \setupbackgrounds[page][background=chapCover] \page[empty] \popbackground} \stopsetups %%% Sreeram ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] typesetting serial letters in Context
I still cannot generate letters from my xml database, although there is apparently a solution to use csv files through lua code (https://tex.stackexchange.com/questions/72735/how-to-create-form-letters-from-spreadsheet-data-in-context <https://tex.stackexchange.com/questions/72735/how-to-create-form-letters-from-spreadsheet-data-in-context>). Your help is much appreciated! Yet I found out how to generate certificates with backgrounds changing according to the candidate's course level, which I would like to share with you: % participants.xml Janssen Piet P. levelA 1 june 2017 Nijmegen certificates.tex \setuppapersize[A4,landscape][A4,landscape] \setuplayout[width=170mm,topspace=60mm,rightmargindistance=2.5mm] \definelayer[module][width=\paperwidth,height=\paperheight,preset=middle] \useexternalfigure[levelA][sjablonen/CourseLevelA.pdf] \resetlayer[level]{} \setupbackgrounds[page][background={level}] \startxmlsetups xml:setups \xmlsetsetup{#1}{contacts}{xml:contacts} \xmlsetsetup{#1}{contact}{xml:contacts:contact} \stopxmlsetups \xmlregistersetup{xml:setups} \startxmlsetups xml:contacts \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:contacts:contact \setlayer[module][][]{\externalfigure[\xmltext{#1}{/courselevel}][factor=550]} \startalignment [middle] \color[red]{{\tfd \xmltext{#1}{/initials}} {\tfd \xmltext{#1}{/formalname}}\par \blank[10mm] {\ss \xmltext{#1}{/city}, \xmltext{#1}{/coursedate}} \stopalignment \page[yes] \stopxmlsetups \starttext \xmlprocessfile{main}{./participants.xml}{} \stoptext Kind regards, Robert > Op 13 jun. 2017, om 15:59 heeft r.erm...@hccnet.nl het volgende geschreven: > > I can take the information out of the nodes. The main problem is to use them > in a layout and in a sequences other the one they appear in the xml data file. > > In the current (mkii) file I have something like this: > \midaligned{\XMLflush{formalname}, \XMLflush{informalname}}. > > > Another point on my wishlist is to change the background of the certificate > depending on the type of certificate. In mkii I manage to do this as follows: > > File: participants.xml > > > Janssen > Piet > levelA > > > > certificates.tex: > \resetlayer[module]{} > \setlayer[module][][]{\externalfigure[\XMLflush{courselevel}[width=\paperwidth,height=\paperheight]} > > \useexternalfigure[levelA][sjablonen/backgroundlevelA.pdf] > > Help is very much appreciated! > > Robert > > >> Op 13 jun. 2017, om 09:53 heeft luigi scarso <luigi.sca...@gmail.com> het >> volgende geschreven: >> >> On Tue, Jun 13, 2017 at 9:40 AM, <r.erm...@hccnet.nl> wrote: >>> Hello all, >>> >>> I have been using Context mkii with the x-corres.mkii module for a number >>> of years now, for many different purposes (mailings, certificates, etc). >>> The module works with an xml (actually rng) file with the following >>> structure: >>> >>> >>> >>> Janssen >>> Piet >>> >>> >>> >>> The contents of each item is grabbed and put in the document by means of >>> the command \XMLflush{formalname}. >>> >>> I would like to shift to mkiv now with all its possibilities. >>> >>> Yet there is no x-corres.mkiv. Who can help me out? >>> >> I don't remember x-corres.mkiv, but >> mkiv has a guide >> tex/texmf-context/doc/context/documents/general/manuals/xml-mkiv.pdf >> >> -- >> luigi >> ___ >> 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://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> ___ > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] typesetting serial letters in Context
I can take the information out of the nodes. The main problem is to use them in a layout and in a sequences other the one they appear in the xml data file. In the current (mkii) file I have something like this: \midaligned{\XMLflush{formalname}, \XMLflush{informalname}}. Another point on my wishlist is to change the background of the certificate depending on the type of certificate. In mkii I manage to do this as follows: File: participants.xml Janssen Piet levelA certificates.tex: \resetlayer[module]{} \setlayer[module][][]{\externalfigure[\XMLflush{courselevel}[width=\paperwidth,height=\paperheight]} \useexternalfigure[levelA][sjablonen/backgroundlevelA.pdf] Help is very much appreciated! Robert > Op 13 jun. 2017, om 09:53 heeft luigi scarso <luigi.sca...@gmail.com> het > volgende geschreven: > > On Tue, Jun 13, 2017 at 9:40 AM, <r.erm...@hccnet.nl> wrote: >> Hello all, >> >> I have been using Context mkii with the x-corres.mkii module for a number of >> years now, for many different purposes (mailings, certificates, etc). The >> module works with an xml (actually rng) file with the following structure: >> >> >> >>Janssen >>Piet >> >> >> >> The contents of each item is grabbed and put in the document by means of the >> command \XMLflush{formalname}. >> >> I would like to shift to mkiv now with all its possibilities. >> >> Yet there is no x-corres.mkiv. Who can help me out? >> > I don't remember x-corres.mkiv, but > mkiv has a guide > tex/texmf-context/doc/context/documents/general/manuals/xml-mkiv.pdf > > -- > luigi > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Vertically centered text in each page
Am 2016-02-19 12:23, schrieb Marco Patzer: On Fri, 19 Feb 2016 11:54:12 +0100 Nicola <nvitacolo...@gmail.com> wrote: How do I setup the slide command to do that by default? I have tried putting {before,after,beforesection,aftersection}=\vfill in various combinations in \setuphead, but I cannot obtain the desired effect. \setuphead[slide][ style=\ssb, command=\MySlide, color=white, insidesection=\vfill, aftersection=\vfill, page=yes] I'm in a similar situation currently, but can't quite get it to work with the mentioned solution. The attached example shows several problems. Test 1 and Test 3 show, that the \vfill at the beginning apparently adds a forced space (which is worse in Test 3 than in Test 1). Another problem is, that when the page needs to break (which is fine), the last page will not be centered. This is a logic consequence of the \vfill being after the section. Is there any other mechanism to center text on _all_ pages, no matter how often the sections or paragraphs need to get broken? Best regards Andreas\setuppapersize[S8] \setupbodyfont[24pt] \setupinterlinespace[height=0.8] \setuppagenumbering[location=] \definelayer [header] [width=\paperwidth, height=\paperheight] \define[2]\setheader{% \resetlayer[header]% \setlayer[header]% [preset=lefttop, x=10mm, y=5mm, width=15cm, heigth=40pt]% {#2}% } \define[2]\setsubtitle{% \setlayer[header]% [preset=lefttop, x=10mm, y=\dimexpr(5mm+40pt), width=15cm, heigth=22pt]% {#2}% } \setuphead[chapter][command=\setheader, page=yes, before={\setupbackgrounds[page][background={header}, state=repeat]}, after={\strut\blank[-2*line,samepage,disable]}, insidesection=\vfill, aftersection=\vfill] \setuphead[section][command=\setsubtitle, after={\strut\blank[-2*line,samepage,disable]}, before=] %\showboxes \showframe \starttext \startchapter[title={Test 1}] \input knuth \input knuth \stopchapter \startchapter[title={Test 2}] No page-breaks here. \stopchapter \startchapter[title={Test 3}] \startsection[title={Subtitle}] \input knuth \input knuth \stopsection \stopchapter \stoptext___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
Sorry for coming back again and again, but I’m still stuck, and my deadline is overdue. * I need full-page pictures on defined pages in the middle of a chapter. * I don’t care if I must define on page x or on the next right page after the current paragraph. - The only way for full-page pictures (i.e. bleeding over the page) that I know of is layers. - The only way to interrupt a story with full-page content that I know of is postponing. (makeups were a dead end so far - maybe they can help to get to a right page withput using \page[right]) While each works for itself, I can’t get layers working within postponing. And when that works, I need to wrap it in a macro, since I alway need to define and postpone three sequential pages. Without postponing, this works: --- *** --- \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height= \dimexpr(\paperheight+6mm)] %\definemakeup[rightpage][page=right] \def\DoublePic#1{ %\startmakeup[rightpage] % error! \page[right] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut %\stopmakeup % empty back of the first picture, since it’s printed on transparent paper %\startmakeup[rightpage] % error! \page[right] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-hg][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut %\stopmakeup \page } \starttext \input tufte \DoublePic{koe} \input knuth \stoptext --- *** --- This doesn’t: --- *** --- \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height= \dimexpr(\paperheight+6mm)] \def\DoublePicAt#1#2{ \startpostponing[#2] \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut \page \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext --- *** --- Can you show me a way to use layers within postponing, please? Greetlings, Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
On Tue, Jun 5, 2012 at 2:00 PM, Henning Hraban Ramm hra...@fiee.net wrote: Sorry for coming back again and again, but I’m still stuck, and my deadline is overdue. * I need full-page pictures on defined pages in the middle of a chapter. * I don’t care if I must define on page x or on the next right page after the current paragraph. - The only way for full-page pictures (i.e. bleeding over the page) that I know of is layers. - The only way to interrupt a story with full-page content that I know of is postponing. (makeups were a dead end so far - maybe they can help to get to a right page withput using \page[right]) While each works for itself, I can’t get layers working within postponing. And when that works, I need to wrap it in a macro, since I alway need to define and postpone three sequential pages. Without postponing, this works: --- *** --- \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] %\definemakeup[rightpage][page=right] \def\DoublePic#1{ %\startmakeup[rightpage] % error! \page[right] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut %\stopmakeup % empty back of the first picture, since it’s printed on transparent paper %\startmakeup[rightpage] % error! \page[right] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-hg][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut %\stopmakeup \page } \starttext \input tufte \DoublePic{koe} \input knuth \stoptext --- *** --- This doesn’t: --- *** --- \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] \def\DoublePicAt#1#2{ \startpostponing[#2] \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext --- *** --- Can you show me a way to use layers within postponing, please? A first step --- still quite similar to your macro. Hope it helps just for now. \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] \def\DoublePicAt#1#2{ %\startpostponing[#2] \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page %\stoppostponing } \starttext \startpostponing[5] \DoublePicAt{hacker}{5} \stoppostponing \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext -- luigi ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
Another one \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] \unexpanded\def\DoDoublePicAt#1{ \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page } \def\DoublePicAt#1#2{ \startpostponing[#2] \DoDoublePicAt{#1} \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext -- luigi ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
Am 2012-06-05 um 14:42 schrieb luigi scarso: Another one \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height= \dimexpr(\paperheight+6mm)] \unexpanded\def\DoDoublePicAt#1{ \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height= \dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page } \def\DoublePicAt#1#2{ \startpostponing[#2] \DoDoublePicAt{#1} \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext Thank you again, but, did you test that? I get: ) Runaway argument? \dorecur\section{\ETC.r} \stoppostponing ! File ended while scanning use of \buff_gobble. system tex error on line 4 in file /Users/hraban/Library/ texmf/tex/texmf-context/tex/context/base/cont-yes.mkiv: File ended while scanning use of \buff_gobble ... 1 %D \module 2 %D [ file=cont-yes, 3 %Dversion=2012.06.01, 4 %D title=\CONTEXT\ Miscellaneous Macros, 5 %D subtitle=Startup Stub, 6 %D author=Hans Hagen, 7 %D date=\currentdate, 8 %D copyright={PRAGMA ADE \ \CONTEXT\ Development Team}] 9 %C 10 %C This module is part of the \CONTEXT\ macro||package and is 11 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for 12 %C details. 13 14 % At some point I will reconsider the \starttext .. \stoptext inserted text \par l.4 } } context.finishjob() \luat_start_lua_code_indeed ...ua \zerocount {#1}} l.70 \stopluacode ? Greetlings, Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
On Tue, Jun 5, 2012 at 6:01 PM, Henning Hraban Ramm hra...@fiee.net wrote: Am 2012-06-05 um 14:42 schrieb luigi scarso: Another one \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] \unexpanded\def\DoDoublePicAt#1{ \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page } \def\DoublePicAt#1#2{ \startpostponing[#2] \DoDoublePicAt{#1} \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext Thank you again, but, did you test that? I get: ) Runaway argument? \dorecur\section{\ETC.r} \stoppostponing ! File ended while scanning use of \buff_gobble. Uhm I've tested but maybe I've made a wrong cut and paste. Re-check now. -- luigi ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
On Tue, Jun 5, 2012 at 6:08 PM, luigi scarso luigi.sca...@gmail.com wrote: On Tue, Jun 5, 2012 at 6:01 PM, Henning Hraban Ramm hra...@fiee.net wrote: Am 2012-06-05 um 14:42 schrieb luigi scarso: Another one \setuppagenumbering[alternative=doublesided] \definelayer[bg][x=0mm,y=-3mm,width=\dimexpr(\paperwidth+3mm),height=\dimexpr(\paperheight+6mm)] \unexpanded\def\DoDoublePicAt#1{ \page[right] % tried also makeups... \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page[right] \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page } \def\DoublePicAt#1#2{ \startpostponing[#2] \DoDoublePicAt{#1} \stoppostponing } \starttext \DoublePicAt{hacker}{5} \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext Thank you again, but, did you test that? I get: ) Runaway argument? \dorecur\section{\ETC.r} \stoppostponing ! File ended while scanning use of \buff_gobble. Uhm I've tested but maybe I've made a wrong cut and paste. Re-check now. Ah, it 's a side effect of the previous code -- luigi ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
On 27-5-2012 16:06, Henning Hraban Ramm wrote: Hi again, in my current book project there are sets of full-page graphics, where there’s first a drawing, to be printed on transparent paper, followed by a water colour picture as background, i.e. a series of right page: foreground graphic right page: background graphic The transparent pages are left out in pagination. Between chapters (i.e. stories), the following macro does what I want: \def\DoublePic#1{ \page[right] % foreground picture on transparent paper \setuppagenumbering[state=stop]\setuppagenumber[state=stop]\par \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-fore][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut\par % page needs some content \page[right] % background picture on normal paper \setuppagenumber[state=start]\par \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut\par \page \setuppagenumbering[state=start] } Now, the publisher would like to move the picture pages in the middle of the stories, i.e. I need them to float here without manual page breaking. How can I achieve that? I’d also appreciate enhancements to my macro above. (MkIV latest beta on OSX Intel.) Thank you very much in advance! \startpostponing might help (you can add [pagenumber] or [+pagenumber] if needed) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] multi-page floats
Am 2012-05-28 um 19:27 schrieb Hans Hagen: \startpostponing might help (you can add [pagenumber] or [+pagenumber] if needed) Oh, of course, Philipp Gesang recently reminded me. I would like to use \startpostponing[right], but fixed pages are ok. This works: \starttext \startpostponing[3] \section{Tufte} \input tufte \strut \page \strut \page \section{More Tufte} \input tufte \page \stoppostponing \dorecurse{30}{ \section{Knuth \recurselevel} \input knuth } \stoptext But if I try to put graphics in layers within the postponing, I get empty pages. Further, if I put that postponing stuff into a macro (see below), I get errors about \par ending the buffer. I guess I’d need some unexpanding, but where? Without \def, I get 2 (instead of 3) empty pages, but with page numbers. I need to switch off the pagenumbering for the first two pages (because it’s a transparent page that doesn’t count); it’s probably also a problem fixed-page postponing... \def\DoublePicAt#1#2{ \startpostponing[#2] \setuppagenumbering[state=stop]\setuppagenumber[state=stop] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1][height=\dimexpr(\paperheight+6mm)]} \setupbackgrounds[page][background=bg] \strut \page %[right] doesn’t work \strut \page \setuppagenumber[state=start] \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-hg][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut \page \setuppagenumbering[state=start] \stoppostponing } Thanks in advance! Greetlings, Hraban ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] multi-page floats
Hi again, in my current book project there are sets of full-page graphics, where there’s first a drawing, to be printed on transparent paper, followed by a water colour picture as background, i.e. a series of right page: foreground graphic right page: background graphic The transparent pages are left out in pagination. Between chapters (i.e. stories), the following macro does what I want: \def\DoublePic#1{ \page[right] % foreground picture on transparent paper \setuppagenumbering[state=stop]\setuppagenumber[state=stop]\par \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-fore][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut\par % page needs some content \page[right] % background picture on normal paper \setuppagenumber[state=start]\par \resetlayer[bg] \setlayer[bg]{\externalfigure[#1-back][height=\dimexpr(\paperheight +6mm)]} \setupbackgrounds[page][background=bg] \strut\par \page \setuppagenumbering[state=start] } Now, the publisher would like to move the picture pages in the middle of the stories, i.e. I need them to float here without manual page breaking. How can I achieve that? I’d also appreciate enhancements to my macro above. (MkIV latest beta on OSX Intel.) Thank you very much in advance! Greetlings, Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer) ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Layers again
On 26-4-2011 6:26, Ian Lawrence wrote: But when I get to a new page I'd like to be able to change that plug, or even have the layer blank that happens automatically unless the state of the layer is set to 'repeat' so normally, once a layer is placed its content is forgotten \page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure [dummy][width=100px]} % the actual contents of the layer And; \page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure ??? } % HOW TO SET THE \externalfigure to NOTHING, or hide the layer? \resetlayer [SPTinteractivemedium] I might try changing the backgrounds on a page by page basis, but this seems inelegant, as the \setups ought to be before the \starttext..? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Layers again
OK, now maybe I get it. This might help someone... It's the **contents** of the layer that get repeated if you set repeat=yes in \definelayer - as in http://wiki.contextgarden.net/Layers If you do a \setlayer then this simply adds to the existing stack of contents displayed on the layer. You get more and more stuff until you do a \resetlayer, assuming you set repeat=yes in the \definelayer. Thus(?) \definelayer is all about the contents of the layer (? Apart from setting the dimensions and so on... I think that's what deflected me into thinking that this command was about the canvas, and the \setlayer about the contents.) The \setupbackgrounds[page][state=repeat,background={XXX}] is the command that puts the logical layer on each page. If this seems about right then I'll have a go at adding a sentence or two to the wiki...maybe on-one else thinks of it in terms of the existence and then the population of a layer...? On 26 April 2011 17:44, Hans Hagen pra...@wxs.nl wrote: On 26-4-2011 6:26, Ian Lawrence wrote: But when I get to a new page I'd like to be able to change that plug, or even have the layer blank that happens automatically unless the state of the layer is set to 'repeat' so normally, once a layer is placed its content is forgotten \page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure [dummy][width=100px]} % the actual contents of the layer And; \page[yes] \setlayer [SPTinteractivemedium] % name of the layer [hoffset=0px, voffset=0px,] % placement (from upper left corner of the layer) { \externalfigure ??? } % HOW TO SET THE \externalfigure to NOTHING, or hide the layer? \resetlayer [SPTinteractivemedium] I might try changing the backgrounds on a page by page basis, but this seems inelegant, as the \setups ought to be before the \starttext..? - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] ConTeXt-ifying Kile
# \processaction # \processallactionsinset \processblocks[names][names] # \processcommacommand # \processcommalist # \processfirstactioninset \processpage[names][yes|no] # \processXMLbuffer # \processXMLelement # \processXMLfile # \processXMLfilegrouped # \product \program[name] # \project # \protect \publication[reference] \quotation{text} \quote{text} \ran{text} # \readfile \ref[t|p|r|s|e][reference] \reference[reference]{text} \referral[options] \referraldate \register[text]{register+register+register} \reservefloat[options][text][references]{text} \reset[names] # \resetlayer \resetmarking[name] \rightaligned{text} \Romannumerals{text} \romannumerals{text} \rotate[settings]{text} # \saveXMLasdata # \saveXMLdata # \saveXMLelement # \sbox \scale[options]{text} # \scratchbox # \scratchcounter # \scratchdimen # \scratchskip \screen \section[references]{text} \seeregister[text]{text}{text+text+text} \selectblocks[names][names][critererium] \selectpaper[options] \selectversion # \setcollector # \setevalue # \setevariables # \setflag # \setfontstrut # \setgvalue # \setgvariables # \setlayer # \setlayerframed # \setlocalhsize # \setstrut \settextvariable[name]{text} \setupalign[options] \setuparranging[options] # \setupattachments \setupbackground[options] \setupbackgrounds[position][position][state][settings] \setupblackrules[options] \setupblank[options] \setupblock[names][options] \setupbodyfont[options] \setupbodyfontenvironment[settings][settings] \setupbottom[settings][settings] \setupbottomtexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupbuffer[name][options] \setupbuttons[state][settings] \setupcapitals[title=yes|no][sc=yes|no] \setupcaption[name][settings] \setupcaptions[options] \setupclipping[options] \setupcolor[name] \setupcolors[options] \setupcolumns[options] \setupcombinations[options] \setupcombinedlist[name][levels and options] \setupcomment[options] \setupdescriptions[names][options] # \setupencoding \setupenumerations[names][settings] \setupexternalfigures[options] \setupfield[name][label|horizontal|vertical|frame][settings] \setupfields[names][reset|label|horizontal|vertical|frame][options][settings][settings] \setupfillinlines[options] \setupfillinrules[options] \setupfloat[name][options] \setupfloats[options] \setupfloatsplitting[options] # \setupFLOWcharts # \setupFLOWlines # \setupFLOWshapes # \setupfontsynonym \setupfooter[text|margin|edge][options] \setupfootertexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupfootnotedefinition[settings] \setupfootnotes[options] \setupforms[method=HTML|FDF] \setupformulae[options] \setupframed[options] \setupframedtexts[options] \setuphead[sections][options] \setupheader[text|margin|edge][options] \setupheadertexts[text|margin|edge][text|section|date|mark|pagenumber][text|section|date|mark|pagenumber] \setupheadnumber[section][number|+number|-number] \setupheads[options] \setupheadtext[language code][name=text] \setuphyphenmark[sign=-|--|---|( )|=|/] \setupindentations[names][options] \setupindenting[none|small|medium|big|next|first|normal|odd|even|dimension] \setupinmargin[left|right|number][options] \setupinteraction[options] \setupinteractionbar[options] \setupinteractionscreen[options] \setupinterlinespace[reset|small|medium|auto|big|on|off][options] \setupitemgroup[name][number|each][options][options] \setupitems[options] \setuplabeltext[language code][name=text] \setuplanguage[language code][settings] # \setuplayer \setuplayout[options] \setuplegend[options] \setuplinenumbering[options] \setuplines[options] \setuplinewidth[dimension] \setuplist[names][options] \setupmakeup[name][options] \setupmarginblocks[options] \setupmarginrules[level=number|rulethickness=dimension] \setupmarking[name][options] \setupnarrower[options] \setupnumbering[options] \setupoppositeplacing[options] \setupoutput[names] \setuppagenumber[number][state=start|stop|keep] \setuppagenumbering[options] \setuppagetransitions[options] \setuppalet[name] \setuppaper[options] \setuppapersize[typesetting papersize][printing papersize] \setupparagraphnumbering[options] \setupparagraphs[name][number|each][options] \setuppositioning[options] \setupprofiles[options] \setupprograms[directory=text] \setuppublications[options] \setupquote[options] \setupreferencelist[names][options] \setupreferencing[options] \setupregister[singular][name][options] \setuprotate[options] \setuprule[name][options] # \setups \setupscreens[options] \setupsection[name][name][options] \setupsectionblock[name][options] \setupsorting[name][options] \setupspacing[broad|packed] \setupstrut[yes|no|cap|text] \setupsubpagenumber[options] \setupsymbolset[name] \setupsynchronization[state=start|stop] \setupsynchronizationbar[options] \setupsynonyms[name][options] \setupsystem[options] \setuptab[options] # \setupTABLE \setuptables[options] \setuptabulate[name][options] \setuptext[text|margin|edge][options