[NTG-context] Use of context in lua (was: date calculated with currentdate plus n days)

2018-08-14 Thread Jan U. Hasecke
On 14.08.2018 16:58, Pablo Rodriguez wrote:
> I rewrote your sample as (xtables are the only tables I know in ConTeXt):
> 
> \starttext
> \startlua
> context.startxtable()
> context.startxrow()
>  context.startxcell()
>   context("Note 1")
>  context.stopxcell()
>  context.startxcell()
>   context("Note 2")
>  context.stopxcell()
> context.stopxrow()
> context.startxrow()
>  context.startxcell()
>   context("Note 3")
>  context.stopxcell()
>  context.startxcell()
>   context("Note 4")
>  context.stopxcell()
> context.stopxrow()
> context.stopxtable()
> \stoplua
> \stoptext

Seeing this example I wonder if there is already an example taking a
csv-file and creating a table based on its content. I guess building
blocks are readfile, loops and setting the stop sign (; oder ,).

As I know a bit of Python, at least, I might be able to search for the
building blocks in the doku. ;-)

juh
___
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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

On Wed, Aug 15, 2018 at 05:41:33AM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,
  location=none,
  page=no]


Thanks Wolfgang, that works like a champ.  Now I've found the documentation for
ConTeXt in Debian, it is tucked away in
/usr/share/texmf/doc/context/documents/general/manuals directory as a pile of
PDFs.  I have some reading to do now.  Thank you everyone for your help.

David




Wolfgang


David Walther schrieb am 14.08.18 um 22:44:
Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure 
how to address:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the 
number and the word of.


Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided 
option I get 3
pages as expected, but it doesn't do the nice interior margins and 
switching
sides of page numbers.  Even context doesn't view the blank page at 
the end as

a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
[alternative=doublesided,   % doublesided layout
%alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

 location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
[] [Page \userpagenumber\ of \lastuserpagenumber]
[Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully: http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a 
blob of code I need to put into one of the boxes in the Layout?


David
___


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] Logo in the margin at the bottom of the page

2018-08-14 Thread Henri Menke
You have to use the correct margin width, i.e. \rightmarginwidth in the 
right margin and vice versa in the left margin.  You should also scale 
the margins to fit in the backspace/cutspace because by default they 
don't and run off the paper.


\showframe
\useMPlibrary[dum]
\setuplayout
  [height=middle,
   width=middle,
   backspace=2cm,
   topspace=10mm,
   bottomspace=10mm,
   header=10mm,
   footer=10mm,
   footerdistance=10mm,
   headerdistance=10mm,

leftmargin=\dimexpr\layoutparameter{backspace}-\layoutparameter{leftmargindistance}\relax,

cutspace=\dimexpr\layoutparameter{rightmargin}+\layoutparameter{rightmargindistance}\relax]

\setupfooter[margin][strut=no]

\setupfootertexts
  [margin]
  []
  [{\externalfigure[dummy][width=\rightmarginwidth,height=\footerheight]}]
  []
  [{\externalfigure[dummy][width=\leftmarginwidth,height=\footerheight]}]

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


On 14/08/18 22:50, Fabrice Couvreur wrote:

Hi Henri,
Thank you for your suggestion.
However, I believe that my way of doing should not be the best because 
fixing width=\marginwidth the image is cropped.

Fabrice


\showframe
\useMPlibrary[dum]
\setuplayout
   [height=middle,
    width=middle,
    backspace=2cm,
    topspace=10mm,
    bottomspace=10mm,
    header=10mm,
    footer=10mm,
    footerdistance=10mm,
    headerdistance=10mm]

\setupfooter[margin][strut=no]

\setupfootertexts
     [margin]
     []
     [{\externalfigure[dummy][width=,height=\footerheight]}]
     []
     [{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

     \starttext
     \dorecurse{10}{\page[dummy]}
     \stoptext


Le mar. 14 août 2018 à 12:18, Henri Menke > a écrit :




On 14/08/18 22:13, Fabrice Couvreur wrote:
 > Hello,
 > I wish to place a small logo at the bottom of the page.
 > It works almost but it is not very well adjusted.
 > How to cure it ?
 > Thank you.
 > fabrice
 >
 > \showframe
 > \useMPlibrary[dum]
 > \setuplayout
 >    [height=middle,
 >     width=middle,
 >     backspace=2cm,
 >     topspace=10mm,
 >     bottomspace=10mm,
 >     header=10mm,
 >     footer=10mm,
 >     footerdistance=10mm,
 >     headerdistance=10mm]
 >

\setupfooter[margin][strut=no]

 > \setupfootertexts
 >      [margin]
 >      []
 > 
[{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

 >      []
 > 
[{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

 >
 >      \starttext
 >      \dorecurse{10}{\page[dummy]}
 >      \stoptext
 >
 >
 >

___
 > 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] how to put page X of N in header or top space?

2018-08-14 Thread Wolfgang Schuster

\setuppagenumbering
  [alternative=doublesided,
   location=none,
   page=no]


Wolfgang


David Walther schrieb am 14.08.18 um 22:44:
Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure 
how to address:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number 
and the word of.


Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided option 
I get 3
pages as expected, but it doesn't do the nice interior margins and 
switching
sides of page numbers.  Even context doesn't view the blank page at 
the end as

a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,   % doublesided layout
 %alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

  location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully: http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob 
of code I need to put into one of the boxes in the Layout?


David
___ 



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] How can I remove a blank leading line from a buffer

2018-08-14 Thread Aditya Mahajan

On Tue, 14 Aug 2018, Rik Kabel wrote:

I really think, though, that a buffers.strip function would be the way to go, 
instead of futzing after the damage is done.


In lua, buffers.getcontent('name') gives the contents of the buffer 
labelled 'name'. You can post-process this in whatever way you want. For 
example, you could write a lua function userdata.strip that strips the 
leading and ending black spaces from a string, and then call


context(userdata.strip(buffers.getcontent('name)))

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] how to put page X of N in header or top space?

2018-08-14 Thread Alan Braslau
On Tue, 14 Aug 2018 14:19:25 -0700
David Walther  wrote:

> On Tue, Aug 14, 2018 at 02:58:58PM -0600, Alan Braslau wrote:
> >On Tue, 14 Aug 2018 13:44:43 -0700
> >David Walther  wrote:
> >  
> >> I did page Page X of N, but in the output, it displays like
> >> Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and 
> >> the word of.  
> >
> >You must have forgotten the trailing "\ " of "\userpagenumber\ ".  
> 
> Thank you Alan.  That worked.  I didn't forget it; I never knew it.  I'm
> starting to run into the area where the Wiki isn't enough, but I don't know
> enough TeX to read the Context source for the macros.  What is recommended to
> get up to speed on Context?  Should I go back and re-read Knuth's book on TeX
> then try reading ConTeXt source?  Last time I read it was 20 years ago, and
> only got half way through; that was enough for my needs back then.  I guess a
> week or two reading everything on this page would help too:
> 
>   http://www.luatex.org/documentation.html
> 
> Now just need an answer for the blank page issue and I can start shipping 
> these
> spreadsheets to clients.

TeX commands such as \userpagenumber "gobble" a trailing blank space, 
delimiting the end of the token name ("userpagenumber"). It can also be 
terminated by any non-token-name character or another token. So we generally 
write \userpagenumber\ . One could also write {\userpagenumber}, i.e. enclosing 
the TeX command within delimiters, and it is a question of taste what coding is 
more readable. \userpagenumber{} is also valid, yet I find this even less 
readable.

You can learn much from emulation, paying attention to details, as Wolfgang had 
written

\setupheadertexts
   [] [Page \userpagenumber\ of \lastuserpagenumber]
   [Page \userpagenumber\ of \lastuserpagenumber] []



One tricky point that might not be obvious, \setupheadertexts can take a 
varying number of arguments enclosed in []. The form above (4 groups of []), 
sets the left/right headertexts for even/odd pages. Whereas the single group 
instance

\setupheadertexts [My Spreadsheet]

sets the center text. Having three or five group versions gets unwieldy or 
ambiguous (the two group version sets left/right for singlesided layout), so 
having to make two "calls" to \setupheadertexts as above is cleaner, although 
was confusing to me at first.

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] Logo in the margin at the bottom of the page

2018-08-14 Thread Fabrice Couvreur
Hi Hraban,
It seems a little more complicated but I have never used the layers.
Fabrice

Le mar. 14 août 2018 à 13:11, Henning Hraban Ramm  a écrit :

> Am 2018-08-14 um 12:13 schrieb Fabrice Couvreur <
> fabrice1.couvr...@gmail.com>:
>
> > Hello,
> > I wish to place a small logo at the bottom of the page.
> > It works almost but it is not very well adjusted.
> > How to cure it ?
>
> Salut,
> while the footer text approach may be viable, I’d use layers for exact
> placement.
> http://wiki.contextgarden.net/Layers
>
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
>
>
>
> ___
> 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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

On Tue, Aug 14, 2018 at 02:58:58PM -0600, Alan Braslau wrote:

On Tue, 14 Aug 2018 13:44:43 -0700
David Walther  wrote:


I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
word of.


You must have forgotten the trailing "\ " of "\userpagenumber\ ".


Thank you Alan.  That worked.  I didn't forget it; I never knew it.  I'm
starting to run into the area where the Wiki isn't enough, but I don't know
enough TeX to read the Context source for the macros.  What is recommended to
get up to speed on Context?  Should I go back and re-read Knuth's book on TeX
then try reading ConTeXt source?  Last time I read it was 20 years ago, and
only got half way through; that was enough for my needs back then.  I guess a
week or two reading everything on this page would help too:

 http://www.luatex.org/documentation.html

Now just need an answer for the blank page issue and I can start shipping these
spreadsheets to clients.

David
___
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] how to put page X of N in header or top space?

2018-08-14 Thread Alan Braslau
On Tue, 14 Aug 2018 13:44:43 -0700
David Walther  wrote:

> I did page Page X of N, but in the output, it displays like
> Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
> word of.

You must have forgotten the trailing "\ " of "\userpagenumber\ ".

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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

Thank you Wolfgang, that worked nicely.  Two artifacts I'm not sure how to 
address:

I did page Page X of N, but in the output, it displays like
Page 2of 3, Page 1of 3, etc.  It ignores the space between the number and the 
word of.

Secondly, when I use the doublesided and the {singlesided,doublesided}
alternative page numbering, it rounds up to an even number of pages, even
though the last page is blank.  When I just use the singlesided option I get 3
pages as expected, but it doesn't do the nice interior margins and switching
sides of page numbers.  Even context doesn't view the blank page at the end as
a page, because it doesn't print the header or footer on it.

David


On Tue, Aug 14, 2018 at 09:32:29PM +0200, Wolfgang Schuster wrote:

\setuppagenumbering
 [alternative=doublesided,   % doublesided layout
 %alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

  location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
 [] [Page \userpagenumber\ of \lastuserpagenumber]
 [Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully:  http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob 
of code I need to put into one of the boxes in the Layout?


David
___

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] how to put page X of N in header or top space?

2018-08-14 Thread Wolfgang Schuster

\setuppagenumbering
  [alternative=doublesided,   % doublesided layout
  %alternative={singlesided,doublesided}, % singlesided layout with 
left/right pages

   location=none]

\setupheadertexts [My Spreadsheet]

\setupheadertexts
  [] [Page \userpagenumber\ of \lastuserpagenumber]
  [Page \userpagenumber\ of \lastuserpagenumber] []

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Wolfgang


David Walther schrieb am 14.08.18 um 18:28:
Hi, I am slowly learning ConTeXt.  I am generating tables and 
spreadsheets, and

transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully:  http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob of 
code I need to put into one of the boxes in the Layout?


David
___ 

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] embedded sounds aren’t played

2018-08-14 Thread Hans Hagen

On 8/14/2018 5:38 PM, Pablo Rodriguez wrote:

Dear list,

this is sounds-001.tex from the examples:

 \definerenderingwindow
   [example]
   [width=0pt,height=0pt,frame=off]

 \setupinteraction[state=start]

 \useexternalrendering
   [mysound]
   [audio/mpeg] % audio/x-mp3
   [akkerman.mp3]
   [embed]

 \definereference [StartSoundTrack] [StartRendering{mysound}]
 \definereference [StopSoundTrack]  [StopRendering{mysound}]

 \definelayer[resources][width=\paperwidth,height=\paperheight]

 \setupbackgrounds[page][background=resources]

 \starttext
 \setlayer[resources]{\placerenderingwindow[example][mysound]}
 \startTEXpage
 \button{start}[StartSoundTrack]
 \button{stop}[StopSoundTrack]
 \stopTEXpage
 \startTEXpage
 \button{start}[StartSoundTrack]
 \button{stop}[StopSoundTrack]
 \stopTEXpage
 \stoptext

I added the option to embed the file. I’m attaching the result.

As I cannot check it myself with Acrobat for Linux (it seems to lack a
player for MP3 files), I asked at the Spanish TeX mailing list whether
they can play the MP3 file embedded in the PDF file.


I have no clue. But these interactive media features in pdf are such a 
mess. Embedding a simple sound file or video has become a pain and 
changed over time. I think that the modern way is to create a bunch of 
useless objects, embed a shockwave (soon obsolete flash) player etc etc 
and who knows what in a few years.


While all we want is to embed a sound file (afaik the old easy ways are 
obsolete).


One can only use acrobat to check. My most recent version is 10.1 and 
i'm not going to subscribe to some lock-in pro version for 20 euro per 
month in order to check if code still works. Having the file in the sam 
epaths seems to work so maybe something is missing. One problem i 
remember is that when one adds too many key/values one suddenly gets 
sounds mentioned in side bars and so.


If you need it you can spend some time on deciphering the latest spec 
and tell me what is missing.



A MacOS X user (with Acrobat 9.5) told me that the program reports that
the file "akkerman.mp3" is missing. Although the file is indeed
embedded, the /Filespec points to the external file.

Decompressing the PDF file, I see that there are two similar objects:


\nopdfcompression save you that step



 8 0 obj
 <<
   /EF <<
 /F 7 0 R
   >>
   /F (akkerman.mp3)
   /Type /Filespec
   /UF
(\376\377\000a\000k\000k\000e\000r\000m\000a\000n\000.\000m\000p\0003)
 >>
 endobj

 10 0 obj
 <<
   /EF 8 0 R
   /F (akkerman.mp3)
   /Type /Filespec
 >>
 endobj

This object contains a strange dictionary (an indirect reference to the
same object it contains it?):

 13 0 obj
 <<
   /Type /Annot
   /A <<
 /AN 13 0 R
 /OP 0
 /R 12 0 R
 /S /Rendition
   >>
   /Border [ 0 0 0 ]
   /P 14 0 R
   /Subtype /Screen
   /Rect [ 0 14.416 0 14.416 ]
 >>
 endobj

I mean, the object already exists:

 15 0 obj
 <<
   /AN 13 0 R
   /OP 0
   /R 12 0 R
   /S /Rendition
 >>
 endobj

Could anyone tell me what I’m doing wrong so that the embedded file
isn’t played?

Many thanks for your help,

Pablo



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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] how to put page X of N in header or top space?

2018-08-14 Thread David Walther

Hi, I am slowly learning ConTeXt.  I am generating tables and spreadsheets, and
transforming them into ConTeXt, finally got it working after a lot of
mysterious errors about missing } as macro arguments.

I have read this page carefully:  http://wiki.contextgarden.net/Layout

How can I alter the page number?  Is it in the header, or is it in the
topspace?

I want this to be at the top of each page of my spreadsheet:

My Spreadsheet (centered) Page 1 of 3 (right justified)

And on even pages, the other way around:

Page 2 of 3 (left justified) My Spreadsheet (centered)

What is the right way to do this?  Is there an override and a blob of code I 
need to put into one of the boxes in the Layout?

David
___
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] \definetextbackground does not fill tables within

2018-08-14 Thread Alan Braslau
On Tue, 14 Aug 2018 09:49:05 +0200
Hans Hagen  wrote:

> > I have simple document which I define my \definetextbackground: 
> > \startteoria and \stopteoria (see below). When I use it and put table 
> > within, the table does not get filled with color. Any solution?  
> \setupfloats[table][freeregion=no]

I see that this is even referenced in i-context.pdf
(We should recognize that great job made by Wolfgang in assembling the 
interface xml files.)

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
___

[NTG-context] embedded sounds aren’t played

2018-08-14 Thread Pablo Rodriguez
Dear list,

this is sounds-001.tex from the examples:

\definerenderingwindow
  [example]
  [width=0pt,height=0pt,frame=off]

\setupinteraction[state=start]

\useexternalrendering
  [mysound]
  [audio/mpeg] % audio/x-mp3
  [akkerman.mp3]
  [embed]

\definereference [StartSoundTrack] [StartRendering{mysound}]
\definereference [StopSoundTrack]  [StopRendering{mysound}]

\definelayer[resources][width=\paperwidth,height=\paperheight]

\setupbackgrounds[page][background=resources]

\starttext
\setlayer[resources]{\placerenderingwindow[example][mysound]}
\startTEXpage
\button{start}[StartSoundTrack]
\button{stop}[StopSoundTrack]
\stopTEXpage
\startTEXpage
\button{start}[StartSoundTrack]
\button{stop}[StopSoundTrack]
\stopTEXpage
\stoptext

I added the option to embed the file. I’m attaching the result.

As I cannot check it myself with Acrobat for Linux (it seems to lack a
player for MP3 files), I asked at the Spanish TeX mailing list whether
they can play the MP3 file embedded in the PDF file.

A MacOS X user (with Acrobat 9.5) told me that the program reports that
the file "akkerman.mp3" is missing. Although the file is indeed
embedded, the /Filespec points to the external file.

Decompressing the PDF file, I see that there are two similar objects:

8 0 obj
<<
  /EF <<
/F 7 0 R
  >>
  /F (akkerman.mp3)
  /Type /Filespec
  /UF
(\376\377\000a\000k\000k\000e\000r\000m\000a\000n\000.\000m\000p\0003)
>>
endobj

10 0 obj
<<
  /EF 8 0 R
  /F (akkerman.mp3)
  /Type /Filespec
>>
endobj

This object contains a strange dictionary (an indirect reference to the
same object it contains it?):

13 0 obj
<<
  /Type /Annot
  /A <<
/AN 13 0 R
/OP 0
/R 12 0 R
/S /Rendition
  >>
  /Border [ 0 0 0 ]
  /P 14 0 R
  /Subtype /Screen
  /Rect [ 0 14.416 0 14.416 ]
>>
endobj

I mean, the object already exists:

15 0 obj
<<
  /AN 13 0 R
  /OP 0
  /R 12 0 R
  /S /Rendition
>>
endobj

Could anyone tell me what I’m doing wrong so that the embedded file
isn’t played?

Many thanks for your help,

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


mediaclip-sound.pdf
Description: Adobe PDF 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] \startregister…\stopregister bug?

2018-08-14 Thread Wolfgang Schuster

You forgot the second argument for \startregister and \stopregister.


\defineregister[TesT]

\starttext

\startregister[TesT][one]{samples}

\input knuth

\page

\startregister[TesT][two]{more}

\input ward

\stopregister[TesT][one]

\page zapf

\stopregister[TesT][two]

\blank[3*big]

\placeregister[TesT]

\stoptext


Wolfgang

Alan Bowen schrieb am 14.08.18 um 17:25:

In the latest beta (2018.08.10),

\defineregister[TesT]
\starttext
\startregister[TesT]{samples}
\input knuth
\page
\input ward
\stopregister[TesT]
\blank[3*big]
\placeregister[TesT]
\stoptext

produces on page 2 the index entry
/samples 1/
when one expects
/samples 1–2/
/
/
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
___


___
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] \startregister…\stopregister bug?

2018-08-14 Thread Alan Bowen
In the latest beta (2018.08.10),

\defineregister[TesT]
\starttext
\startregister[TesT]{samples}
\input knuth
\page
\input ward
\stopregister[TesT]
\blank[3*big]
\placeregister[TesT]
\stoptext

produces on page 2 the index entry
*samples 1*
when one expects
*samples 1–2*

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] date calculated with currentdate plus n days

2018-08-14 Thread Pablo Rodriguez
On 08/14/2018 09:24 AM, Henri Menke wrote:
> On 14/08/18 17:29, Pablo Rodriguez wrote:
>> [...]
>> Where are those context.* Lua commands documented?
>>
>> I want to generate an xtable using Lua code, but I don’t know where to read.
> 
> They aren't documented because they are just the context commands.  You 
> can read more about how it works in 
> http://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf

Many thanks for your reply, Henri.

I remember paging through the manual, it’s included in the distribution.

I rewrote your sample as (xtables are the only tables I know in ConTeXt):

\starttext
\startlua
context.startxtable()
context.startxrow()
 context.startxcell()
  context("Note 1")
 context.stopxcell()
 context.startxcell()
  context("Note 2")
 context.stopxcell()
context.stopxrow()
context.startxrow()
 context.startxcell()
  context("Note 3")
 context.stopxcell()
 context.startxcell()
  context("Note 4")
 context.stopxcell()
context.stopxrow()
context.stopxtable()
\stoplua
\stoptext

Many thanks for your help,

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] How can I remove a blank leading line from a buffer

2018-08-14 Thread Rik Kabel

On 8/13/2018 18:43, Rik Kabel wrote:

On 8/13/2018 15:52, Wolfgang Schuster wrote:



Rik Kabel schrieb am 13.08.18 um 20:27:

On 8/13/2018 13:46, Wolfgang Schuster wrote:


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang


I am applying it incorrectly, or it does not work with the buffers 
created by \grabbufferdata:


\setupwhitespace[none]
\setupindenting[none]
\starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
\stoptexdefinition
\starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition
\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \BeforePar{\dontleavehmode\llap{? }}\GotoPar
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition



\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \dontleavehmode\llap{? }%
    \blank[overlay]
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


Wolfgang


Thank you, Wolfgang. That does it. Note that the % escaping the line 
end is not needed (    although it might be needed outside a 
\starttexdefinition environment) – the following works as well:



\starttexdefinition stopBufTest

  \startnarrower[left,right]

  \startparagraph

    \dontleavehmode{\llap{? }}

    \blank[overlay]

    \inlinebuffer[TestBuffer]

  \stopparagraph

  \stopnarrower

  \egroup

\stoptexdefinition




Alas, this is not yet a workable solution. It does not work with a 
layout of grid=tolerant, which I am currently using (although it does 
work with some other grid settings). For now I will just add empty [] to 
the startBufTest invocations.


I really think, though, that a buffers.strip function would be the way 
to go, instead of futzing after the damage is done.


--
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] Scite + ConTeXt

2018-08-14 Thread Ken Moffat
On Tue, Aug 14, 2018 at 12:17:06PM +0200, Fabrice Couvreur wrote:
> Hi Ken,
> In which file ?
> Fabrice
> 
As a user, on the command line: xdg-mime is a command to set
preferences.  But I said 'perhaps' because it depends on the rest of
your desktop adhering to freedesktop.org standards.

> 
> Le mar. 14 août 2018 à 02:18, Ken Moffat  a écrit :
> 
> > On Tue, Aug 14, 2018 at 01:54:06AM +0200, Fabrice Couvreur wrote:
> >
> > > How to have evince as the default reader ?
> > >
> > perhaps
> >
> >  xdg-mime default evince.desktop application/pdf
> >
> > ĸen
> > --
> >Entropy not found, thump keyboard to continue
> >
> >
> > ___
> > 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
> ___


-- 
   Entropy not found, thump keyboard to continue

___
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] Framed flush bottom

2018-08-14 Thread Hans Hagen

On 8/14/2018 11:53 AM, Henri Menke wrote:

Dear list,

According to the wiki page for \setupalign

"height" Fill the height: press the last line's baseline against the 
lower boundary.


but that doesn't see to work in framed.  How can I get the interline 
space stretched to flush to the bottom?  MWE is below.

\starttext

\installalign
  {henri}
  {\baselineskip1\baselineskip plus 10pt}

\startframed
  [width=\textwidth,
   height=\textheight,
   align={normal,henri},
   top=,
   bottom=]
  \input knuth \par
  \input knuth
\stopframed

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Logo in the margin at the bottom of the page

2018-08-14 Thread Henning Hraban Ramm
Am 2018-08-14 um 12:13 schrieb Fabrice Couvreur :

> Hello,
> I wish to place a small logo at the bottom of the page. 
> It works almost but it is not very well adjusted.
> How to cure it ?

Salut,
while the footer text approach may be viable, I’d use layers for exact 
placement.
http://wiki.contextgarden.net/Layers

Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD


___
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] Logo in the margin at the bottom of the page

2018-08-14 Thread Fabrice Couvreur
Hi Henri,
Thank you for your suggestion.
However, I believe that my way of doing should not be the best because
fixing width=\marginwidth the image is cropped.
Fabrice


\showframe
\useMPlibrary[dum]
\setuplayout
  [height=middle,
   width=middle,
   backspace=2cm,
   topspace=10mm,
   bottomspace=10mm,
   header=10mm,
   footer=10mm,
   footerdistance=10mm,
   headerdistance=10mm]

\setupfooter[margin][strut=no]

\setupfootertexts
[margin]
[]
[{\externalfigure[dummy][width=,height=\footerheight]}]
[]
[{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext


Le mar. 14 août 2018 à 12:18, Henri Menke  a écrit :

>
>
> On 14/08/18 22:13, Fabrice Couvreur wrote:
> > Hello,
> > I wish to place a small logo at the bottom of the page.
> > It works almost but it is not very well adjusted.
> > How to cure it ?
> > Thank you.
> > fabrice
> >
> > \showframe
> > \useMPlibrary[dum]
> > \setuplayout
> >[height=middle,
> > width=middle,
> > backspace=2cm,
> > topspace=10mm,
> > bottomspace=10mm,
> > header=10mm,
> > footer=10mm,
> > footerdistance=10mm,
> > headerdistance=10mm]
> >
>
> \setupfooter[margin][strut=no]
>
> > \setupfootertexts
> >  [margin]
> >  []
> >  [{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]
> >  []
> >  [{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]
> >
> >  \starttext
> >  \dorecurse{10}{\page[dummy]}
> >  \stoptext
> >
> >
> >
> ___
> > 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] Logo in the margin at the bottom of the page

2018-08-14 Thread Henri Menke



On 14/08/18 22:13, Fabrice Couvreur wrote:

Hello,
I wish to place a small logo at the bottom of the page.
It works almost but it is not very well adjusted.
How to cure it ?
Thank you.
fabrice

\showframe
\useMPlibrary[dum]
\setuplayout
   [height=middle,
    width=middle,
    backspace=2cm,
    topspace=10mm,
    bottomspace=10mm,
    header=10mm,
    footer=10mm,
    footerdistance=10mm,
    headerdistance=10mm]



\setupfooter[margin][strut=no]


\setupfootertexts
     [margin]
     []
     [{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]
     []
     [{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

     \starttext
     \dorecurse{10}{\page[dummy]}
     \stoptext


___
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] Scite + ConTeXt

2018-08-14 Thread Fabrice Couvreur
Hi Ken,
In which file ?
Fabrice


Le mar. 14 août 2018 à 02:18, Ken Moffat  a écrit :

> On Tue, Aug 14, 2018 at 01:54:06AM +0200, Fabrice Couvreur wrote:
>
> > How to have evince as the default reader ?
> >
> perhaps
>
>  xdg-mime default evince.desktop application/pdf
>
> ĸen
> --
>Entropy not found, thump keyboard to continue
>
>
> ___
> 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
___

[NTG-context] Logo in the margin at the bottom of the page

2018-08-14 Thread Fabrice Couvreur
Hello,
I wish to place a small logo at the bottom of the page.
It works almost but it is not very well adjusted.
How to cure it ?
Thank you.
fabrice

\showframe
\useMPlibrary[dum]
\setuplayout
  [height=middle,
   width=middle,
   backspace=2cm,
   topspace=10mm,
   bottomspace=10mm,
   header=10mm,
   footer=10mm,
   footerdistance=10mm,
   headerdistance=10mm]

\setupfootertexts
[margin]
[]
[{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]
[]
[{\externalfigure[dummy][width=\marginwidth,height=\footerheight]}]

\starttext
\dorecurse{10}{\page[dummy]}
\stoptext
___
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] Framed flush bottom

2018-08-14 Thread Henri Menke

Dear list,

According to the wiki page for \setupalign

"height" Fill the height: press the last line's baseline against the 
lower boundary.


but that doesn't see to work in framed.  How can I get the interline 
space stretched to flush to the bottom?  MWE is below.


Cheers, Henri

---

\starttext

\startframed[width=\textwidth,height=\textheight,align={width,height}]
  \input knuth

  \input knuth
\stopframed

\stoptext
___
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] \definetextbackground does not fill tables within

2018-08-14 Thread Hans Hagen

On 8/13/2018 11:37 PM, dxpubl...@posteo.net wrote:

Hi,

I have simple document which I define my \definetextbackground: 
\startteoria and \stopteoria (see below). When I use it and put table 
within, the table does not get filled with color. Any solution?

\setupfloats[table][freeregion=no]


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] Scite + ConTeXt

2018-08-14 Thread Hans Hagen

On 8/14/2018 2:06 AM, Alan Braslau wrote:

On Tue, 14 Aug 2018 01:54:06 +0200
Fabrice Couvreur  wrote:


Hello,
As I am having some problems with Emacs, I will try to use Scite !

1. How to insert an environment ?
That is with AUCTEX + Emacs, I was doing C-c C-e but how do with Scite ?

2. To compile, I do Alt + F12 (Run with jit) and it works but how to have
the test.pdf output because F5 (go) gives me  > gv test.pdf then RET but
nothing ...
How to have evince as the default reader ?

3. How to have highlighting of context code with Scite ?


Hans uses a (lua) lpeg library for syntax highlighting with Scite. As far as I 
know, this library has only been successfully compiled under Windows, at least 
our feeble attempts at porting it to other systems did not go very far. Perhaps 
the situation is now better?
yes, we still need to look into that ... ship precompiled scites as 
benchmarks (because they support the syntax highlighting that i use 
here) .. btw, you can see that with


context --extra=listing --scite --compact foo.tex (or foo.lua or ...)

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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] date calculated with currentdate plus n days

2018-08-14 Thread Henri Menke



On 14/08/18 17:29, Pablo Rodriguez wrote:

On 08/14/2018 01:46 AM, Henri Menke wrote:

On top of that I recommend to use context.date to get the correct
formatting according to the current language options:

\def\duedate{\ctxlua{
local t = os.date('*t', os.time()+ 10 * 24 * 3600)
context.date{ d = t.day, m = t.month, y = t.year }
}}


Many thanks for your reply, Henri.

Where are those context.* Lua commands documented?

I want to generate an xtable using Lua code, but I don’t know where to read.


They aren't documented because they are just the context commands.  You 
can read more about how it works in 
http://www.pragma-ade.nl/general/manuals/cld-mkiv.pdf


Here a little sample with an xtable:

\starttext

\startluacode
local function duedate()
local t = os.date('*t', os.time()+ 10 * 24 * 3600)
context.date{ d = t.day, m = t.month, y = t.year }
end

context.startxtable{frame = "off"}
   context.NC() context("Note") context.NC() context("Date") context.NR()
   context.NC() context("Hand in before") context.NC() duedate() 
context.NR()

context.stopxtable()
\stopluacode

\stoptext



Many thanks for your help,

Pablo


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