[NTG-context] \enabletrackers[*] gives lua error.

2018-10-06 Thread Ulrike Fischer
I tried to look at a font and enabled the trackers like this

\enabletrackers[*]

\definefont [test][name:texgyreheros]
\starttext
  abcäöü
\stoptext

The context compilations fails then with 

...ext/tex/texmf-context/tex/context/base/mkiv/font-oup.lua:718:
attempt to call a nil value (global 'report_unicode')

Imho around a week ago (when I asked about the source han font) this
worked.

-- 
Ulrike Fischer 
https://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] context and sqlite

2018-10-06 Thread luigi scarso
On Sat, Oct 6, 2018 at 8:01 PM Jörg Hofmann  wrote:

> I've been trying to connect ConTeXt to sqlite for almost a week
> but I have repeatedly failed. Neither the
> "internal" variant according to the documentation, nor the attempt on
> luasql
> have worked. Above all, the Google request showed me that
> not alone with this problem - how reassuring. ;-)
>
> At the moment, concentrate I am accessing via swiglib and think my
> problem lies here (from my log file):
>
> sql> start loading method 'sqlite'
> swiglib> unknown: 'swiglib.sqlite.core'
> swiglib> unknown: 'swiglib.helpers.core'
>
> Obviously, the appropriate modules are not found, but where
> Can I get them and where do they belong? And maybe
> also someone a working code example for me.
> I'm working with Texlive 2017 on XUBUNTU 16.04.
>

hm I will look into asap.

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

2018-10-06 Thread Kelley, Claire
Again thank you everyone for their incredibly helpful advice and 
responsiveness! 

The work flow I am envisioning is: 

1) Use R to read in a csv file, filter according to some rules and then use 
propensity score matching (based on r packages) to create a model. 
2) The final data output is a table with standardize coefficients and mean 
values. 
3) This final data output is then used to create a table using Context/ Tikz to 
create the very specific format that I need for the final report. 
 
I can do this using Sweave, but I need to be able to  use context for some 
additional features (in particular the tagging/back end structure). 

Best, 
Claire 




On 10/5/18, 2:07 PM, "Hans Hagen"  wrote:

>On 10/5/2018 8:00 PM, Kelley, Claire wrote:
>> Thank you for all the answers so far !
>> 
>> 
>> 
>> Ive gathered from that I need to use filter to call R externally.
>> 
>>   What I am still most interested in is how I could get a single value from 
>> R to be part of the Context code. (Like you would do with \Sexpr{} in 
>> sweave. The use case for this is that I have some complicated tikz code that 
>> makes a fancy matrix - I want to fill it in with numbers that r reads from a 
>> csv file and processes.
>Can you give an example? Do you only need R for reading the csv?
>
>Hans ntg-context@ntg.nl
>
>
>-
>   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 Wolfgang Schuster



Aditya Mahajan schrieb am 06.10.18 um 19:06:

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?


ConTeXt can read JSON files, see util-jsn.lua

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

2018-10-06 Thread Alan Braslau
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? Would it not 
make more sense developing code directly in lua in this case?

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.

Our experimentation with lua and with MetaPost is that one can achieve HUGE 
differences in efficiencies through efficient programming, factors of 2-3 or 
even orders of magnitude. (Hans can usually succeed in speeding-up my lua 
code.) Sometimes surprising things can make huge differences (never surprising 
once one understands what is happening). One can hope that python and R (and 
other) developers are efficient-minded programmers, but this is not always the 
case.

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Can anyone connect context to R or python?

2018-10-06 Thread Kelley, Claire
I also just got an incredibly helpful answer over on stack overflow : 
https://tex.stackexchange.com/questions/453868/how-can-i-use-context-and-r-together
Which shows how to use Lua and filter together 
Claire 



On 10/6/18, 1:06 PM, "ntg-context on behalf of Aditya Mahajan" 
 wrote:

>On Sat, 6 Oct 2018, Kelley, Claire wrote:
>
>> Again thank you everyone for their incredibly helpful advice and 
>> responsiveness!
>>
>> The work flow I am envisioning is:
>>
>> 1) Use R to read in a csv file, filter according to some rules and then use 
>> propensity score matching (based on r packages) to create a model.
>> 2) The final data output is a table with standardize coefficients and mean 
>> values.
>> 3) This final data output is then used to create a table using Context/ Tikz 
>> to create the very specific format that I need for the final report.
>
>Is the final post-processed data a table that can be saved to a CSV file? 
>If so, the simplest solution will be to write R code (inside a \startR ... 
>\stopR environment) that does the post-processing and saves the data as a 
>CSV file.
>
>Both ConTeXt and TikZ can easily read CSV table and format as desired.
>
>---
>
>I also want to take this opportunity to express my views on intefacing 
>with external programs. The file based interaction provided by the filter 
>module is okay for small projects but it is not ideal. Slightly better is 
>to use pipes (popen to a REPL) or use FFI 
>(e.g https://adityam.github.io/context-blog/post/interfacing-with-julia), 
>but neither of these is easy to implement and needs to be done on a 
>per-language basis. Henri Menke had a Tugboat article on this as well.
>
>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?
>
>Aditya
>___
>If your question is of interest to others as well, please add an entry to the 
>Wiki!
>
>maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
>webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>archive  : https://bitbucket.org/phg/context-mirror/commits/
>wiki : http://contextgarden.net
>___
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Can anyone connect context to R or python?

2018-10-06 Thread Aditya Mahajan

On Sat, 6 Oct 2018, Kelley, Claire wrote:


Again thank you everyone for their incredibly helpful advice and responsiveness!

The work flow I am envisioning is:

1) Use R to read in a csv file, filter according to some rules and then use 
propensity score matching (based on r packages) to create a model.
2) The final data output is a table with standardize coefficients and mean 
values.
3) This final data output is then used to create a table using Context/ Tikz to 
create the very specific format that I need for the final report.


Is the final post-processed data a table that can be saved to a CSV file? 
If so, the simplest solution will be to write R code (inside a \startR ... 
\stopR environment) that does the post-processing and saves the data as a 
CSV file.


Both ConTeXt and TikZ can easily read CSV table and format as desired.

---

I also want to take this opportunity to express my views on intefacing 
with external programs. The file based interaction provided by the filter 
module is okay for small projects but it is not ideal. Slightly better is 
to use pipes (popen to a REPL) or use FFI 
(e.g https://adityam.github.io/context-blog/post/interfacing-with-julia), 
but neither of these is easy to implement and needs to be done on a 
per-language basis. Henri Menke had a Tugboat article on this as well.


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?


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
___

[NTG-context] context and sqlite

2018-10-06 Thread Jörg Hofmann
I've been trying to connect ConTeXt to sqlite for almost a week
but I have repeatedly failed. Neither the
"internal" variant according to the documentation, nor the attempt on
luasql
have worked. Above all, the Google request showed me that
not alone with this problem - how reassuring. ;-)

At the moment, concentrate I am accessing via swiglib and think my
problem lies here (from my log file):

sql> start loading method 'sqlite'
swiglib> unknown: 'swiglib.sqlite.core'
swiglib> unknown: 'swiglib.helpers.core'

Obviously, the appropriate modules are not found, but where
Can I get them and where do they belong? And maybe
also someone a working code example for me.
I'm working with Texlive 2017 on XUBUNTU 16.04.

Best regards
Jörg Hofmann
___
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] Unexpected space after hyphen in xml/html export

2018-10-06 Thread Hans Hagen

On 10/7/2018 12:19 AM, Rik Kabel wrote:

List,

Occasionally an unexpected and unwanted space is inserted following the 
hyphen of a compound word in html/xml exports. In a document with about 
500 such compounds, this occurs 30 times.


The following input:

\setupbackend [export=yes,xhtml=yes]
\starttext
Theocracy, the priest power; monarchy, the one|-|man power; and
oligarchy, the few|-|men power|—|are three forms of vicarious
government over the people, perhaps for them, not by them. Democracy is
direct self|-|government over all the people, for all the people, by
all the people. Our institutions are democratic: theocratic, monarchic,
oligarchic vicariousness is all gone. We have no Divine vicar who is
responsible to God for our politics and religion; only a human attorney,
answerable to the people for his official work. The axis of rotation has
changed: the equator of the old civilization passes through the poles
of the new. This makes some change in the geography of both Church and
State.
\stopsection
\stoptext

Produces, in relevant part, the following xml (wrapped for convenience):

Theocracy, the priest power; monarchy, the one-man power; and oligarchy,
the few- men power—are three forms of vicarious government over
the people, perhaps for them, not by them. Democracy is direct
self-government over all the people, for all the people, by all the
people. Our institutions are democratic: theocratic, monarchic,
oligarchic vicariousness is all gone. We have no Divine vicar who is
responsible to God for our politics and religion; only a human attorney,
answerable to the people for his official work. The axis of rotation has
changed: the equator of the old civilization passes through the poles
of the new. This makes some change in the geography of both Church and
State.

Note the space after "few-" in the second line of the output text.

(The paragraph is a quotation from Theodore Parker's sermon "The Effect 
of Slavery on the American People," delivered on July 4, 1858. It is 
thought by many to be the inspiration for part of Lincoln's Gettysburg 
Address.)


But it's not what happened: quite some folks in power have middle age 
monarchic characteristics, oligarchies are around etc. Old institutions 
(that probably root deeply in mankind0 are just better in pretending to 
be different.


Anyway fixed in next beta (but you need to keep an eye on disc side 
effects.


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] Homebrew packaging for macOS

2018-10-06 Thread Andrew Dunning

> On 7 Oct 2018, at 01:32, Hans Hagen  wrote:
> 
> How do you now update? It's just one recall to first-setup.sh

Thanks for the response: to be more precise, my suggestion is more about 
building discoverability and trust for ConTeXt. Homebrew provides an extremely 
simple way of installing and uninstalling things along with any dependencies.

I think it might be possible to get the script version into Homebrew Cask as it 
stands, but it would be nicer if it could get directly into Homebrew if that is 
possible.

All best,

Andrew


___
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] context and sqlite

2018-10-06 Thread luigi scarso
On Sat, Oct 6, 2018 at 9:02 PM luigi scarso  wrote:

>
>
> On Sat, Oct 6, 2018 at 8:01 PM Jörg Hofmann  wrote:
>
>> I've been trying to connect ConTeXt to sqlite for almost a week
>> but I have repeatedly failed. Neither the
>> "internal" variant according to the documentation, nor the attempt on
>> luasql
>> have worked. Above all, the Google request showed me that
>> not alone with this problem - how reassuring. ;-)
>>
>> At the moment, concentrate I am accessing via swiglib and think my
>> problem lies here (from my log file):
>>
>> sql> start loading method 'sqlite'
>> swiglib> unknown: 'swiglib.sqlite.core'
>> swiglib> unknown: 'swiglib.helpers.core'
>>
>> Obviously, the appropriate modules are not found, but where
>> Can I get them and where do they belong? And maybe
>> also someone a working code example for me.
>> I'm working with Texlive 2017 on XUBUNTU 16.04.
>>
>
> hm I will look into asap.
>
> The relevant docs are
tex/texmf-context/doc/context/documents/general/manuals/swiglib-mkiv.pdf
tex/texmf-context/doc/context/documents/general/manuals/sql-mkiv.pdf

The old svn site is gone , the new one is
https://serveur-svn.lri.fr/svn/modhel/swiglib
(see http://www.luatex.org/download.html)


-- 
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] 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] Homebrew packaging for macOS

2018-10-06 Thread Hans Hagen

On 10/7/2018 1:24 AM, Andrew Dunning wrote:

Dear list,

Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
)? Providing it as an installation option would make it far 
easier to obtain the latest version.


How do you now update? It's just one recall to first-setup.sh


In looking into it myself, I immediately came across the problem of not being exactly 
sure where to find a versioned download link. See their guidelines at 
.

All best,

Andrew Dunning

___
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] context and sqlite

2018-10-06 Thread Hans Hagen

On 10/6/2018 8:01 PM, Jörg Hofmann wrote:

I've been trying to connect ConTeXt to sqlite for almost a week
but I have repeatedly failed. Neither the
"internal" variant according to the documentation, nor the attempt on
luasql
have worked. Above all, the Google request showed me that
not alone with this problem - how reassuring. ;-)

At the moment, concentrate I am accessing via swiglib and think my
problem lies here (from my log file):

sql> start loading method 'sqlite'
swiglib> unknown: 'swiglib.sqlite.core'
swiglib> unknown: 'swiglib.helpers.core'

Obviously, the appropriate modules are not found, but where
Can I get them and where do they belong? And maybe
also someone a working code example for me.
I'm working with Texlive 2017 on XUBUNTU 16.04.
did you read the sql manual in the distribution ... it should work okay 
(no need for special lua module, all in the distribution)


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
___

[NTG-context] Unexpected space after hyphen in xml/html export

2018-10-06 Thread Rik Kabel

List,

Occasionally an unexpected and unwanted space is inserted following the 
hyphen of a compound word in html/xml exports. In a document with about 
500 such compounds, this occurs 30 times.


The following input:

   \setupbackend [export=yes,xhtml=yes]
   \starttext
   Theocracy, the priest power; monarchy, the one|-|man power; and
   oligarchy, the few|-|men power|—|are three forms of vicarious
   government over the people, perhaps for them, not by them. Democracy is
   direct self|-|government over all the people, for all the people, by
   all the people. Our institutions are democratic: theocratic, monarchic,
   oligarchic vicariousness is all gone. We have no Divine vicar who is
   responsible to God for our politics and religion; only a human attorney,
   answerable to the people for his official work. The axis of rotation has
   changed: the equator of the old civilization passes through the poles
   of the new. This makes some change in the geography of both Church and
   State.
   \stopsection
   \stoptext

Produces, in relevant part, the following xml (wrapped for convenience):

   Theocracy, the priest power; monarchy, the one-man power; and oligarchy,
   the few- men power—are three forms of vicarious government over
   the people, perhaps for them, not by them. Democracy is direct
   self-government over all the people, for all the people, by all the
   people. Our institutions are democratic: theocratic, monarchic,
   oligarchic vicariousness is all gone. We have no Divine vicar who is
   responsible to God for our politics and religion; only a human attorney,
   answerable to the people for his official work. The axis of rotation has
   changed: the equator of the old civilization passes through the poles
   of the new. This makes some change in the geography of both Church and
   State.

Note the space after "few-" in the second line of the output text.

(The paragraph is a quotation from Theodore Parker's sermon "The Effect 
of Slavery on the American People," delivered on July 4, 1858. It is 
thought by many to be the inspiration for part of Lincoln's Gettysburg 
Address.)


--
Rik

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Homebrew packaging for macOS

2018-10-06 Thread Andrew Dunning
Dear list,

Has anyone ever looked into packaging ConTeXt for Homebrew on macOS (see 
)? Providing it as an installation option would make it far 
easier to obtain the latest version.

In looking into it myself, I immediately came across the problem of not being 
exactly sure where to find a versioned download link. See their guidelines at 
.

All best,

Andrew Dunning

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