From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98878 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Couvreur Newsgroups: gmane.comp.tex.context Subject: Re: About \setupheadertexts : simplify a code Date: Sat, 19 Aug 2017 01:06:33 +0200 Message-ID: References: <1503009593.5007.98.camel@gmail.com> <4E4C3ACE-6834-4D63-9AB7-B88568A34CF2@gmail.com> <4e1cd231-003f-9e90-2d6a-fee511086d04@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7400316333431482342==" X-Trace: blaine.gmane.org 1503097674 11113 195.159.176.226 (18 Aug 2017 23:07:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 23:07:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 19 01:07:50 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 1diqMn-0002b0-QM for gctc-ntg-context-518@m.gmane.org; Sat, 19 Aug 2017 01:07:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 91C5DFC1096; Sat, 19 Aug 2017 01:06:47 +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 iEXvlrl8fyrj; Sat, 19 Aug 2017 01:06:46 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id C1C60FC10AB; Sat, 19 Aug 2017 01:06:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EAD7EFC10AB for ; Sat, 19 Aug 2017 01:06:45 +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 RbS8HdiKSKXN for ; Sat, 19 Aug 2017 01:06:45 +0200 (CEST) Original-Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (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 1FA0FFC1096 for ; Sat, 19 Aug 2017 01:06:35 +0200 (CEST) Original-Received: by mail-wm0-f51.google.com with SMTP id u29so2907669wma.0 for ; Fri, 18 Aug 2017 16:06:35 -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=0faiNuBNiOg4jTF/21FaQXSl9wnqV5PUmci48EM+5GE=; b=BBczAQ4L+1kGgfpjzhTfTAhz5n/ZXg8WHFkfmsb8boKpdk+f2TQ1UrXNoGxqv0e7y7 VCiHsgYbSRDj0VYBVR8hPQqAF1zumOr4Qc6NutjmhiF96PYWGY390LbSMc9ypupFIsk8 iEXuoLBiBDvtL1BYjDitHruCbqv96+JpKl4gsfKg+U8OhYoKfbZAeIZ+NVMgt8Lc5nik /ljM3WRvbxGqtJtJAXmAHuL0DAifBRbHbPvnzQt/W1Een3TkVVaplPuLLYiY1JiQUYiI LchJoX1eOrEKydDiDTsU7inEjTIk7NcJbeq6dtGoOFxPCo0iON59+TJdtsAPAASPnu03 bn7g== 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=0faiNuBNiOg4jTF/21FaQXSl9wnqV5PUmci48EM+5GE=; b=IktBPh/zhvvL55zz797jXU8UHGMjD+uOjCWgTj5nWimNVMpMoqYx+nr8Hw3uuiz12P 9MxS+687PWiiU+q9dC+Pw50j0HbFKrI9dzOhl1x6W/jnSt+4dEy9mlJVz/ACTxEDh/4P LN1otD/RRz+eFH2sWogqIuP1I/pYzEFezAjnmFpAASHXA39qHmG168i5N/KN6CBWYH2Q +Y1OcGZGSNQdQv8OuwPpyzuBXRF17S68djb//YIZlc1m/XNTJJK63CEZEaeZ6UYcDDZK h/XfdHXkgAN3wtA3tQSWlFqvbnyBu9K74eUgKZZwX6cht2SHASCaj8YZHOt5faMydQIm UecQ== X-Gm-Message-State: AHYfb5i0FbRRyHoUMqrnKJYjCflI9vif1Yu9udIork5CiXksKwp5ksvi ENhEmNEadVQFPqC3w36p34N4qSBuQDGW X-Received: by 10.80.157.12 with SMTP id v12mr6046612ede.159.1503097594577; Fri, 18 Aug 2017 16:06:34 -0700 (PDT) Original-Received: by 10.80.205.92 with HTTP; Fri, 18 Aug 2017 16:06:33 -0700 (PDT) In-Reply-To: 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:98878 Archived-At: --===============7400316333431482342== Content-Type: multipart/alternative; boundary="089e0824cc843007ae05570f2e81" --089e0824cc843007ae05570f2e81 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Aditya it does not work 2017-08-19 1:01 GMT+02:00 Fabrice Couvreur : > If I test this file, it does not work > > % macros=3Dmkvi > > \startcomponent dm-1 > > \environment MyLayout > > \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3=A9}{1}{1h\,30m} > > \dorecurse{20}{\input knuth} > > \math{x^2+4x+5=3D0} > > \stopcomponent > > 2017-08-19 0:23 GMT+02:00 Rik Kabel : > >> On 2017-08-18 18:14, Fabrice Couvreur wrote: >> >> Hi Rik, >> Can you clarify by editing my files ? >> Fabrice >> >> 2017-08-18 23:57 GMT+02:00 Rik Kabel : >> >>> On 2017-08-18 17:34, Fabrice Couvreur wrote: >>> >>> 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#year]}}] >>> [{\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 exampl= e from >>>> 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 sp= irit 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.0= 8.14 >>>> 23:57. >>>> > >>>> > Aditya >>> >>> >>> I believe you need to declare the use of MKVI macros as the first thing >>> in your project file if they will be used by any components. >>> >>> -- >>> Rik >>> >>> >> %macros=3Dmkvi >> \startcomponent dm-1 >> =E2=80=A6 >> >> >> >> -- >> Rik >> >> >> >> ____________________________________________________________ >> _______________________ >> If your question is of interest to others as well, please add an entry t= o >> the Wiki! >> >> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/list >> info/ntg-context >> webpage : http://www.pragma-ade.nl / http://context.aanhet.net >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> wiki : http://contextgarden.net >> ____________________________________________________________ >> _______________________ >> > > --089e0824cc843007ae05570f2e81 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Aditya
it does not work

20= 17-08-19 1:01 GMT+02:00 Fabrice Couvreur <fabrice1.couvreur@gmai= l.com>:
If= I test this file, it does not work

% macros=3Dmkvi

\startcomponent dm-1

=C2=A0 \environment MyLay= out

=C2=A0 \MyHeader{Seconde}{17}{08}{2017}{Devoir surveill=C3= =A9}{1}{1h\,30m}
=C2=A0
=C2=A0 \dorecurse{20}{\input knuth}
=C2=A0 \math{x^2+4x+5=3D0}

\stopcomponent

2017-08-19 0:23 GMT+02:00 Rik Kabel <context@rik.users.panix.co= m>:
=20 =20 =20
On 2017-08-18 18:14, Fabrice Couvreur wrote:
Hi Rik,
Can you clarify by editing my files ?
F= abrice

2017-08-18 23:57 GMT+02:00 Rik Kabel <context@rik.users.panix.com>:
On 2017-08-18 17:34, Fabrice Couvreur wrote:
Hello,
It's ok for me if I compile the Aditya file.<= br> 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
=C2=A0=C2=A0 [header=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 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=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 frame=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,
=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 boffset=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 #month #year #title #number #time

=C2=A0=C2=A0=C2=A0 \setupheadertexts
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{\headerframed[alig= n=3Dmiddle, foregroundstyle=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 [{\headerframed[alig= n=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 [{\headerframed[alig= n=3Dflushright, foregroundstyle=3D\ssx]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 {#where \\ {#time}}}]

\stoptexdefinition
=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}
=C2=A0
=C2=A0 \input knuth

\stopcomponent

2017-08-18 18:44 GMT+02:00 Otared Kavian <otared@gmail.com>:
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 from 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 before 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 friendl= y, 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<= br> >> is present on the fist line, then ConTeXt complains saying that
>>=C2=A0 =C2=A0 =C2=A0 ! Illegal parame= ter number in definition of \MyHeader
>> and stops typesetting pointing to the command \stoptexdefinition.
>
> I am attaching the file. It runs fine here with ConTeXt=C2=A0 ver: 2017.08.14 23:= 57.
>
> Aditya<frame.tex>

I believe you need to declare the use of MKVI macros as the first thing in your project file if they will be used by any components.

--
Rik


%macros=3Dmkvi
\startcomponent dm-1
=E2=80=A6
=

--
Rik

=C2=A0

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

maillist : ntg-cont= ext@ntg.nl / http://www.ntg.nl/mailman/listin= fo/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
_________________________________________________________________= __________________


--089e0824cc843007ae05570f2e81-- --===============7400316333431482342== 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 --===============7400316333431482342==--