From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98877 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:01:08 +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="===============7407336590479188259==" X-Trace: blaine.gmane.org 1503097449 30221 195.159.176.226 (18 Aug 2017 23:04:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 23:04:09 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 19 01:04:05 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 1diqJ9-0007V3-FT for gctc-ntg-context-518@m.gmane.org; Sat, 19 Aug 2017 01:04:03 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 0F3BCFC10A5; Sat, 19 Aug 2017 01:01:22 +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 gdTa8ppVFnoP; Sat, 19 Aug 2017 01:01:21 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 3BCE8FC10A6; Sat, 19 Aug 2017 01:01:21 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8E6ECFC10A2 for ; Sat, 19 Aug 2017 01:01:20 +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 ZkBaZ8YXmqbE for ; Sat, 19 Aug 2017 01:01:19 +0200 (CEST) Original-Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (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 7A419FC1095 for ; Sat, 19 Aug 2017 01:01:09 +0200 (CEST) Original-Received: by mail-wm0-f48.google.com with SMTP id l19so9737850wmi.1 for ; Fri, 18 Aug 2017 16:01:09 -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=9ypkZzEQHGsZP+kSIc2OGcCfpOMSXwT0UC2/1G+ifbw=; b=EOCzuPjfvEWJrR9x82HHvlUsNoJGpdx+K24VcizKUMwHemB391ys6hhVkYSHIj/W/M AK0zTPVn8ts9zxlrQFETMRrIYzQSMQl4FzD/QlpouGWX17xLNUrbmshSopMWndwpjNHH D71OiWt84IJB8hY0pHwc2RZMwtZJs4+CePO9UjadLYTXdUUtx7CpldwiPaQXLTYJ8H05 nBq+7isSYSpuJcvDTut8vVHj6dUho0Kl1yBbCom44BiO8LnfVCy0r97j9vXWW+2k30Vq UeNvX/nByWUfPFiWuaZosNuAMidJdDZrvDJ9ne85QkmD/PjY9k00O0aI2GITXzUrkdRh 4Xqg== 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=9ypkZzEQHGsZP+kSIc2OGcCfpOMSXwT0UC2/1G+ifbw=; b=cZBNW1EfhsdM33C4I6VnVqqKf8+Jd7mNVE1vSOyuBu5F28ghke/qp/xXMiNc1ahrKo KlRNS0Rm7t+dbyV7B5GFqp/NU/v0IWQFZw9cEq+Ff1nz2k8YnAIObF6pqTtsksg20/Uo 74+XyH3/WR+tpuOTe0nICjVtHEB25AURcCGXZ52XvQYtD+uHe6f+zzQ1ux2wRGPMNb/1 B3ucN/sUnJ7ts1fY7e6/Bbn/2+9rEkotc9m09p8YoChlKlreKD4FsiVaI+BVeFqDSKWX 0FLqJqi31bwK4f/a4nsWOw0fajCua8+m4idkLyxAF2ccxMFF7+YAatMx6uJcIbmzouJ9 LvdA== X-Gm-Message-State: AHYfb5gAXz42oK8qmZdAloKqD/v4Ga0GBrqfj19crKIGXTIUkmicezoP i0/r3Ca2AoH909eU7xk/vysNtfCclEk2 X-Received: by 10.80.144.123 with SMTP id z56mr6078996edz.290.1503097268929; Fri, 18 Aug 2017 16:01:08 -0700 (PDT) Original-Received: by 10.80.205.92 with HTTP; Fri, 18 Aug 2017 16:01:08 -0700 (PDT) In-Reply-To: <4e1cd231-003f-9e90-2d6a-fee511086d04@rik.users.panix.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:98877 Archived-At: --===============7407336590479188259== Content-Type: multipart/alternative; boundary="f403045c26cac70a0105570f1aa2" --f403045c26cac70a0105570f1aa2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 #ti= me >> >> \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 example= 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 spi= rit 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 th= e >>> 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= .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 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 > ____________________________________________________________ > _______________________ > --f403045c26cac70a0105570f1aa2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If I test this file, it does not work=

% macros=3Dmkvi

\startcomponent dm-1

=C2=A0 \e= nvironment MyLayout

=C2=A0 \MyHeader{Seconde}{17}{08}{2017}{Devoir s= urveill=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.com>:
=20 =20 =20
On 2017-08-18 18:1= 4, Fabrice Couvreur wrote:
Hi Rik,
Can you clarify by editing my files ?
Fabrice

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-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
_________________________________________________________________= __________________

--f403045c26cac70a0105570f1aa2-- --===============7407336590479188259== 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 --===============7407336590479188259==--