From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98858 Path: news.gmane.org!.POSTED!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: About \setupheadertexts : simplify a code Date: Fri, 18 Aug 2017 00:25:08 -0400 (EDT) Message-ID: References: <1503009593.5007.98.camel@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1531393465-1503030309=:21282" X-Trace: blaine.gmane.org 1503030363 4965 195.159.176.226 (18 Aug 2017 04:26:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 04:26:03 +0000 (UTC) User-Agent: Alpine 2.02 (OSX 1266 2009-07-14) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 18 06:25:57 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diYr4-0000kO-GJ for gctc-ntg-context-518@m.gmane.org; Fri, 18 Aug 2017 06:25:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 87A151055E0; Fri, 18 Aug 2017 06:25:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YpFRgdK4gyPF; Fri, 18 Aug 2017 06:25:26 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id F3F211055D7; Fri, 18 Aug 2017 06:25:25 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A4EDD1055D9 for ; Fri, 18 Aug 2017 06:25:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XtaEY4LgAr-h for ; Fri, 18 Aug 2017 06:25:23 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id CD0F41055D6 for ; Fri, 18 Aug 2017 06:25:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2016-05-12; t=1503030310; bh=2ui6AkcGgMCU7Jxgv0JFbgduJnV4R77Km+vpib9pfm0=; h=Date:From:To:Subject:In-Reply-To:References; b=M2MbgTHKzZKsk14wt+oHzX8pBpy0Yisb3AmI2nJqCqG8fkR59VfwBMMflCUNG3EYd O5SwC0LsRmrY+nNjgTTLUdzG4b1ANHA8u7HWK22TYiZ6B/A5pqcKh22m5j9nLQxNXr JVFui9j4flFfUQ8CVjcUcKQ1rLPeu9EQpv1X7ShURq0hTs99Ui0JICs0hx4CnbWW6b EPLijfxvU6nJWJamKf9NCYiIkVCRAXjOptnzc/PUFPuion6Fy94z5FJCyhxu0zjHZu TMelWkfysqMXQiMx96yY2ijwnVnoPBPerf/U7X9NABeap2jBoKmBLyF++rTJ91ypCL +Mys+ANM4LU/Q== Authentication-Results: tombraider.mr.itd.umich.edu; iprev=pass policy.iprev=198.84.249.206 (198-84-249-206.cpe.teksavvy.com); auth=pass smtp.auth=adityam Original-Received: FROM [192.168.0.13] (198-84-249-206.cpe.teksavvy.com [198.84.249.206]) By tombraider.mr.itd.umich.edu ID 59966C25.D5512.15976; Authuser adityam; Fri, 18 Aug 2017 00:25:09 -0400 In-Reply-To: <1503009593.5007.98.camel@gmail.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:98858 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1531393465-1503030309=:21282 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 18 Aug 2017, Henri wrote: > On Thu, 2017-08-17 at 15:25 +0200, Fabrice Couvreur wrote: >> Hello, >> To get the alignment, I had to create three \vbox. Can we simplify this = code a bit ? >> Thank you >> Fabrice > > Use the optional argument of the new framed you defined. In addition to that, you can also simplify other things as well. This is=20 how I would have done it: % macros=3Dmkvi \showframe \setuplayout [header=3D3\lineheight, headerdistance=3D\lineheight] \setupbackgrounds [header] [text] [ frame=3Doff, bottomframe=3Don, framecolor=3Ddarkgray, rulethickness=3D2pt, ] \defineframed[headerframed] [ frame=3Doff, % For visualization set this to on height=3Dfit, width=3Dfit, location=3Dbottom, boffset=3D\lineheight, ] \starttexdefinition MyHeader #where #day #month #year #title #number #time \setupheadertexts [{\headerframed[align=3Dmiddle, foregroundstyle=3Dbold, foregroundco= lor=3Dred] {#title n\high{o}\,#number}}] \setupheadertexts [{\headerframed[align=3Dflushleft, foregroundstyle=3D\ssx] {Lyc=C3=A9e JANSON DE SAILLY \\ \date[d=3D#day,m=3D#month,y=3D#y= ear]}}] [{\headerframed[align=3Dflushright, foregroundstyle=3D\ssx] {#where \\ {#time}}}] \stoptexdefinition \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3=A9}{1}{1h\,30m} \starttext \input knuth \stoptext An added benefit is that you get correct interlinespace for the left and=20 right header. Aditya --0-1531393465-1503030309=:21282 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --0-1531393465-1503030309=:21282--