From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98874 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 00:14:10 +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="===============5298269295336688299==" X-Trace: blaine.gmane.org 1503094478 6817 195.159.176.226 (18 Aug 2017 22:14:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 18 Aug 2017 22:14:38 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 19 00:14:32 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 1dipXA-0001LM-Pq for gctc-ntg-context-518@m.gmane.org; Sat, 19 Aug 2017 00:14:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 15C9AFC0F87; Sat, 19 Aug 2017 00:14:25 +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 WlWwcGAe0qY7; Sat, 19 Aug 2017 00:14:24 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 5AEB5FC0F57; Sat, 19 Aug 2017 00:14:24 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 419CAFC0F4A for ; Sat, 19 Aug 2017 00:14:23 +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 91-1LYcTt-ql for ; Sat, 19 Aug 2017 00:14:22 +0200 (CEST) Original-Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) (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 6491CFC0F45 for ; Sat, 19 Aug 2017 00:14:12 +0200 (CEST) Original-Received: by mail-wm0-f41.google.com with SMTP id l19so9245438wmi.1 for ; Fri, 18 Aug 2017 15:14:12 -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=NNZ238bWW/PHG7PiNIKnWewSzluiTpjvwFfgcOJF7Xs=; b=G6IGYUp/rjo4Ds7TbDfC1DGbbE/zjBbRHwtvcw78b5fjNbQDWeAqrOFG+GjUwEBnG2 /I41nHf+vS1+7Iz2eEvCJ6T6U+oIeTTdDIQGhkdZzT8NQ2h5IVmBNRMw2F//vIKvXHUR GyDaEYCeLmCpunIYY16ulLVq52ayCRRTpxWx/5LJyA8UOOzZvv3+5QT7RN9pXIqas5TY v7Y7G3SgmbdVT/bIynZq2f68Y1LiU2GT1WkCSBWD3tVCs52LByg7ShxCuiF56DOMG7f9 q/rvdx70AHGzm55HH0CvOx7IbSE3BX5m+TaqbVqiyQrjTD+wJtFc4cpNRS+Qsqh32FGN 6o7g== 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=NNZ238bWW/PHG7PiNIKnWewSzluiTpjvwFfgcOJF7Xs=; b=MvGZ9j+mK7w9D5Vc0U8pAOr7v9M88RdSGOcGspvv7l4zxnywIh159sOn+zkq0B393b ihhwnlnS2B8f6kLbvH2EQJ04uFuykZNvZqN2fZ6GV0Z7g2xWl3VjxLcsPfVQe9/I5obg zXOzGmkxScUr1leoBeeCUDhGq8V7vUw1TU/73lo16yqpJd4Cw61QCyz1w89iQN7q+4Xy t2tArI6+WsWznajBZ8b0C0XvYLbRWgPx+yN8fV+ZMIlFtdf4KxkE0YzDWn3QZZPy5oZH qBxK4dImooAQBIRSBrldbqXY7zMufPlVDwawjnxiNmVsvUdVklMrjuybrtPK149/uqjf IWqw== X-Gm-Message-State: AHYfb5jMrcefPUVIoLCwxm9sawWuVY8w2McX43vSlIq0HpFpP/UFFyXz qqadr+H10mPC/26R6HLINW01q4MjI2eb X-Received: by 10.80.144.123 with SMTP id z56mr6010182edz.290.1503094451837; Fri, 18 Aug 2017 15:14:11 -0700 (PDT) Original-Received: by 10.80.205.92 with HTTP; Fri, 18 Aug 2017 15:14:10 -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:98874 Archived-At: --===============5298269295336688299== Content-Type: multipart/alternative; boundary="f403045c26cadd9dfd05570e72f0" --f403045c26cadd9dfd05570e72f0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 #tim= e > > \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 spir= it 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.= 14 >> 23 <2017.08.14%2023>:57. >> > >> > Aditya > > > I believe you need to declare the use of MKVI macros as the first thing i= n > your project file if they will be used by any components. > > -- > 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 > ____________________________________________________________ > _______________________ > --f403045c26cadd9dfd05570e72f0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Rik,
Can you clarify by editing my files= ?
Fabric= e

2017-08-18 23:57 GMT+02:00 Rik Kabel <context@rik.= users.panix.com>:
=20 =20 =20
On 2017-08-18 17:34= , Fabrice Couvreur wrote:
He= llo,
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
=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[align=3Dmiddle, fo= regroundstyle=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[align=3Dflush= left, foregroundstyle=3D\ssx]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {Lyc=C3=A9= e JANSON DE SAILLY \\ \date[d=3D#day,m=3D#month,y=3D#year]}}]
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [{\headerframed[align=3Dflush= right, 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 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 \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

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

--f403045c26cadd9dfd05570e72f0-- --===============5298269295336688299== 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 --===============5298269295336688299==--