From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91751 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \setuphead[part] - special look Date: Mon, 22 Jun 2015 10:51:46 +0200 Message-ID: <5587CCA2.9010806@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0078144038==" X-Trace: ger.gmane.org 1434963173 25749 80.91.229.3 (22 Jun 2015 08:52:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2015 08:52:53 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 22 10:52:42 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z6xT6-0007To-Gk for gctc-ntg-context-518@m.gmane.org; Mon, 22 Jun 2015 10:52:40 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B70210223 for ; Mon, 22 Jun 2015 10:52:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id HyKys6iMygKw for ; Mon, 22 Jun 2015 10:52:38 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 05ADA10233 for ; Mon, 22 Jun 2015 10:52:06 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 97D10101F7 for ; Mon, 22 Jun 2015 10:52:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Q20eSXZKfZup for ; Mon, 22 Jun 2015 10:52:00 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 46F7C101E6 for ; Mon, 22 Jun 2015 10:51:55 +0200 (CEST) Original-Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id t5M8ps8L026965 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 22 Jun 2015 10:51:54 +0200 Original-Received: by wibdq8 with SMTP id dq8so68060957wib.1 for ; Mon, 22 Jun 2015 01:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=mM2yfUQXV/LDYGhqlkYyFoEa9yBmHULYoHm/mmUhEio=; b=bsyCOljydWhrBKwFzGjInTNkUn4v8owOgSG0PdW52P4CfQwGLbODnYO3+bWUjnaZFs TrT7aYhvpkBPajStyHdYgB5VB84M01QstYCoHa/5Wkiek8K29wL7jfuV3eO0aF5pSsI1 lzTNzkuoXEJmO1XuKFrziIHuPGucbnwe23m58LW2q+ATRSrmUIiMsDDTgiELgZHCKhDx XCyHuInUa/y0pPUJ+ekrahODIho+OXVYVVb+FXGVIWKDem05HWmUxi939sOZuLXod8nf qJqRjhfIMJdwrJATGTh4ZJx5r7mK9PyMYNiOG2vWXhUSwDEzW+QNoWisLOe9OwheRb23 +eRQ== X-Received: by 10.194.62.205 with SMTP id a13mr47615245wjs.98.1434963113938; Mon, 22 Jun 2015 01:51:53 -0700 (PDT) Original-Received: from keima.localdomain (x2f346ea.dyn.telefonica.de. [2.243.70.234]) by mx.google.com with ESMTPSA id v3sm29461877wja.31.2015.06.22.01.51.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jun 2015 01:51:53 -0700 (PDT) User-Agent: Postbox 4.0.1 (Macintosh/20150514) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::229; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 03OHkPSrp - 6ee67638b2d3 - 20150622 (trained as not-spam) Received-SPF: pass (filter3-ams.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::229 as permitted sender) receiver=filter3-ams.mf.surf.net; client-ip=2a00:1450:400c:c05::229; envelope-from=; helo=mail-wi0-x229.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:91751 Archived-At: This is a multi-part message in MIME format. --===============0078144038== Content-Type: multipart/alternative; boundary="------------010200030900060107090407" This is a multi-part message in MIME format. --------------010200030900060107090407 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: quoted-printable > Proch=E1zka Luk=E1=B9 Ing. - Pontex s. r. o. > 22. Juni 2015 09:35 > Hello, > > I'm trying to \setuphead[part] to have the following features: > > 1. Part head to fill the whole page. > > 2. Part number and name to be placed (approx.) in the golden ratio of=20 > the page. > > 3. Page background (for the \part only!) to be colored, e.g. blue. > > ---- > \define[2]\MyPartCmd{% > {% > \vbox to\vsize{% > \vfill\vfill% > #1 > \blank[big] > #2 > \vfill\vfill\vfill% > } > }% > } > > \define[1]\MyPartCmdText{% > \hbox to\hsize{\hfill \bf D=C3l #1\hfill}% > } > > \definefontsize[e] > \definebodyfontenvironment[default][e=3D5.] > > \define[1]\MyPartCmdNum{% > \hbox to\hsize{\hfill \bfe\sc#1\hfill}% > } > > \setuphead[part] > [command=3D\MyPartCmd, > numbercommand=3D\MyPartCmdText, > textcommand=3D\MyPartCmdNum, > placehead=3Dyes,header=3Dnone,page=3Dodd, > =20 > before=3D{\setupbackgrounds[page][background=3Dcolor,backgroundcolor=3D= blue,state=3Dstart]},=20 > > %after=3D{\setupbackgrounds[page][background=3D]}, > ] > > \starttext > \showboxes > \part{Part} > \input knuth > \stoptext > ---- > > The code above doesn't satisfy the features: > > Ad 1: Some text (from knuth) appears in the bottom (should be solved=20 > by "after=3D\page", but is there a better solution, e.g. to affect=20 > height of the \vbox in \MyPartCmd?) The \page command is needed here. > Ad 3: I'm able to make only the part page blue (now all pages are=20 > blue; when I uncomment=20 > "after=3D{\setupbackgrounds[page][background=3D]},", no page is blue). You can use the \pushbackground and \popbackground command to limit the=20 background changes to a certain part of your document. > Could anyone help me to "tune" the \setuphead[part]? \defineheadalternative [partpage] [renderingsetup=3Dpartpage] \startsetups[partpage] \startmakeup[part] \headsetupspacing \headnumbercontent \blank[big] \headtextcontent \stopmakeup \stopsetups \definemakeup [part] [align=3Dmiddle, top=3D\vfill\vfill, bottom=3D\vfill\vfill\vfill] \setuphead [part] [placehead=3Dyes, alternative=3Dpartpage, page=3Dright, =20 before=3D{\pushbackground[page]\setupbackgrounds[page][background=3Dcolor= ,backgroundcolor=3Dblue]}, after=3D{\page\popbackground}, bodypartlabel=3Dpart, align=3Dmiddle, numberstyle=3D\bfb, textstyle=3D\bfd\sc] \setuplabeltext[en][part=3DD=C3l ] \starttext \part{Part} \input knuth \stoptext BTW: Where is Ad 2? Wolfgang --------------010200030900060107090407 Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable
= =20 22. Juni 2015=20 09:35
Hello,

I'm trying to \setuphead[part] to have the following features:

1. Part head to fill the whole page.

2. Part number and name to be placed (approx.) in the golden ratio=20 of the page.

3. Page background (for the \part only!) to be colored, e.g. blue.

----
\define[2]\MyPartCmd{%
=A0=A0=A0 {%
=A0=A0=A0=A0=A0 \vbox to\vsize{%
=A0=A0=A0=A0=A0=A0=A0 \vfill\vfill%
=A0=A0=A0=A0=A0=A0=A0 #1
=A0=A0=A0=A0=A0=A0=A0 \blank[big]
=A0=A0=A0=A0=A0=A0=A0 #2
=A0=A0=A0=A0=A0=A0=A0 \vfill\vfill\vfill%
=A0=A0=A0=A0=A0 }
=A0=A0=A0 }%
}

\define[1]\MyPartCmdText{%
=A0 \hbox to\hsize{\hfill \bf D=C3l #1\hfill}%
}

\definefontsize[e]
\definebodyfontenvironment[default][e=3D5.]

\define[1]\MyPartCmdNum{%
=A0 \hbox to\hsize{\hfill \bfe\sc#1\hfill}%
}

\setuphead[part]
=A0 [command=3D\MyPartCmd,
=A0=A0 numbercommand=3D\MyPartCmdText,
=A0=A0 textcommand=3D\MyPartCmdNum,
=A0=A0 placehead=3Dyes,header=3Dnone,page=3Dodd,
=A0=A0=20 before=3D{\setupbackgrounds[page][background=3Dcolor,backgroundcolor=3Dbl= ue,state=3Dstart]},
=A0=A0 %after=3D{\setupbackgrounds[page][background=3D]},
=A0 ]

\starttext
=A0 \showboxes
=A0 \part{Part}
=A0 \input knuth
\stoptext
----

The code above doesn't satisfy the features:

Ad 1: Some text (from knuth) appears in the bottom (should be solved by "after=3D\page", but is there a better solution, e.g. to affect heigh= t of the \vbox in \MyPartCmd?)
The \page command is needed here.
Ad 3: I= 'm=20 able to make only the part page blue (now all pages are blue; when I=20 uncomment "after=3D{\setupbackgrounds[page][background=3D]},", no page is= =20 blue).
You can use the \pushbackground and \popbackground command to limit the=20 background changes to a certain part of your document.
Could anyone help me to "tun= e"=20 the \setuphead[part]?
\defineheadalternative
=A0 [partpage]
=A0 [renderingsetup=3Dpartpage]

\startsetups[partpage]

=A0=A0=A0 \startmakeup[part]
=A0=A0=A0 =A0=A0=A0 \headsetupspacing
=A0=A0=A0 =A0=A0=A0 \headnumbercontent
=A0=A0=A0 =A0=A0=A0 \blank[big]
=A0=A0=A0 =A0=A0=A0 \headtextcontent
=A0=A0=A0 \stopmakeup

\stopsetups

\definemakeup
=A0 [part]
=A0 [align=3Dmiddle,
=A0=A0 top=3D\vfill\vfill,
=A0=A0 bottom=3D\vfill\vfill\vfill]

\setuphead
=A0 [part]
=A0 [placehead=3Dyes,
=A0=A0 alternative=3Dpartpage,
=A0=A0 page=3Dright,
=A0=A0=20 before=3D{\pushbackground[page]\setupbackgrounds[page][background=3Dcolor= ,backgroundcolor=3Dblue]},
=A0=A0 after=3D{\page\popbackground},
=A0=A0 bodypartlabel=3Dpart,
=A0=A0 align=3Dmiddle,
=A0=A0 numberstyle=3D\bfb,
=A0=A0 textstyle=3D\bfd\sc]

\setuplabeltext[en][part=3DD=C3l ]

\starttext
=A0 \part{Part}
=A0 \input knuth
\stoptext

BTW: Where is Ad 2?

Wolfgang
--------------010200030900060107090407-- --===============0078144038== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0078144038==--