Re: [NTG-context] unwanted space after \in

2017-08-18 Thread Aditya Mahajan

On Fri, 18 Aug 2017, Alan Bowen wrote:


Unlike \goto and \at, \in seems to insert an unwanted space before any text
that follows.

MWE—

starttext
Text\reference[abc]{}

\page
Text ,

\in{Text}[abc],

\at{Text, p.}[abc],

\goto{Text}[abc],
\stoptext


I am not sure if I consider this a bug. In a typical use case, \reference 
will have a value, e.g., \reference[abc]{whatever}. In that case, if you 
use \in{Text}[abc], there should be a non-breakable space between "Text" 
and "whatever". You appear to be abusing the reference system by giving an 
empty reference.


I think that usin \goto is better in this case rather than adding a check 
to \in for an atypical use case.


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
___

Re: [NTG-context] unwanted space after \in

2017-08-18 Thread Sebastian L.

Confirmed, see attached JPG.

Cheers, Sebastian


On 8/18/2017 11:03 PM, Alan Bowen wrote:
Hi, Pablo—I should have been clearer. The issue is the space that \in 
inserts before the final comma. At that’s what I get using the latest 
standalone beta. (Do you see it?)


Alan

On Fri, Aug 18, 2017 at 4:47 PM, Pablo Rodriguez > wrote:


On 08/18/2017 09:33 PM, Alan Bowen wrote:
> Unlike \goto and \at, \in seems to insert an unwanted space
before any
> text that follows.

Alan,

I’m not sure I get what is the issue:

    \starttext
    \chapter[abc]{Chapter}

    \reference[bca]{}

    \page
    \in{in reference}[abc],

    \in{in reference}[bca],

    \at{at reference, p.}[abc],

    \goto{goto reference}[abc],

    \stoptext

\in behaves as \at in terms of blank spaces in the first case.

I guess that the problem there is that there is no reference to
solve in
the second case.

But I may be missing your point.

Pablo
--
http://www.ousia.tk

___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Jeong Dal
Hi, Otared,

I am also able to typeset Aditya’s example without problem, so example file is 
OK for me.
There may be something which is not in the file.
I am using MKIV beta 6. 21 version under OSX.

This is LuaTeX, Version 1.05.0 (TeX Live 2017) 
 system commands enabled.
open source > level 1, order 1, name 
'/Users/graph/ConTeXt/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  > 
system  > ConTeXt  ver: 2017.06.21 23:03 MKIV beta  fmt: 2017.6.25  
int: english/english

Best regards,

Dalyoung


> 2017. 8. 19. 오전 7:14, ntg-context-requ...@ntg.nl 작성:
> 
> About \setupheadertexts : simplify a code

___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
I turn around !!
It does not work

2017-08-19 1:15 GMT+02:00 Rik :

> On 2017-08-18 19:01, Fabrice Couvreur wrote:
>
> If I test this file, it does not work
>
> % macros=mkvi
>
> \startcomponent dm-1
>
>   \environment MyLayout
>
>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
>
>   \dorecurse{20}{\input knuth}
>
>   \math{x^2+4x+5=0}
>
> \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=mkvi
>>>
>>> \startenvironment MyLayout
>>>
>>> \setuplayout
>>>[header=3\lineheight,
>>> headerdistance=\lineheight]
>>>
>>> \setupbackgrounds
>>>   [header]
>>>   [text]
>>>   [
>>> frame=off,
>>> bottomframe=on,
>>> framecolor=darkgray,
>>> rulethickness=2pt,
>>>   ]
>>>
>>> \defineframed[headerframed]
>>>  [
>>>frame=off, % For visualization set this to on
>>>height=fit,
>>>width=fit,
>>>location=bottom,
>>>boffset=\lineheight,
>>>  ]
>>>
>>> \starttexdefinition MyHeader #where #day #month #year #title #number
>>> #time
>>>
>>> \setupheadertexts
>>>   [{\headerframed[align=middle, foregroundstyle=bold,
>>> foregroundcolor=red]
>>> {#title n\high{o}\,#number}}]
>>>
>>> \setupheadertexts
>>>   [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>>>   {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>>>   [{\headerframed[align=flushright, foregroundstyle=\ssx]
>>>   {#where \\ {#time}}}]
>>>
>>> \stoptexdefinition
>>>
>>> \stopenvironment
>>>
>>> ##
>>> dm-1.tex
>>> ##
>>>
>>> \startcomponent dm-1
>>>
>>>   \environment MyLayout
>>>
>>>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example from
 the e-mail…
 I think the command
 % macros = mkvi
 was not set correctly written at the first line, that is I had a space
 before the percent sign « % ». In fact
 %macros=mkvi
 or
 %macros = mkvi
 work as well.

 By the way, wouldn’t be more user friendly, and more in the spirit of
 ConTeXt, if we had a command saying
 \enablemode[mkvi]
 in order to tell ConTeXt that we are using %macros = 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=mkvi
 >> 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
>>> in your project file if they will be used by any components.
>>>
>>> --
>>> Rik
>>>
>>>
>> %macros=mkvi
>> \startcomponent dm-1
>> …
>>
>>
> I was wrong, and (no surprise) Aditya was correct.
>
> The %macros=mkvi line is not needed in dm1.tex. It should be at the top
> of MyLayout.tex.
>
> You may then reference MyLayout.tex (note the addition of the extension)
> in dm1.tex, or you may rename the file to MyLayout.mkvi, where you can
> reference it as either MyLayout or as MyLayout.mkvi.
>
> Sorry for the noise.
>
> --
> 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
> 
> 

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Rik

On 2017-08-18 19:01, Fabrice Couvreur wrote:

If I test this file, it does not work

% macros=mkvi

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

  \dorecurse{20}{\input knuth}

  \math{x^2+4x+5=0}

\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=mkvi

\startenvironment MyLayout

\setuplayout
   [header=3\lineheight,
    headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [
    frame=off,
    bottomframe=on,
    framecolor=darkgray,
    rulethickness=2pt,
  ]

\defineframed[headerframed]
 [
   frame=off, % For visualization set this to on
   height=fit,
   width=fit,
   location=bottom,
boffset=\lineheight,
 ]

\starttexdefinition MyHeader #where #day #month #year #title
#number #time

    \setupheadertexts
[{\headerframed[align=middle, foregroundstyle=bold,
foregroundcolor=red]
    {#title n\high{o}\,#number}}]

    \setupheadertexts
[{\headerframed[align=flushleft, foregroundstyle=\ssx]
  {Lycée JANSON DE SAILLY \\
\date[d=#day,m=#month,y=#year]}}]
[{\headerframed[align=flushright, foregroundstyle=\ssx]
  {#where \\ {#time}}}]

\stoptexdefinition

\stopenvironment

##
dm-1.tex
##

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the
example from the e-mail…
I think the command
        % macros = mkvi
was not set correctly written at the first line, that is
I had a space before the percent sign « % ». In fact
        %macros=mkvi
or
        %macros = mkvi
work as well.

By the way, wouldn’t be more user friendly, and more in
the spirit of ConTeXt, if we had a command saying
        \enablemode[mkvi]
in order to tell ConTeXt that we are using %macros = 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=mkvi
>> 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=mkvi
\startcomponent dm-1
…



I was wrong, and (no surprise) Aditya was correct.

The %macros=mkvi line is not needed in dm1.tex. It should be at the top 
of MyLayout.tex.


You may then reference MyLayout.tex (note the addition of the extension) 
in dm1.tex, or you may rename the file to MyLayout.mkvi, where you can 
reference it as either MyLayout or as MyLayout.mkvi.


Sorry for the noise.

--
Rik

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
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=mkvi
>
> \startcomponent dm-1
>
>   \environment MyLayout
>
>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
>
>   \dorecurse{20}{\input knuth}
>
>   \math{x^2+4x+5=0}
>
> \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=mkvi
>>>
>>> \startenvironment MyLayout
>>>
>>> \setuplayout
>>>[header=3\lineheight,
>>> headerdistance=\lineheight]
>>>
>>> \setupbackgrounds
>>>   [header]
>>>   [text]
>>>   [
>>> frame=off,
>>> bottomframe=on,
>>> framecolor=darkgray,
>>> rulethickness=2pt,
>>>   ]
>>>
>>> \defineframed[headerframed]
>>>  [
>>>frame=off, % For visualization set this to on
>>>height=fit,
>>>width=fit,
>>>location=bottom,
>>>boffset=\lineheight,
>>>  ]
>>>
>>> \starttexdefinition MyHeader #where #day #month #year #title #number
>>> #time
>>>
>>> \setupheadertexts
>>>   [{\headerframed[align=middle, foregroundstyle=bold,
>>> foregroundcolor=red]
>>> {#title n\high{o}\,#number}}]
>>>
>>> \setupheadertexts
>>>   [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>>>   {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>>>   [{\headerframed[align=flushright, foregroundstyle=\ssx]
>>>   {#where \\ {#time}}}]
>>>
>>> \stoptexdefinition
>>>
>>> \stopenvironment
>>>
>>> ##
>>> dm-1.tex
>>> ##
>>>
>>> \startcomponent dm-1
>>>
>>>   \environment MyLayout
>>>
>>>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example from
 the e-mail…
 I think the command
 % macros = mkvi
 was not set correctly written at the first line, that is I had a space
 before the percent sign « % ». In fact
 %macros=mkvi
 or
 %macros = mkvi
 work as well.

 By the way, wouldn’t be more user friendly, and more in the spirit of
 ConTeXt, if we had a command saying
 \enablemode[mkvi]
 in order to tell ConTeXt that we are using %macros = 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=mkvi
 >> 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=mkvi
>> \startcomponent dm-1
>> …
>>
>>
>>
>> --
>> 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/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
>> 
>> ___
>>
>
>
___
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 : 

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
If I test this file, it does not work

% macros=mkvi

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}

  \dorecurse{20}{\input knuth}

  \math{x^2+4x+5=0}

\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=mkvi
>>
>> \startenvironment MyLayout
>>
>> \setuplayout
>>[header=3\lineheight,
>> headerdistance=\lineheight]
>>
>> \setupbackgrounds
>>   [header]
>>   [text]
>>   [
>> frame=off,
>> bottomframe=on,
>> framecolor=darkgray,
>> rulethickness=2pt,
>>   ]
>>
>> \defineframed[headerframed]
>>  [
>>frame=off, % For visualization set this to on
>>height=fit,
>>width=fit,
>>location=bottom,
>>boffset=\lineheight,
>>  ]
>>
>> \starttexdefinition MyHeader #where #day #month #year #title #number #time
>>
>> \setupheadertexts
>>   [{\headerframed[align=middle, foregroundstyle=bold,
>> foregroundcolor=red]
>> {#title n\high{o}\,#number}}]
>>
>> \setupheadertexts
>>   [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>>   {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>>   [{\headerframed[align=flushright, foregroundstyle=\ssx]
>>   {#where \\ {#time}}}]
>>
>> \stoptexdefinition
>>
>> \stopenvironment
>>
>> ##
>> dm-1.tex
>> ##
>>
>> \startcomponent dm-1
>>
>>   \environment MyLayout
>>
>>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example from the
>>> e-mail…
>>> I think the command
>>> % macros = mkvi
>>> was not set correctly written at the first line, that is I had a space
>>> before the percent sign « % ». In fact
>>> %macros=mkvi
>>> or
>>> %macros = mkvi
>>> work as well.
>>>
>>> By the way, wouldn’t be more user friendly, and more in the spirit of
>>> ConTeXt, if we had a command saying
>>> \enablemode[mkvi]
>>> in order to tell ConTeXt that we are using %macros = 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=mkvi
>>> >> 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=mkvi
> \startcomponent dm-1
> …
>
>
>
> --
> 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
> 
> ___
>
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Aditya Mahajan

On Fri, 18 Aug 2017, 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=mkvi


Save this file as MyLayout.mkvi

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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread 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=mkvi

\startenvironment MyLayout

\setuplayout
   [header=3\lineheight,
    headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [
    frame=off,
    bottomframe=on,
    framecolor=darkgray,
    rulethickness=2pt,
  ]

\defineframed[headerframed]
 [
   frame=off, % For visualization set this to on
   height=fit,
   width=fit,
   location=bottom,
   boffset=\lineheight,
 ]

\starttexdefinition MyHeader #where #day #month #year #title
#number #time

    \setupheadertexts
  [{\headerframed[align=middle, foregroundstyle=bold,
foregroundcolor=red]
    {#title n\high{o}\,#number}}]

    \setupheadertexts
  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
  {Lycée JANSON DE SAILLY \\
\date[d=#day,m=#month,y=#year]}}]
  [{\headerframed[align=flushright, foregroundstyle=\ssx]
  {#where \\ {#time}}}]

\stoptexdefinition

\stopenvironment

##
dm-1.tex
##

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the
example from the e-mail…
I think the command
        % macros = mkvi
was not set correctly written at the first line, that is I
had a space before the percent sign « % ». In fact
        %macros=mkvi
or
        %macros = mkvi
work as well.

By the way, wouldn’t be more user friendly, and more in the
spirit of ConTeXt, if we had a command saying
        \enablemode[mkvi]
in order to tell ConTeXt that we are using %macros = 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=mkvi
>> 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=mkvi
   \startcomponent dm-1
   …



--
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
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=mkvi
>
> \startenvironment MyLayout
>
> \setuplayout
>[header=3\lineheight,
> headerdistance=\lineheight]
>
> \setupbackgrounds
>   [header]
>   [text]
>   [
> frame=off,
> bottomframe=on,
> framecolor=darkgray,
> rulethickness=2pt,
>   ]
>
> \defineframed[headerframed]
>  [
>frame=off, % For visualization set this to on
>height=fit,
>width=fit,
>location=bottom,
>boffset=\lineheight,
>  ]
>
> \starttexdefinition MyHeader #where #day #month #year #title #number #time
>
> \setupheadertexts
>   [{\headerframed[align=middle, foregroundstyle=bold,
> foregroundcolor=red]
> {#title n\high{o}\,#number}}]
>
> \setupheadertexts
>   [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>   {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>   [{\headerframed[align=flushright, foregroundstyle=\ssx]
>   {#where \\ {#time}}}]
>
> \stoptexdefinition
>
> \stopenvironment
>
> ##
> dm-1.tex
> ##
>
> \startcomponent dm-1
>
>   \environment MyLayout
>
>   \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example from the
>> e-mail…
>> I think the command
>> % macros = mkvi
>> was not set correctly written at the first line, that is I had a space
>> before the percent sign « % ». In fact
>> %macros=mkvi
>> or
>> %macros = mkvi
>> work as well.
>>
>> By the way, wouldn’t be more user friendly, and more in the spirit of
>> ConTeXt, if we had a command saying
>> \enablemode[mkvi]
>> in order to tell ConTeXt that we are using %macros = 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=mkvi
>> >> 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 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
> 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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread 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=mkvi

\startenvironment MyLayout

\setuplayout
   [header=3\lineheight,
    headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [
    frame=off,
    bottomframe=on,
    framecolor=darkgray,
    rulethickness=2pt,
  ]

\defineframed[headerframed]
 [
   frame=off, % For visualization set this to on
   height=fit,
   width=fit,
   location=bottom,
   boffset=\lineheight,
 ]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

    \setupheadertexts
  [{\headerframed[align=middle, foregroundstyle=bold, 
foregroundcolor=red]

    {#title n\high{o}\,#number}}]

    \setupheadertexts
  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
  [{\headerframed[align=flushright, foregroundstyle=\ssx]
  {#where \\ {#time}}}]

\stoptexdefinition

\stopenvironment

##
dm-1.tex
##

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example
from the e-mail…
I think the command
        % macros = mkvi
was not set correctly written at the first line, that is I had a
space before the percent sign « % ». In fact
        %macros=mkvi
or
        %macros = mkvi
work as well.

By the way, wouldn’t be more user friendly, and more in the spirit
of ConTeXt, if we had a command saying
        \enablemode[mkvi]
in order to tell ConTeXt that we are using %macros = 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=mkvi
>> 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
___
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
___

Re: [NTG-context] Strange behavior with the Garamond font

2017-08-18 Thread Fabrice Couvreur
Hi,
@Aditya

This does not solve my problem

@Pablo

fab@debian:~$ pdffonts layout15.pdf
name type  encoding emb
sub uni object ID
 -  ---
--- --- -
AHYUQI+GaramondNo8-Regular   CID Type 0C   Identity-H   yes
yes yes 10  0


2017-08-18 20:17 GMT+02:00 Aditya Mahajan :

> On Thu, 17 Aug 2017, Fabrice Couvreur wrote:
>
> When I speak of non-readable, I mean it looks like "hieroglyphics".
>>
>
> Try
>
> mtxrun --script fonts --reload --force
>
> and then compiling again.
>
> 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/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
> 
> ___
>
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
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=mkvi

\startenvironment MyLayout

\setuplayout
   [header=3\lineheight,
headerdistance=\lineheight]

\setupbackgrounds
  [header]
  [text]
  [
frame=off,
bottomframe=on,
framecolor=darkgray,
rulethickness=2pt,
  ]

\defineframed[headerframed]
 [
   frame=off, % For visualization set this to on
   height=fit,
   width=fit,
   location=bottom,
   boffset=\lineheight,
 ]

\starttexdefinition MyHeader #where #day #month #year #title #number #time

\setupheadertexts
  [{\headerframed[align=middle, foregroundstyle=bold,
foregroundcolor=red]
{#title n\high{o}\,#number}}]

\setupheadertexts
  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
  [{\headerframed[align=flushright, foregroundstyle=\ssx]
  {#where \\ {#time}}}]

\stoptexdefinition

\stopenvironment

##
dm-1.tex
##

\startcomponent dm-1

  \environment MyLayout

  \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{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’t know what happened when I copied and pasted the example from the
> e-mail…
> I think the command
> % macros = mkvi
> was not set correctly written at the first line, that is I had a space
> before the percent sign « % ». In fact
> %macros=mkvi
> or
> %macros = mkvi
> work as well.
>
> By the way, wouldn’t be more user friendly, and more in the spirit of
> ConTeXt, if we had a command saying
> \enablemode[mkvi]
> in order to tell ConTeXt that we are using %macros = 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=mkvi
> >> 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___
> 
> > 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
___

Re: [NTG-context] unwanted space after \in

2017-08-18 Thread Alan Bowen
Hi, Pablo—I should have been clearer. The issue is the space that \in
inserts before the final comma. At that’s what I get using the latest
standalone beta. (Do you see it?)

Alan

On Fri, Aug 18, 2017 at 4:47 PM, Pablo Rodriguez  wrote:

> On 08/18/2017 09:33 PM, Alan Bowen wrote:
> > Unlike \goto and \at, \in seems to insert an unwanted space before any
> > text that follows.
>
> Alan,
>
> I’m not sure I get what is the issue:
>
> \starttext
> \chapter[abc]{Chapter}
>
> \reference[bca]{}
>
> \page
> \in{in reference}[abc],
>
> \in{in reference}[bca],
>
> \at{at reference, p.}[abc],
>
> \goto{goto reference}[abc],
>
> \stoptext
>
> \in behaves as \at in terms of blank spaces in the first case.
>
> I guess that the problem there is that there is no reference to solve in
> the second case.
>
> But I may be missing your point.
>
> Pablo
> --
> http://www.ousia.tk
> 
> ___
> 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
___

Re: [NTG-context] unwanted space after \in

2017-08-18 Thread Pablo Rodriguez
On 08/18/2017 09:33 PM, Alan Bowen wrote:
> Unlike \goto and \at, \in seems to insert an unwanted space before any
> text that follows.

Alan,

I’m not sure I get what is the issue:

\starttext
\chapter[abc]{Chapter}

\reference[bca]{}

\page
\in{in reference}[abc],

\in{in reference}[bca],

\at{at reference, p.}[abc],

\goto{goto reference}[abc],

\stoptext

\in behaves as \at in terms of blank spaces in the first case.

I guess that the problem there is that there is no reference to solve in
the second case.

But I may be missing your point.

Pablo
-- 
http://www.ousia.tk
___
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
___

[NTG-context] unwanted space after \in

2017-08-18 Thread Alan Bowen
Unlike \goto and \at, \in seems to insert an unwanted space before any text
that follows.

MWE—

starttext
Text\reference[abc]{}

\page
 Text ,

\in{Text}[abc],

\at{Text, p.}[abc],

\goto{Text}[abc],
\stoptext

Alan
___
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
___

Re: [NTG-context] Strange behavior with the Garamond font

2017-08-18 Thread Aditya Mahajan

On Thu, 17 Aug 2017, Fabrice Couvreur wrote:


When I speak of non-readable, I mean it looks like "hieroglyphics".


Try

mtxrun --script fonts --reload --force

and then compiling again.

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
___

Re: [NTG-context] Strange behavior with the Garamond font

2017-08-18 Thread Pablo Rodriguez
On 08/17/2017 11:11 PM, Fabrice Couvreur wrote:
> Hi Pablo,
> When I speak of non-readable, I mean it looks like "hieroglyphics".
> 
> fab@debian:~$ mtxrun --script fonts  --list --pattern=garamond --all

Hi Fabrice,

sorry, I asked you to use pdffonts on the output PDF document to check
which font it is embedded.

From my outuput, I get:

$ pdffonts a.pdf
name   typeencoding   emb sub uni object ID
-- -- -- --- --- --- -
WKSCSW+GaramondNo8-Regular CID Type 0C Identity-H yes yes yes  10  0

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread 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’t know what happened when I copied and pasted the example from the e-mail…
I think the command
% macros = mkvi
was not set correctly written at the first line, that is I had a space before 
the percent sign « % ». In fact 
%macros=mkvi
or
%macros = mkvi
work as well.

By the way, wouldn’t be more user friendly, and more in the spirit of ConTeXt, 
if we had a command saying
\enablemode[mkvi]
in order to tell ConTeXt that we are using %macros = 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=mkvi
>> 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___
> 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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Aditya Mahajan

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=mkvi
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

frame.tex
Description: TeX document
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
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" 
> À: "mailing list for ConTeXt users" 
> Envoyé: Vendredi 18 Août 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=mkvi
> 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 is
> how I would have done it:
> >
> > % macros=mkvi
> > \showframe
> >
> > \setuplayout
> >   [header=3\lineheight,
> >headerdistance=\lineheight]
> >
> > \setupbackgrounds
> >  [header]
> >  [text]
> >  [
> >frame=off,
> >bottomframe=on,
> >framecolor=darkgray,
> >rulethickness=2pt,
> >  ]
> >
> > \defineframed[headerframed]
> > [
> >   frame=off, % For visualization set this to on
> >   height=fit,
> >   width=fit,
> >   location=bottom,
> >   boffset=\lineheight,
> > ]
> >
> > \starttexdefinition MyHeader #where #day #month #year #title #number
> #time
> >
> >\setupheadertexts
> >  [{\headerframed[align=middle, foregroundstyle=bold,
> foregroundcolor=red]
> >{#title n\high{o}\,#number}}]
> >
> >\setupheadertexts
> >  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
> >  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
> >  [{\headerframed[align=flushright, foregroundstyle=\ssx]
> >  {#where \\ {#time}}}]
> >
> > \stoptexdefinition
> >
> > \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> >
> > \starttext
> > \input knuth
> > \stoptext
> >
> > An added benefit is that you get correct interlinespace for the left and
> 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
> 
> ___
>
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
Hi,
It's okay for me
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" 
> À: "mailing list for ConTeXt users" 
> Envoyé: Vendredi 18 Août 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=mkvi
> 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 is
> how I would have done it:
> >
> > % macros=mkvi
> > \showframe
> >
> > \setuplayout
> >   [header=3\lineheight,
> >headerdistance=\lineheight]
> >
> > \setupbackgrounds
> >  [header]
> >  [text]
> >  [
> >frame=off,
> >bottomframe=on,
> >framecolor=darkgray,
> >rulethickness=2pt,
> >  ]
> >
> > \defineframed[headerframed]
> > [
> >   frame=off, % For visualization set this to on
> >   height=fit,
> >   width=fit,
> >   location=bottom,
> >   boffset=\lineheight,
> > ]
> >
> > \starttexdefinition MyHeader #where #day #month #year #title #number
> #time
> >
> >\setupheadertexts
> >  [{\headerframed[align=middle, foregroundstyle=bold,
> foregroundcolor=red]
> >{#title n\high{o}\,#number}}]
> >
> >\setupheadertexts
> >  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
> >  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
> >  [{\headerframed[align=flushright, foregroundstyle=\ssx]
> >  {#where \\ {#time}}}]
> >
> > \stoptexdefinition
> >
> > \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> >
> > \starttext
> > \input knuth
> > \stoptext
> >
> > An added benefit is that you get correct interlinespace for the left and
> 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
> 
> ___
>
___
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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread 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" 
À: "mailing list for ConTeXt users" 
Envoyé: Vendredi 18 Août 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=mkvi
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 is how 
> I would have done it:
> 
> % macros=mkvi
> \showframe
> 
> \setuplayout
>   [header=3\lineheight,
>headerdistance=\lineheight]
> 
> \setupbackgrounds
>  [header]
>  [text]
>  [
>frame=off,
>bottomframe=on,
>framecolor=darkgray,
>rulethickness=2pt,
>  ]
> 
> \defineframed[headerframed]
> [
>   frame=off, % For visualization set this to on
>   height=fit,
>   width=fit,
>   location=bottom,
>   boffset=\lineheight,
> ]
> 
> \starttexdefinition MyHeader #where #day #month #year #title #number #time
> 
>\setupheadertexts
>  [{\headerframed[align=middle, foregroundstyle=bold, foregroundcolor=red]
>{#title n\high{o}\,#number}}]
> 
>\setupheadertexts
>  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>  [{\headerframed[align=flushright, foregroundstyle=\ssx]
>  {#where \\ {#time}}}]
> 
> \stoptexdefinition
> 
> \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> 
> \starttext
> \input knuth
> \stoptext
> 
> An added benefit is that you get correct interlinespace for the left and 
> 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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Fabrice Couvreur
Hi,
@Aditya and Henri Thank you for your suggestions.
@Otared Maybe remove \showframe ?
Fabrice

2017-08-18 11:45 GMT+02:00 Otared Kavian :

> Hi Aditya,
>
> I tried to typeset your example, but got an error: whether or not the
> command
> % macros=mkvi
> 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 is
> how I would have done it:
> >
> > % macros=mkvi
> > \showframe
> >
> > \setuplayout
> >   [header=3\lineheight,
> >headerdistance=\lineheight]
> >
> > \setupbackgrounds
> >  [header]
> >  [text]
> >  [
> >frame=off,
> >bottomframe=on,
> >framecolor=darkgray,
> >rulethickness=2pt,
> >  ]
> >
> > \defineframed[headerframed]
> > [
> >   frame=off, % For visualization set this to on
> >   height=fit,
> >   width=fit,
> >   location=bottom,
> >   boffset=\lineheight,
> > ]
> >
> > \starttexdefinition MyHeader #where #day #month #year #title #number
> #time
> >
> >\setupheadertexts
> >  [{\headerframed[align=middle, foregroundstyle=bold,
> foregroundcolor=red]
> >{#title n\high{o}\,#number}}]
> >
> >\setupheadertexts
> >  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
> >  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
> >  [{\headerframed[align=flushright, foregroundstyle=\ssx]
> >  {#where \\ {#time}}}]
> >
> > \stoptexdefinition
> >
> > \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> >
> > \starttext
> > \input knuth
> > \stoptext
> >
> > An added benefit is that you get correct interlinespace for the left and
> 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
___

Re: [NTG-context] About \setupheadertexts : simplify a code

2017-08-18 Thread Otared Kavian
Hi Aditya,

I tried to typeset your example, but got an error: whether or not the command
% macros=mkvi
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 is how 
> I would have done it:
> 
> % macros=mkvi
> \showframe
> 
> \setuplayout
>   [header=3\lineheight,
>headerdistance=\lineheight]
> 
> \setupbackgrounds
>  [header]
>  [text]
>  [
>frame=off,
>bottomframe=on,
>framecolor=darkgray,
>rulethickness=2pt,
>  ]
> 
> \defineframed[headerframed]
> [
>   frame=off, % For visualization set this to on
>   height=fit,
>   width=fit,
>   location=bottom,
>   boffset=\lineheight,
> ]
> 
> \starttexdefinition MyHeader #where #day #month #year #title #number #time
> 
>\setupheadertexts
>  [{\headerframed[align=middle, foregroundstyle=bold, foregroundcolor=red]
>{#title n\high{o}\,#number}}]
> 
>\setupheadertexts
>  [{\headerframed[align=flushleft, foregroundstyle=\ssx]
>  {Lycée JANSON DE SAILLY \\ \date[d=#day,m=#month,y=#year]}}]
>  [{\headerframed[align=flushright, foregroundstyle=\ssx]
>  {#where \\ {#time}}}]
> 
> \stoptexdefinition
> 
> \MyHeader{Seconde}{17}{08}{2017}{Devoir surveillé}{1}{1h\,30m}
> 
> \starttext
> \input knuth
> \stoptext
> 
> An added benefit is that you get correct interlinespace for the left and 
> 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
___