From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98871 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 23:34:49 +0200 Message-ID: References: <1503009593.5007.98.camel@gmail.com> <4E4C3ACE-6834-4D63-9AB7-B88568A34CF2@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5991706975809484280==" X-Trace: blaine.gmane.org 1503092126 17656 195.159.176.226 (18 Aug 2017 21:35:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 21:35:26 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Aug 18 23:35:19 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 1diovE-000448-D7 for gctc-ntg-context-518@m.gmane.org; Fri, 18 Aug 2017 23:35:16 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5D5AEFC106B; Fri, 18 Aug 2017 23:35:04 +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 UPjAPKORqE_w; Fri, 18 Aug 2017 23:35:03 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id F2430FC105B; Fri, 18 Aug 2017 23:35:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E11D6FC1055 for ; Fri, 18 Aug 2017 23:35:01 +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 1cKthDB3ql8N for ; Fri, 18 Aug 2017 23:35:00 +0200 (CEST) Original-Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (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 6428DFC1051 for ; Fri, 18 Aug 2017 23:34:50 +0200 (CEST) Original-Received: by mail-wm0-f47.google.com with SMTP id t201so8790347wmt.1 for ; Fri, 18 Aug 2017 14:34:50 -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=S7BX8BN3zFjfzo1Nn0Z0qr3e5Adh0z8WuataJfwcQ8Q=; b=C0Hwv8bnYuvGjvqiEbwwZlHIigimFN36ergusmeAYV12pgPffUc+ElAHCrwUMkOWrw kYaD1hU4MnesCxxQ13mg8rSfKCg8fYwYCBjEdjzu7cn85Owt/q/67QidDyqVH09I7e8d rma3D6xwwppgCJsY/SKRg/BYDjVFar7RZiTcNgKexQLk7ors+lQVXVGCBYuSMaKSo0Zz 4/VNFoZhq5Uap7Fqev7XbNCFipLmnh3/VaVjoi9m9p4iEX228+NpZmpkUxYGvC4UZjJP Fde6bLTsakwfk/smqR26fdg0eouUehd97+cgplsldu2FitABkVJc47Lsxc3wVWDabG4j zwrQ== 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=S7BX8BN3zFjfzo1Nn0Z0qr3e5Adh0z8WuataJfwcQ8Q=; b=OEeXKAloWPFPrPUTAaKkLh6DTktyMCdlctuNJ/OM6lyXYAIzZS1B3RFXDCSpfe+s+w 8J5oJyL3uj6t77z60z3Bkfac/oTN5RjlkqE1x7SFLKBFJbainH2/NSn2o+/X3xhlpdx1 w2j77DWcHmPBxxlBK2/fWGRifBy9G+6X230rzbAjwYOqjn/a4iFhT2lO7S0lUmMQ58/h PSMuq58NKnnjsaCNo8RArHICBX0bXr1xFe359/YA/TwLTrlbUbToooP5xQDk8tVa5945 CZhZCn9RKCBq37++yDrM8lfBhpiCL/GujuVeGtNyOe8MFkUo9uwsbML8yWIEFA4PGuOZ sEBA== X-Gm-Message-State: AHYfb5igdzpwlf0b3ER2UC89JoOLNHMTvcRyfS4FoVDcmu+hU7RsuqzW Mlo5rrikLM7wuIprLSOmnZXG3g/LOwsw X-Received: by 10.80.184.53 with SMTP id j50mr183415ede.132.1503092089823; Fri, 18 Aug 2017 14:34:49 -0700 (PDT) Original-Received: by 10.80.205.92 with HTTP; Fri, 18 Aug 2017 14:34:49 -0700 (PDT) In-Reply-To: <4E4C3ACE-6834-4D63-9AB7-B88568A34CF2@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:98871 Archived-At: --===============5991706975809484280== Content-Type: multipart/alternative; boundary="f403045c120614246c05570de6cc" --f403045c120614246c05570de6cc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, It's ok for me if I compile the Aditya file. I have another problem with a simple structure. I created the file MyLayout.tex containing the macro and I want to call this macro in the dm1.tex file, but it does not work. Thank you Fabrice ######### MyLayout.tex ######### % macros=3Dmkvi \startenvironment MyLayout \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#ye= ar]}}] [{\headerframed[align=3Dflushright, foregroundstyle=3D\ssx] {#where \\ {#time}}}] \stoptexdefinition \stopenvironment ###### dm-1.tex ###### \startcomponent dm-1 \environment MyLayout \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3=A9}{1}{1h\,30m} \input knuth \stopcomponent 2017-08-18 18:44 GMT+02:00 Otared Kavian : > Hi Aditya, > > Thanks for having sent the example file: indeed with your file I can > typeset the example and see the expected result. > I don=E2=80=99t know what happened when I copied and pasted the example f= rom the > e-mail=E2=80=A6 > I think the command > % macros =3D mkvi > was not set correctly written at the first line, that is I had a space > before the percent sign =C2=AB % =C2=BB. In fact > %macros=3Dmkvi > or > %macros =3D mkvi > work as well. > > By the way, wouldn=E2=80=99t be more user friendly, and more in the spiri= t of > ConTeXt, if we had a command saying > \enablemode[mkvi] > in order to tell ConTeXt that we are using %macros =3D mkvi ? > > Best regards: OK > > > On 18 Aug 2017, at 17:54, Aditya Mahajan wrote: > > > > On Fri, 18 Aug 2017, Otared Kavian wrote: > > > >> 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. > > > > I am attaching the file. It runs fine here with ConTeXt ver: 2017.08.1= 4 > 23:57. > > > > 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 > ____________________________________________________________ > _______________________ > --f403045c120614246c05570de6cc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
It's ok for = me if I compile the Aditya file.
I have another problem wit= h a simple structure. I created the file MyLayout.tex containi= ng the macro and I want to call this macro in the dm1.tex file, but it does= not work.
Thank you
Fabrice

#######= ##
MyLayout.tex
#########

% macros=3Dmkvi<= br>
\startenvironment MyLayout

\setuplayout
=C2=A0=C2=A0 [hea= der=3D3\lineheight,
=C2=A0=C2=A0=C2=A0 headerdistance=3D\lineheight]
=
\setupbackgrounds
=C2=A0 [header]
=C2=A0 [text]
=C2=A0 [
= =C2=A0=C2=A0=C2=A0 frame=3Doff,
=C2=A0=C2=A0=C2=A0 bottomframe=3Don,
= =C2=A0=C2=A0=C2=A0 framecolor=3Ddarkgray,
=C2=A0=C2=A0=C2=A0 rulethickne= ss=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=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fr= ame=3Doff, % For visualization set this to on
=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 height=3Dfit,<= br>=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 width=3Dfit,
=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 location=3Dbottom,
=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 bo= ffset=3D\lineheight,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 ]

\starttexdefinition MyHeader #where #day #mo= nth #year #title #number #time

=C2=A0=C2=A0=C2=A0 \setupheadertexts<= br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{\headerframed[align=3Dmiddle, foregroun= dstyle=3Dbold, foregroundcolor=3Dred]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {#title n\high{o}\,#number}}]

=C2= =A0=C2=A0=C2=A0 \setupheadertexts
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{\head= erframed[align=3Dflushleft, foregroundstyle=3D\ssx]
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {Lyc=C3=A9e JANSON DE SAILLY \\ \date[= d=3D#day,m=3D#month,y=3D#year]}}]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{\head= erframed[align=3Dflushright, foregroundstyle=3D\ssx]
=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {#where \\ {#time}}}]

\stoptexd= efinition
=C2=A0
\stopenvironment

######
dm-1.tex
###= ###

\startcomponent dm-1

=C2=A0 \environment MyLayout

= =C2=A0 \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3=A9}{1}{1h\,30m}<= br>=C2=A0
=C2=A0 \input knuth

\stopcomponent

2017-08-18 18:44 GM= T+02:00 Otared Kavian <otared@gmail.com>:
Hi Aditya,

Thanks for having sent the example file: indeed with your file I can typese= t the example and see the expected result.
I don=E2=80=99t know what happened when I copied and pasted the example fro= m the e-mail=E2=80=A6
I think the command
=C2=A0 =C2=A0 =C2=A0 =C2=A0 % macros =3D mkvi
was not set correctly written at the first line, that is I had a space befo= re the percent sign =C2=AB % =C2=BB. In fact
=C2=A0 =C2=A0 =C2=A0 =C2=A0 %macros=3Dmkvi
or
=C2=A0 =C2=A0 =C2=A0 =C2=A0 %macros =3D mkvi
work as well.

By the way, wouldn=E2=80=99t be more user friendly, and more in the spirit = of ConTeXt, if we had a command saying
=C2=A0 =C2=A0 =C2=A0 =C2=A0 \enablemode[mkvi]
in order to tell ConTeXt that we are using %macros =3D mkvi ?

Best regards: OK

> On 18 Aug 2017, at 17:54, Aditya Mahajan <adityam@umich.edu> wrote:
>
> On Fri, 18 Aug 2017, Otared Kavian wrote:
>
>> Hi Aditya,
>>
>> I tried to typeset your example, but got an error: whether or not = the command
>>=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 ! Illegal parameter number in definition of \M= yHeader
>> and stops typesetting pointing to the command \stoptexdefinition.<= br> >
> I am attaching the file. It runs fine here with ConTeXt=C2=A0 ver: 2017.08.14 23:57. >
> Aditya<frame.tex>______________________________= _____________________________________________________
> If your question is of interes= t 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
_________________________________________________________________= __________________

--f403045c120614246c05570de6cc-- --===============5991706975809484280== 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 --===============5991706975809484280==--