Re: [NTG-context] Welcome to LMTX

2019-04-02 Thread Rudolf Bahr
> > On Mon, Apr 01, 2019 at 04:55:11PM +0200, Hans Hagen wrote:
> > >   http://www.pragma-ade.nl/install.htm
> > > 
> > /home/sam/context-lmtx/tex/texmf-linux-64/bin/mtxrun --autogenerate 
> > --script context --autopdf ABCD-Helmstedt-Lauf.tex
> > 
> > and got:
> > 
> > sh: 1: luametatex: not found
> > mtx-context | fatal error: return code: 32512

> Did you use the installer? I assume so. What happens if you just add
> /home/sam/context-lmtx/tex/texmf-linux-64/bin to your path?
> 
> There is a rather fundamental difference between a regular luatex/mkiv setup
> and luametatex/lmtx:
> 
> - in lmtx we only have one program, nothing else gets installed, there is no
> jit variant (and there will never be as we move on with lua: we use lua 5.4
> here)
> 
> - mtxrun and context are both (on all platforms) symlinks to luametatex (can
> you check that? the installer should manage that)
> 
> - when installing there are no dependencies on other programs so missing
> programs cannot be a reason for a failed install
> 
> (Mojca will set up the garden and that will then be the primary source; the
> installer which is also the updater already know this.)
> 
> Hans

Hi Hans,

thank you for your response.

Yes, I did use the installer and followed the advice under "Linux 64 bit".

After having 

export 
PATH="/home/sam/context-lmtx/tex/texmf-linux-64/bin:/home/sam/context/tex/texmf-linux-64/bin:$PATH"
 as well as

export 
PATH="/home/sam/context-lmtx/tex/texmf-linux-64/bin:/home/sam/context-lmtx/bin:/home/sam/context-lmtx/tex/texmf-linux-64/bin:"

in my .bashrc and not forgotten "source ~/.bashrc" ofcourse :-)

my (old) mkiv context runs well:

context ABCD-Helmstedt-Lauf.tex

but

/home/sam/context-lmtx/tex/texmf-linux-64/bin/mtxrun --autogenerate --script 
context --autopdf ABCD-Helmstedt-Lauf.tex

fails still with

sh: 1: luametatex: not found
mtx-context | fatal error: return code: 32512


Could it have something to do with the lack of lua5.4 in my PC? lua5.3 and 
lua5.2
are installed.

whereis mtxrun gives:
mtxrun: /home/sam/context/tex/texmf-linux-64/bin/mtxrun

whereis context gives:
context: /usr/local/context /home/sam/context/tex/texmf-linux-64/bin/context

Rudolf
___
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] lmtx

2019-04-02 Thread Hans Hagen

Hi,

So, for those who hesitate to check out lmtx, here is some information.

- In order to achieve long term stability context will use a lean and 
mean variant of luatex (although for now context will keep running on 
luatex too; i might drop support for luajittex). Eventually the source 
code will be part of the context distribution so that one can always 
compile a binary that matches an archived context version.


- This version also permits us to experiment (even very extreme) without 
interupting the parent program luatex, which is now used by other macro 
packages too and therefore needs to be frozen in functionality. Some 
features might trickle back into luatex eventually (unless it breaks 
compatibility).


- As a direct effect it means that context does a bit more: creating the 
pdf file (already most is done anyway in mkiv), dealing with font 
embedding, handling image inclusion, etc. For sure there can be issues 
with that but it has run on my machine already for quite a while.


- It is hard to be conclusive about performance but for instance the 
luatex manual processes a bit faster with lmtx as does the test suite. A 
gain in performance on very demanding documents is also observed by Alan 
and Thomas. Normally one can expect a similar performance. However, the 
memory footprint could be a bit smaller.


- The current somewhat hybrid codebase of context will stepwise be 
adapted so that at some point we can start experimenting with some 
pending ideas. (Which is why i sometimes answer "later this year".)


Anyway, it might not look like it, but it is a conceptual change in how 
context evolves.


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] Welcome to LMTX

2019-04-02 Thread Hans Hagen

On 4/2/2019 9:57 AM, Rudolf Bahr wrote:

On Mon, Apr 01, 2019 at 04:55:11PM +0200, Hans Hagen wrote:

  http://www.pragma-ade.nl/install.htm

Of course you should keep your current installation too. We're sure that
there will be issues so when you run into unexpected surprises, you can
blame us ...


Hello All,

I run cautiously the full path

/home/sam/context-lmtx/tex/texmf-linux-64/bin/mtxrun --autogenerate --script 
context --autopdf ABCD-Helmstedt-Lauf.tex

and got:

sh: 1: luametatex: not found
mtx-context | fatal error: return code: 32512
Did you use the installer? I assume so. What happens if you just add 
/home/sam/context-lmtx/tex/texmf-linux-64/bin to your path?


There is a rather fundamental difference between a regular luatex/mkiv 
setup and luametatex/lmtx:


- in lmtx we only have one program, nothing else gets installed, there 
is no jit variant (and there will never be as we move on with lua: we 
use lua 5.4 here)


- mtxrun and context are both (on all platforms) symlinks to luametatex 
(can you check that? the installer should manage that)


- when installing there are no dependencies on other programs so missing 
programs cannot be a reason for a failed install


(Mojca will set up the garden and that will then be the primary source; 
the installer which is also the updater already know this.)


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] Welcome to LMTX

2019-04-01 Thread Hans Hagen

On 4/1/2019 5:36 PM, Joseph Wright wrote:

On 01/04/2019 15:55, Hans Hagen wrote:

Hi all,

After more than a decade of mkiv and luatex it's time to move on to a 
new stage. After all, nowadays a ten-year old program is considered to 
be really old, especially for those who consider a manual typeset 
three years ago as an indication of lack of progress. Therefore: 
welcome to lua(meta)tex 2.00 and context lmtx, the follow up on luatex 
and mkiv, if you dare. It has many deep-down changes but aims to be a 
simple evolution.


The average user will probably not notice many differences but 
nevertheless, when you are in for something new, you can give it a try:


  http://www.pragma-ade.nl/install.htm

Of course you should keep your current installation too. We're sure 
that there will be issues so when you run into unexpected surprises, 
you can blame us (and fall-back on the current Context beta and 
luatex). Of course with the proper mwe's (tex, metapost, lua, or a 
combination of these) we will try to solve them all, we have been 
testing. In due time more about this project will be revealed.


Hans Hagen & Alan Braslau


Hi Hans,

Thanks for the link to the code. A quick install suggests that a 'hello 
world' is working nicely from ConTeXt. However, if I try what you might 
expect from me


     luametatex --ini latex.ltx

things go a bit wrong:

     This is LuaMetaTeX, Version 2.00.0  (INITEX)
     ! error:  (system): missing find_write_file callback

(I also notice there is no plain-like format for testing, or at least 
that just "luametatex" yields an error.)


i might cook up something plain but it has a very low priority, after 
all, plain works with luatex


Clearly things work for ConTeXt, so there must be some early Lua magic 
or similar required. Any thoughts? (I don't get a .log or any other 
output.)
it's a stripped down "lean and mean" engine so it's very unlikely to 
work with plain and latex or other macro packages out of the box


a manual will come available around the context meeting, articles will 
be published the coming months and reveal a bit more


(all this involved over half a year of development and exploration, 
which itself is documented which will also surface around the ctx 
meeting or when i feel the need)


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] Welcome to LMTX

2019-04-01 Thread Joseph Wright

On 01/04/2019 15:55, Hans Hagen wrote:

Hi all,

After more than a decade of mkiv and luatex it's time to move on to a 
new stage. After all, nowadays a ten-year old program is considered to 
be really old, especially for those who consider a manual typeset three 
years ago as an indication of lack of progress. Therefore: welcome to 
lua(meta)tex 2.00 and context lmtx, the follow up on luatex and mkiv, if 
you dare. It has many deep-down changes but aims to be a simple evolution.


The average user will probably not notice many differences but 
nevertheless, when you are in for something new, you can give it a try:


  http://www.pragma-ade.nl/install.htm

Of course you should keep your current installation too. We're sure that 
there will be issues so when you run into unexpected surprises, you can 
blame us (and fall-back on the current Context beta and luatex). Of 
course with the proper mwe's (tex, metapost, lua, or a combination of 
these) we will try to solve them all, we have been testing. In due time 
more about this project will be revealed.


Hans Hagen & Alan Braslau


Hi Hans,

Thanks for the link to the code. A quick install suggests that a 'hello 
world' is working nicely from ConTeXt. However, if I try what you might 
expect from me


luametatex --ini latex.ltx

things go a bit wrong:

This is LuaMetaTeX, Version 2.00.0  (INITEX)
! error:  (system): missing find_write_file callback

(I also notice there is no plain-like format for testing, or at least 
that just "luametatex" yields an error.)


Clearly things work for ConTeXt, so there must be some early Lua magic 
or similar required. Any thoughts? (I don't get a .log or any other output.)


Joseph

___
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] Welcome to LMTX

2019-04-01 Thread Hans Hagen

Hi all,

After more than a decade of mkiv and luatex it's time to move on to a 
new stage. After all, nowadays a ten-year old program is considered to 
be really old, especially for those who consider a manual typeset three 
years ago as an indication of lack of progress. Therefore: welcome to 
lua(meta)tex 2.00 and context lmtx, the follow up on luatex and mkiv, if 
you dare. It has many deep-down changes but aims to be a simple evolution.


The average user will probably not notice many differences but 
nevertheless, when you are in for something new, you can give it a try:


 http://www.pragma-ade.nl/install.htm

Of course you should keep your current installation too. We're sure that 
there will be issues so when you run into unexpected surprises, you can 
blame us (and fall-back on the current Context beta and luatex). Of 
course with the proper mwe's (tex, metapost, lua, or a combination of 
these) we will try to solve them all, we have been testing. In due time 
more about this project will be revealed.


Hans Hagen & Alan Braslau

-
  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] Fwd: IBM Wordcloud with the Filter Module

2019-03-14 Thread Aditya Mahajan

On Thu, 14 Mar 2019, Jeroen wrote:


I am able to run R, asymptote, graphviz, octave, openscad, python and
freecad all on the filter module without problems. The same problem as I
have with wordcloud I have with maxima and geogebra. \traceexternalfilters
isnt giving me a lot. I have tried the following sample1.bat batch file and
it seems to create the wc file from the sample text file that comes with
wordcloud

java

-jar /context/wordcloud/ibm-word-cloud.jar

-c /context/wordcloud/examples/configuration.txt

-w 800

-h 600

< /context/wordcloud/examples/hamlet.txt >

/context/documents/sample1.png


Can you attach your test file and the log file? The email program is 
creating line breaks and I am not sure whether that is there in the 
original file or not.


The only other thing that I can think of is that some executables are not 
in the path when you are running context (depends a bit on the OS and how 
context is being run)


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] IBM Wordcloud with the Filter Module

2019-03-11 Thread Jeroen
Yes, there is a batch file for testing purposes, and that one works fine

Thanks, Jeroen

Op ma 11 mrt. 2019 om 16:55 schreef Aditya Mahajan :

> Can you run the java file from the command promt?
>
> Aditya
>
> On Mon, 11 Mar 2019, Jeroen wrote:
>
> > Dear List,
> >
> > I am trying to get the IBM wordcloud java application working with the
> > filter module on MS Windows. This configuration does not create the
> > wordcloud png file. The in and out files
> "naamloos-10-temp-wordcloud-x.tmp"
> > are actually created. If this configuration correct? Java is installed
> and
> > I am indicating absolute file locations.
> >
> > Thanks, Jeroen
> >
> >
> > \usemodule[filter]
> >
> > \defineexternalfilter
> >
> > [wordcloud]
> >
> > [filtercommand={/Program Files/Java/jre1.8.0_181/bin/java
> >
> > -jar /context/wordcloud/ibm-word-cloud.jar
> >
> > -c /context/wordcloud/examples/configuration.txt
> >
> > -w 800
> >
> > -h 600
> >
> > -o \externalfilteroutputfile\space
> >
> > -i \externalfilterinputfile},
> >
> > output=\externalfilterbasefile.png,
> >
> > readcommand=\ExternalFigure,
> >
> > continue=yes,
> >
> > purge=no,]
> >
> > \def\ExternalFigure#1{\externalfigure[#1]}
> >
> > \starttext
> >
> > \startwordcloud %[width=100]
> >
> > Thus, I came to the conclusion that the designer of a new
> >
> > system must not only be the implementer and first
> >
> > large||scale user; the designer should also write the first
> >
> > user manual.
> >
> > The separation of any of these four components would have
> >
> > hurt \TeX\ significantly. If I had not participated fully in
> >
> > all these activities, literally hundreds of improvements
> >
> > would never have been made, because I would never have
> >
> > thought of them or perceived why they were important.
> >
> > But a system cannot be successful if it is too strongly
> >
> > influenced by a single person. Once the initial design is
> >
> > complete and fairly robust, the real test begins as people
> >
> > with many different viewpoints undertake their own
> >
> > experiments.
> >
> > \stopwordcloud
> >
> > \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] IBM Wordcloud with the Filter Module

2019-03-11 Thread Aditya Mahajan

Can you run the java file from the command promt?

Aditya

On Mon, 11 Mar 2019, Jeroen wrote:


Dear List,

I am trying to get the IBM wordcloud java application working with the
filter module on MS Windows. This configuration does not create the
wordcloud png file. The in and out files "naamloos-10-temp-wordcloud-x.tmp"
are actually created. If this configuration correct? Java is installed and
I am indicating absolute file locations.

Thanks, Jeroen


\usemodule[filter]

\defineexternalfilter

[wordcloud]

[filtercommand={/Program Files/Java/jre1.8.0_181/bin/java

-jar /context/wordcloud/ibm-word-cloud.jar

-c /context/wordcloud/examples/configuration.txt

-w 800

-h 600

-o \externalfilteroutputfile\space

-i \externalfilterinputfile},

output=\externalfilterbasefile.png,

readcommand=\ExternalFigure,

continue=yes,

purge=no,]

\def\ExternalFigure#1{\externalfigure[#1]}

\starttext

\startwordcloud %[width=100]

Thus, I came to the conclusion that the designer of a new

system must not only be the implementer and first

large||scale user; the designer should also write the first

user manual.

The separation of any of these four components would have

hurt \TeX\ significantly. If I had not participated fully in

all these activities, literally hundreds of improvements

would never have been made, because I would never have

thought of them or perceived why they were important.

But a system cannot be successful if it is too strongly

influenced by a single person. Once the initial design is

complete and fairly robust, the real test begins as people

with many different viewpoints undertake their own

experiments.

\stopwordcloud

\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] IBM Wordcloud with the Filter Module

2019-03-11 Thread Jeroen
Dear List,

I am trying to get the IBM wordcloud java application working with the
filter module on MS Windows. This configuration does not create the
wordcloud png file. The in and out files "naamloos-10-temp-wordcloud-x.tmp"
are actually created. If this configuration correct? Java is installed and
I am indicating absolute file locations.

Thanks, Jeroen


\usemodule[filter]

\defineexternalfilter

[wordcloud]

[filtercommand={/Program Files/Java/jre1.8.0_181/bin/java

-jar /context/wordcloud/ibm-word-cloud.jar

-c /context/wordcloud/examples/configuration.txt

-w 800

-h 600

-o \externalfilteroutputfile\space

-i \externalfilterinputfile},

output=\externalfilterbasefile.png,

readcommand=\ExternalFigure,

continue=yes,

purge=no,]

\def\ExternalFigure#1{\externalfigure[#1]}

\starttext

\startwordcloud %[width=100]

Thus, I came to the conclusion that the designer of a new

system must not only be the implementer and first

large||scale user; the designer should also write the first

user manual.

The separation of any of these four components would have

hurt \TeX\ significantly. If I had not participated fully in

all these activities, literally hundreds of improvements

would never have been made, because I would never have

thought of them or perceived why they were important.

But a system cannot be successful if it is too strongly

influenced by a single person. Once the initial design is

complete and fairly robust, the real test begins as people

with many different viewpoints undertake their own

experiments.

\stopwordcloud

\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] Fwd: BachoTeX 2019 registrations

2019-03-11 Thread Henning Hraban Ramm
Dear TeXies,

registrations are open (for some time already) so:

"The time has come for all good women and men
to come to the aid of BachoTeX 2019"

Well, jokes aside -- the deadline for registrations is
on the 31st of March, thus please hurry to take the
advantage of early rates!

http://gust.org.pl/bachotex/2019-en/registration/registration-form

Especially to prospective authors:  the call for papers
is to be found at
http://www.gust.org.pl/bachotex/2019-en/cfp

Everybody is most welcome!

For the Organizing and Program Committee --
-- Jerzy Ludwichowski
(GUST, President)

___
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] Fwd: BachoTeX 2019 registrations

2019-03-11 Thread Taco Hoekwater
Hi everybody,

Registration for BachoTeX 2019 is now open!

Taco

> Begin forwarded message:
> 
> From: "Jerzy.Ludwichowski" 
> Subject: [tug-board] BachoTeX 2019 registrations
> Date: 11 March 2019 at 01:17:51 CET
> 
> 
> 
> Dear TeXies,
> 
> registrations are open (for some time already) so:
> 
> "The time has come for all good women and men
> to come to the aid of BachoTeX 2019"
> 
> Well, yokes aside -- the deadline for registrations is
> on the 31st of March, thus please hurry to take the
> advantage of early rates!
> 
> http://gust.org.pl/bachotex/2019-en/registration/registration-form
> 
> Especially to prospective authors:  the call for papers
> is to be found at
> http://www.gust.org.pl/bachotex/2019-en/cfp
> 
> Everybody is most welcome!
> 
> For the Organizing and Program Committee --
> -- Jerzy Ludwichowski
> (GUST, President)
> 
> 
> 
> 

Taco Hoekwater
Elvenkind BV




___
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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-23 Thread Hans Hagen

On 2/23/2019 12:37 PM, Rudolf Bahr wrote:

On Sat, Feb 23, 2019 at 11:56:32AM +0100, Hans Hagen wrote:

On 2/23/2019 11:08 AM, Rudolf Bahr wrote:

On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote:

On Fri, Feb 22 2019, Rudolf Bahr wrote:


The picture sizes in px One gets by invoking for instance graphics Magick's 
identify
in a lua program:


Or just img.scan():

\startluacode
local image = img.scan{filename = "my-image.jpg"}
logs.report("xsize", image.xsize)
logs.report("ysize", image.ysize)
\stopluacode

--
 Peter


Hi Peter,

thank you for pointing to img.scan{}! It's indeed shorter than to invoke 
Graphics Magick
in Lua. Remains the conversion of image sizes into pt. There is an example in 
the chapter
"Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a 
work in
progress). According to there it's necessary to know the resolution in order to 
convert
image sizes from px to pt which at least I don't know. Mostly I can preset one 
size of
a picture (say the width in pt) to be able to place it on a page and assuming
x-resolution = y-resolution and keeping width-to-height ratio I calculate the 
missing
size (here the height in pt) in Lua by

  
picture-height-in-px
asked-picture-height-in-pt = preset-picture-width-in-pt  *  
picture-width-in-px

This is simple and normally it suffices for me.

Better use the built-in methods:

\starttext

 \getfiguredimensions[t:/sources/mill.png]

 (\figurewidth,\figureheight)

 (\figurexsize,\figureysize)

\stoptext

as it prevents opening the files multiple times. It's also more futureproof.

Hans



Hi Hans,

I fear it doesn't work. I used the above code with a test-picture of mine
(in .png and .jpg version) and got:

(0sp,0sp)
(0,0)

Now I'm baffled what the explanation could be. Are "mill" or "cow" somehow
specially prepared? I used:

ConTeXt  ver: 2018.03.16 22:20 MKIV beta  fmt: 2018.3.21 and
getfiguredimensions[~/my-test-picture.png]


maybe the image is not found ... what if you replace the ~



--

-
  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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-23 Thread Rudolf Bahr
On Sat, Feb 23, 2019 at 11:56:32AM +0100, Hans Hagen wrote:
> On 2/23/2019 11:08 AM, Rudolf Bahr wrote:
> > On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote:
> > > On Fri, Feb 22 2019, Rudolf Bahr wrote:
> > > 
> > > > The picture sizes in px One gets by invoking for instance graphics 
> > > > Magick's identify
> > > > in a lua program:
> > > 
> > > Or just img.scan():
> > > 
> > > \startluacode
> > >local image = img.scan{filename = "my-image.jpg"}
> > >logs.report("xsize", image.xsize)
> > >logs.report("ysize", image.ysize)
> > > \stopluacode
> > > 
> > > -- 
> > > Peter
> > 
> > Hi Peter,
> > 
> > thank you for pointing to img.scan{}! It's indeed shorter than to invoke 
> > Graphics Magick
> > in Lua. Remains the conversion of image sizes into pt. There is an example 
> > in the chapter
> > "Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; 
> > (a work in
> > progress). According to there it's necessary to know the resolution in 
> > order to convert
> > image sizes from px to pt which at least I don't know. Mostly I can preset 
> > one size of
> > a picture (say the width in pt) to be able to place it on a page and 
> > assuming
> > x-resolution = y-resolution and keeping width-to-height ratio I calculate 
> > the missing
> > size (here the height in pt) in Lua by
> > 
> >  
> > picture-height-in-px
> > asked-picture-height-in-pt = preset-picture-width-in-pt  *  
> > 
> > 
> > picture-width-in-px
> > 
> > This is simple and normally it suffices for me.
> Better use the built-in methods:
> 
> \starttext
> 
> \getfiguredimensions[t:/sources/mill.png]
> 
> (\figurewidth,\figureheight)
> 
> (\figurexsize,\figureysize)
> 
> \stoptext
> 
> as it prevents opening the files multiple times. It's also more futureproof.
> 
> Hans
> 

Hi Hans,

I fear it doesn't work. I used the above code with a test-picture of mine
(in .png and .jpg version) and got:

(0sp,0sp)
(0,0)

Now I'm baffled what the explanation could be. Are "mill" or "cow" somehow
specially prepared? I used:

ConTeXt  ver: 2018.03.16 22:20 MKIV beta  fmt: 2018.3.21 and
getfiguredimensions[~/my-test-picture.png]

Rudolf
___
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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-23 Thread Hans Hagen

On 2/23/2019 11:08 AM, Rudolf Bahr wrote:

On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote:

On Fri, Feb 22 2019, Rudolf Bahr wrote:


The picture sizes in px One gets by invoking for instance graphics Magick's 
identify
in a lua program:


Or just img.scan():

\startluacode
   local image = img.scan{filename = "my-image.jpg"}
   logs.report("xsize", image.xsize)
   logs.report("ysize", image.ysize)
\stopluacode

--
Peter


Hi Peter,

thank you for pointing to img.scan{}! It's indeed shorter than to invoke 
Graphics Magick
in Lua. Remains the conversion of image sizes into pt. There is an example in 
the chapter
"Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a 
work in
progress). According to there it's necessary to know the resolution in order to 
convert
image sizes from px to pt which at least I don't know. Mostly I can preset one 
size of
a picture (say the width in pt) to be able to place it on a page and assuming
x-resolution = y-resolution and keeping width-to-height ratio I calculate the 
missing
size (here the height in pt) in Lua by

 
picture-height-in-px
asked-picture-height-in-pt = preset-picture-width-in-pt  *  
picture-width-in-px

This is simple and normally it suffices for me.

Better use the built-in methods:

\starttext

\getfiguredimensions[t:/sources/mill.png]

(\figurewidth,\figureheight)

(\figurexsize,\figureysize)

\stoptext

as it prevents opening the files multiple times. It's also more futureproof.

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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-23 Thread Rudolf Bahr
On Fri, Feb 22, 2019 at 12:59:55PM +0100, Peter Münster wrote:
> On Fri, Feb 22 2019, Rudolf Bahr wrote:
> 
> > The picture sizes in px One gets by invoking for instance graphics Magick's 
> > identify
> > in a lua program:
> 
> Or just img.scan():
> 
> \startluacode
>   local image = img.scan{filename = "my-image.jpg"}
>   logs.report("xsize", image.xsize)
>   logs.report("ysize", image.ysize)
> \stopluacode
> 
> -- 
>Peter

Hi Peter,

thank you for pointing to img.scan{}! It's indeed shorter than to invoke 
Graphics Magick
in Lua. Remains the conversion of image sizes into pt. There is an example in 
the chapter
"Calculations in Lua" in "https://wiki.contextgarden.net/Image_Placement; (a 
work in
progress). According to there it's necessary to know the resolution in order to 
convert
image sizes from px to pt which at least I don't know. Mostly I can preset one 
size of
a picture (say the width in pt) to be able to place it on a page and assuming
x-resolution = y-resolution and keeping width-to-height ratio I calculate the 
missing
size (here the height in pt) in Lua by

picture-height-in-px
asked-picture-height-in-pt = preset-picture-width-in-pt  *  
picture-width-in-px

This is simple and normally it suffices for me.

Rudolf

___
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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-22 Thread Peter Münster
On Fri, Feb 22 2019, Rudolf Bahr wrote:

> The picture sizes in px One gets by invoking for instance graphics Magick's 
> identify
> in a lua program:

Or just img.scan():

\startluacode
  local image = img.scan{filename = "my-image.jpg"}
  logs.report("xsize", image.xsize)
  logs.report("ysize", image.ysize)
\stopluacode

-- 
   Peter
___
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] When newsizing an external figure bei [width=], what will be its height in pt and viceversa?

2019-02-22 Thread Rudolf Bahr
On Tue, Feb 19, 2019 at 10:48:38AM +0100, Bahr Rudolf wrote:
> Hi All,
> 
> from an external figure I normally know its width and height in px. 
> But I don't know its exact sizes in pt. When newsizing the figure 
> in a document (by the same width-to-height-ratio), I'll do that as 
> some part of textwidth or textheight, in pt or mm, but not in px, 
> i.e. by means of [width=]. 
> Sometimes it would be interesting to know its new height in pt, 
> and viceversa. 
> 
> Is there a variable or something else containing its new size in pt?
> 
> Regards,
> Rudolf




Hi All,

up to now Nobody answered to my question, perhaps it might have been
too simple.

Indeed One could normally assume:


picture-width-in-px  preset-picture-width-in-pt
  =  --
picture-height-in-px asked-picture-height-in-pt


And according to Adam Riese One gets:

 preset-picture-width-in-pt  *  picture-height-in-px
asked-picture-height-in-pt = ---
 picture-width-in-px


-
The picture sizes in px One gets by invoking for instance graphics Magick's 
identify
in a lua program:

local file = assert ( io.popen ( 'gm identify ' .. picture_name, 'r' ))
local output = file:read ( '*all' )
file:close ()

local words = {}
for w in string.gmatch ( output, "%g+" ) do
words [ #words + 1 ] = w
end

-- Width and height are found in words[3]: i.e. 5407x3544+0+0
local dims = {}
for d in string.gmatch ( words [ 3 ], "%d+" ) do
dims [ #dims + 1 ] = d
end

local px_width  = dims [ 1 ]
local px_height = dims [ 2 ]
-

It's a solution at least as long as your Lua supports "io.popen". There might be
shorter solutions.

Cheers, Rudolf

 
___
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] Bad names

2019-02-09 Thread Hans Hagen

On 2/9/2019 12:15 AM, Alan Braslau wrote:

On Fri, 8 Feb 2019 23:26:21 +0100
Hans Hagen  wrote:


On 2/8/2019 10:22 PM, Marco Patzer wrote:


What is a bad name for context? Does it have any consequences if badly named
files are used? Just being curious.

Bad names are names that can result i a miss when looked up on a case
sensitive system. When you have a workflow where images come from e.g.
graphic designers don't be surprised to get names with inconsistent
casing, one of more spaces in a row, multiple suffixes (or wrong ones),
etc etc ... now when images are referred to e.g. from xml files that
also come from someplace it can get pretty hard to find where something
goes miss. So, here we always normalize (az09-).

In a tex tree files with the same name can lead to wrong lookups
depending on the order of configured paths. There context alway has had
case insensitive lookups.


Because people use brain-dead file systems
we get to use brain-dead file names, case-insensitive, etc., etc.

This can be a bit frustrating for those used to working with real file systems
and real (arbitrary) file names, but it gives better results
for the least common denominator, i.e. Windows... :-(
very subjective ... when program shave to deal with names Foo FoO FOO 
foo ... a pain esp when users don't care, are inconistent, dont' see a 
difference between one or two (proportionally displayed) spaces


imo windows is quite ok: in permits mixed case but also has a normalized 
name .. it's for the tex runs on unixes that we always need to deal with 
inconsistent naming


the problem is nor that much related to operatign systems but to graphic 
editors using a gui, moving files around without typing, constructing 
names from cur and pasted sentences describing the image (and mouse 
moves give worse names than keypresses). Fwiw: most images that we deal 
with come from illustrator on the mac.


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] 404 error: Not found for first-setup.sh

2019-02-08 Thread Alan Braslau
fetch http://minimals.contextgarden.net/setup/first-setup.sh

works as well - why do we suggest wget, a gnuism?

Alan

On Fri, 8 Feb 2019 20:24:45 +0100
Taco Hoekwater  wrote:

> Hi,
> 
> That is helpful knowledge. I am quietly confident I can fix wget tomorrow, 
> now.
> 
> I’ll report back.
> 
> Taco
> 
> > Op 8 feb. 2019 om 19:59 heeft Mohammad Hossein Bateni  
> > het volgende geschreven:
> > 
> > I ran into the same issue two days ago, where "curl -O" worked while "wget" 
> > did not.
> >   
> >> On Fri, Feb 8, 2019 at 1:51 PM Marcus Vinicius Mesquita 
> >>  wrote:
> >> Hi, Pablo
> >> 
> >> Indeed, with curl I was able to download the file. Thank you. 
> >> 
> >> In the wiki page about ConTeXt standalone 
> >> (https://wiki.contextgarden.net/ConTeXt_Standalone), the section about 
> >> single user installation suggests only the wget program, so I got stuck, 
> >> and perhaps we could avoid that for future users. 
> >> 
> >> Regards 
> >> 
> >> Marcus Vinicius 
> >>   
> >>> On Fri, Feb 8, 2019, 16:39 Pablo Rodriguez  wrote:
> >>> On 2/8/19 7:02 PM, Marcus Vinicius Mesquita wrote:  
> >>> > Hi, Taco
> >>> > 
> >>> > I tried again, but the server still answers with a 404 error.   
> >>> 
> >>> Hi Marcus,
> >>> 
> >>> I have just updated my ConTeXt Suite to its latest beta.
> >>> 
> >>> And the following command downloads the file (I don’t have wget 
> >>> installed):
> >>> 
> >>>   $ curl -O http://minimals.contextgarden.net/setup/first-setup.sh
> >>> 
> >>> 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
> >>> ___
> >>>   
> >> ___
> >> 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] 404 error: Not found for first-setup.sh

2019-02-08 Thread Taco Hoekwater
Hi,

That is helpful knowledge. I am quietly confident I can fix wget tomorrow, now.

I’ll report back.

Taco

> Op 8 feb. 2019 om 19:59 heeft Mohammad Hossein Bateni  het 
> volgende geschreven:
> 
> I ran into the same issue two days ago, where "curl -O" worked while "wget" 
> did not.
> 
>> On Fri, Feb 8, 2019 at 1:51 PM Marcus Vinicius Mesquita 
>>  wrote:
>> Hi, Pablo
>> 
>> Indeed, with curl I was able to download the file. Thank you. 
>> 
>> In the wiki page about ConTeXt standalone 
>> (https://wiki.contextgarden.net/ConTeXt_Standalone), the section about 
>> single user installation suggests only the wget program, so I got stuck, and 
>> perhaps we could avoid that for future users. 
>> 
>> Regards 
>> 
>> Marcus Vinicius 
>> 
>>> On Fri, Feb 8, 2019, 16:39 Pablo Rodriguez  wrote:
>>> On 2/8/19 7:02 PM, Marcus Vinicius Mesquita wrote:
>>> > Hi, Taco
>>> > 
>>> > I tried again, but the server still answers with a 404 error. 
>>> 
>>> Hi Marcus,
>>> 
>>> I have just updated my ConTeXt Suite to its latest beta.
>>> 
>>> And the following command downloads the file (I don’t have wget installed):
>>> 
>>>   $ curl -O http://minimals.contextgarden.net/setup/first-setup.sh
>>> 
>>> 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
>>> ___
>> ___
>> 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] 404 error: Not found for first-setup.sh

2019-02-08 Thread Mohammad Hossein Bateni
I ran into the same issue two days ago, where "curl -O" worked while "wget"
did not.

On Fri, Feb 8, 2019 at 1:51 PM Marcus Vinicius Mesquita <
marcusvinicius.mesqu...@gmail.com> wrote:

> Hi, Pablo
>
> Indeed, with curl I was able to download the file. Thank you.
>
> In the wiki page about ConTeXt standalone (
> https://wiki.contextgarden.net/ConTeXt_Standalone), the section about
> single user installation suggests only the wget program, so I got stuck,
> and perhaps we could avoid that for future users.
>
> Regards
>
> Marcus Vinicius
>
> On Fri, Feb 8, 2019, 16:39 Pablo Rodriguez  wrote:
>
>> On 2/8/19 7:02 PM, Marcus Vinicius Mesquita wrote:
>> > Hi, Taco
>> >
>> > I tried again, but the server still answers with a 404 error.
>>
>> Hi Marcus,
>>
>> I have just updated my ConTeXt Suite to its latest beta.
>>
>> And the following command downloads the file (I don’t have wget
>> installed):
>>
>>   $ curl -O http://minimals.contextgarden.net/setup/first-setup.sh
>>
>> 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
>>
>> ___
>>
>
> ___
> 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] 404 error: Not found for first-setup.sh

2019-02-08 Thread Marcus Vinicius Mesquita
Hi, Pablo

Indeed, with curl I was able to download the file. Thank you.

In the wiki page about ConTeXt standalone (
https://wiki.contextgarden.net/ConTeXt_Standalone), the section about
single user installation suggests only the wget program, so I got stuck,
and perhaps we could avoid that for future users.

Regards

Marcus Vinicius

On Fri, Feb 8, 2019, 16:39 Pablo Rodriguez  wrote:

> On 2/8/19 7:02 PM, Marcus Vinicius Mesquita wrote:
> > Hi, Taco
> >
> > I tried again, but the server still answers with a 404 error.
>
> Hi Marcus,
>
> I have just updated my ConTeXt Suite to its latest beta.
>
> And the following command downloads the file (I don’t have wget installed):
>
>   $ curl -O http://minimals.contextgarden.net/setup/first-setup.sh
>
> 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
>
> ___
>
___
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] MetaFun: how to check the number of arguments

2019-01-16 Thread Jeong Dal
Dear Hans,

> vardef textlength(text t) =
>save n ; n := 0 ;
>for i = t :
>   n := n + 1 ;
>endfor;
>n
> enddef;
> 

Thank you for a  good method!
It can be used in another program.

Best regards,

Dalyoung
___
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] Processing XML file inside a zip file

2019-01-10 Thread Aditya Mahajan

On Fri, 11 Jan 2019, Henri Menke wrote:


On 11/01/19 4:42 PM, Aditya Mahajan wrote:

Hi,

Is it possible to process an XML file inside a zip file without unzipping?

In particular, I have a program that generates zip files which look like
this:

The file `filename.zip` contains:
- filename.xml - file_hash1.png
- file_hash2.png
etc.

Where `filename.xml` (the name matches the basename of the zip file) is
the main xml file and the `file_hash1.png` etc are png files that are
referred to inside the xml file.

If I unzip the file and add

\setupexternalfigures[directory={path-to-unzipped-folder]

then, I have an \startxmlsetups .. \stopxmlsetups environment that
correctly typesets the xml file. I believe that I have seen Hans post
snippets of code that suggest that context can directly read from a zip
file. So, I am wondering if there is a way that I can just call

context --magic-flags filename.zip


You can directly typeset ePub files which is just zipped XML.  There is
a script in mtxrun for it:

   context --ctx=x-epub.ctx yourfile.epub

Documented in: http://www.pragma-ade.nl/general/manuals/hybrid.pdf


Thanks. But I could not find `x-epub.ctx` file in the standalone 
distribution.


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] Processing XML file inside a zip file

2019-01-10 Thread Henri Menke
On 11/01/19 4:42 PM, Aditya Mahajan wrote:
> Hi,
> 
> Is it possible to process an XML file inside a zip file without unzipping?
> 
> In particular, I have a program that generates zip files which look like
> this:
> 
> The file `filename.zip` contains:
> - filename.xml - file_hash1.png
> - file_hash2.png
> etc.
> 
> Where `filename.xml` (the name matches the basename of the zip file) is
> the main xml file and the `file_hash1.png` etc are png files that are
> referred to inside the xml file.
> 
> If I unzip the file and add
> 
> \setupexternalfigures[directory={path-to-unzipped-folder]
> 
> then, I have an \startxmlsetups .. \stopxmlsetups environment that
> correctly typesets the xml file. I believe that I have seen Hans post
> snippets of code that suggest that context can directly read from a zip
> file. So, I am wondering if there is a way that I can just call
> 
> context --magic-flags filename.zip

You can directly typeset ePub files which is just zipped XML.  There is
a script in mtxrun for it:

context --ctx=x-epub.ctx yourfile.epub

Documented in: http://www.pragma-ade.nl/general/manuals/hybrid.pdf

> 
> and obtain the correct output.
> 
> Thanks,
> 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
___

[NTG-context] Processing XML file inside a zip file

2019-01-10 Thread Aditya Mahajan

Hi,

Is it possible to process an XML file inside a zip file without unzipping?

In particular, I have a program that generates zip files which look like 
this:


The file `filename.zip` contains:
- filename.xml 
- file_hash1.png

- file_hash2.png
etc.

Where `filename.xml` (the name matches the basename of the zip file) is 
the main xml file and the `file_hash1.png` etc are png files that are 
referred to inside the xml file.


If I unzip the file and add

\setupexternalfigures[directory={path-to-unzipped-folder]

then, I have an \startxmlsetups .. \stopxmlsetups environment that 
correctly typesets the xml file. I believe that I have seen Hans post 
snippets of code that suggest that context can directly read from a zip 
file. So, I am wondering if there is a way that I can just call


context --magic-flags filename.zip

and obtain the correct output.

Thanks,
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] XML and math

2019-01-10 Thread Aditya Mahajan

On Thu, 10 Jan 2019, Aditya Mahajan wrote:


On Thu, 10 Jan 2019, Hans Hagen wrote:


On 1/10/2019 10:26 PM, Aditya Mahajan wrote:

Hi,

I have an XML file (which is generated via a program that I have no 
control over), which contains elements as follows:


  
     
    height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>

     
  

I want to typeset the `text` attribute of equation (and ignore the  
tag). So, I tried:


\startxmlsetups matlab
   % Bunch of missing definitions
   \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:equation
   \xmlatt{#1}{text}
\stopxmlsetups

This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the 
attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for 
content and not attributes).

Time for an "aha, I knew it" moment ...


This contains `` which I want to convert to either newline or blank.


Some debugging showed that the entity was being translated correctly. I 
was typesetting the output under texcatcodes, which was causing the 
problem. Setting formfeedasciicode and endoflineasciicode to ignorecatcode 
made everything work correctly.


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] XML and math

2019-01-10 Thread Aditya Mahajan

On Thu, 10 Jan 2019, Hans Hagen wrote:


On 1/10/2019 10:26 PM, Aditya Mahajan wrote:

Hi,

I have an XML file (which is generated via a program that I have no control 
over), which contains elements as follows:


  
     
    height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>

     
  

I want to typeset the `text` attribute of equation (and ignore the  
tag). So, I tried:


\startxmlsetups matlab
   % Bunch of missing definitions
   \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:equation
   \xmlatt{#1}{text}
\stopxmlsetups

This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the 
attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for 
content and not attributes).

Time for an "aha, I knew it" moment ...


:-) Thanks.

Follow-up question: How do I escape entities inside the attributes. One 
snippet is:


 
$$x_2(t) = 
\begin{cases}  t,  0 \leq t  5 \\ -t+10,   t \geq

5\end{cases}$$
 

This contains `` which I want to convert to either newline or blank.

(I have to use the text attribute. The content has the right information 
in this particular instance due to a bug in the conversion)


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] XML and math

2019-01-10 Thread Aditya Mahajan

On Fri, 11 Jan 2019, Henri Menke wrote:


On 11/01/19 10:26 AM, Aditya Mahajan wrote:

Hi,

I have an XML file (which is generated via a program that I have no
control over), which contains elements as follows:

 
    
   
    
 

I want to typeset the `text` attribute of equation (and ignore the 
tag). So, I tried:

\startxmlsetups matlab
  % Bunch of missing definitions
  \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:equation
  \xmlatt{#1}{text}
\stopxmlsetups

This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the
attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for
content and not attributes).


You could write your own attribute fetcher in Lua.  Probably there is a
more elegant method.

\startbuffer[test]

   
  
   

\stopbuffer

\startxmlsetups matlab
 % Bunch of missing definitions
 \xmlsetsetup{#1}{p}{matlab:*}
 \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:p
 \xmlflush{#1}
\stopxmlsetups

\startxmlsetups matlab:equation
 \xmlfunction{#1}{equation}
\stopxmlsetups
\startluacode
local a = "text"
local ctxcatcodes = catcodes.numbers.ctxcatcodes

function xml.functions.equation(id)
   local e = lxml.getid(id)
   if e then
   local at = e.at
   if at then
   local att = at[a]
   if att ~= "" then
   context.sprint(ctxcatcodes,att)
   end
   end
   end
end
\stopluacode

\xmlregistersetup{matlab}

\starttext
\xmlprocessbuffer{test}{test}{}
\stoptext


Thanks!

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] XML and math

2019-01-10 Thread Hans Hagen

On 1/10/2019 10:26 PM, Aditya Mahajan wrote:

Hi,

I have an XML file (which is generated via a program that I have no 
control over), which contains elements as follows:


  
     
    height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>

     
  

I want to typeset the `text` attribute of equation (and ignore the  
tag). So, I tried:


\startxmlsetups matlab
   % Bunch of missing definitions
   \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:equation
   \xmlatt{#1}{text}
\stopxmlsetups

This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the 
attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for 
content and not attributes).

Time for an "aha, I knew it" moment ...

\starttext

\startbuffer[test]


   height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>



\stopbuffer

\startxmlsetups whatever
\xmlsetsetup{#1}{p|equation}{xml:*}
\stopxmlsetups

\xmlregistersetup{whatever}

\startxmlsetups xml:p
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:equation
\cldcontext{lxml.getid("#1").at.text}
\stopxmlsetups

\startxmlsetups xml:equation
\startformula
\cldcontext{(string.gsub(lxml.getid("#1").at.text,"[$][$]",""))}
\stopformula
\stopxmlsetups

\xmlprocessbuffer{main}{test}{}

\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] XML and math

2019-01-10 Thread Henri Menke
On 11/01/19 10:26 AM, Aditya Mahajan wrote:
> Hi,
> 
> I have an XML file (which is generated via a program that I have no
> control over), which contains elements as follows:
> 
>  
>     
>     height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>
>     
>  
> 
> I want to typeset the `text` attribute of equation (and ignore the 
> tag). So, I tried:
> 
> \startxmlsetups matlab
>   % Bunch of missing definitions
>   \xmlsetsetup{#1}{equation}{matlab:*}
> \stopxmlsetups
> 
> \startxmlsetups matlab:equation
>   \xmlatt{#1}{text}
> \stopxmlsetups
> 
> This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the
> attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for
> content and not attributes).

You could write your own attribute fetcher in Lua.  Probably there is a
more elegant method.

\startbuffer[test]
 

   

 
\stopbuffer

\startxmlsetups matlab
  % Bunch of missing definitions
  \xmlsetsetup{#1}{p}{matlab:*}
  \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:p
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups matlab:equation
  \xmlfunction{#1}{equation}
\stopxmlsetups
\startluacode
local a = "text"
local ctxcatcodes = catcodes.numbers.ctxcatcodes

function xml.functions.equation(id)
local e = lxml.getid(id)
if e then
local at = e.at
if at then
local att = at[a]
if att ~= "" then
context.sprint(ctxcatcodes,att)
end
end
end
end
\stopluacode

\xmlregistersetup{matlab}

\starttext
\xmlprocessbuffer{test}{test}{}
\stoptext


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

[NTG-context] XML and math

2019-01-10 Thread Aditya Mahajan

Hi,

I have an XML file (which is generated via a program that I have no 
control over), which contains elements as follows:


 

   height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>


 

I want to typeset the `text` attribute of equation (and ignore the  
tag). So, I tried:


\startxmlsetups matlab
  % Bunch of missing definitions
  \xmlsetsetup{#1}{equation}{matlab:*}
\stopxmlsetups

\startxmlsetups matlab:equation
  \xmlatt{#1}{text}
\stopxmlsetups

This literally typesets `$$y_1(t) = 1, t \geq 0$$`. How can I flush the 
attribute using ctxcatcodes? (There is \xmlflushcontent, but that is for 
content and not attributes).


Thanks,
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] color check

2018-12-06 Thread Floris van Manen
it is the behaviour of the (old) osx preview app for sure.
when looking at the pdf, the thumbnails are correct, however when focussing on 
the page it turns green.
its getting more urgent to move to Linux ;-)

.F





> On 6 Dec 2018, at 11:12, luigi scarso  wrote:
> 
> 
> 
> On Thu, Dec 6, 2018 at 10:55 AM Floris van Manen  wrote:
> while experimenting with the sample transparency color code
> 
> 
> \definecolor [transparentred]  [r=1,t=.5,a=1]
> \definecolor [transparentblue] [b=1,t=.5,a=1]
> \definecolor [solidyellow]  [y=1,t=1,a=1]
> 
> \starttext
> 
> \startTEXpage
> ~This is some sample text that goes behind the rectangles\hskip-80mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
> \stopTEXpage
> 
> \stoptext
> 
> 
> 
> i get the intended result.
> 
> 
> 
> if i change the yellow t value to .99
> \definecolor [solidyellow]  [y=1,t=0.99,a=1]
> some green layer pops up.
> 
> 
> 
> as this is all about software, there is a reason to this.
> it cold be the OSX preview program too, of course.
> can someone explain to me ?
> :-)
> 
> here is ok under ubuntu
> Can you convert pdf to png ? This should show almost the same png.
> 
> You can also prepend
> \nopdfcompression
> and post the pdf.
> 
> \nopdfcompression
> \definecolor [transparentred]  [r=1,t=.5,a=1]
> \definecolor [transparentblue] [b=1,t=.5,a=1]
> \definecolor [solidyellow]  [y=1,t=1,a=1]
> 
> \starttext
> 
> \startTEXpage
> \definecolor [solidyellow]  [y=1,t=1,a=1]
> ~This is some sample text that goes behind the rectangles\hskip-80mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
> \stopTEXpage
> 
> 
> \startTEXpage
> \definecolor [solidyellow]  [y=1,t=0.99,a=1]
> ~This is some sample text that goes behind the rectangles\hskip-80mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
> \stopTEXpage
> 
> 
> \stoptext
> 
> --
> luigi
>  10.53.21.PNG> at 
> 10.48.56.PNG>___
> 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
> ___



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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] color check

2018-12-06 Thread luigi scarso
On Thu, Dec 6, 2018 at 10:55 AM Floris van Manen  wrote:

> while experimenting with the sample transparency color code
>
>
> \definecolor [transparentred]  [r=1,t=.5,a=1]
> \definecolor [transparentblue] [b=1,t=.5,a=1]
> \definecolor [solidyellow]  [y=1,t=1,a=1]
>
> \starttext
>
> \startTEXpage
> ~This is some sample text that goes behind the rectangles\hskip-80mm
> \blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
>
> \blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
> \blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
> \stopTEXpage
>
> \stoptext
>
>
>
> i get the intended result.
>
>
> if i change the yellow t value to .99
> \definecolor [solidyellow]  [y=1,t=0.99,a=1]
> some green layer pops up.
>
>
> as this is all about software, there is a reason to this.
> it cold be the OSX preview program too, of course.
> can someone explain to me ?
> :-)
>
> here is ok under ubuntu
Can you convert pdf to png ? This should show almost the same png.

You can also prepend
\nopdfcompression
and post the pdf.

\nopdfcompression
\definecolor [transparentred]  [r=1,t=.5,a=1]
\definecolor [transparentblue] [b=1,t=.5,a=1]
\definecolor [solidyellow]  [y=1,t=1,a=1]

\starttext

\startTEXpage
\definecolor [solidyellow]  [y=1,t=1,a=1]
~This is some sample text that goes behind the rectangles\hskip-80mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
\stopTEXpage


\startTEXpage
\definecolor [solidyellow]  [y=1,t=0.99,a=1]
~This is some sample text that goes behind the rectangles\hskip-80mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
\stopTEXpage


\stoptext

-- 
luigi
___
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] color check

2018-12-06 Thread Pablo Rodriguez
On 12/6/18 10:55 AM, Floris van Manen wrote:
> while experimenting with the sample transparency color code
> [...] 
> if i change the yellow t value to .99 
> \definecolor [solidyellow]  [y=1,t=0.99,a=1]
> some green layer pops up.
> 
> as this is all about software, there is a reason to this.
> it cold be the OSX preview program too, of course.
> can someone explain to me ?
> :-)

Hi Floris,

this is an Apple Preview issue. I wonder what it might be doing wrong.

Evince, mupdf-gl and acroread for Linux display it fine (see the
attached image).

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] color check

2018-12-06 Thread Floris van Manen
while experimenting with the sample transparency color code


\definecolor [transparentred]  [r=1,t=.5,a=1]
\definecolor [transparentblue] [b=1,t=.5,a=1]
\definecolor [solidyellow]  [y=1,t=1,a=1]

\starttext

\startTEXpage
~This is some sample text that goes behind the rectangles\hskip-80mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=solidyellow]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=transparentred]\hskip-6mm
\blackrule[width=18mm,height=10mm,depth=10mm,color=transparentblue]\hskip-6mm
\blackrule[width=18mm,height=20mm,depth=1mm,color=solidyellow]\hskip27mm
\stopTEXpage

\stoptext



i get the intended result.



if i change the yellow t value to .99
\definecolor [solidyellow]  [y=1,t=0.99,a=1]
some green layer pops up.



as this is all about software, there is a reason to this.
it cold be the OSX preview program too, of course.
can someone explain to me ?
:-)

.F



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
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 configure context command in Emacs

2018-10-24 Thread Mohammad Hossein Bateni
I have a hacky solution, which I haven't tested in a while.

Make a shell script called "mycontext" somewhere in the PATH.  Include the
following in it:

#!/bin/bash

. ~/context/tex/setuptex

context $@

Make it executable.  And then use "mycontext" as the TeX command inside
emacs.  For example, you can refer to AucTeX's documentation for that.

On Wed, Oct 24, 2018 at 10:08 AM luigi scarso 
wrote:

>
>
> On Wed, Oct 24, 2018 at 3:30 PM Jan U. Hasecke <
> juh+ntg-cont...@mailbox.org> wrote:
>
>> Hello,
>>
>> I hope there are some Emacs users out there. ;-)
>>
>> I can use emacs with context-mode when I start the program like this:
>>
>> . ~/context/tex/setuptex ; emacs &
>>
>> I could not find a way to set this in my emacs init file. Neither of the
>> ways described here worked for me:
>>
>> https://www.emacswiki.org/emacs/ExecPath
>>
>> I set this in .bashrc:
>>
>> if [-f ~/context/tex/setuptex ]; then
>>. ~/context/tex/setuptex
>> fi
>>
>> to always have context available in a shell and in emacs if I start it
>> from bash.
>>
>> Starting Emacs via the start menu of Gnome results in an Emacs that does
>> not know ConTeXt.
>>
>> I found some hints how to source .bashrc in emacs but this only affects
>> the emacs shell not the command calling from within AucTeX.
>>
>> Has anyone found a solution for this?
>>
>> juh
>>
>>
>> not a solution for your problem (I manually run setuptex when I open an
> emacs shell)
> but I guess that looking at
> https://www.gnu.org/software/auctex/
> can help.
>
> --
> luigi
>
> ___
> 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 configure context command in Emacs

2018-10-24 Thread luigi scarso
On Wed, Oct 24, 2018 at 3:30 PM Jan U. Hasecke 
wrote:

> Hello,
>
> I hope there are some Emacs users out there. ;-)
>
> I can use emacs with context-mode when I start the program like this:
>
> . ~/context/tex/setuptex ; emacs &
>
> I could not find a way to set this in my emacs init file. Neither of the
> ways described here worked for me:
>
> https://www.emacswiki.org/emacs/ExecPath
>
> I set this in .bashrc:
>
> if [-f ~/context/tex/setuptex ]; then
>. ~/context/tex/setuptex
> fi
>
> to always have context available in a shell and in emacs if I start it
> from bash.
>
> Starting Emacs via the start menu of Gnome results in an Emacs that does
> not know ConTeXt.
>
> I found some hints how to source .bashrc in emacs but this only affects
> the emacs shell not the command calling from within AucTeX.
>
> Has anyone found a solution for this?
>
> juh
>
>
> not a solution for your problem (I manually run setuptex when I open an
emacs shell)
but I guess that looking at
https://www.gnu.org/software/auctex/
can help.

-- 
luigi
___
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 configure context command in Emacs

2018-10-24 Thread Taco Hoekwater


> On 24 Oct 2018, at 15:30, Jan U. Hasecke  wrote:
> 
> Hello,
> 
> I hope there are some Emacs users out there. ;-)
> 
> I can use emacs with context-mode when I start the program like this:
> 
> . ~/context/tex/setuptex ; emacs &
> 
> I could not find a way to set this in my emacs init file. Neither of the
> ways described here worked for me:

AFAIK, combining both of these should have worked, but it has been ages
since I used emacs that way, and I do not even have one installed any more,
sorry.

> https://www.emacswiki.org/emacs/ExecPath
> 
> I set this in .bashrc:

Perhaps if you use .profile instead, as that should be executed during login
(before gnome even starts)?

Best wishes,

Taco


___
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 configure context command in Emacs

2018-10-24 Thread Jan U. Hasecke
Hello,

I hope there are some Emacs users out there. ;-)

I can use emacs with context-mode when I start the program like this:

. ~/context/tex/setuptex ; emacs &

I could not find a way to set this in my emacs init file. Neither of the
ways described here worked for me:

https://www.emacswiki.org/emacs/ExecPath

I set this in .bashrc:

if [-f ~/context/tex/setuptex ]; then
   . ~/context/tex/setuptex
fi

to always have context available in a shell and in emacs if I start it
from bash.

Starting Emacs via the start menu of Gnome results in an Emacs that does
not know ConTeXt.

I found some hints how to source .bashrc in emacs but this only affects
the emacs shell not the command calling from within AucTeX.

Has anyone found a solution for this?

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] insert natural table at the top left of some png

2018-10-15 Thread Hans Hagen

On 10/15/2018 8:11 PM, Damien Thiriet wrote:

Hello,

I am still working on maps and facing some new issue.
The program I used to design one map is not convenient for writing key
to symbols, and what I have is a map.png file with big spare space on
its upper left corner.
So I have either to write on the png with ImageMagick or GIMP,
or have a nicer output with ConTeXt.

I wrote this legend file.

\definecolor[canaux][h=81b3e0]

\startreusableMPgraphic{voies}
path p; p:= (0,0) -- (20,0) ;
drawarrow p withcolor black ;
\stopreusableMPgraphic

\startreusableMPgraphic{canaux}
path p; p:= (0,0) -- (20,0) ;
drawarrow p withcolor \MPcolor{canaux} withpen pencircle scaled 2pt;
\stopreusableMPgraphic


\startbuffer
\bTABLE[frame=off]
\setupTABLE[column][1,3][align={middle,lohi}]
\bTR
\bTH 1) \eTH \bTH Le milieu \eTH \bTH 2) \eTH \bTH Les activités \eTH
\eTR
\bTR
\bTD \externalfigure[illustrations/zone_urbaine][height=12bp] \eTD \bTD 
zones urbaines \eTD
\eTR
\bTR
\bTD \leavevmode \reuseMPgraphic{voies} \eTD \bTD infrastructures~: voies 
ferrées \eTD
\eTR
\bTR
\bTD \leavevmode \reuseMPgraphic{canaux} \eTD \bTD infrastructures~: canaux 
\eTD
\eTR
eTR
\eTABLE
\stopbuffer

The idea was to make some
\hbox{
   \externalfigure[map][width=0.9 \textwidth]
   \vbox{\hfill -0.9 \textwidth
  \getbuffer
  }
}

to put the boxed legend at this upper left corner.
Of course I couldn't succeed, since I do not understand so much
boxes. ConTeXt complains with a missing number.

How could I achieve such boxing ?


\definecolor[canaux][h=81b3e0]

\startreusableMPgraphic{voies}
drawarrow
(0,0) -- (20,0)
withcolor black ;
\stopreusableMPgraphic

\startreusableMPgraphic{canaux}
drawarrow
(0,0) -- (20,0)
withcolor \MPcolor{canaux} withpen pencircle scaled 2pt;
\stopreusableMPgraphic

\startbuffer[legend]
\bTABLE[frame=off]
\bTR
   \bTH 1) \eTH \bTH Le milieu \eTH \bTH 2) \eTH \bTH Les 
activités \eTH

\eTR
\bTR
\bTD
\externalfigure[t:/sources/mill.png][height=12bp]
\eTD
\bTD
zones urbaines
\eTD
\eTR
\bTR
\bTD
\inframed[frame=off,offset=0pt]{\reuseMPgraphic{voies}}
\eTD
\bTD
infrastructures~: voies ferrées
\eTD
\eTR
\bTR
   \bTD
\inframed[frame=off,offset=0pt]{\reuseMPgraphic{canaux}}
\eTD
\bTD
infrastructures~: canaux
\eTD
\eTR
\eTABLE
\stopbuffer

\definelayer
  [legend]
  [width=\overlaywidth,
   height=\overlayheight]

\starttext

% \setlayer
%   [legend]
%   {\getbuffer[legend]}

\setlayerframed
  [legend]
  [background=color,
   backgroundoffset=2pt,
   backgroundcolor=red,
   strut=no,
   frame=off]
  {\getbuffer[legend]}

\externalfigure
  [t:/sources/cow.pdf]
  [background={foreground,legend},
   width=0.9\textwidth]

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

[NTG-context] insert natural table at the top left of some png

2018-10-15 Thread Damien Thiriet
Hello,

I am still working on maps and facing some new issue.
The program I used to design one map is not convenient for writing key
to symbols, and what I have is a map.png file with big spare space on
its upper left corner.
So I have either to write on the png with ImageMagick or GIMP, 
or have a nicer output with ConTeXt.

I wrote this legend file.

\definecolor[canaux][h=81b3e0]

\startreusableMPgraphic{voies}
path p; p:= (0,0) -- (20,0) ;
drawarrow p withcolor black ;
\stopreusableMPgraphic

\startreusableMPgraphic{canaux}
path p; p:= (0,0) -- (20,0) ;
drawarrow p withcolor \MPcolor{canaux} withpen pencircle scaled 2pt;
\stopreusableMPgraphic


\startbuffer
\bTABLE[frame=off] 
\setupTABLE[column][1,3][align={middle,lohi}]
\bTR
   \bTH 1) \eTH \bTH Le milieu \eTH \bTH 2) \eTH \bTH Les activités \eTH
\eTR
\bTR
   \bTD \externalfigure[illustrations/zone_urbaine][height=12bp] \eTD \bTD 
zones urbaines \eTD 
\eTR
\bTR 
   \bTD \leavevmode \reuseMPgraphic{voies} \eTD \bTD infrastructures~: voies 
ferrées \eTD 
\eTR
\bTR 
   \bTD \leavevmode \reuseMPgraphic{canaux} \eTD \bTD infrastructures~: canaux 
\eTD
\eTR
eTR
\eTABLE
\stopbuffer

The idea was to make some 
\hbox{
  \externalfigure[map][width=0.9 \textwidth]
  \vbox{\hfill -0.9 \textwidth 
 \getbuffer
 }
}

to put the boxed legend at this upper left corner.
Of course I couldn't succeed, since I do not understand so much
boxes. ConTeXt complains with a missing number.

How could I achieve such boxing ?

Thanks,


Damien Thiriet 


___
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] Can anyone connect context to R or python?

2018-10-06 Thread Hans Hagen

On 10/6/2018 10:19 PM, Aditya Mahajan wrote:

Now, what I want to do (at some stage) is to extend the functionality of 
the
filter module to call jupyter kernels. So, instead of passing messages 
between

context and the external program through text files, the messages can be
passed as JSON objects (using sockets, I believe). The advantage is that 
you

avoid multiple restarts of the external program (which is what the filter
module currently does).
but that assumes that the listener is not restarting the a program (i.e. 
that e.g. r is listening and sending, right?


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] Can anyone connect context to R or python?

2018-10-06 Thread Aditya Mahajan

On Sat, 6 Oct 2018, Alan Braslau wrote:


On Sat, 6 Oct 2018 13:06:18 -0400 (EDT)
Aditya Mahajan  wrote:


In my opinion, a better long-term option is to write a jupyter client in
lua that can be called by context. Then we can easily interface with all
languages that provide a jupyter kernel
(https://github.com/jupyter/jupyter/wiki/Jupyter-kernels).

The interface of a jupter-client is available here
https://jupyter-client.readthedocs.io/en/stable/index.html. It seems
relatively straight forward (send a JSON message and receive a JSON
message). Translating the JSON messages to ConTeXt should also be easy.
Is there anyone who wants to play around trying to implement this?


jupyter runs python code.

Have you ever tried doing any real heavy data analysis using jupyter? My 
experience is that it chokes on large data sets... So why write lua code 
to call a jupyter kernel running python?


That's why I want to write a jupyter client in lua (so that there is no 
python code involved).


Would it not make more sense developing code directly in lua in this 
case?


Yes, but let me try to explain. When creating homework assignments for a
course I teach, I often have documents as follows:

\starttext
Consider an LTI system with the transfer function
\placefigure[eq:sys] \startformula
  H(s) = \frac{1}{s^2 + 2s + 2}
\stopformula
The step response of the system is shown in Figure \in[fig:plot]. Note
that the step response settles to a final value of $0.5$
\startplacefigure
  [title={Step response of the LTI system described in \eqref[eq:sys]}]
  \externalfigure[step-response.pdf]
\stopplacefigure
\stoptext

What I want to do is to be able to change the transfer function (given in the
formula) and regenerate the plot. Something like the following:

\defineLTIsystem[example][num={1}, den={1,2,2}]

\starttext
Consider an LTI system with the transfer function
\placefigure[eq:sys] \startformula
  H(s) = \TF[example]
\stopformula
The step response of the system is shown in Figure \in[fig:plot]. Note
that the step response settles to a final value of
$\calculate{lim(s*TF[example], s, 0)}$.
\startplacefigure
  [title={Step response of the LTI system described in \eqref[eq:sys]}]
  \STEP[example]
\stopplacefigure
\stoptext

Now, it is possible to write the code to generate the step response in
Lua/Metapost. But it quickly gets tiring and one essentially ends up creating
a domain specific computational library in Lua.

An alternative approach, is to use an existing library written in some other
programming language (say Matlab or R or Julia or whatever). It is possible to
do so using the `filter` module (plus some lua code). In this case, the user
simply calls "context filename" and ConTeXt macros take care of calling an
external program (say matlab) to generate the plot and do the algebraic
calculations.

Another approach which is taken by programs like Sweave and Knitr is to first
run the program through R (or someother programming language). These are
typically written for LaTeX. So code that is between \begin{Rcode} ..
\end{Rcode} and \Rexp{...} (or something similar, haven't used R in a decade)
is treated as R code and everything else is treated as comments. The evaluated
file can then be run through `latex` or `context` or any typesetting program.
The drawback of this approach is that not all programming languages have such
a program.

Now, what I want to do (at some stage) is to extend the functionality of the
filter module to call jupyter kernels. So, instead of passing messages between
context and the external program through text files, the messages can be
passed as JSON objects (using sockets, I believe). The advantage is that you
avoid multiple restarts of the external program (which is what the filter
module currently does).

The one thing that python (and jupyter) brings, or R for that matter, 
are libraries of calculation routines. These can be quite sophisticated, 
some efficient, and some not so efficient. My approach has always been 
to write my own routines or to adapt algorithms, at least then I know 
what the calculation is actually doing. Of course, this means that I 
spend time redoing what might have been done elsewhere, but the variety 
of routines that I actually use is rather small.


If you have the time (and the expertise) then this is a good strategy. For me,
this is not always the 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] Font installation help needed!

2018-09-30 Thread Schmitz Thomas A.


> On 30. Sep 2018, at 20:56, Geert Verhaag  wrote:
> 
> I'd like to use the Advent Pro font, so I downloaded the font and have 7 ttf 
> files available.
> 
> After looking around for some manual I found: "Integrating TrueType Fonts 
> into ConTEXt" by Thomas A. Schmitz.
> 
> Immediately I run into problems when trying to run the texfont command.
> 
> My Linux (ubuntu 14.04) says:
> 
> The program 'texfont' is currently not installed.
> 
> I did a standalone installation years ago of this version of ConTeXt, and 
> don't dare to upgrade because I might run into other issues, sorry!
> 
> Any hints on how to procede installing the Advent Pro font to this version of 
> ConTeXt are very much welcomed!

Ah, you like old systems! Ubuntu 14.04 and context 2013, what a wonderful 
combination, back in the days! texfont is still part of the distribution, but 
you will have to invoke it with its full path. I just tried (with a current 
standalone), and it still works as expected. I had to copy texnansi.enc into 
the working directory, and then I invoked

perl ~/context/tex/texmf-context/scripts/context/perl/texfont.pl —fontroot=<> 
—ve=<> —co=<> --en=texnansi

Try this (replacing the variables with your values, of course).

Thomas
___
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] Font installation help needed!

2018-09-30 Thread Geert Verhaag

Hi,

I'm currently using ConTeXt version:

mtx-context | ConTeXt Process Management 0.60
mtx-context |
mtx-context | main context file: 
/home/verhaag/context/tex/texmf-context/tex/context/base/context.mkiv
mtx-context | current version: 2013.08.11 20:23

I'd like to use the Advent Pro font, so I downloaded the font and have 7 
ttf files available.


After looking around for some manual I found: "Integrating TrueType 
Fonts into ConTEXt" by Thomas A. Schmitz.


Immediately I run into problems when trying to run the texfont command.

My Linux (ubuntu 14.04) says:

The program 'texfont' is currently not installed.

I did a standalone installation years ago of this version of ConTeXt, 
and don't dare to upgrade because I might run into other issues, sorry!


Any hints on how to procede installing the Advent Pro font to this 
version of ConTeXt are very much welcomed!


Regards,

Gerard

--


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

2018-09-18 Thread Taco Hoekwater


> On 17 Sep 2018, at 21:12, Hans van der Meer  wrote:
> 
> This completely escapes me: \xmlstrippednolines behaves differently for:
> (1) no embedded nodes - just the node content
> (2) embedded nodes - outer node encloses node content
> See the minimal example.
> 
> For me this works out a disaster, because in the second case the outer node 
> is added, throwing my program completely off track.
> 
> Questions:
> Is this the defined behaviour? Then what other means can be used to get the 
> node content and nothing but the node content in both cases?

\startxmlsetups xml:text
tex: \xmlflush{#1}\crlf
xmlstrippednolines: \xmlstripnolines{#1}{.}\xmlflush{#1}\crlf
\stopxmlsetups

> Why does \xmlstrippednolines behaves in this manner?

No idea about that.

Best wishes,
Taco

Taco Hoekwater
Elvenkind BV




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

2018-09-17 Thread Hans van der Meer
This completely escapes me: \xmlstrippednolines behaves differently for:(1) no embedded nodes - just the node content(2) embedded nodes - outer node encloses node contentSee the minimal example.For me this works out a disaster, because in the second case the outer node is added, throwing my program completely off track.Questions:Is this the defined behaviour? Then what other means can be used to get the node content and nothing but the node content in both cases?Why does \xmlstrippednolines behaves in this manner?
dr. Hans van der Meer



test.pdf
Description: Adobe PDF document


test.tex
Description: Binary data
___
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] picking up parameters from mtxrun

2018-09-08 Thread Wolfgang Schuster
If you need example how to use the commands take a look into the 
mtx-context-XXX.tex files.


Wolfgang


Hans van der Meer schrieb am 08.09.18 um 18:38:
Indeed, that was it.Your mail brings the memory back. But I am an old 
man, so …. :-) Thanks.


On 8 Sep 2018, at 17:40, Wolfgang Schuster 
<mailto:wolfgang.schuster.li...@gmail.com>> wrote:


\getdocumentargument{...}

\getdocumentargumentdefault{...}{}

Wolfgang


Hans van der Meer schrieb am 08.09.18 um 15:23:
I seem to remember (from a galaxy far far away) that it was possible 
to pick up the parameters from the mtxrun call that sets ConTeXt 
typesetting in motion. For example doing

mtxrun —mymode=something
and then in the program retrieving that something.
Will someone enlighten me?

dr. Hans van der Meer




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




met vriendelijke groet
dr. Hans van der Meer




___
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] picking up parameters from mtxrun

2018-09-08 Thread Wolfgang Schuster

\getdocumentargument{...}

\getdocumentargumentdefault{...}{}

Wolfgang


Hans van der Meer schrieb am 08.09.18 um 15:23:
I seem to remember (from a galaxy far far away) that it was possible 
to pick up the parameters from the mtxrun call that sets ConTeXt 
typesetting in motion. For example doing

mtxrun —mymode=something
and then in the program retrieving that something.
Will someone enlighten me?

dr. Hans van der Meer




___
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] picking up parameters from mtxrun

2018-09-08 Thread Hans van der Meer
I seem to remember (from a galaxy far far away) that it was possible to pick up 
the parameters from the mtxrun call that sets ConTeXt typesetting in motion. 
For example doing 
mtxrun —mymode=something
and then in the program retrieving that something.
Will someone enlighten me?

dr. Hans van der Meer


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

2018-09-07 Thread Procházka Lukáš Ing .

Hello,

due to great TextAdept (TA) [1] extendibility, I'd like to try to program a TA add-on 
which would provide a ConTeXt source "browser".

The idea is to create an independent window in the TA which will show the 
current document structure, or even the project structure, and provide some 
click-in-browser-go-to-source functionality.

Suppose having a source file with the following content (line numbers in (...) 
just for referring):

 a.tex
(1) \section{Sec}
(2)
(3) Hello
(4)
(5)  \subsection{Subsec}
(6)
(7)  Word


The "browser" should display this:


Sec (section)
Subsec (subsection)


After some investigation and some questioning in TA mailing list, it seem that 
"tatoolbar" [2] might bu useful for this purpose.

Unfortunately, there is an initial problem: the tatoolbar is not pre-compiled 
for Windows [3] and compilation under Windows is not so easy (I tried with 
GnuWin32 and MinGW installed on my WinX computer); getting Win bins is done by 
cross compiling under Linux.

Is there someone here - who is familiar with Linux - who could compile 
tatoolbar first - and provide it for trying to write the source browser?

Thank you in advance.

Best regards,

Lukas

[1] https://foicica.com/textadept/
[2] https://github.com/gabdub/ta-tweaks/wiki/tatoolbar
[3] https://foicica.com/textadept/manual.html#Compiling


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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] Emacs + latest beta

2018-08-30 Thread Fabrice Couvreur
df (backend for directly generating pdf
> > output)
> > mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds
> loading
> > mkiv lua stats  > callbacks: internal: 177, file: 180, direct: 2, late:
> 2,
> > function 534, total: 895
> > mkiv lua stats  > randomizer: resumed with value 0.55005725985393
> > mkiv lua stats  > loaded patterns: en::2, load time: 0.000
> > mkiv lua stats  > result saved in file: vladimir.pdf, compresslevel 3,
> > objectcompresslevel 3
> > mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf,
> > lmroman10-bold.otf, lmroman10-regular.otf, lmroman12-regular.otf
> > mkiv lua stats  > font engine: otf 3.104, afm 1.513, tfm 1.000, 9
> > instances, 3 shared in backend, 3 common vectors, 0 common hashes, load
> > time 0.221 seconds
> > mkiv lua stats  > metapost: 0.001 seconds, loading: 0.018, execution:
> > 0.001, n: 1, average: 0.019, instances: 1, luacalls: 8, memory: 2.635 M
> > mkiv lua stats  > used platform: linux-64, type: unix, binary subtree:
> > texmf-linux-64
> > mkiv lua stats  > used engine: luatex version 1.08 with functionality
> level
> > 6731, banner: this is luatex, version 1.08.0 (tex live 2018)
> > mkiv lua stats  > control sequences: 46536 of 65536 + 10
> > mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 86 MB
> (ctx:
> > 85 MB), hash type: lua, hash chars: min(64,40), symbol mask: utf (τεχ)
> > mkiv lua stats  > runtime: 0.536 seconds, 1 processed pages, 1 shipped
> > pages, 1.866 pages/second
> > mtx-context | purged files: vladimir.log, vladimir.tuc
> > system  | total runtime: 2.525 seconds
> >
> >
> > TeX Output finished at Wed Aug 29 11:54:03
>
> So no error this time, how about the resulted PDF file?
>
> >> Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
> >> Emacs ?
>
> > I use AUCTEX but I d not know bare Emacs
>
> I assumed that you installed auctex package, like
>
>   $ sudo pacman -S auctex
>
> and do
>
>   (load "auctex")
>
> in your ~/.emacs file. If you do not use auctex or not load it the Emacs
> will use it's own (builtin) support for LaTeX and ConTeXt file (a
> limited one).
>
> > (custom-set-variables
> >  ;; custom-set-variables was added by Custom.
> >  ;; If you edit it by hand, you could mess it up, so be careful.
> >  ;; Your init file should contain only one such instance.
> >  ;; If there is more than one, they won't work right.
> >  '(ConTeXt-Mark-version "IV")
> >  '(ConTeXt-engine "luatex")
> >  '(TeX-command-extra-options "-shell-escape")
> >  '(ansi-color-faces-vector
> >[default default default italic underline success warning error])
> >  '(ansi-color-names-vector
> >["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#66" "#ccaa8f"
> > "#f6f3e8"])
> >  '(custom-enabled-themes (quote (leuven)))
> >  '(package-selected-packages
> >(quote
> > (yasnippet-snippets auto-complete-auctex context-coloring nova-theme
> > auctex)))
> >  '(tab-width 4))
> > (custom-set-faces
> >  ;; custom-set-faces was added by Custom.
> >  ;; If you edit it by hand, you could mess it up, so be careful.
> >  ;; Your init file should contain only one such instance.
> >  ;; If there is more than one, they won't work right.
> >  )
> >
> > ;; SERVER Download (MELPA):
> >
> > (when (>= emacs-major-version 24)
> >   (require 'package)
> >   (add-to-list
> >'package-archives
> >'("melpa" . "http://melpa.org/packages/;)
> >t))
> >
> >
> > (eval-after-load "context"
> >   '(setq TeX-command-list
> >(cons '("ConTeXt"
> > "PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context
> --purgeall
> > %s"
> >  TeX-run-command nil t :help "Run context (MarkIV)")
> > TeX-command-list))
> > )
> >
> >
> > ;;(add-hook 'ConTeXt-mode-hook
> >   ;;(lambda()
> >   ;;  (setq TeX-command-default "ConTeXt Full")))
> >
> > (setq-default cursor-type 'bar)
> >
> > (set-cursor-color "#ff")
> >
> >
> > (setq TeX-view-program-list '(("Evince" "evince %o"))
> >   TeX-view-program-selection '((output-pdf "Evince")))
> >
> > (setq make-backup-files nil) ; stop creating backup~ files
> > (setq auto-save-default nil) ; stop creating #autosave# files
> >
> > ;; auto close bracket insertion. New in emacs 24
> > (electric-pair-mode 1)
> >
> > ;; turn on highlight matching brackets when cursor is on one
> > (show-paren-mode 1)
> >
> >
> > (setq inhibit-startup-screen t)
> >
> >
> > (add-to-list 'load-path
> "/home/aragorn/texlive/2018/texmf-dist/asymptote")
> > (autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
> > (autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode."
> t)
> > (autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate
> LaTeX." t)
> > (add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))
> >
> > (setq column-number-mode t)
> >
> > (setq line-number-mode t)
> >
> >
> > (setq py-install-directory "~/.emacs.d/site-lisp/python-mode.el-6.1.1")
> >
> > (add-to-list 'load-path py-install-directory)
> >
> > (require 'python-mode)
> >
> > ;;(add-hook 'ConTeXt-mode-hook
> >   ;;(lambda ()
> >;; (setq indent-tabs-mode t
> > ;;  indent-line-function 'indent-relative)))
> >
> > (add-hook 'LaTeX-mode-hook
> >   (lambda()
> >  (add-to-list 'TeX-command-list '("LuaTeX"
> "%`lualatex%(mode)%'
> > %t" TeX-run-TeX nil t))
> >  (setq TeX-command-default "LuaTeX")
> >  (setq TeX-save-query nil)
> >  (setq TeX-show-compilation t)))
> >
> >
> > (setq-default TeX-engine 'luatex
> >   TeX-PDF-mode t)
>
> These settings looks good. Hope you resolved your problem.
>
> P.S. Why you install auctex as MELPA and don't use Archlinux package?
>
> > Thanks
> > Fabrice
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
> --
> A memorandum is written not to inform the reader, but to protect the
> writer.
> -- Dean Acheson
>
> ___
> 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] Emacs + latest beta

2018-08-29 Thread Vladimir Lomov
orn/vladimir.tex'
> system  > synctex functionality is enabled, expect 5-10 pct runtime
> overhead!
> fonts   > preloading latin modern fonts (second stage)
> fonts   > 'fallback modern-designsize rm 12pt' is loaded
> structure   > sectioning > chapter @ level 2 : 0.1 -> First chapter
> metapost> initializing instance 'metafun:1' using format 'metafun'
> and method 'default'
> metapost> loading 'metafun' as
> '/home/aragorn/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv'
> using method 'default'
> metapost> initializing number mode 'scaled'
> open source > level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> close source> level 3, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/sample/common/ward.tex'
> backend > xmp > using file
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/lpdf-pdx.xml'
> pages   > flushing realpage 1, userpage 1, subpage 1
> close source> level 2, order 4, name '/home/aragorn/vladimir.tex'
> close source> level 1, order 4, name
> '/home/aragorn/context/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
> 
> mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
> mkiv lua stats  > used cache path:
> /home/aragorn/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
> mkiv lua stats  > resource resolver: loadtime 0.007 seconds, 1 scans with
> scantime 0.000 seconds, 0 shared scans, 31 found files, scanned paths:
> /home/aragorn/texmf
> mkiv lua stats  > stored bytecode data: 437 modules (0.217 sec), 93 tables
> (0.015 sec), 530 chunks (0.232 sec)
> mkiv lua stats  > traced context: maxstack: 1328, freed: 5, unreachable:
> 1323
> mkiv lua stats  > cleaned up reserved nodes: 58 nodes, 9 lists of 455
> mkiv lua stats  > node memory usage: 2 glue, 2 kern, 2 penalty, 14
> attribute, 50 glue_spec, 4 attribute_list, 2 temp, 2 user_defined
> mkiv lua stats  > node list callback tasks: 8 unique task lists, 6
> instances (re)created, 55 calls
> mkiv lua stats  > synctex tracing: 2 referenced files, 5 files ignored, 3
> objects flushed, logfile: vladimir.synctex
> mkiv lua stats  > used backend: pdf (backend for directly generating pdf
> output)
> mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
> mkiv lua stats  > callbacks: internal: 177, file: 180, direct: 2, late: 2,
> function 534, total: 895
> mkiv lua stats  > randomizer: resumed with value 0.55005725985393
> mkiv lua stats  > loaded patterns: en::2, load time: 0.000
> mkiv lua stats  > result saved in file: vladimir.pdf, compresslevel 3,
> objectcompresslevel 3
> mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf,
> lmroman10-bold.otf, lmroman10-regular.otf, lmroman12-regular.otf
> mkiv lua stats  > font engine: otf 3.104, afm 1.513, tfm 1.000, 9
> instances, 3 shared in backend, 3 common vectors, 0 common hashes, load
> time 0.221 seconds
> mkiv lua stats  > metapost: 0.001 seconds, loading: 0.018, execution:
> 0.001, n: 1, average: 0.019, instances: 1, luacalls: 8, memory: 2.635 M
> mkiv lua stats  > used platform: linux-64, type: unix, binary subtree:
> texmf-linux-64
> mkiv lua stats  > used engine: luatex version 1.08 with functionality level
> 6731, banner: this is luatex, version 1.08.0 (tex live 2018)
> mkiv lua stats  > control sequences: 46536 of 65536 + 10
> mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 86 MB (ctx:
> 85 MB), hash type: lua, hash chars: min(64,40), symbol mask: utf (τεχ)
> mkiv lua stats  > runtime: 0.536 seconds, 1 processed pages, 1 shipped
> pages, 1.866 pages/second
> mtx-context | purged files: vladimir.log, vladimir.tuc
> system  | total runtime: 2.525 seconds
> 
> 
> TeX Output finished at Wed Aug 29 11:54:03

So no error this time, how about the resulted PDF file?

>> Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
>> Emacs ?
  
> I use AUCTEX but I d not know bare Emacs

I assumed that you installed auctex package, like

  $ sudo pacman -S auctex

and do

  (load "auctex")

in your ~/.emacs file. If you do not use auctex or not load it the Emacs
will use it's own (builtin) support for LaTeX and ConTeXt file (a
limited one).
 
> (custom-set-variables
>  ;; custom-set-variables was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  '(ConTeXt-Mark-version "IV"

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
xt: maxstack: 1328, freed: 5, unreachable:
1323
mkiv lua stats  > cleaned up reserved nodes: 58 nodes, 9 lists of 455
mkiv lua stats  > node memory usage: 2 glue, 2 kern, 2 penalty, 14
attribute, 50 glue_spec, 4 attribute_list, 2 temp, 2 user_defined
mkiv lua stats  > node list callback tasks: 8 unique task lists, 6
instances (re)created, 55 calls
mkiv lua stats  > synctex tracing: 2 referenced files, 5 files ignored, 3
objects flushed, logfile: vladimir.synctex
mkiv lua stats  > used backend: pdf (backend for directly generating pdf
output)
mkiv lua stats  > jobdata time: 0.001 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: internal: 177, file: 180, direct: 2, late: 2,
function 534, total: 895
mkiv lua stats  > randomizer: resumed with value 0.55005725985393
mkiv lua stats  > loaded patterns: en::2, load time: 0.000
mkiv lua stats  > result saved in file: vladimir.pdf, compresslevel 3,
objectcompresslevel 3
mkiv lua stats  > loaded fonts: 4 files: latinmodern-math.otf,
lmroman10-bold.otf, lmroman10-regular.otf, lmroman12-regular.otf
mkiv lua stats  > font engine: otf 3.104, afm 1.513, tfm 1.000, 9
instances, 3 shared in backend, 3 common vectors, 0 common hashes, load
time 0.221 seconds
mkiv lua stats  > metapost: 0.001 seconds, loading: 0.018, execution:
0.001, n: 1, average: 0.019, instances: 1, luacalls: 8, memory: 2.635 M
mkiv lua stats  > used platform: linux-64, type: unix, binary subtree:
texmf-linux-64
mkiv lua stats  > used engine: luatex version 1.08 with functionality level
6731, banner: this is luatex, version 1.08.0 (tex live 2018)
mkiv lua stats  > control sequences: 46536 of 65536 + 10
mkiv lua stats  > lua properties: engine: lua 5.3, used memory: 86 MB (ctx:
85 MB), hash type: lua, hash chars: min(64,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.536 seconds, 1 processed pages, 1 shipped
pages, 1.866 pages/second
mtx-context | purged files: vladimir.log, vladimir.tuc
system  | total runtime: 2.525 seconds


TeX Output finished at Wed Aug 29 11:54:03

Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
> Emacs
> ?
>

I use AUCTEX but I d not know bare Emacs

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ConTeXt-Mark-version "IV")
 '(ConTeXt-engine "luatex")
 '(TeX-command-extra-options "-shell-escape")
 '(ansi-color-faces-vector
   [default default default italic underline success warning error])
 '(ansi-color-names-vector
   ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#66" "#ccaa8f"
"#f6f3e8"])
 '(custom-enabled-themes (quote (leuven)))
 '(package-selected-packages
   (quote
(yasnippet-snippets auto-complete-auctex context-coloring nova-theme
auctex)))
 '(tab-width 4))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

;; SERVER Download (MELPA):

(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list
   'package-archives
   '("melpa" . "http://melpa.org/packages/;)
   t))


(eval-after-load "context"
  '(setq TeX-command-list
   (cons '("ConTeXt"
"PATH=/home/aragorn/context/tex/texmf-linux-64/bin:$PATH context --purgeall
%s"
 TeX-run-command nil t :help "Run context (MarkIV)")
TeX-command-list))
)


;;(add-hook 'ConTeXt-mode-hook
  ;;(lambda()
  ;;  (setq TeX-command-default "ConTeXt Full")))

(setq-default cursor-type 'bar)

(set-cursor-color "#ff")


(setq TeX-view-program-list '(("Evince" "evince %o"))
  TeX-view-program-selection '((output-pdf "Evince")))

(setq make-backup-files nil) ; stop creating backup~ files
(setq auto-save-default nil) ; stop creating #autosave# files

;; auto close bracket insertion. New in emacs 24
(electric-pair-mode 1)

;; turn on highlight matching brackets when cursor is on one
(show-paren-mode 1)


(setq inhibit-startup-screen t)


(add-to-list 'load-path "/home/aragorn/texlive/2018/texmf-dist/asymptote")
(autoload 'asy-mode "asy-mode.el" "Asymptote major mode." t)
(autoload 'lasy-mode "asy-mode.el" "hybrid Asymptote/Latex major mode." t)
(autoload 'asy-insinuate-latex "asy-mode.el" "Asymptote insinuate LaTeX." t)
(add-to-list 'auto-mode-alist '("\\.asy$" . asy-mode))

(setq column-number-mode t)

(setq line-number-mode t)


(setq py-install-directory "~/.emacs.d/site-lisp/python-mode

Re: [NTG-context] Emacs + latest beta

2018-08-29 Thread Fabrice Couvreur
Hello,
Before considering modifications, here's what I get when I do which context
:

Setting "/home/aragorn/context/tex" as ConTeXt root.
[aragorn@fab ~]$ which context
/home/aragorn/context/tex/texmf-linux-64/bin/context
[aragorn@fab ~]$

$ pacman -Qs texlive
>

 [root@fab aragorn]# pacman -Qs texlive
[root@fab aragorn]#

$ pacman -Qs emacs
>

 [root@fab aragorn]# pacman -Qs emacs
local/emacs 26.1-2
The extensible, customizable, self-documenting real-time display editor
local/emacs-python-mode 6.2.3-1
Python mode for Emacs
[root@fab aragorn]#

you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>


To be able to test with the
texlive context binary and context standalone context binary
.


The next in the next message after restarting my PC ...

Fabrice


Le mer. 29 août 2018 à 04:58, Vladimir Lomov  a écrit :

> Hello,
> ** Fabrice Couvreur [2018-08-28 11:18:58 +0200]:
>
> > Hi Vladimir,
>
> > I do not use Arch Linux repositories to install  texlive 2018 packages
>
> Some texlive-* packages could be installed as dependencies of other
> packages. You may check if your system has any texlive package:
>
>   $ pacman -Qs texlive
>
> > but I installed texlive 2018 "scheme-full" with tlmgr -gui  in
> > /home/aragorn /texlive/2018.  I then make regular updates in the same
> > way. No texlive traces in the \usr\share\ directory or elsewhere.
>
> I prefer to rely on package manager.
>
> > Standalone Context is also installed in my home directory. However,
> > Emacs is installed from the Arch Linux repositories and is located in
> > /usr/share/emacs.
>
>   $ pacman -Qs emacs
>
> > So I have to add the path of texlive 2018 ?
> > Maybe you do not need to add the Context Standalone path ?
> > My ~/.profile file would be this :
> >
> > source /home/aragorn/context/tex/setuptex
> > export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
> > export PATH = $ PATH: /home/aragorn /bin
>
> This part is a bit strange:
> - in message
>   https://mailman.ntg.nl/pipermail/ntg-context/2018/092418.html
>   you mentioned that commands run in terminal worked fine, but you
>   invoked them by full path;
>
> - in the same message you set PATH in emacs as
>
> (setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
>
>   (I have to admit that I didn't know it is possible to use '$PATH' in
>   setenv), so it prepends path to context binary to PATH list. The above
>   lines do opposite: they append path to context binary to the end of
>   PATH list.
>
>   The first line, 'source ...', helps here because 'setuptex' in turns
>   prepend path to context binary to PATH.
>
> When you invoke 'context' in terminal (I assume it is bash shell) the
> shell searches program in current directory (depends on configuration)
> and then in PATH, the first wins. So to use context from ConTeXt
> standalone you may simply do
>
>   $ export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH
>
> either in terminal or in ~/.profile. You may always check if this is
> true by runnig
>
>   $ command -v context
>
> (for bash shell) or
>
>   $ which context
>
> Returning to your problem. I looked closely again in messages with
> output from context and I don't understand what may cause the error.
> Seems that Emacs uses correct context (according to loading files).
> Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
> Emacs?
>
> > Regards,
> > Fabrice
> >
>
> [...]
>
> ---
> WBR, Vladimir Lomov
>
>
> --
> Uncontrolled power will turn even saints into savages.  And we can all
> be counted on to live down to our lowest impulses.
> -- Parmen, "Plato's Stepchildren", stardate 5784.3
>
> ___
> 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] Emacs + latest beta

2018-08-28 Thread Vladimir Lomov
Hello,
** Fabrice Couvreur [2018-08-28 11:18:58 +0200]:

> Hi Vladimir,

> I do not use Arch Linux repositories to install  texlive 2018 packages

Some texlive-* packages could be installed as dependencies of other
packages. You may check if your system has any texlive package:

  $ pacman -Qs texlive

> but I installed texlive 2018 "scheme-full" with tlmgr -gui  in
> /home/aragorn /texlive/2018.  I then make regular updates in the same
> way. No texlive traces in the \usr\share\ directory or elsewhere.

I prefer to rely on package manager.

> Standalone Context is also installed in my home directory. However,
> Emacs is installed from the Arch Linux repositories and is located in
> /usr/share/emacs.

  $ pacman -Qs emacs

> So I have to add the path of texlive 2018 ?
> Maybe you do not need to add the Context Standalone path ?
> My ~/.profile file would be this :
> 
> source /home/aragorn/context/tex/setuptex
> export PATH = $ PATH: /home/aragorn/texlive/2018/bin/x86_64-linux
> export PATH = $ PATH: /home/aragorn /bin

This part is a bit strange:
- in message
  https://mailman.ntg.nl/pipermail/ntg-context/2018/092418.html
  you mentioned that commands run in terminal worked fine, but you
  invoked them by full path;

- in the same message you set PATH in emacs as

(setenv "PATH" "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)

  (I have to admit that I didn't know it is possible to use '$PATH' in
  setenv), so it prepends path to context binary to PATH list. The above
  lines do opposite: they append path to context binary to the end of
  PATH list.

  The first line, 'source ...', helps here because 'setuptex' in turns
  prepend path to context binary to PATH.

When you invoke 'context' in terminal (I assume it is bash shell) the
shell searches program in current directory (depends on configuration)
and then in PATH, the first wins. So to use context from ConTeXt
standalone you may simply do

  $ export PATH=$HOME/context/tex/texmf-linux-64/bin:$PATH

either in terminal or in ~/.profile. You may always check if this is
true by runnig

  $ command -v context

(for bash shell) or

  $ which context

Returning to your problem. I looked closely again in messages with
output from context and I don't understand what may cause the error.
Seems that Emacs uses correct context (according to loading files).
Could you show in full your ~/.emacs file? Do you use AUCTeX or bare
Emacs?

> Regards,
> Fabrice
> 

[...]

---
WBR, Vladimir Lomov


-- 
Uncontrolled power will turn even saints into savages.  And we can all
be counted on to live down to our lowest impulses.
-- Parmen, "Plato's Stepchildren", stardate 5784.3


signature.asc
Description: PGP signature
___
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] Emacs + latest beta

2018-08-26 Thread Vladimir Lomov
Hello,
** Hans Hagen [2018-08-24 16:39:54 +0200]:

> On 8/24/2018 3:48 PM, Vladimir Lomov wrote:
> 
>> I don't know why you get "damaged" pdf file (in fact how do you know
>> that file is damaged?) but "TEXMFCNF" is special variable that I uses to
>> tweak TeX Live configuration for my latex workflow but context
>> (standalone and from TL) refuses to work if this variable is set (in
>> terminal I do 'unset' while in Emacs I set its value to 'nil' because
>> this is identical to "unset" it). The "TEXROOT" variable I found in
>> update script, I'm not sure if context requires it to work but IMHO, it
>> is harmless. And the last variable "TEXMFCACHE" I use to force context
>> to use ~/.cache for "luatex-cache" directory and not "pollute" my home
>> directory (without it the "luatex-cache" directory will be created in
>> $HOME directory).
> 
> context does listen to some of these variables but all lookups are done
> independent of kpse,

And I suspect this causes strange behaviour of context in my case. I have

$ echo $TEXMFCNF
/home/vladimir/.texlive2018/texmf-config/web2c:

The last colon is kpse feature to use not only the first texmf.cnf
(https://www.tug.org/texinfohtml/kpathsea.html#Config-files) but all
others (I use personal texmf.cnf to adjust some TEXMF variables for my
latex workflow). With that TEXMFCNF context can't find its files (this
is for context from TeX Live:
 8< ---
mtxrun  | forcing cache reload
resolvers   | resolving | looking for regular 'texmfcnf.lua' on given path 
'/home/vladimir/.texlive2018/texmf-config/web2c:' from specification 
'/home/vladimir/.texlive2018/texmf-config/web2c:'
resolvers   | resolving | looking for fallback 'contextcnf.lua' on given 
path '/home/vladimir/.texlive2018/texmf-config/web2c:' from specification 
'/home/vladimir/.texlive2018/texmf-config/web2c:'
resolvers   | resolving |
resolvers   | resolving | warning: no lua configuration files found
resolvers   | resolving | no texmf paths are defined (using TEXMF)
resolvers   | resolving |
mtxrun  | the resolver databases are not present or outdated
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-context.lua' using hash 
'lua::mtx-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-contexts.lua' using hash 
'lua::mtx-contexts.lua'
resolvers   | resolving | remembered file 'mtx-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-t-context.lua' using hash 
'lua::mtx-t-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'mtx-t-contexts.lua' using hash 
'lua::mtx-t-contexts.lua'
resolvers   | resolving | remembered file 'mtx-t-context.lua'
resolvers   | resolving | using suffix based filetype 'lua'
resolvers   | resolving | remembering file 'context.lua' using hash 
'lua::context.lua'
mtxrun  | unknown script 'context.lua' or 'mtx-context.lua'
 8< ---

). I didn't try to figure out how to "fix" this, I simply unset that variable
when I use context (both standalone and from TeX Live).

> basically you only need to set the path or run context
> / mtxrun with a full path, often from an editor
> /mtxrun --script context 
>
> works ok

context script do exactly that.

> Hans

---
WBR, Vladimir Lomov

-- 
If you ever want to have a lot of fun, I recommend that you go off and program
an imbedded system.  The salient characteristic of an imbedded system is that
it cannot be allowed to get into a state from which only direct intervention
will suffice to remove it.  An imbedded system can't permanently trust
anything it hears from the outside world.  It must sniff around, adapt,
consider, sniff around, and adapt again.  I'm not talking about ordinary
modular programming carefulness here.  No.  Programming an imbedded system
calls for undiluted raging maniacal paranoia.  For example, our ethernet front
ends need to know what network number they are on so that they can address and
route PUPs properly.  How do you find out what your network number is?  Easy,
you ask a gateway.  Gateways are required by definition to know their correct
network numbers.  Once you've got your network number, you start using it and
before you can blink you've got it wired into fifteen different sockets spread
all over creation.  Now what happens when the panic-stricken operator realizes
he was running the wrong version of the gateway which was giving out the wrong
n

Re: [NTG-context] Synctex + Sumatra + TextPad

2018-08-21 Thread Hans Hagen

On 8/21/2018 9:23 PM, Procházka Lukáš Ing. wrote:

Hello,

this question extends the "[NTG-context] future versions - synctex" thread.

I'm using TextPad for editing Ctx source files, PdfXChange Viewer to 
view PDFs, both on Windows.


After reading some recent posts and after studying some web sources - 
especially


 [a] https://www.sumatrapdfreader.org/docs/DDE-Commands.html for 
SumatraPDF viever and


 [b] 
https://tex.stackexchange.com/questions/116981/how-to-configure-texniccenter-2-0-with-sumatra-2013-2016-version/116994#116994 
for inspiration how to make TXC interoperate with Sumatra,


dunno

I would like to provide "click-in-PDF-go-to-source" functionality - be 
Sumatra the viewer for this case.


Questions are:
 
1. How to run Sumatra so that it opens a PDF file AND reacts somehow to 
a mouse click, in order to provide a command to get to the corresponding 
place in the source file?


 (IIUC, Sumatra provides such functionality, as e.g. TeXnic Center 
use it. [b].)


I guess that I have to configure Sumatra somehow, or to launch Sumatra 
with some command line parameters, so that when I click a point in the 
PDF (maybe while also holding CTRL or something - but it is a detail), a 
command is launched to open the source file in the editor and go to a 
particular line.


from the workflow manual:

Of course you need to configure the viewer to respond to the request for 
editing. In Sumatra combined with SciTE the magic command is:


c:\data\system\scite\wscite\scite.exe "%f" "-goto:%l"

2. What should be the command line parameters passed to Sumatra to 
provide the linkage "open PDF-source at line"?


config file

I deduce also that such command should call "mtxrun --script synctex" 
somehow (which will call 
"...\tex\texmf-context\scripts\context\lua\mtx-synctex.lua") as the 
"mtx-synctex" is able to read the .synctex produced during compilation 
of .tex files.


no, because the lib is hard coded in the sumatra bin so you need to 
cross your fingers


I deduce also that "mtx-synctex" calls the editor (which the user uses 
to edit source files) in the manner that it tells the editor "open file 
(...) and go to line (...).
Existing "mtx-synctex" is "aware" of "scite" editor, which is - next to 
"console" - the only editor pre-configured.


pdf viewers use the lib .. what we're discussing is hwo to make them 
call a program instead


3. What code should be added into "mtx-synctex" in order to make TextPad 
an editor known to "mtx-synctex"?


dunno, i never used textpad  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
___

[NTG-context] Synctex + Sumatra + TextPad

2018-08-21 Thread Procházka Lukáš Ing .

Hello,

this question extends the "[NTG-context] future versions - synctex" thread.

I'm using TextPad for editing Ctx source files, PdfXChange Viewer to view PDFs, 
both on Windows.

After reading some recent posts and after studying some web sources - especially

[a] https://www.sumatrapdfreader.org/docs/DDE-Commands.html for 
SumatraPDF viever and

[b] 
https://tex.stackexchange.com/questions/116981/how-to-configure-texniccenter-2-0-with-sumatra-2013-2016-version/116994#116994
 for inspiration how to make TXC interoperate with Sumatra,

I would like to provide "click-in-PDF-go-to-source" functionality - be Sumatra 
the viewer for this case.

Questions are:


1. How to run Sumatra so that it opens a PDF file AND reacts somehow to a mouse 
click, in order to provide a command to get to the corresponding place in the 
source file?

(IIUC, Sumatra provides such functionality, as e.g. TeXnic Center use 
it. [b].)

I guess that I have to configure Sumatra somehow, or to launch Sumatra with 
some command line parameters, so that when I click a point in the PDF (maybe 
while also holding CTRL or something - but it is a detail), a command is 
launched to open the source file in the editor and go to a particular line.


2. What should be the command line parameters passed to Sumatra to provide the linkage 
"open PDF-source at line"?

I deduce also that such command should call "mtxrun --script synctex" somehow (which will call 
"...\tex\texmf-context\scripts\context\lua\mtx-synctex.lua") as the "mtx-synctex" is able 
to read the .synctex produced during compilation of .tex files.

I deduce also that "mtx-synctex" calls the editor (which the user uses to edit 
source files) in the manner that it tells the editor "open file (...) and go to line 
(...).
Existing "mtx-synctex" is "aware" of "scite" editor, which is - next to 
"console" - the only editor pre-configured.

So:


3. What code should be added into "mtx-synctex" in order to make TextPad an editor known 
to "mtx-synctex"?

I found and tried that command e.g. 'C:\Program Files\TextPad 7\system\ddeopn32.exe" 
TextPad.dde Test.mkiv(40)' successfully opens "Test.mkiv" (being open before) and 
scrolls to line #40.

(TextPad location may vary - depending on version installed - can be e.g.:

C:\Program Files\TextPad 7
C:\Program Files (x86)\TextPad 7
C:\Program Files\TextPad 8
...
)

Any idea would be appreciated...

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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] future versions - synctex

2018-08-21 Thread Aditya Mahajan

On Tue, 21 Aug 2018, Hans Hagen wrote:


On 8/21/2018 3:04 PM, Aditya Mahajan wrote:

On Tue, 21 Aug 2018, Hans Hagen wrote:

Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), 
namely when user "tunes" the docs to their final stage, would be great.
I think that the current approach to hard code synctex libraries into a 
viewer is a limitation (instead an editor should call an external program 
with the page and coordinates so that an external program can then look at 
the synctex file and decide where to go in the editor. That way more 
sophisticated support is possible than the now hard coded heuristics. Keep 
in mind that these heuristics are tuned for latex and from context we 
generate the real minimal amount of synctex code that works without 
clashing with these heuristics. If that were not that case is would be 
unuseable.


Anyhow, there's only so much i can do about it (i'm not going to patch 
viewers). Currently synctex is mostly working for decent structured source 
(can be multiple files).


Which of the existing viewers have this functionality? Last time I tried 
using synctex on linux, almost all viewers gave an error that they could 
not parse synctex file.


I think that is because the format of the synctex file changed.

Is there some documentation on what is the format of the synctex file 
written by ConTeXt and how the external program should be called with page 
and coordinates? With that we can try to raise an issue asking the pdf 
viewers to support that.


context outputs a bare minimum of synctex info: basically it identifies text 
and marks that, so we don't need the whole nested box mess that can confuse 
the parser (think of boxes that lap or are moved or lie about dimensions)


is you have a context synctex file you only see a few levels (basically words 
/ lines) marked


There is a script:

mtxrun --script synctex

basically all an editor has to do is call:

mtxrun --script synctex
 --page=123 --x=400 --y=500
 --editor=scite
 foo.synctex


Are the x and y values in pts (post script points or big points?) 
measured from the top-left corner?


the script will look into the synctex file and figure out where to go to. 
Basically all the viewer needs to do is react to a click/cursor/key 
combination and call mtxrun  with the page and positions (basepoints in 
pdf coordinate space)


How do I configure the editor command, e.g., with VIM, mtxrun will need to 
call:


`vim --servername=VIM --remote +{line_number} {filename}`

What should be the value of `editor` in this 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] future versions - synctex

2018-08-21 Thread Hans Hagen

On 8/21/2018 3:04 PM, Aditya Mahajan wrote:

On Tue, 21 Aug 2018, Hans Hagen wrote:

Anyway, a better support for "pick-in-PDF-and-go-to-source" 
(synctex), namely when user "tunes" the docs to their final stage, 
would be great.
I think that the current approach to hard code synctex libraries into 
a viewer is a limitation (instead an editor should call an external 
program with the page and coordinates so that an external program can 
then look at the synctex file and decide where to go in the editor. 
That way more sophisticated support is possible than the now hard 
coded heuristics. Keep in mind that these heuristics are tuned for 
latex and from context we generate the real minimal amount of synctex 
code that works without clashing with these heuristics. If that were 
not that case is would be unuseable.


Anyhow, there's only so much i can do about it (i'm not going to patch 
viewers). Currently synctex is mostly working for decent structured 
source (can be multiple files).


Which of the existing viewers have this functionality? Last time I tried 
using synctex on linux, almost all viewers gave an error that they could 
not parse synctex file.


I think that is because the format of the synctex file changed.

Is there some documentation on what is the format of the synctex file 
written by ConTeXt and how the external program should be called with 
page and coordinates? With that we can try to raise an issue asking the 
pdf viewers to support that.


context outputs a bare minimum of synctex info: basically it identifies 
text and marks that, so we don't need the whole nested box mess that can 
confuse the parser (think of boxes that lap or are moved or lie about 
dimensions)


is you have a context synctex file you only see a few levels (basically 
words / lines) marked


There is a script:

mtxrun --script synctex

basically all an editor has to do is call:

mtxrun --script synctex
  --page=123 --x=400 --y=500
  --editor=scite
  foo.synctex

the script will look into the synctex file and figure out where to go 
to. Basically all the viewer needs to do is react to a click/cursor/key 
combination and call mtxrun  with the page and positions (basepoints 
in pdf coordinate space)


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] future versions - synctex

2018-08-21 Thread Aditya Mahajan

On Tue, 21 Aug 2018, Hans Hagen wrote:

Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), 
namely when user "tunes" the docs to their final stage, would be great.
I think that the current approach to hard code synctex libraries into a 
viewer is a limitation (instead an editor should call an external 
program with the page and coordinates so that an external program can 
then look at the synctex file and decide where to go in the editor. That 
way more sophisticated support is possible than the now hard coded 
heuristics. Keep in mind that these heuristics are tuned for latex and 
from context we generate the real minimal amount of synctex code that 
works without clashing with these heuristics. If that were not that case 
is would be unuseable.


Anyhow, there's only so much i can do about it (i'm not going to patch 
viewers). Currently synctex is mostly working for decent structured 
source (can be multiple files).


Which of the existing viewers have this functionality? Last time I tried 
using synctex on linux, almost all viewers gave an error that they could 
not parse synctex file.


Is there some documentation on what is the format of the synctex file 
written by ConTeXt and how the external program should be called with page 
and coordinates? With that we can try to raise an issue asking the pdf 
viewers to support that.


Thanks,
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] future versions - synctex

2018-08-21 Thread Hans Hagen

On 8/21/2018 10:00 AM, Procházka Lukáš Ing. wrote:

When building a document (or more precisely: documentation which 
consists of many documents), I'm widely referring to other files via 
\input, \component etc., I'm widely using \defs, \defines and \buffers 
defined in separate files (as these defs are used at more places - so 
let them being defined in one source file) and I'm often generating 
texts by Lua (e.g. tables - being read and parsed from a text in a 
\start/\stopluacode block or e.g. Excel named range read via LuaXls or 
from a .xml - and typeset by a Lua function, which allows simply change 
all \NC into \VL in a particular place).


The lengthy process is to EDIT (almost) finished docs/documentation. And 
at this place, it would be very handy if synctex worked. So I vote for a 
better click-in-PDF-go-to-source support.


in principle you can push  / pop input states but for such a variety of 
input you have to do that yourself in the styles ... and it will quickly 
become a performance issue then


the core will not get that kind of hard coded synctex flip-flopping

fwiw, the xml sub mechanism does support that kind of functionality as 
option (only because a collegue uses xml with deeply nested inclusions 
spread all over a direcory structure)


I don't know anything deep about how sync is provided. But my layman 
point of view would be that whenever a character (or a "box") is to be 
placed on the page (or into output stream), ConTeXt should know which is 
the "deepest - currently read" source file, the line, moreover the 
column - and that position could result into "pick-and-go" position.


only partly ... you don't know where a macro comes from (or what lua 
code generated something) and it makes no sense either to go bakc to 
some macro ... in fact, synctex support in context blocks going to 
styles because those who edit files are not supposed to change styles


things like headers and footers come from styles, not user input

and even much structure stuff comes from elsewhere (like titles of 
sections: they go via lua so there we already need to cheat input 
registration)


In this approach - "boxes" generated by Lua-in-ConTeXt should "jump" on 
\startluacode, \ctxlua, \cldcommand statement...


won't happen ... way too much overhead and it would polute the source 
too (i follow the principle that any new mechanism that gets added will 
not slow down compilation in a measurable way)



Anyway, i can cheat at the tex/lua end if needed and support e.g. titles
but i'm not going to pollute the code with every place where we come
from lua (also because in most cases there is no relation with the
source anyway then). Also, I will not add code that can have an impact
on performance when synctex is turned off.


Synctex should be turned on/off before source files are compiled into 
PDF - via command line option "--synctex" or 
\enabledirectives[system.synctex] before \starttext 
(\enabledirectives[system.synctex] after \starttext (\startcomponent) 
should be ignored?) - that could cause hooking picked Lua functions (or 
taking their "synctex-on" alternatives) - so normally (with synctex off) 
there wouldn't be any performance impact; worse performance would come 
only with synctex on - but it's user's choice.



But for a subset of
constructs that are relatively short in usage it is doable (but doesn't
really qualify as fun -- also, i don't use it myself).


Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), 
namely when user "tunes" the docs to their final stage, would be great.
I think that the current approach to hard code synctex libraries into a 
viewer is a limitation (instead an editor should call an external 
program with the page and coordinates so that an external program can 
then look at the synctex file and decide where to go in the editor. That 
way more sophisticated support is possible than the now hard coded 
heuristics. Keep in mind that these heuristics are tuned for latex and 
from context we generate the real minimal amount of synctex code that 
works without clashing with these heuristics. If that were not that case 
is would be unuseable.


Anyhow, there's only so much i can do about it (i'm not going to patch 
viewers). Currently synctex is mostly working for decent structured 
source (can be multiple files).


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 /

Re: [NTG-context] future versions - synctex

2018-08-21 Thread Procházka Lukáš Ing .

Hello,

a bit later - I was thinking if to react here, after reading all about synctex 
and complicated support for complicatedly assembled source files - but my 
personal experience/wish...


On 7/24/2018 11:02 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Hi Hans, all,



One needed feature that would be of general use is better support for
synctex. Thinking especially of structural elements such as headings,
footnotes, etc. which mostly do not work with synctex - i.e., clicking
on these elements in the pdf do not take one back to the correct
location in the relevant TEX file.


When building a document (or more precisely: documentation which consists of 
many documents), I'm widely referring to other files via \input, \component 
etc., I'm widely using \defs, \defines and \buffers defined in separate files 
(as these defs are used at more places - so let them being defined in one 
source file) and I'm often generating texts by Lua (e.g. tables - being read 
and parsed from a text in a \start/\stopluacode block or e.g. Excel named range 
read via LuaXls or from a .xml - and typeset by a Lua function, which allows 
simply change all \NC into \VL in a particular place).

The lengthy process is to EDIT (almost) finished docs/documentation. And at 
this place, it would be very handy if synctex worked. So I vote for a better 
click-in-PDF-go-to-source support.

On Wed, 25 Jul 2018 01:21:48 +0200, Hans Hagen  wrote:


Synctex is a beast. Basically it is not that useable for context which
is why we have a different implementation with a rather clean, minimal,
and predictable output. Unfortunately the usual approahc is to use a
library for interoreting the synctex files which has too much heuristics
built in. More flexible would be to let the viewer cann an external
program which then can interpret the synctex file based on a page and
position. This also would make it possible to have more clever
synchronization and/or adapt to a macro package. Anyway, were sort of
stuck and can only try to make the best of it.

That said, the context generated synctex file is nornally okay unless we
render from lua, which happens for instance with titles. Just try

\ctxlua{context("foo bar")}

and you will also see that there is no line related positioning.
Tweaking luatex for this is not really an options because whatever
decision we make here will backfire at some point. (I can look into some
option later but it needs bit of thinking)


I don't know anything deep about how sync is provided. But my layman point of view would be that whenever a 
character (or a "box") is to be placed on the page (or into output stream), ConTeXt should know 
which is the "deepest - currently read" source file, the line, moreover the column - and that 
position could result into "pick-and-go" position.

In this approach - "boxes" generated by Lua-in-ConTeXt should "jump" on 
\startluacode, \ctxlua, \cldcommand statement...


Anyway, i can cheat at the tex/lua end if needed and support e.g. titles
but i'm not going to pollute the code with every place where we come
from lua (also because in most cases there is no relation with the
source anyway then). Also, I will not add code that can have an impact
on performance when synctex is turned off.


Synctex should be turned on/off before source files are compiled into PDF - via command line option 
"--synctex" or \enabledirectives[system.synctex] before \starttext 
(\enabledirectives[system.synctex] after \starttext (\startcomponent) should be ignored?) - that 
could cause hooking picked Lua functions (or taking their "synctex-on" alternatives) - so 
normally (with synctex off) there wouldn't be any performance impact; worse performance would come 
only with synctex on - but it's user's choice.


But for a subset of
constructs that are relatively short in usage it is doable (but doesn't
really qualify as fun -- also, i don't use it myself).


Anyway, a better support for "pick-in-PDF-and-go-to-source" (synctex), namely when user 
"tunes" the docs to their final stage, would be great.

Best regards,

Lukas


(One complication is that for instance fixing it for some constructs
will break it for xml input which also supports synctex.)

Hans



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | 
IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

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

[NTG-context] Fwd: Problem of compiling a file with Emacs

2018-08-01 Thread Fabrice Couvreur
> >>
> >> 2018-07-30 16:02 GMT+02:00 Lizardo Reyna  >> <mailto:far...@disroot.org>>:
> >>
> >>
> >> I had a similar issue in emacs few months ago. I use an
> >> Ubuntu based
> >> GNU/Linux distribution.
> >>
> >>  My solution was start a new terminal to execute the
> >> commands in .bashrc
> >> file. When it works, a message will appear in the top of
> >> the terminal.
> >> "Setting "/home/farliz/context/tex" as ConTeXt root."
> >>
> >> Then execute emacs from that terminal typing  $ emacs &.
> >> This was the
> >> only way I got run conTeXt from emacs.
> >>
> >> I'm not advanced GNU/Linux  user, but there are three
> >> configuration
> >> files when login; .bashrc, .bash_profile, and .profile. I
> >> don't know why
> >> this files were not execute automatically when I login, so
> >> the path to
> >> conTeXt bin is not added and setuptex file is not execute.
> >> For this
> >> reason it was necessary to start a new terminal.
> >>
> >> I have my system upgraded and now I don't have problem
> >> with that.
> >>
> >> Regards
> >>
> >>
> >> On 30/07/18 05:45, Fabrice Couvreur wrote:
> >> > Hi,
> >> > I made the changes that you recommend, but it does not
> work
> >> >
> >> > ./emacs
> >> >
> >> >
> >> > (custom-set-variables
> >> >  ;; custom-set-variables was added by Custom.
> >> >  ;; If you edit it by hand, you could mess it up, so be
> >> careful.
> >> >  ;; Your init file should contain only one such instance.
> >> >  ;; If there is more than one, they won't work right.
> >> >  '(ConTeXt-Mark-version "IV")
> >> >  '(ConTeXt-engine "luatex")
> >> >  '(custom-enabled-themes (quote (leuven)))
> >> >  '(package-selected-packages (quote (nova-theme auctex
> >> > (custom-set-faces
> >> >  ;; custom-set-faces was added by Custom.
> >> >  ;; If you edit it by hand, you could mess it up, so be
> >> careful.
> >> >  ;; Your init file should contain only one such instance.
> >> >  ;; If there is more than one, they won't work right.
> >> >  )
> >> >
> >> > ;; SERVER Download (MELPA):
> >> > (when (>= emacs-major-version 24)
> >> >   (require 'package)
> >> >   (add-to-list
> >> >'package-archives
> >> >'("melpa" . "http://melpa.org/packages/;)
> >> >t)
> >> >   (package-initialize))
> >> >
> >> > ;;(setenv "PATH"
> >> "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
> >> >
> >> >
> >> > (setq ConTeXt-mode-hook
> >> >   (lambda () (setq TeX-command-extra-options
> >> "--purgeall")))
> >> >
> >> > (setq-default cursor-type 'bar)
> >> >
> >> > (set-cursor-color "#ff")
> >> >
> >> >
> >> > (setq TeX-view-program-list '(("Evince" "evince %o"))
> >> >   TeX-view-program-selection '((output-pdf "Evince")))
> >> >
> >> > (setq make-backup-files nil) ; stop creating backup~ files
> >> > (setq auto-save-default nil) ; stop creating #autosave#
> >> files
> >> >
> >> > ;; auto close bracket insertion. New in emacs 24
> >> > (electric-pair-m

Re: [NTG-context] Problem of compiling a file with Emacs

2018-08-01 Thread Lizardo Reyna
  >
>> >
>> > (custom-set-variables
>> >  ;; custom-set-variables was added by Custom.
>> >  ;; If you edit it by hand, you could mess it up, so be
>> careful.
>> >  ;; Your init file should contain only one such instance.
>> >  ;; If there is more than one, they won't work right.
>> >  '(ConTeXt-Mark-version "IV")
>> >  '(ConTeXt-engine "luatex")
>> >  '(custom-enabled-themes (quote (leuven)))
>> >  '(package-selected-packages (quote (nova-theme auctex
>> > (custom-set-faces
>> >  ;; custom-set-faces was added by Custom.
>> >  ;; If you edit it by hand, you could mess it up, so be
>> careful.
>> >  ;; Your init file should contain only one such instance.
>> >  ;; If there is more than one, they won't work right.
>> >  )
>> >
>> > ;; SERVER Download (MELPA):
>> > (when (>= emacs-major-version 24)
>> >   (require 'package)
>> >   (add-to-list
>> >    'package-archives
>> >    '("melpa" . "http://melpa.org/packages/;)
>> >    t)
>> >   (package-initialize))
>> >
>> > ;;(setenv "PATH"
>> "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
>> >
>> >
>> > (setq ConTeXt-mode-hook
>> >   (lambda () (setq TeX-command-extra-options
>> "--purgeall")))
>> >
>> > (setq-default cursor-type 'bar)
>> >
>> > (set-cursor-color "#ff")
>> >
>> >
>> > (setq TeX-view-program-list '(("Evince" "evince %o"))
>> >   TeX-view-program-selection '((output-pdf "Evince")))
>> >
>> > (setq make-backup-files nil) ; stop creating backup~ files
>> > (setq auto-save-default nil) ; stop creating #autosave#
>> files
>> >
>> > ;; auto close bracket insertion. New in emacs 24
>> > (electric-pair-mode 1)
>> >
>> > ;; turn on highlight matching brackets when cursor is on one
>> > (show-paren-mode 1)
>> >
>> >
>> > (setq inhibit-startup-screen t)
>> >
>> >
>> > ./bashrc
>> >
>> > export
>> PATH=$PATH:/home/aragorn/context/tex/texmf-linux-64/bin
>> > source ~/context/tex/setuptex
>> > export TEXROOT=/home/aragorn/context/tex
>> > export
>> PATH=$PATH:/home/aragorn/texlive/2018/bin/x86_64-linux
>> >
>> >
>> >
>> >
>> > 2018-07-30 4:16 GMT+02:00 Lizardo M. Reyna Bowen
>> mailto:far...@disroot.org>
>> > <mailto:far...@disroot.org <mailto:far...@disroot.org>>>:
>> > 
>> >     I understand that you can not compile the document
>> with C-c C-c in
>> >     Emacs.
>> >
>> >     I have the following setup of my .bashrc and .init
>> files.
>> >
>> >     BASH:
>> >
>> >     export
>> PATH=$PATH:/home/farliz/context/tex/texmf-linux-64/bin
>> >     source ~/context/tex/setuptex
>> >     export OSFONTDIR="~/.fonts"
>> >     export TEXROOT=~/context/tex
>> >
>> >
>> >     EMACS:
>> >
>> >     (custom-set-variables
>> >      '(ConTeXt-Mark-version "IV")
>> >      '(ConTeXt-engine "luatex"))
>> >
>> >     Using this setup I compile all documents with C-c
>> C-c (AucTex mode).
>> >
>> >
>> >     Cheers
>> >
>> >     --
>> >
>> >     Dr. Lizardo M. Reyna Bowen
>> >     Docente
>> >     Facultad de Ingeniería Agrícola | Universidad
>> Técnica de Manabí
>> >     [Dirección]  Lodana, Santa Ana, Manabí, Ecuador
>> >     [Móvil]  +593  982924637
>> >     PGP Key: 0xa35a15b90ee64e8d
>> >
>> >
>> >
>>
>> -- 
>> Dr. Lizardo M. Reyna Bowen
>> Profesor
>> Facultad de Ingeniería Agrícola | Universidad Técnica de
>> Manabí
>> [Dirección]  Lodana, Santa Ana, Manabí, Ecuador
>> [Móvil]  +593  982924637
>> PGP Key: 0xa35a15b90ee64e8d
>>
>>
>>
> 
> -- 
> Dr. Lizardo M. Reyna Bowen
> Docente
> Facultad de Ingeniería Agrícola | Universidad Técnica de Manabí
> [Dirección]  Lodana, Santa Ana, Manabí, Ecuador
> [Móvil]  +593  982924637
> PGP Key: 0xa35a15b90ee64e8d
> 
> 

-- 
Dr. Lizardo M. Reyna Bowen
Profesor
Facultad de Ingeniería Agrícola | Universidad Técnica de Manabí
[Dirección]  Lodana, Santa Ana, Manabí, Ecuador
[Móvil]  +593  982924637
PGP Key: 0xa35a15b90ee64e8d

___
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] Problem of compiling a file with Emacs

2018-07-31 Thread Lizardo M. Reyna Bowen
I tested the file and conTeXt works well from emacs. The problem seems
to be related with your conTeXt standalone installation. when the file
is compiled, emacs create a log buffer  *... output*.  You could post
that information to look the possible error.

Have you tried reinstalling conTeXt?

attached test.pdf


On 07/31/2018 04:43 AM, Fabrice Couvreur wrote:
> With (setenv "PATH"
> "/home/aragorn/texlive/2018/bin/x86_64-linux/context:$PATH" t)  It
> works properly with C-c C-c
>
>
> With (setenv "PATH"
> "/home/aragorn/context/tex/texmf-linux-64/bin:$PATH" t) It does not
> work with C-c C-c
>
> The compilation is however correct by using a terminal without Emacs
> from the standalone version
> Fabrice
>
> 2018-07-31 10:18 GMT+02:00 Fabrice Couvreur
> mailto:fabrice1.couvr...@gmail.com>>:
>
> Hello,
> I did the same thing as you, but nothing changes. Have you tested
> the file? The expected result is to have the title of the chapter
> with the chapter number in large and light gray color. All
> compiles except the macro that allows to have the chapter number;
> I get a small rectangle instead.
> Fabrice
>
> 2018-07-30 16:02 GMT+02:00 Lizardo Reyna  <mailto:far...@disroot.org>>:
>
>
> I had a similar issue in emacs few months ago. I use an Ubuntu
> based
> GNU/Linux distribution.
>
>  My solution was start a new terminal to execute the commands
> in .bashrc
> file. When it works, a message will appear in the top of the
> terminal.
> "Setting "/home/farliz/context/tex" as ConTeXt root."
>
> Then execute emacs from that terminal typing  $ emacs &. This
> was the
> only way I got run conTeXt from emacs.
>
> I'm not advanced GNU/Linux  user, but there are three
> configuration
> files when login; .bashrc, .bash_profile, and .profile. I
> don't know why
> this files were not execute automatically when I login, so the
> path to
> conTeXt bin is not added and setuptex file is not execute. For
> this
> reason it was necessary to start a new terminal.
>
> I have my system upgraded and now I don't have problem with that.
>
> Regards
>
>
> On 30/07/18 05:45, Fabrice Couvreur wrote:
> > Hi,
> > I made the changes that you recommend, but it does not work
> >
> > ./emacs
> >
> >
> > (custom-set-variables
> >  ;; custom-set-variables was added by Custom.
> >  ;; If you edit it by hand, you could mess it up, so be careful.
> >  ;; Your init file should contain only one such instance.
> >  ;; If there is more than one, they won't work right.
> >  '(ConTeXt-Mark-version "IV")
> >  '(ConTeXt-engine "luatex")
> >  '(custom-enabled-themes (quote (leuven)))
> >  '(package-selected-packages (quote (nova-theme auctex
> > (custom-set-faces
> >  ;; custom-set-faces was added by Custom.
> >  ;; If you edit it by hand, you could mess it up, so be careful.
> >  ;; Your init file should contain only one such instance.
> >  ;; If there is more than one, they won't work right.
> >  )
> >
> > ;; SERVER Download (MELPA):
> > (when (>= emacs-major-version 24)
> >   (require 'package)
> >   (add-to-list
> >    'package-archives
> >    '("melpa" . "http://melpa.org/packages/;)
>     >    t)
> >   (package-initialize))
>     >
> > ;;(setenv "PATH"
> "/home/aragorn/context/tex/texmf-linux-64/bin/:$PATH" t)
> >
> >
> > (setq ConTeXt-mode-hook
> >   (lambda () (setq TeX-command-extra-options "--purgeall")))
> >
> > (setq-default cursor-type 'bar)
> >
> > (set-cursor-color "#ff")
> >
> >
> > (setq TeX-view-program-list '(("Evince" "evince %o"))
> >   TeX-view-program-selection '((output-pdf "Evince")))
> >
> > (setq make-backup-files nil) ; stop creating backup~ files
> > (setq auto-save-default nil) ; stop creating #autosave# files
> >
> > ;; auto close bracket insertion. New in emac

Re: [NTG-context] future versions

2018-07-25 Thread Henning Hraban Ramm
Am 2018-07-25 um 19:50 schrieb Hans Hagen :

>> In any case, I would very much appreciate another “frozen” release like MK 
>> II that one can use for documents that need to be  retypeset over years
>> (like my lecture notes that need an update every few years).
> 
> When we have luatex 1.10 that will be easier because older code can run on a 
> newer engine then.
> 
> But even then, if we make snapshots that can be downloaded for a long time, 
> we need some way to recognize them (by year?).

LilyPond (as a somewhat similar program) requires a version statement in every 
source file; and then there’s a converter script that understands and updates 
all constructs that are part of the official syntax - of course, if you use 
custom scripting (Scheme in this case), you are on your own again.

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] future versions

2018-07-24 Thread Hans Hagen

On 7/24/2018 11:02 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

Hi Hans, all,


One needed feature that would be of general use is better support for 
synctex. Thinking especially of structural elements such as headings, 
footnotes, etc. which mostly do not work with synctex - i.e., clicking 
on these elements in the pdf do not take one back to the correct 
location in the relevant TEX file.
Synctex is a beast. Basically it is not that useable for context which 
is why we have a different implementation with a rather clean, minimal, 
and predictable output. Unfortunately the usual approahc is to use a 
library for interoreting the synctex files which has too much heuristics 
built in. More flexible would be to let the viewer cann an external 
program which then can interpret the synctex file based on a page and 
position. This also would make it possible to have more clever 
synchronization and/or adapt to a macro package. Anyway, were sort of 
stuck and can only try to make the best of it.


That said, the context generated synctex file is nornally okay unless we 
render from lua, which happens for instance with titles. Just try


\ctxlua{context("foo bar")}

and you will also see that there is no line related positioning. 
Tweaking luatex for this is not really an options because whatever 
decision we make here will backfire at some point. (I can look into some 
option later but it needs bit of thinking)


Anyway, i can cheat at the tex/lua end if needed and support e.g. titles 
but i'm not going to pollute the code with every place where we come 
from lua (also because in most cases there is no relation with the 
source anyway then). Also, I will not add code that can have an impact 
on performance when synctex is turned off. But for a subset of 
constructs that are relatively short in usage it is doable (but doesn't 
really qualify as fun -- also, i don't use it myself).


(One complication is that for instance fixing it for some constructs 
will break it for xml input which also supports synctex.)


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] TeXLive and ConTeXt

2018-06-14 Thread Robert Zydenbos
Perhaps it is useful that I mention that this is a MkIV problem on my iMac with 
TeXLive (2018 version). Using MkII, also with XeTeX, everything ran right out 
of the box. For MkIV, I had to run a program to let LuaTeX find all the fonts, 
and then it worked.

Robert
___
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] TeXLive and ConTeXt

2018-06-07 Thread Hans Åberg

> On 7 Jun 2018, at 00:40, Taco Hoekwater  wrote:
> 
> It is interesting (and a bit depressing) that my TL2018 install worked out of 
> the box on my mac.

I got errors, but then I updated the application 'TeX Live Utility' in 
/Applications/TeX/, and then it worked.

So run this program, and also regularly for updates.

Even though the distribution is only released once a year, it is possible to 
keep packages up-to-date.


___
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] Including part of a program source file

2018-04-21 Thread Alan Braslau
Can't one also use matching strings in the range={,}, 
(with the command \typefile)?

Alan

On Sat, 21 Apr 2018 17:29:58 +0200
Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote:

> The verbatim commands have a range key which let you select parts of
> the code,
> you can use line numbers to include a small block (e.g. range={3,10}
> or range {3,+7})
> or you put labels in your code.
> 
> \startbuffer
> % cmd:one:begin
> \define\FirstCommand
>{\dosingleempty\doFirstCommand}
> 
> \def\doFirstCommand[#1]%
>{This is the definition for the first command}
> % cmd:one:end
> 
> % cmd:two:begin
> \define\SecondCommand
>{\dosingleempty\doSecondCommand}
> 
> \def\doSecondCommand[#1]%
>{This is the definition for the second command}
> % cmd:two:end
> \stopbuffer
> 
> \starttext
> \typebuffer[range={cmd:two:begin,cmd:two:end}]
> \stoptext
> 
> Wolfgang
> > N. Raghavendra <mailto:nyraghu27...@gmail.com>
> > 21. April 2018 um 16:00
> > I am writing some notes using ConTeXt, which involves displaying
> > parts of some program source files. At present, I am manually
> > cutting and pasting the parts into the ConTeXt file. Is it possible
> > to make ConTeXt do that for me? I am thinking of including each
> > part of the Coq sources between tags like this:
> >
> > 
> > $ cat src-file
> > 
> > part_to_be_included_1
> > 
> >
> > 
> > part_to_be_included_2
> > 
> > 
> >
> > I would like to say something like
> >
> > \IncludePart{src-file}{tag-1}
> >
> > in my ConTeXt file to get
> >
> > part_to_be_included_1
> >
> > at that place in the PDF output after I run `context'. I would
> > appreciate any advice on how to go about this.
> >
> > Thanks,
> > Raghu.
> >
> > --
> > N. Raghavendra <ra...@hri.res.in>, http://www.retrotexts.net/
> > Harish-Chandra Research Institute, http://www.hri.res.in/
> > ___
> > 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] Including part of a program source file

2018-04-21 Thread N. Raghavendra
At 2018-04-21T17:29:58+02:00, Wolfgang Schuster wrote:

> The verbatim commands have a range key which let you select parts of
> the code, you can use line numbers to include a small block
> (e.g. range={3,10} or range {3,+7}) or you put labels in your code.

Many thanks! It works perfectly, with something like this:

\starttext

\typefile
  [range={beg:8e1e0cb9:6524:4a9b:a58e:6610c8bcf156,
  end:8e1e0cb9:6524:4a9b:a58e:6610c8bcf156}]
  {../coq/univalence/transport/total_path.v}

\typefile
  [range={beg:8edf79a4:6fe4:4a0c:a1a4:5be2ab413b47,
  end:8edf79a4:6fe4:4a0c:a1a4:5be2ab413b47}]
  {../coq/univalence/transport/path_from.v}

\stoptext

Raghu.

--
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] Including part of a program source file

2018-04-21 Thread Wolfgang Schuster
The verbatim commands have a range key which let you select parts of the 
code,
you can use line numbers to include a small block (e.g. range={3,10} or 
range {3,+7})

or you put labels in your code.

\startbuffer
% cmd:one:begin
\define\FirstCommand
  {\dosingleempty\doFirstCommand}

\def\doFirstCommand[#1]%
  {This is the definition for the first command}
% cmd:one:end

% cmd:two:begin
\define\SecondCommand
  {\dosingleempty\doSecondCommand}

\def\doSecondCommand[#1]%
  {This is the definition for the second command}
% cmd:two:end
\stopbuffer

\starttext
\typebuffer[range={cmd:two:begin,cmd:two:end}]
\stoptext

Wolfgang

N. Raghavendra <mailto:nyraghu27...@gmail.com>
21. April 2018 um 16:00
I am writing some notes using ConTeXt, which involves displaying parts
of some program source files. At present, I am manually cutting and
pasting the parts into the ConTeXt file. Is it possible to make ConTeXt
do that for me? I am thinking of including each part of the Coq sources
between tags like this:


$ cat src-file

part_to_be_included_1



part_to_be_included_2



I would like to say something like

\IncludePart{src-file}{tag-1}

in my ConTeXt file to get

part_to_be_included_1

at that place in the PDF output after I run `context'. I would
appreciate any advice on how to go about this.

Thanks,
Raghu.

--
N. Raghavendra <ra...@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] Including part of a program source file

2018-04-21 Thread N. Raghavendra
I am writing some notes using ConTeXt, which involves displaying parts
of some program source files.  At present, I am manually cutting and
pasting the parts into the ConTeXt file.  Is it possible to make ConTeXt
do that for me?  I am thinking of including each part of the Coq sources
between tags like this:


$ cat src-file

part_to_be_included_1



part_to_be_included_2



I would like to say something like

\IncludePart{src-file}{tag-1}

in my ConTeXt file to get

part_to_be_included_1

at that place in the PDF output after I run `context'.  I would
appreciate any advice on how to go about this.

Thanks,
Raghu.

--
N. Raghavendra <ra...@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___
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] BachoTeX 2018 reminder

2018-04-06 Thread Taco Hoekwater
Dear prospect BachoTeX 2018 participants and authors,

this is to remind you that the "normal" BachoTeX 2018
registrations were until March 31st. Trying to be good
to you, we've extended the non-penalty date until
April 10th, so hurry to save!

I also remind and urge you to offer proposals for papers,
workshops and any other ideas. Please contribute!

The conference program  details will be published at
the conference web site, so please watch it.

Again: register now so we can finalize planning.

See you there,

for the Organizing Committee
(-) Jerzy Ludwichowski


___
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] ANNOUNCEMENT: Notepad++ for ConTeXt - Version 0.98

2018-03-05 Thread Idris Samawi Hamid ادريس سماوي حامد
 plugins (notably WebEdit); and, from the
experience of Professor Hamid, several macros and customizations. In the
second phase, a significant part of development was devoted to
translating the xml documentation files of ConTeXt (= the English
interface files that list and classify commands, see below) into the
relevant xml configuration files of Notepad++, and to look for an
efficient way to edit a document while minimizing the need to access the
documentation. One outcome of this effort is the current autocompletion
calltip mechanism, which provides columnar representation of the
documentation for each autocompleted command, and equivalent to that
provided by setup-en.pdf ("ConTeXt commands EN").

(In a ConTeXt distribution it lies at the end of this path:
/tex/texmf-context/doc/context/documents/general/qrcs/setup-en.pdf)

One of the fundamental differences between ConTeXt and traditional
programming languages is the huge quantity of keywords (=commands,
macros) and parameters (= command arguments) in ConTeXt. Fortunately,
nearly all of them are described in the interface files of the
standalone distribution, under

tex/texmf-context/tex/context/interface/mkiv.

Here one finds the file context-en.xml, which is constituted by the
concatenation of all of the the other interface files.

The build.cmd script, under the /scripts folder of Npp-for-ConTeXt.zip,
reads context-en.xml and results in two files, i) /Program Files
(x86)/Notepad++/plugins/Config/ConTeXt.xml, which is used by the ConTeXt
lexer for Notepad++, and ii) /Program Files
(x86)/Notepad++/plugins/APIs/context.xml, which is used by the
autocompletion and calltips mechanism. The build.cmd script is a batch
script that has to be executed outside Notepad++; under the hood it runs
the Python2.7 script command_primitives_api.py with the correct command
line options; if xmllint.exe is installed it checks to make sure that
the files saved are well-formed.

The Npp-for-ConTeXt.zip ships with versions of Config/ConTeXt.xml and
APIs/context.xml that take as reference the official ConTeXt that is
shipped with the TeXLive 2018 distribution (see
https://www.tug.org/texlive/). So the build.cmd script is useful if the
user has a different (possibly updated) standalone distribution.

The switches at command line of command_primitives_api.py are

usage: command_primitives_api_new.py [-h] [-m MTXCMD] [-i IFCFILE] [-u
IFCUFILE] [-c CMDFILE] [-p PRIMFILE] [-d CHARDEF] [-r MACROCHARDEFFILE]

optional arguments: -h, --help show this help message and exit -m
MTXCMD, --mtxcmd MTXCMD ConTeXt mtxrun program -i IFCFILE, --ifcfile
IFCFILE ConTeXt XML interface file -u IFCUFILE, --ifcufile IFCUFILE
ConTeXt XML interface user file -c CMDFILE, --cmdfile CMDFILE ConTeXt
XML command file -p PRIMFILE, --primfile PRIMFILE ConTeXt primitives.lua
script -d CHARDEF, --chardef CHARDEF ConTeXt char-def.lua file -r
MACROCHARDEFFILE, --macrochardeffile MACROCHARDEFFILE ConTeXt
macro-chardef.lua script

and the build.cmd sets the following

-m mtxrun.exe ^ -c
%CTXDIR%\tex\texmf-context\tex\context\base\mkiv\mult-prm.lua ^ -i
%CTXDIR%\tex\texmf-context\tex\context\interface\mkiv\context-en.xml ^
-d %CTXDIR%\tex\texmf-context\tex\context\base\mkiv\char-def.lua

The above assumes that the user sets the correct standalone in %CTXDIR%.
It's important to note that this is the standalone also used by the
ConTeXt plugin. Usually there is no need to pass --primfile PRIMFILE and
--macrochardeffile MACROCHARDEFFILE, because they should be generated by
the python script. The option --ifcufile IFCUFILE is useful if the user
wants to add the documentation of a set of private macros: in this case
it's necessary to know the syntax of that documentation, where the
ConTeXt XML command files are taken as reference.

Another component introduced in the plugin is the user's macro window,
enabled with Ctrl+'-'. The idea is to offer to the user a way to quickly
insert one's most used macros, set and saved under the section entitled
[Markup] in

/Roaming/Notepad++/plugins/config/ConTeXt.ini

The body of the macro to insert must contain a single '|', which is a
placeholder for the selected text; the macro can be selected with the
mouse or by hitting the Return key. It may also be selected by typing a
shortcut key. The Esc key closes the window. For example, if the user
needs to insert a macro '\framed', as in

\framed[frame=on]{...}

(where '...' signifies some text to be operated upon by the command),
and with a single key 'f' as shortcut, the text to set in ConTeXt.ini is

(f)\framed[frame=on]{|}

Note the full parenthesis that enclose the key shortcut - '(f)' in this
case. The user's macros stored in ConTeXt.ini can be edited from
Plugin->ConTeXt->Edit Config; once saved it has to be re-loaded with
Plugin->ConTeXt->Load Config (no need to restart Notepad++). For the
sake of readability, the string '%n' in the body of the text is
translated into a newline. The shortcut can be a sequence o

Re: [NTG-context] synctex file is not compressed

2018-02-27 Thread Hans Hagen

On 2/26/2018 4:53 PM, Ulrike Fischer wrote:

I seem to be not able to get a synctex.gz instead of a synctex file.

I tried
  context --synctex=1 file
and
  context --synctex=-1 file
but in both cases a simple synctex-file is created.

Is this normal?

Sure, because

- context doesn't use syntex's internal code but uses its own logic
- there is no gain in zipping
- we have relative small synctex files because we use a different logic

the way to enable synctex is in the document (see workflows.pdf):

\setupsynctex[state=start]

it's a bit pitty that pdf viewers have hard coded syntex file parsing 
instead of calling a program with coordinates as arguments that starts 
the editor because that would make a more powerful combo and give room 
for additional functionality:


> mtxrun --script synctex

but anyway, i can only test with summatra pdf and it works ok here (last 
time i checked)


a collegue uses synctex with documents that are constructed runtime of 
thousands of small xml files deeply nested and filesize of the synctex 
file is neglectable by the size fo the pdf


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] add to \setbuffer

2018-01-10 Thread Hans Hagen

On 1/10/2018 6:30 PM, Wolfgang Schuster wrote:



dr. Hans van der Meer <mailto:havdm...@ziggo.nl>
10. Januar 2018 um 13:45
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put 
something in this buffer.
But is it possible to add something at the end of this buffer at a 
later moment?


You can use the “buffers.append” and “buffers.prepend” functions to add 
text to a buffer.


\starttext

\startbuffer[a]
First
\stopbuffer

\startbuffer[b]
Second
\stopbuffer

\startbuffer[c]
Third
\stopbuffer

\startluacode

buffers.append("b",buffers.getcontent("c"))

buffers.prepend("b",buffers.getcontent("a"))

\stopluacode

\getbuffer[b]

\stoptext

or just getbuffer[a,b,c]


-
  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] add to \setbuffer

2018-01-10 Thread Wolfgang Schuster



dr. Hans van der Meer <mailto:havdm...@ziggo.nl>
10. Januar 2018 um 13:45
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put 
something in this buffer.
But is it possible to add something at the end of this buffer at a 
later moment?


You can use the “buffers.append” and “buffers.prepend” functions to add 
text to a buffer.


\starttext

\startbuffer[a]
First
\stopbuffer

\startbuffer[b]
Second
\stopbuffer

\startbuffer[c]
Third
\stopbuffer

\startluacode

buffers.append("b",buffers.getcontent("c"))

buffers.prepend("b",buffers.getcontent("a"))

\stopluacode

\getbuffer[b]

\stoptext

Wolfgang
___
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] add to \setbuffer

2018-01-10 Thread dr. Hans van der Meer
With \setbuffer[ABUFFER] .. \endbuffer I can program a macro to put something 
in this buffer.
But is it possible to add something at the end of this buffer at a later moment?

Hans van der Meer


___
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] xtables: rowwise, columnwise, and cellwise opera

2018-01-07 Thread Wolfgang Schuster



jdh <mailto:dhen...@gmail.com>
6. Januar 2018 um 23:42
You're right, the manual says what you pasted.
I agree that it is logical and makes sense, but the actual program 
does not

do it. My version is: "mtx-context

I was using: version: 2017.08.29 19:35
I updated to: version: 2018.01.05 19:26


Reality does not match the manual page you quated.
I recommend that you test before you send out manual pages which are 
not accurate with the actual processing.


The description for the \startxcell command was written two years ago 
and nothing

has changed since then but you have use the \setupxtable command to create
a named setup.

\setupxtable[emphasized][foregroundstyle=italic]

\starttext

\startxtable[width=4cm,height=4cm,align={middle,lohi}]
\startxrow
\startxcell
Default settings
\stopxcell
\startxcell[emphasized]
Named settings
\stopxcell
\stopxrow
\startxrow
\startxcell[foregroundcolor=red]
Direct settings
\stopxcell
\startxcell[emphasized][foregroundcolor=red]
Named + direct settings
\stopxcell
\stopxrow
\stopxtable

\stoptext

Wolfgang
___
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] xtables: rowwise, columnwise, and cellwise opera

2018-01-07 Thread jdh

You're right, the manual says what you pasted.
I agree that it is logical and makes sense, but the actual program does not
do it.  My version is:  "mtx-context

I was using:  version: 2017.08.29 19:35
I updated to: version: 2018.01.05 19:26


Reality does not match the manual page you quated.
I recommend that you test before you send out manual pages which are not 
accurate with the actual processing. 

Regards




Alan Braslau <braslau.l...@comcast.net> wrote:

> According to i-context.pdf ($CONTEXTHOME/tex/context/interface/mkiv)
> 
>   1 2
> \startxcell [...] [..,..=..,..] ... \stopxcell
>  OPT   OPT
> 1 NAME
> 2 nx=NUMBER
>   ny=NUMBER
>   nc=NUMBER
>   nr=NUMBER
> inherits: \setupxtable
> 
> 
> 
> On Fri, 05 Jan 2018 15:50:51 -0800
> "jdh" <dhen...@gmail.com> wrote:
> 
> > 
> > No it wont compile with two groups.  It takes the second as content.
> > It may be a version difference.  But it likewise would not work as is
> > for me with puting the key=value into the 1st bracket pair.
> > 
> > Version parsing difference?
> > 
> > Alan Braslau <braslau.l...@comcast.net> wrote:
> > 
> > > No, in ConTeXt one NEVER, EVER mixes key=value lists with simple
> > > keywords (parsing would otherwise be very less efficient).
> > > 
> > > The feature to be able to declare a "namespace" (such as the
> > > one called "suffix") having particular values of its parameters is
> > > really powerful. Think of it as "xtable:suffix" that inherits from
> > > the namespace "xtable" but then lives a life of its own...
> > > 
> > > \startxcell takes and optional namespace specification, i.e.
> > > [suffix] and an optional key=value list of parameters, i.e.
> > > [ny=2,...]. These parameters override locally the values that are
> > > otherwise carried by the namespace.
> > > 
> > > ConTeXt gurus: I hope that I have gotten this explanation right.
> > > 
> > > Alan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > On Fri, 5 Jan 2018 17:12:40 +0100
> > > Floris van Manen <v...@klankschap.nl> wrote:
> > > 
> > > > apparently
> > > > 
> > > > >\startxcell[suffix][ny=2] cell a 1 \stopxcell  
> > > > 
> > > > should be
> > > > 
> > > >\startxcell[suffix, ny=2] cell a 1 \stopxcell
> > > > 
> > > > 
> > > > 
> > > > 
> > > > > On 5 Jan 2018, at 14:32, Hans Hagen <pra...@wxs.nl> wrote:
> > > > > 
> > > > > On 1/5/2018 4:57 AM, Henri wrote:  
> > > > >> Dear list,
> > > > >> The Natural Tables have this great feature that I can control
> > > > >> the layout with rowwise, columnwise, or cellwise setups.  For
> > > > >> example: \starttext
> > > > >> \setupTABLE [frame=off]
> > > > >> \setupTABLE [r] [first] [topframe=on,bottomframe=on,style=bold]
> > > > >> \setupTABLE [c] [2] [style=italic]
> > > > >> \setupTABLE [2] [3] [color=red]
> > > > >> \setupTABLE [r] [last]  [bottomframe=on]
> > > > >> \startTABLE
> > > > >>   \NC A \NC A \NC A \NC\NR
> > > > >>   \NC B \NC B \NC B \NC\NR
> > > > >>   \NC C \NC C \NC C \NC\NR
> > > > >>   \NC D \NC D \NC D \NC\NR
> > > > >>   \NC E \NC E \NC E \NC\NR
> > > > >> \stopTABLE
> > > > >> \stoptext  
> > > > > 
> > > > > it's also an extremely inefficient method
> > > > >   
> > > > >> How can I do such a thing with Extreme Tables?  If it is not
> > > > >> yet possible I'd like to request the inclusion of such a
> > > > >> mechanism.  
> > > > > from the manual, named setups:
> > > > > 
> > > > > \setupxtable[suffix][align=middle,foregroundcolor=red]
> > > > > \setupxtable[blabla][foregroundstyle=slanted]
> > > > > \setupxtable[crap]  [foregroundcolor=blue]
> > > > > \setupxtable[bold]  [crap][foregroundstyle=bold]
> > > > > 
> > > > > \startxtable % [frame=off]
> > > > >\startxtablehead
> > > > >\startxrow[bold]
> > > > >\startxcell[suffix]   head a \stopxcell
> > > &

Re: [NTG-context] German letter style

2017-12-05 Thread Henning Hraban Ramm
Am 2017-12-05 um 17:28 schrieb Floris van Manen <v...@klankschap.nl>:
> lua error   > lua error on line 30 in file 
> /Applications/ConTeXt/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:
> 
> ...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument 
> #1 to 'gmatch' (string expected, got nil)
> stack traceback:
>   [C]: in function 'gmatch'
>   ...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in 
> function 'registercode'
>   [ctxlua]:1: in main chunk
> 
> 20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> 21 %C GNU General Public License for more details.
> 22 %C
> 23 %C You should have received a copy of the GNU General Public License
> 24 %C along with this program.  If not, see 
> <http://www.gnu.org/licenses/>.
> 25 
> 26 \unprotect
> 27 
> 28 % Lua functions for the core and also for the frontend modules
> 29 
> 30 >>  \ctxloadluafile{s-cor-00}


This is a bug (that I urge to fix for a while) and has nothing to do with 
letters, it’s just also triggered by the letter module.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] German letter style

2017-12-05 Thread Floris van Manen

> On 5 Dec 2017, at 16:41, Jan U. Hasecke <juh+ntg-cont...@mailbox.org> wrote:
> 
> contextgarden is full of letter examples. But even the first simple
> example here http://wiki.contextgarden.net/Letter#Example does not
> compile.

same here:


mtx-context | run 1: luatex 
--fmt="/Applications/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
 --jobname="test" 
--lua="/Applications/ConTeXt/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
 --no-parse-first-line --c:currentrun=1 
--c:fulljobname="/Users/vm/Desktop/tex/test.tex" 
--c:input="/Users/vm/Desktop/tex/test.tex" --c:kindofrun=1 --c:maxnofruns=9 
"cont-yes.mkiv"
This is LuaTeX, Version 1.05.0 (TeX Live 2017)
 system commands enabled.
open source > level 1, order 1, name 
'/Applications/ConTeXt/tex/texmf-context/tex/context/base/mkiv/cont-yes.mkiv'
system  >
system  > ConTeXt  ver: 2017.11.01 15:58 MKIV beta  fmt: 2017.11.8  
int: english/english
system  >
system  > 'cont-new.mkiv' loaded
open source > level 2, order 2, name 
'/Applications/ConTeXt/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
close source> level 2, order 2, name 
'/Applications/ConTeXt/tex/texmf-context/tex/context/base/mkiv/cont-new.mkiv'
system  > files > jobname 'test', input '/Users/vm/Desktop/tex/test', 
result 'test'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
open source > level 2, order 3, name '/Users/vm/Desktop/tex/test.tex'
modules > 'letter' is loaded
open source > level 3, order 4, name 
'/Applications/ConTeXt/tex/texmf-modules/tex/context/third/letter/base/s-cor-01.mkvi'
modules > 'cor-00' is loaded
open source > level 4, order 5, name 
'/Applications/ConTeXt/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'

lua error   > lua error on line 30 in file 
/Applications/ConTeXt/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in 
function 'registercode'
[ctxlua]:1: in main chunk

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26 \unprotect
27
28 % Lua functions for the core and also for the frontend modules
29
30 >>  \ctxloadluafile{s-cor-00}
31
32 % Constants and variables
33
34 \startinterface all
35   \setinterfaceconstant {whitespace}  {whitespace}
36   \setinterfaceconstant {backgroundimage} {backgroundimage}
37   \setinterfaceconstant {fromname}{fromname}
38   \setinterfaceconstant {fromaddress} {fromaddress}
39   \setinterfaceconstant {attention}   {attention}
40   \setinterfaceconstant {subject} {subject}


?

lua error   > lua error on line 30 in file 
/Applications/ConTeXt/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...eXt/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in 
function 'registercode'
[ctxlua]:1: in main chunk

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26 \unprotect
27
28 % Lua functions for the core and also for the frontend modules
29
30 >>  \ctxloadluafile{s-cor-00}
31
32 % Constants and variables
33
34 \startinterface all
35   \setinterfaceconstant {whitespace}  {whitespace}
36   \setinterfaceconstant {backgroundimage} {backgroundimage}
37   \setinterfaceconstant {fromname}{fromname}
38   \setinterfaceconstant {fromaddress} {fromaddress}
39   \setinterfaceconstant {attention}   {attention}
40   \setinterfaceconstant {subject} {subject}



mtx-context | fatal error: return code: 1



signature.asc
Description: Message signed with OpenPGP using GPGMail
___
If your question is of interest to others as well, please add an entry to the 
Wiki!


Re: [NTG-context] 'lua.registercode' bug in latest beta

2017-11-26 Thread Hans Hagen

On 11/26/2017 3:05 PM, Marco Patzer wrote:

On Tue, 7 Nov 2017 11:59:51 +0800
Li Yanrui (李延瑞) <liyanrui...@gmail.com> wrote:


Using '\ctxloadluafile'  can get an error:

```
..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad
argument #1 to 'gmatch' (string expected, got nil)
```

It seems to be caused by 'if options ~= ""' in `lua.registercode'.
That empyt string should be 'nil'?


that line should be:

if type(options) == "string" and options ~= "" then


I can confirm the issue, MWE:

\usemodule [letter]
\starttext
\null
\stoptext

throws:

open source > level 4, order 5, name 
'/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'

lua error   > lua error on line 30 in file 
/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: in 
function 'registercode'
[ctxlua]:1: in main chunk

>

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25
26 \unprotect
27
28 % Lua functions for the core and also for the frontend modules
29
30 >>  \ctxloadluafile{s-cor-00}

context: 2017.11.22 13:35

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

Re: [NTG-context] 'lua.registercode' bug in latest beta

2017-11-26 Thread Marco Patzer
On Tue, 7 Nov 2017 11:59:51 +0800
Li Yanrui (李延瑞) <liyanrui...@gmail.com> wrote:

> Using '\ctxloadluafile'  can get an error:
> 
> ```
> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad
> argument #1 to 'gmatch' (string expected, got nil)
> ```
> 
> It seems to be caused by 'if options ~= ""' in `lua.registercode'.
> That empyt string should be 'nil'?

I can confirm the issue, MWE:

\usemodule [letter]
\starttext
\null
\stoptext

throws:

open source > level 4, order 5, name 
'/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi'

lua error   > lua error on line 30 in file 
/tmp/ctx/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...ctx/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: in 
function 'registercode'
[ctxlua]:1: in main chunk

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25 
26 \unprotect
27 
28 % Lua functions for the core and also for the frontend modules
29 
30 >>  \ctxloadluafile{s-cor-00}

context: 2017.11.22 13:35

Marco
___
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] synctex and TeXShop problem

2017-11-21 Thread Hans Hagen

On 11/21/2017 1:18 PM, Ulrike Fischer wrote:

Am Fri, 17 Nov 2017 15:13:56 +0100 schrieb Hans Hagen:


it's not clear to me why a newer parser lib would fail on an older
synctex format (whatever the change is) .. sumatra pdf works (last
updates ayear ago) works ok


synctex fails with lualatex on windows too. And it fails with with
the luatex version 1.06 (which is now in miktex) but not with 1.04
(texlive).

I compared the synctex files of both and the problem is that the
link to the main tex file is missing at the start.

The synctex files refers to a lot positions in input 0 but the file
list starts with

Input:1:D:/MiKTeX2.9/tex/latex/base/article.cls


I added before this line

Input:0:G:/Z-Test/./test-utf8.tex

and then synchronization worked again. Imho this is a luatex bug.

(the texlive synctex starts with number 1 and not 0
  Input:1:G:/Z-Test/./test-utf8.tex)
i noticed this 0 /1 iusue too but it was ok in old viewers so mayeb that 
changed .. fwiw, nothing changed in luatex where we just take the syntex 
code as-is ... actually in sumatra starting at 1 is the only thing that 
works


what i did notice (quick test on linux) is that the error that pops up 
reports a missing source file and shows only the path part which looks 
like a biug in the parser to me


there is not much documentation about the synctex file; actually, if an 
editor would call out to an external program to resolve the location in 
the file that would be more robust and easier to maintain, given the 
one-call-per-document there is not that much gain in using a library in 
the viewer; it would be easier to update and keep in sync with tex too 
as now one depends on updating a viewer


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] 'lua.registercode' bug in latest beta

2017-11-18 Thread Henning Hraban Ramm
Am 2017-11-07 um 08:14 schrieb Henning Hraban Ramm <te...@fiee.net>:

> Am 2017-11-07 um 04:59 schrieb Li Yanrui (李延瑞) <liyanrui...@gmail.com>:
> 
>> Hi,
>> 
>> Using '\ctxloadluafile'  can get an error:
>> 
>> ```
>> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument 
>> #1 to 'gmatch' (string expected, got nil)
>> ```
> 
> Same here:
> 
> lua error   > lua error on line 30 in file 
> /Users/hraban/Library/texmf/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:
> 
> ...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument 
> #1 to 'gmatch' (string expected, got nil)
> stack traceback:
>   [C]: in function 'gmatch'
>   ...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in 
> function 'registercode'
>   [ctxlua]:1: in main chunk
> 
> 20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> 21 %C GNU General Public License for more details.
> 22 %C
> 23 %C You should have received a copy of the GNU General Public License
> 24 %C along with this program.  If not, see 
> <http://www.gnu.org/licenses/>.
> 25 
> 26 \unprotect
> 27 
> 28 % Lua functions for the core and also for the frontend modules
> 29 
> 30 >>  \ctxloadluafile{s-cor-00}
> 
> 
> 
>> It seems to be caused by 'if options ~= ""' in `lua.registercode'. That 
>> empyt string should be 'nil'?
> 
> Yep, after 'context --make' that lets it work for me.
> Thank you!


Why is this still not fixed? It’s so easy, but I don’t like to patch it after 
every update again!

Please change "" to nil in 
tex/texmf-context/tex/context/base/mkiv/luat-cod.lua, line 49!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] 'lua.registercode' bug in latest beta

2017-11-06 Thread Henning Hraban Ramm
Am 2017-11-07 um 04:59 schrieb Li Yanrui (李延瑞) <liyanrui...@gmail.com>:

> Hi,
> 
> Using '\ctxloadluafile'  can get an error:
> 
> ```
> ..ext/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:50: bad argument 
> #1 to 'gmatch' (string expected, got nil)
> ```

Same here:

lua error   > lua error on line 30 in file 
/Users/hraban/Library/texmf/tex/texmf-modules/tex/context/third/letter/base/s-cor-00.mkvi:

...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: bad argument #1 
to 'gmatch' (string expected, got nil)
stack traceback:
[C]: in function 'gmatch'
...xmf/tex/texmf-context/tex/context/base/mkiv/luat-cod.lua:47: in 
function 'registercode'
[ctxlua]:1: in main chunk

20 %C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 %C GNU General Public License for more details.
22 %C
23 %C You should have received a copy of the GNU General Public License
24 %C along with this program.  If not, see <http://www.gnu.org/licenses/>.
25 
26 \unprotect
27 
28 % Lua functions for the core and also for the frontend modules
29 
30 >>  \ctxloadluafile{s-cor-00}



> It seems to be caused by 'if options ~= ""' in `lua.registercode'. That empyt 
> string should be 'nil'?

Yep, after 'context --make' that lets it work for me.
Thank you!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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] Asymptote with Context

2017-11-02 Thread Fabrice Couvreur
Hi Aditya

> Are you using context minimals or texlive?


 With Emacs, I work with context minimals and command 'ConTeXt Full' but I
also tried with texlive  2017.

If you compile the attach ntg71.tex file, do you get ntg71-macro.pdf?


No
Fabrice

2017-11-01 16:49 GMT+01:00 Mojca Miklavec <mojca.miklavec.li...@gmail.com>:

> On 1 November 2017 at 16:29, Ulrike Fischer wrote:
> > Am Wed, 1 Nov 2017 09:50:47 -0400 (EDT) schrieb Aditya Mahajan:
> >
> >> The only reason that I can think of is that "import solids;" is
> >> calling an external program and there are some settings in your
> >> texmfcnf file that is restricting that program to run.
> >
> > I don't know much about asymptote but as I just tried to debug an
> > error message in miktex: Imho the "solids" library calls the three
> > library which tries to use the OpenGL-renderer.
> >
> > In miktex this fails (https://github.com/MiKTeX/miktex/issues/26)
> > and the "solution" is to set the output format to pdf:
> >
> > https://tex.stackexchange.com/questions/398421/miktex-how-
> to-install-glut-library-on-windows/398674#398674
> >
> > Perhaps the problem here is due to a similar issue.
>
> If this has something to do with OpenGL, a properly built asymptote
> might solve the problem. Which OS and which distribution are you
> using?
>
> Mojca
> 
> ___
> 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] Asymptote with Context

2017-11-01 Thread Mojca Miklavec
On 1 November 2017 at 16:29, Ulrike Fischer wrote:
> Am Wed, 1 Nov 2017 09:50:47 -0400 (EDT) schrieb Aditya Mahajan:
>
>> The only reason that I can think of is that "import solids;" is
>> calling an external program and there are some settings in your
>> texmfcnf file that is restricting that program to run.
>
> I don't know much about asymptote but as I just tried to debug an
> error message in miktex: Imho the "solids" library calls the three
> library which tries to use the OpenGL-renderer.
>
> In miktex this fails (https://github.com/MiKTeX/miktex/issues/26)
> and the "solution" is to set the output format to pdf:
>
> https://tex.stackexchange.com/questions/398421/miktex-how-to-install-glut-library-on-windows/398674#398674
>
> Perhaps the problem here is due to a similar issue.

If this has something to do with OpenGL, a properly built asymptote
might solve the problem. Which OS and which distribution are you
using?

Mojca
___
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] Asymptote with Context

2017-11-01 Thread Ulrike Fischer
Am Wed, 1 Nov 2017 09:50:47 -0400 (EDT) schrieb Aditya Mahajan:

> The only reason that I can think of is that "import solids;" is
> calling an external program and there are some settings in your
> texmfcnf file that is restricting that program to run.

I don't know much about asymptote but as I just tried to debug an
error message in miktex: Imho the "solids" library calls the three
library which tries to use the OpenGL-renderer. 

In miktex this fails (https://github.com/MiKTeX/miktex/issues/26)
and the "solution" is to set the output format to pdf:

https://tex.stackexchange.com/questions/398421/miktex-how-to-install-glut-library-on-windows/398674#398674

Perhaps the problem here is due to a similar issue.


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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] Asymptote with Context

2017-11-01 Thread Aditya Mahajan

On Wed, 1 Nov 2017, Fabrice Couvreur wrote:


Hi Aditya,
I continue to test files, some work (ntg70.tex) and some do not
(ntg71.tex). This
seems to depend on imported modules but why ?


Both files work correctly at my end. I don't understand asymptote well 
enough to debug why some imported modules fail. The only reason that I can 
think of is that "import solids;" is calling an external program and there 
are some settings in your texmfcnf file that is restricting that program 
to run.


Are you using context minimals or texlive?

If you compile the attach ntg71.tex file, do you get ntg71-macro.pdf? If 
not, then this is an issue with shell escape restrictions on your system.


Aditya

ntg71.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] Difficulties with learning about ConTeXt

2017-10-23 Thread Pablo Rodriguez
On 10/23/2017 12:40 PM, N. Raghavendra wrote:
> I am a mathematician, and have been using LaTeX on a daily basis since
> 1992, when I was a graduate student.  I have recently started using
> ConTeXt, and am very happy with the facilities it provides, and with its
> self-contained system which does not require one to load external
> packages with subtle interactions.

Hi Raghu,

my experience with LaTeX was brief when compared with yours: about seven
years. I think I may be using ConTeXt for almost a decade.

My background is in humanities. I cannot code, although I may read and
understand very basic scripts. I simply don’t do math (it’s all Greek to
me).

The most useful ConTeXt feature for me is the handling of XML files as
source files for text.

> One problem that I am facing is that the documentation of ConTeXt is
> often not enough for me to figure out what to do when a problem arises.
> I understand that documentation is perhaps not a priority for the
> project.  As Hans Hagen wrote in `? Context',
> 
>   "... writing can get a lower priority in a time when quick and dirty
>answers can be found on the internet, mailing list or wiki.  ... For
>what it's worth: whenever I have to solve a problem with a program
>(or language implementation) I run into cases where I have to look
>long to find (non conflicting) information. It just comes with the
>problems one wants to solve and TeX (ConTeXt) is not different."

When I started learning ConTeXt, I thought it wasn’t well documented. I
changed my mind since that.

I understand that writing documentation may not be a priority for Hans,
becase:

- He is the main developer of ConTeXt and LuaTeX.

- He fixes the bugs users or developers report.

- He kindly implements reasonable requests for new features.

- He checks the mailing list and replies to some of the questions.

- He still writes documentation for many of the ConTeXt features (not
  only literate programming).

In my personal case, many bugs and new requests were fixed or
implemented in less than a week. (I wish it would be the same at work,
where we have paid support.)

I’m not the only user that has experienced that. Hans may be not writing
documentation, because he focuses on other (more important) aspects of
ConTeXt development.

I would like to write a manual for ConTeXt. But it will be in Spanish, I
may need years, and it will be limited to my own experience.

The wiki is an informal invitation to the users to document the issues
the were able to solve.

Hans explained his take on the documentation some years ago:
https://mailman.ntg.nl/pipermail/ntg-context/2010/047500.html.

> However, there is not a great deal of information on the Internet about
> solving ConTeXt problems.  Whenever I ran into a LaTeX problem in the
> last several years, I used to find a solution, or a substantial step
> towards one, that was already documented on the TeX-LaTeX Stack
> Exchange.  Unfortunately, it does not contain a similar amount of
> information about ConTeXt.  In any case, I have started posting ConTeXt
> questions there, see https://tex.stackexchange.com/q/397463/146025 and
> https://tex.stackexchange.com/q/397607/146025

There is no secret that ConTeXt is way less popular than LaTeX. It is
even trickier to search for it (since context is also a rather common word).

I don’t know how many ConTeXt users are in the world. Probably the
number of LaTeX users is a hundred times the number of ConTeXt users.
This explains a lot of things in terms of written explanations.

Let me mention a single case. TUGs are TeX Users Groups, but most of its
participants are LaTeX users. The TeX Spanish mailing list has almost
400 participants. There may be other ConTeXt users on that list. But
LaTeX is by far the most common topic in the vast majority of messages.
My impression when I explain there basic ConTeXt features (such as
modes) is that I’m describing Martian life to the generation of my
grandparents (they have no clue of what I’m speaking about).

StackExchange and similar platforms are great, sure. But being
responsive to questions for users in the mailing list and in SE may be
too much for most of the users. At least, my day has only 24 hours ;-).

> As for the mailing list, I posted three requests for help here in the
> last one week.  When I bumped my first message after more than a day
> without any response, Tomas Hala kindly came to my rescue.  The other
> two messages, posted four and two days ago, have not elicited any
> response yet.  This contrasts with Aditya Mahajan's experience, which he
> describes in his interview at
> http://tex-talk.net/2012/08/textalk-an-interview-with-aditya/:
> 
>   "Most questions on the context mailing lists are answered within
>minutes ... look in the main manual and the wiki to see how to
>achieve the particular effects

Re: [NTG-context] Difficulties with learning about ConTeXt

2017-10-23 Thread luigi scarso
On Mon, Oct 23, 2017 at 12:40 PM, N. Raghavendra <nyraghu27...@gmail.com> wrote:
> I am a mathematician, and have been using LaTeX on a daily basis since
> 1992, when I was a graduate student.  I have recently started using
> ConTeXt, and am very happy with the facilities it provides, and with its
> self-contained system which does not require one to load external
> packages with subtle interactions.
>
> One problem that I am facing is that the documentation of ConTeXt is
> often not enough for me to figure out what to do when a problem arises.
> I understand that documentation is perhaps not a priority for the
> project.  As Hans Hagen wrote in `? Context',
>
>   "... writing can get a lower priority in a time when quick and dirty
>answers can be found on the internet, mailing list or wiki.  ... For
>what it's worth: whenever I have to solve a problem with a program
>(or language implementation) I run into cases where I have to look
>long to find (non conflicting) information. It just comes with the
>problems one wants to solve and TeX (ConTeXt) is not different."
>
> However, there is not a great deal of information on the Internet about
> solving ConTeXt problems.  Whenever I ran into a LaTeX problem in the
> last several years, I used to find a solution, or a substantial step
> towards one, that was already documented on the TeX-LaTeX Stack
> Exchange.  Unfortunately, it does not contain a similar amount of
> information about ConTeXt.  In any case, I have started posting ConTeXt
> questions there, see https://tex.stackexchange.com/q/397463/146025 and
> https://tex.stackexchange.com/q/397607/146025
>



These are the resources that I have found very useful:

0)interface files
tex/texmf-context/tex/context/interface/mkiv

1) test suite cont-tst.7z
http://www.pragma-ade.nl/download-1.htm

2) sources  of the pdf of the standalone,
tex/texmf-context/doc/context/sources/general

3) sources of modules
tex/texmf-context/tex/context/modules

4) source code of mkiv
tex/texmf-context/tex/context/base/mkiv

5) the archives of emails
https://mailman.ntg.nl/pipermail/ntg-context/


The ml is ok of course, but at some point you will develop your own
style of doing things,
and probably you will encapsulate it into a module.



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

<    1   2   3   4   5   6   7   8   9   10   >