From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98863 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: About \setupheadertexts : simplify a code Date: Fri, 18 Aug 2017 17:06:00 +0200 Message-ID: References: <334522994.118252184.1503061523461.JavaMail.root@spooler6-g27.priv.proxad.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5293276237702400626==" X-Trace: blaine.gmane.org 1503068801 4034 195.159.176.226 (18 Aug 2017 15:06:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 15:06:41 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 18 17:06:35 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 1diir2-0000cN-SE for gctc-ntg-context-518@m.gmane.org; Fri, 18 Aug 2017 17:06:32 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CE689FC1011; Fri, 18 Aug 2017 17:06:15 +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 Xmv7wUtvkqmN; Fri, 18 Aug 2017 17:06:15 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 18501FC1005; Fri, 18 Aug 2017 17:06:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8A00BFC1003 for ; Fri, 18 Aug 2017 17:06:13 +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 tjLaw32Tl6xb for ; Fri, 18 Aug 2017 17:06:12 +0200 (CEST) Original-Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (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 1D110FC1002 for ; Fri, 18 Aug 2017 17:06:02 +0200 (CEST) Original-Received: by mail-wm0-f43.google.com with SMTP id l19so2090421wmi.1 for ; Fri, 18 Aug 2017 08:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=t3adpHoMBXb1w6wyTiff4VgGvLtc7ak/TWBfQIuNk5U=; b=PB39Dnwy5fR38r+dBkXFrAnB8UeBN3vZxoG1O/cWIDyJjTs4obOoni8NVgrwgcnqDF t0ur+PstpXHUJhnwOsSvTh1B9ay2XfIx97v1YWItNvOxrStwmtmDCqZE3pGUAO/04q6j WKoPNrqioaPOUTBjSM3LvyLLztNi/pE7BHd9keCkOI4Bbq9rpWS29aZFBlTPBcqmr/PA QdOTkCDzssock8+nRaYvH+fGIoOi2e0PeA7+esSsMWbVSP7byD6Ud154O4sHJghkQgb4 k/AWMjxMN8Pky0OfKF+BGFo+YhN9IPppLz2vO00B/TBbOoRi4GCWrC8wXoxDemHTY5f3 36NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=t3adpHoMBXb1w6wyTiff4VgGvLtc7ak/TWBfQIuNk5U=; b=WAnjhCrPnCorGQ62t3qQlYDwiqhetn8Wj5u1NRkOoRBZL6Qq+a8Mnhf+APQmV1QtfN qOdOH6jQXRoLsxgIWjXcURX7ikCiJELKHfeASmFVjodXFp3xDoljLRZVwoPdtLb6HWFA RFdAt52lKVOj6DNsvz7e4B41fy8UMp2QPFVDaq7hSOTk3eP0FtJrMDGaiO0iwuzaCw5y Hs+OV4TAOPjLzuRg8nwVBBqcABs7SiqS78tCN4faiD/ovUnDFTWst4LRNp9rL7nAy2dC bJvl/4XHi8sQjJ9BbVPuiQOkyK6WGvs6/hkLOuzCjDczKFm5Q8aorhXBJ60gPSMlKrv1 aVrQ== X-Gm-Message-State: AHYfb5j0ZBH5U7XWrBqEh6hnC1JMxEM8gJ1bAygk3lCyUNGcHoFR4jTm e1qzvE4i2kPZxDPGtE8Pp0emFqIa4dpm X-Received: by 10.80.137.61 with SMTP id e58mr5313285ede.67.1503068761582; Fri, 18 Aug 2017 08:06:01 -0700 (PDT) Original-Received: by 10.80.205.92 with HTTP; Fri, 18 Aug 2017 08:06:00 -0700 (PDT) In-Reply-To: <334522994.118252184.1503061523461.JavaMail.root@spooler6-g27.priv.proxad.net> 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:98863 Archived-At: --===============5293276237702400626== Content-Type: multipart/alternative; boundary="f403045c15389b70ea0557087770" --f403045c15389b70ea0557087770 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Thanks for your answers but I also get the same error Fabrice 2017-08-18 15:05 GMT+02:00 Jean-Pierre Delange : > Hi Otared and Aditya, > > I get the same mtx-context | fatal error: return code: 1 > > The log shows this : > > tex error > tex error on line 36 in file /home/adeimantos/TRAVAIL/ > context/Fichiers-ConTeXt_Doc-Tests/ConTEXt_TEST_Formulaire.tex: ! Illegal > parameter number in definition of \MyHeader > > > > ----- Mail original ----- > De: "Otared Kavian" > =C3=80: "mailing list for ConTeXt users" > Envoy=C3=A9: Vendredi 18 Ao=C3=BBt 2017 11:45:47 > Objet: Re: [NTG-context] About \setupheadertexts : simplify a code > > Hi Aditya, > > I tried to typeset your example, but got an error: whether or not the > command > % macros=3Dmkvi > is present on the fist line, then ConTeXt complains saying that > ! Illegal parameter number in definition of \MyHeader > and stops typesetting pointing to the command \stoptexdefinition. > > What am I missing here? > Thanks for your attention: OK > > > On 18 Aug 2017, at 06:25, Aditya Mahajan wrote: > > > > 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 i= s > 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, > foregroundcolor=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= #year]}}] > > [{\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 an= d > right header. > > > > Aditya______________________________________________________ > _____________________________ > > 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 > ____________________________________________________________ > _______________________ > --f403045c15389b70ea0557087770 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
Thanks for your answers but I also get the same e= rror
Fabrice

2017-08-18 15:05 GMT+02:00 Jean-Pierre Delange <a= deimantos@free.fr>:
Hi Otar= ed and Aditya,

I get the same mtx-context=C2=A0 =C2=A0 =C2=A0| fatal error: return code: 1=

The log shows this :

tex error=C2=A0 > tex error on line 36 in file /home/adeimantos/TRAVAIL/= context/Fichiers-ConTeXt_Doc-Tests/ConTEXt_TEST_Formulaire.t= ex: ! Illegal parameter number in definition of \MyHeader



----- Mail original -----
De: "Otared Kavian" <otare= d@gmail.com>
=C3=80: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Envoy=C3=A9: Vendredi 18 Ao=C3=BBt 2017 11:45:47
Objet: Re: [NTG-context] About \setupheadertexts : simplify a code

Hi Aditya,

I tried to typeset your example, but got an error: whether or not the comma= nd
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % macros=3Dmkvi
is present on the fist line, then ConTeXt complains saying that
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ! Illegal parameter number in definition of \My= Header
and stops typesetting pointing to the command \stoptexdefinition.

What am I missing here?
Thanks for your attention: OK

> On 18 Aug 2017, at 06:25, Aditya Mahajan <adityam@umich.edu> wrote:
>
> 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 simp= lify 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 how I would have done it:
>
> % macros=3Dmkvi
> \showframe
>
> \setuplayout
>=C2=A0 =C2=A0[header=3D3\lineheight,
>=C2=A0 =C2=A0 headerdistance=3D\lineheight]
>
> \setupbackgrounds
>=C2=A0 [header]
>=C2=A0 [text]
>=C2=A0 [
>=C2=A0 =C2=A0 frame=3Doff,
>=C2=A0 =C2=A0 bottomframe=3Don,
>=C2=A0 =C2=A0 framecolor=3Ddarkgray,
>=C2=A0 =C2=A0 rulethickness=3D2pt,
>=C2=A0 ]
>
> \defineframed[headerframed]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0frame=3Doff, % F= or visualization set this to on
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0height=3Dfit, >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0width=3Dfit,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0location=3Dbotto= m,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boffset=3D\lineh= eight,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0]
>
> \starttexdefinition MyHeader #where #day #month #year #title #number #= time
>
>=C2=A0 =C2=A0 \setupheadertexts
>=C2=A0 =C2=A0 =C2=A0 [{\headerframed[align=3Dmiddle, foregroundstyle=3D= bold, foregroundcolor=3Dred]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {#title n\high{o}\,#number}}]=
>
>=C2=A0 =C2=A0 \setupheadertexts
>=C2=A0 =C2=A0 =C2=A0 [{\headerframed[align=3Dflushleft, foreground= style=3D\ssx]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {Lyc=C3=A9e JANSON DE SAILLY \\ \dat= e[d=3D#day,m=3D#month,y=3D#year]}}]
>=C2=A0 =C2=A0 =C2=A0 [{\headerframed[align=3Dflushright, foregroun= dstyle=3D\ssx]
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 {#where \\ {#time}}}]
>
> \stoptexdefinition
>
> \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3=A9}{1}{1h\,30= m}
>
> \starttext
> \input knuth
> \stoptext
>
> An added benefit is that you get correct interlinespace for the left a= nd right header.
>
> Aditya______________________________________________________= _____________________________
> 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-contex= t
> webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.ne= t
> archive=C2=A0 : https://bitbucket.org/phg/context-mirror/commits/
> wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
> ____________________________________________________________= _______________________

_________________________________________________________________= __________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context=
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________
_________________________________________________________________= __________________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" rel=3D"noreferrer= " target=3D"_blank">http://www.ntg.nl/mailman/listinfo/ntg-context=
webpage=C2=A0 : http://www.pragma-ade.nl / http://context.aanhet.net=
archive=C2=A0 : https://bitbucket.org/phg/cont= ext-mirror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: http://contextgarden.net
_________________________________________________________________= __________________

--f403045c15389b70ea0557087770-- --===============5293276237702400626== 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 --===============5293276237702400626==--