Re: [NTG-context] Cannot build plain format

2020-04-16 Thread Henri Menke
On 16/04/20, 12:35, Hans Hagen wrote:
> On 4/16/2020 10:51 AM, Henri Menke wrote:
> > Dear list,
> > 
> > I'm trying to build the plain format but it fails with
> > 
> >  $ mtxrun --script plain --make
> >  [...]
> >  ! I can't find file `luatex-plain.tex'.
> > 
> > but mtxrun can find the file.
> > 
> >  $ mtxrun --find-file "luatex-plain.tex"
> >  
> > /opt/context/tex/texmf-context/tex/generic/context/luatex/luatex-plain.tex
> > 
> > What am I doing wrong?
> > 
> > Also another question: Does LMTX come with a plain format?
> 
> currently not but as i for now also have added luatex to it (as it's handy
> for testing) i can also add plain related files (these depend on luatex)

Thanks, but what about the first part of my email?  Why can't I build
the plain format in ConTeXt standalone (MkIV, not LMTX) even though
mtxrun can locate the file?

Cheers, Henri

> 
> Hans
> 
> (fwiw: I only use plain for an occasional test of the shipped generic font
> loader files.)
> 
> 
> -
>   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
> ___
___
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] \startMPcode and \startMPpage

2020-04-16 Thread Jeong Dal
Dear Hans,

Thank you for the reply.
Since  \startMPcode … \stopMPcode form is used in the manual, I think that it 
is OK to use it for all cases.

Thank you again.

Best regards,

Dalyoung


> 2020. 4. 17. 오전 5:01, Hans Hagen  작성:
> 
> On 4/16/2020 8:36 PM, Jeong Dal wrote:
>> Hi,
>> The following sample code is working well in the \startMPpage ~ \stopMPpage, 
>> but is not working in the \startMPcode ~ \stopMPcode.
>> The error message is
>> \textfont0 is undefined (character 63)
>> l.6 \setstrut\strut $A$
>> If I remove “$” from the code, it is also working in \startMPcode ~ 
>> \stopMPcode.
>> Is there anything which I have to set for \startMPcode?
> 
> \starttext ... \stoptext
> 
> or
> 
> \startMPpage[instance=doublefun]
> 
> \stopMPpage
> 
>> Best regards,
>> Dalyoung
>> 
>> \startMPcode{doublefun}
>> %\startMPpage
>> numeric count, temp[], tt, minus, u; u := 1cm;
>> path p,q,r;
>> pair A,B,C,D;
>> string varName, ss, pos[];
>> p := unitsquare xyscaled (8u,3.5u);
>> *draw p;*
>> *
>> *
>> pos[0] := "bot";
>> pos[1] := "rt";
>> pos[2] := "top";
>> pos[3] := "lft";
>> varName := "yxwz";
>> count := 0;
>> pickup pencircle scaled 5pt;
>> for i = 0 upto 3:
>> drawdot (point i of p);
>> draw lmt_text[
>> text = "$" & char(65+i) & "$",
>> anchor = pos[i],
>> offset = 2pt,
>> position = point i of p,
>> ];
>> endfor;
>> %\stopMPpage
>> \stopMPcode
>> ___
>> 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] filtering pages from /PrintPageRange

2020-04-16 Thread Pablo Rodriguez
Dear list,

this is a new experience deep inside LuaMetaTeX (for me).

I need to compose a new document from selected pages (which are marked
automatically and stored in /PrintPageRange) in a PDF document
containing 1000 pages.

It has to be one of the worst coding snippets ever written, but it
works. It reads the array from /PrintPageRange, deploying it in
context.filterpages.

  \startluacode
  function document.printrange_from_file(filename)
  range_array =
pdfe.open(filename).Catalog.ViewerPreferences.PrintPageRange
  for i=1,#range_array do
  file_page = range_array[i]
  if file_pagerange == nil then
  file_pagerange = file_page
  else
  file_pagerange = file_pagerange .. " " .. file_page
  end
  end
  for str in file_pagerange:gmatch("([^%s]+)") do
  add_one = str + 1
  if right_range == nil then
  right_range =  add_one
  else
  right_range = right_range .. " " .. add_one
  end
  end
  spaces_in_pagerange = right_range:find(' ')
  local _, spaces_in_pagerange = right_range:gsub(" ", "")
  for actualspace=1,spaces_in_pagerange do
  if (actualspace % 2 == 0) then
  right_range = right_range:gsub(' ',',', 1)
  else
  right_range = right_range:gsub(' ',':', 1)
  end
  end

  context.filterpages( { filename }, { right_range },
{ width = Opt } )
  end
  \stopluacode

  \def\filterfrompagerange[#1]{%
  \ctxlua{document.printrange_from_file("#1")}}

  \setuplayout[page]
  \setupinteractionscreen[option={portrait, paper}]

  \starttext
  \filterfrompagerange[huge-book.pdf]
  \stoptext

I copied and adapted all from Stackoverflow snippets.

It is useful for me, since it file will be changing, page marking is
automatic and filtering marked pages will be automatic too.

But I wonder whether this may be useful to others. I wonder whether it
makes sense to add it to the wiki.

Let me know what you think about

--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Best way to create a large number of documents from database

2020-04-16 Thread Hans Hagen

On 4/16/2020 8:32 PM, Mojca Miklavec wrote:


Where would be the best way to document this / under what wiki topic,
as I'm sure I'll need it again and forget until then unless I write it
down immediately? "Mail merge"? ;)

maybe a 'workflows' entry?

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] \startMPcode and \startMPpage

2020-04-16 Thread Hans Hagen

On 4/16/2020 8:36 PM, Jeong Dal wrote:

Hi,

The following sample code is working well in the \startMPpage ~ 
\stopMPpage, but is not working in the \startMPcode ~ \stopMPcode.


The error message is

\textfont0 is undefined (character 63)

l.6 \setstrut\strut $A$

If I remove “$” from the code, it is also working in \startMPcode ~ 
\stopMPcode.


Is there anything which I have to set for \startMPcode?


\starttext ... \stoptext

or

\startMPpage[instance=doublefun]

\stopMPpage


Best regards,

Dalyoung


\startMPcode{doublefun}
%\startMPpage
numeric count, temp[], tt, minus, u; u := 1cm;
path p,q,r;
pair A,B,C,D;
string varName, ss, pos[];
p := unitsquare xyscaled (8u,3.5u);
*draw p;*
*
*
pos[0] := "bot";
pos[1] := "rt";
pos[2] := "top";
pos[3] := "lft";
varName := "yxwz";
count := 0;
pickup pencircle scaled 5pt;

for i = 0 upto 3:
drawdot (point i of p);
draw lmt_text[
text = "$" & char(65+i) & "$",
anchor = pos[i],
offset = 2pt,
position = point i of p,
];
endfor;
%\stopMPpage
\stopMPcode



___
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] Best way to create a large number of documents from database

2020-04-16 Thread Pablo Rodriguez
On 4/16/20 8:32 PM, Mojca Miklavec wrote:
> [...]
> Where would be the best way to document this / under what wiki topic,
> as I'm sure I'll need it again and forget until then unless I write it
> down immediately? "Mail merge"? ;)

Hi Mojca,

“Document merge” could be also fine.

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] \startMPcode and \startMPpage

2020-04-16 Thread Jeong Dal
Hi,

The following sample code is working well in the \startMPpage ~ \stopMPpage, 
but is not working in the \startMPcode ~ \stopMPcode.

The error message is 

\textfont0 is undefined (character 63)

l.6 \setstrut\strut $A$

If I remove “$” from the code, it is also working in \startMPcode ~ \stopMPcode.

Is there anything which I have to set for \startMPcode?

Best regards,

Dalyoung


\startMPcode{doublefun}
%\startMPpage
numeric count, temp[], tt, minus, u; u := 1cm;
path p,q,r;
pair A,B,C,D;
string varName, ss, pos[];
p := unitsquare xyscaled (8u,3.5u);
draw p;

pos[0] := "bot";
pos[1] := "rt";
pos[2] := "top";
pos[3] := "lft";
varName := "yxwz";
count := 0;
pickup pencircle scaled 5pt;

for i = 0 upto 3: 
drawdot (point i of p);
draw lmt_text[
text = "$" & char(65+i) & "$",
anchor = pos[i],
offset = 2pt,
position = point i of p,  
];
endfor;
%\stopMPpage
\stopMPcode


___
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] Best way to create a large number of documents from database

2020-04-16 Thread Mojca Miklavec
On Thu, 16 Apr 2020 at 16:52, Hans Hagen wrote:
> On 4/16/2020 4:38 PM, Mojca Miklavec wrote:
> > On Thu, 16 Apr 2020 at 11:29, Taco Hoekwater wrote:
> >>> On 16 Apr 2020, at 11:12, Mojca Miklavec wrote:
> >>>
> >>> One option is that I quickly draft a python script that creates a few
> >>> thousand TeX documents and compiles them individually, but it might be
> >>> easier if there was a way to just create a single template document
> >>> and then run something like
> >>> context --some-params --N=42 --output=document-0042.pdf template.tex
> >>> or something along those lines.
> >>
> >> If you want to go this route (and you may have to if not each record
> >> fits exactly within a single page),
> >
> > I do have one page per document. The more annoying part is having
> > strange document names that need more attention when mapping page
> > number -> name (I'm not saying this is not doable).
>
> so, don't make files:
>
> - write a tex file foo.tex
> - process it: context --batch --result=1 --once foo
>
> etc ... so, use --result for the target name and use the same input name

This works just perfect, thank you very much.

I now have template.tex and process it with
context --batch --result=doc-0042 --someparam=21a --once template
which generates precisely the desired doc-0042.pdf.

For the moment I'm simply using a combination of
\doifdocumentargument {someparam} {\getdocumentargument{someparam}}
from TeX and
environment.arguments
from within the lua code as suggested by Taco and you in the previous
email thread.

Where would be the best way to document this / under what wiki topic,
as I'm sure I'll need it again and forget until then unless I write it
down immediately? "Mail merge"? ;)

Thank you very much,
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] template system

2020-04-16 Thread Henning Hraban Ramm

> Am 16.04.2020 um 19:57 schrieb Wolfgang Schuster 
> :
> 
> Henning Hraban Ramm schrieb am 16.04.2020 um 19:46:
>>> Am 16.04.2020 um 16:52 schrieb Hans Hagen :
>>> 
>>> (I won't bother you with the template system in context that no one knows 
>>> of.)
>> If you throw such bones, I get hungry – where’s the flesh? (Where is this in 
>> the sources? Is there any documentation?)
> 
> Look in the manual folder: templates-mkiv.pdf

Ah, the LMX templates. Of course I already had this in my bibliography but 
never had a deeper look, since it looked too Lua-centric to me.
Thank you!

Best, Hraban
___
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] template system

2020-04-16 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 16.04.2020 um 19:46:



Am 16.04.2020 um 16:52 schrieb Hans Hagen :

(I won't bother you with the template system in context that no one knows of.)


If you throw such bones, I get hungry – where’s the flesh? (Where is this in 
the sources? Is there any documentation?)


Look in the manual folder: templates-mkiv.pdf

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] template system (was: Best way to create a large number of documents from database)

2020-04-16 Thread Henning Hraban Ramm

> Am 16.04.2020 um 16:52 schrieb Hans Hagen :
> 
> (I won't bother you with the template system in context that no one knows of.)

If you throw such bones, I get hungry – where’s the flesh? (Where is this in 
the sources? Is there any documentation?)

I often need ConTeXt templates and mostly use simple replacements (like TITLE, 
CONTENT), but I’m used to Django templates (earlier Smarty/PHP and 
Freemarker/Java) and recently used Jinja2 with LaTeX.

Best, Hraban
___
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] Best way to create a large number of documents from database

2020-04-16 Thread kaddour kardio
A relatively simple way is to use a templating system such as jinja2 and
iterate over a mkiv template.
Calling context with subprocess and you got the result.

Le jeu. 16 avr. 2020 à 15:52, Hans Hagen  a écrit :

> On 4/16/2020 4:38 PM, Mojca Miklavec wrote:
> > On Thu, 16 Apr 2020 at 11:29, Taco Hoekwater wrote:
> >>> On 16 Apr 2020, at 11:12, Mojca Miklavec wrote:
> >>>
> >>> I have been asked to create a few thousand PDF documents from a CSV
> >>> "database" today
> >>
> >> In CPU cycles, the fastest way is to do a single context —once
> >> run generating all the pages as a single document, then using
> >> mutool merge to split it into separate documents using a (shell)
> >> loop.
> >
> > Just to make it clear: I don't really need to optimize on the CPU end,
> > as the bottleneck is on the other side of the keyboard, so as long as
> > the CPU can process 5k pages today, I'm fine with it :) :) :)
>
> 5K is nothing ... so that will work
>
> >>> One option is that I quickly draft a python script that creates a few
> >>> thousand TeX documents and compiles them individually, but it might be
> >>> easier if there was a way to just create a single template document
> >>> and then run something like
> >>> context --some-params --N=42 --output=document-0042.pdf
> template.tex
> >>> or something along those lines.
> >>
> >> If you want to go this route (and you may have to if not each record
> >> fits exactly within a single page),
> >
> > I do have one page per document. The more annoying part is having
> > strange document names that need more attention when mapping page
> > number -> name (I'm not saying this is not doable).
>
> so, don't make files:
>
> - write a tex file foo.tex
> - process it: context --batch --result=1 --once foo
>
> etc ... so, use --result for the target name and use the same input name
>
> (I won't bother you with the template system in context that no one
> knows of.)
>
>   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
>
> ___
>
___
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] Best way to create a large number of documents from database

2020-04-16 Thread Hans Hagen

On 4/16/2020 4:38 PM, Mojca Miklavec wrote:

On Thu, 16 Apr 2020 at 11:29, Taco Hoekwater wrote:

On 16 Apr 2020, at 11:12, Mojca Miklavec wrote:

I have been asked to create a few thousand PDF documents from a CSV
"database" today


In CPU cycles, the fastest way is to do a single context —once
run generating all the pages as a single document, then using
mutool merge to split it into separate documents using a (shell)
loop.


Just to make it clear: I don't really need to optimize on the CPU end,
as the bottleneck is on the other side of the keyboard, so as long as
the CPU can process 5k pages today, I'm fine with it :) :) :)


5K is nothing ... so that will work


One option is that I quickly draft a python script that creates a few
thousand TeX documents and compiles them individually, but it might be
easier if there was a way to just create a single template document
and then run something like
context --some-params --N=42 --output=document-0042.pdf template.tex
or something along those lines.


If you want to go this route (and you may have to if not each record
fits exactly within a single page),


I do have one page per document. The more annoying part is having
strange document names that need more attention when mapping page
number -> name (I'm not saying this is not doable).


so, don't make files:

- write a tex file foo.tex
- process it: context --batch --result=1 --once foo

etc ... so, use --result for the target name and use the same input name

(I won't bother you with the template system in context that no one 
knows of.)


 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] Best way to create a large number of documents from database

2020-04-16 Thread Mojca Miklavec
On Thu, 16 Apr 2020 at 11:29, Taco Hoekwater wrote:
> > On 16 Apr 2020, at 11:12, Mojca Miklavec wrote:
> >
> > I have been asked to create a few thousand PDF documents from a CSV
> > "database" today
>
> In CPU cycles, the fastest way is to do a single context —once
> run generating all the pages as a single document, then using
> mutool merge to split it into separate documents using a (shell)
> loop.

Just to make it clear: I don't really need to optimize on the CPU end,
as the bottleneck is on the other side of the keyboard, so as long as
the CPU can process 5k pages today, I'm fine with it :) :) :)

> > One option is that I quickly draft a python script that creates a few
> > thousand TeX documents and compiles them individually, but it might be
> > easier if there was a way to just create a single template document
> > and then run something like
> >context --some-params --N=42 --output=document-0042.pdf template.tex
> > or something along those lines.
>
> If you want to go this route (and you may have to if not each record
> fits exactly within a single page),

I do have one page per document. The more annoying part is having
strange document names that need more attention when mapping page
number -> name (I'm not saying this is not doable).

> browse back a day or so in the mailing
> list archive for Gerben’s question about
>
>   “Using command line values in a TeX document; writing a script?"

Thanks a lot for the pointer. I didn't have that much time to read
through all the emails recently, I only noticed that he was super
actively working on some metapost stuff, I wasn't paying attention to
this.

> The replies offer various options using either lua or tex code
> to get at user-supplied arguments from the commandline.

Let me see what I come up with, I'm stil fiddling with data & layout
at the moment :)

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] [LMTX] error updating luametatex

2020-04-16 Thread kaddour kardio
Pablo yes I meant 'mtxrun'.

Hans by googling about my issue I found a commentary by Aditya of the issue
on the git repos.



Le jeu. 16 avr. 2020 à 08:51, Pablo Rodriguez  a écrit :

> On 4/16/20 1:14 AM, kaddour kardio wrote:
> > running `mtx run ---generate` with 3 dashes fixed the issue.
> > [...]
> > mtx-run --generate
> > give me this error
> >  unknown script 'cache.lua' or 'mtx-cache.lua'
> Sorry, but I think the command reads:
>
> mtxrun --generate
>
> I mean, no hyphen or space inside "mtxrun".
>
> 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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Pablo Rodriguez
On 4/16/20 10:05 AM, denis.maier.li...@mailbox.org wrote:
>> Pablo Rodriguez hat am 16. April 2020 09:53 geschrieben:
>> [...]
>> Do you plan to release the slides of these talks?
>
> Sure, https://boris.unibe.ch/135830/ and https://boris.unibe.ch/135828/

Many thanks for the links, Denis.

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Pablo Rodriguez
On 4/16/20 10:00 AM, Arthur Reutenauer wrote:
> On Thu, Apr 16, 2020 at 09:53:46AM +0200, Pablo Rodriguez wrote:
>> [...]
>> Do you plan to release the slides of these talks?
>
>   
> https://conference.pkp.sfu.ca/index.php/pkp2019/pkp2019/paper/viewFile/719/455
>  and 
> https://conference.pkp.sfu.ca/index.php/pkp2019/pkp2019/paper/viewFile/691/471.

Many thanks for the links, Arthur.

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread denis . maier . lists

> Hans Hagen  hat am 16. April 2020 12:24 geschrieben:
> 
>  
> On 4/16/2020 9:02 AM, Henning Hraban Ramm wrote:
> > 
> > 
> >> Am 15.04.2020 um 22:52 schrieb denis.maier.li...@mailbox.org:
> >>
> >> Hi,
> >>
> >>> 1) Does anybody know of any scientific publisher or single journals
> >>> which accept papers/book chapters typeset in ConTeXt yet
> >>
> >> I will use ConTeXt to typeset the Jewish Studies journal *Judaica* 
> >> (https://bop.unibe.ch/index.php/judaica/index). (The first issue should 
> >> appear soon.) However, we do not accept ConTeXt sources as we use jats xml 
> >> as our production format. (Actually, I don't expect any of our authors is 
> >> using ConTeXt.)
> > 
> > Interesting. Is ConTeXt handling Hebrew well?
> hebrew is not that complex to handle so context should handle it okay 
> (assuming a proper font setup)


Yeah, it seems so. I'm much more afraid of getting Arabic and Judeo-Arabic 
right...

Denis
___
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] Cannot build plain format

2020-04-16 Thread Hans Hagen

On 4/16/2020 10:51 AM, Henri Menke wrote:

Dear list,

I'm trying to build the plain format but it fails with

 $ mtxrun --script plain --make
 [...]
 ! I can't find file `luatex-plain.tex'.

but mtxrun can find the file.

 $ mtxrun --find-file "luatex-plain.tex"
 /opt/context/tex/texmf-context/tex/generic/context/luatex/luatex-plain.tex

What am I doing wrong?

Also another question: Does LMTX come with a plain format?


currently not but as i for now also have added luatex to it (as it's 
handy for testing) i can also add plain related files (these depend on 
luatex)


Hans

(fwiw: I only use plain for an occasional test of the shipped generic 
font loader files.)



-
  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] Text around an image

2020-04-16 Thread Fabrice Couvreur
Hi,
I know that this question has been raised several times (especially by me
!), but the solutions provided sometimes work and sometimes not, especially
in this example.
Thanks for your help.
Fabrice

  \useMPlibrary [dum]

   \define\ItemCommand
   {\hskip\zeropoint\relax\autoinsertnextspace}

  \setupitemgroup
[itemize]
[color=black,
 style=bold,
 distance=\zeropoint]

  \setupitemgroup
[itemize:1]
[option={n,packed,fit,intext},
command=\ItemCommand]

  \setupitemgroup
[itemize:2]
[lefttext=,
righttext=,
option={a,text}]

  \starttext

\startitemize
  \startitem
Justifier que \m{x>4} et \m{y>2}.
  \stopitem
  \placefigure[right,none]{}{\externalfigure [dummy]}
  \startitem
Pour calculer la valeur de \m{y} en fonction de \m{x}, l'urbaniste
a écrit la fonction en Python.

\startitemize
  \startitem
Son algorithme est-il correct ?
  \stopitem\par
  \startitem
Programmer une fonction \m{A(x)} qui renvoie l'aire totale du
terrain en fonction de la longueur \m{x}.
  \stopitem
\stopitemize
  \stopitem
  \startitem
On considère la fonction suivante.

\startitemize
  \startitem
Qu'affiche l'instruction ?
  \stopitem\par
  \startitem
Interpréter les résultats renvoyés.
  \stopitem
\stopitemize
  \stopitem
\stopitemize
  \stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Hans Hagen

On 4/16/2020 9:02 AM, Henning Hraban Ramm wrote:




Am 15.04.2020 um 22:52 schrieb denis.maier.li...@mailbox.org:

Hi,


1) Does anybody know of any scientific publisher or single journals
which accept papers/book chapters typeset in ConTeXt yet


I will use ConTeXt to typeset the Jewish Studies journal *Judaica* 
(https://bop.unibe.ch/index.php/judaica/index). (The first issue should appear 
soon.) However, we do not accept ConTeXt sources as we use jats xml as our 
production format. (Actually, I don't expect any of our authors is using 
ConTeXt.)


Interesting. Is ConTeXt handling Hebrew well?
hebrew is not that complex to handle so context should handle it okay 
(assuming a proper font setup)


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] Best way to create a large number of documents from database

2020-04-16 Thread Taco Hoekwater


> On 16 Apr 2020, at 11:12, Mojca Miklavec  
> wrote:
> 
> Hi,
> 
> I have been asked to create a few thousand PDF documents from a CSV
> "database" today (which I can easily transform into any other form,
> like XML or a lua table or TeX definitions or whatever).
> 
> Generating a few thousand pages would be straightforward, but I'm sure
> there are some clever ways to handle this scenario as well, I'm just
> not aware of them :)

In CPU cycles, the fastest way is to do a single context —once
run generating all the pages as a single document, then using
mutool merge to split it into separate documents using a (shell)
loop.

Starting up mutool is much faster than starting context, even with lmtx.


> One option is that I quickly draft a python script that creates a few
> thousand TeX documents and compiles them individually, but it might be
> easier if there was a way to just create a single template document
> and then run something like
>context --some-params --N=42 --output=document-0042.pdf template.tex
> or something along those lines.

If you want to go this route (and you may have to if not each record
fits exactly within a single page), browse back a day or so in the mailing
list archive for Gerben’s question about 

  “Using command line values in a TeX document; writing a script?"

The replies offer various options using either lua or tex code
to get at user-supplied arguments from the commandline.

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] Best way to create a large number of documents from database

2020-04-16 Thread Mojca Miklavec
Hi,

I have been asked to create a few thousand PDF documents from a CSV
"database" today (which I can easily transform into any other form,
like XML or a lua table or TeX definitions or whatever).

Generating a few thousand pages would be straightforward, but I'm sure
there are some clever ways to handle this scenario as well, I'm just
not aware of them :)

One option is that I quickly draft a python script that creates a few
thousand TeX documents and compiles them individually, but it might be
easier if there was a way to just create a single template document
and then run something like
context --some-params --N=42 --output=document-0042.pdf template.tex
or something along those lines.

What's the best approach with the existing functionality? I would be
more than grateful for any hints.

Thank you very much,
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
___


[NTG-context] Cannot build plain format

2020-04-16 Thread Henri Menke
Dear list,

I'm trying to build the plain format but it fails with

$ mtxrun --script plain --make
[...]
! I can't find file `luatex-plain.tex'.

but mtxrun can find the file.

$ mtxrun --find-file "luatex-plain.tex"
/opt/context/tex/texmf-context/tex/generic/context/luatex/luatex-plain.tex

What am I doing wrong?

Also another question: Does LMTX come with a plain format?

Cheers, Henri
___
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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread luigi scarso
On Thu, Apr 16, 2020 at 9:08 AM Henning Hraban Ramm  wrote:

>
>
> > Am 15.04.2020 um 22:52 schrieb denis.maier.li...@mailbox.org:
>
> I’m using a Python script to convert DOCX to ConTeXt.


c# under linux is also a valid option.

-- 
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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread denis . maier . lists
> Henning Hraban Ramm  hat am 16. April 2020 09:02 geschrieben:

> > I will use ConTeXt to typeset the Jewish Studies journal *Judaica* 
> > (https://bop.unibe.ch/index.php/judaica/index). (The first issue should 
> > appear soon.) However, we do not accept ConTeXt sources as we use jats xml 
> > as our production format. (Actually, I don't expect any of our authors is 
> > using ConTeXt.)
> 
> Interesting. Is ConTeXt handling Hebrew well?

Well, it's not field tested yet. But yes, the demo files work.

> 
> > 
> >> 2) If there are any is any of them convinced enought about ConTeXt to 
> >> recommend use of ConTeXt or even provide template?
> > 
> > Yes, I gave two talks last year at the Public Knowledge Project Conference 
> > in Barcelona. One was about our general workflow (going from docx via 
> > pandoc markdown to jats xml; the other was about typesetting xml with 
> > ConTeXt.)
> 
> I’m using a Python script to convert DOCX to ConTeXt. The better the input, 
> the better the output can be. Usually there’s a lot of manual work. (Last 
> week I had an article whose author never grew out of the typewriter, i.e. 
> every line was a paragraph, footnotes were just paragraphs at the end of his 
> pages – of course my script couldn’t handle that well.)

Yeah, as always, the output is only as good as the input. That's partly why I 
use pandoc (twice, actually.) In a first run, I produce a normalized markdown 
file, where such idiosyncrasies are removed. There, I then add additional 
formatting. In the second run I can then produce the XML. We need the XML to 
produce a nice web view using the Lens Viewer. And also, with pandoc it's much 
easier to produce XML than ConTeXt. 

Best,
Denis
___
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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Arthur Reutenauer
On Thu, Apr 16, 2020 at 09:53:46AM +0200, Pablo Rodriguez wrote:
> On 4/15/20 10:52 PM, denis.maier.li...@mailbox.org wrote:
>> Yes, I gave two talks last year at the Public Knowledge Project
>> Conference in Barcelona. One was about our general workflow (going
>> from docx via pandoc markdown to jats xml; the other was about
>> typesetting xml with ConTeXt.)
> 
> Do you plan to release the slides of these talks?

  
https://conference.pkp.sfu.ca/index.php/pkp2019/pkp2019/paper/viewFile/719/455 
and 
https://conference.pkp.sfu.ca/index.php/pkp2019/pkp2019/paper/viewFile/691/471

Arthur
___
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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread denis . maier . lists

> Pablo Rodriguez  hat am 16. April 2020 09:53 geschrieben:
> 
>  
> On 4/15/20 10:52 PM, denis.maier.li...@mailbox.org wrote:
> > [...]
> >> 2) If there are any is any of them convinced enought about ConTeXt
> >> to recommend use of ConTeXt or even provide template?
> >
> > Yes, I gave two talks last year at the Public Knowledge Project
> > Conference in Barcelona. One was about our general workflow (going
> > from docx via pandoc markdown to jats xml; the other was about
> > typesetting xml with ConTeXt.)
> 
> Do you plan to release the slides of these talks?

Sure, https://boris.unibe.ch/135830/ and https://boris.unibe.ch/135828/

Best, 
Denis
___
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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Pablo Rodriguez
On 4/15/20 10:52 PM, denis.maier.li...@mailbox.org wrote:
> [...]
>> 2) If there are any is any of them convinced enought about ConTeXt
>> to recommend use of ConTeXt or even provide template?
>
> Yes, I gave two talks last year at the Public Knowledge Project
> Conference in Barcelona. One was about our general workflow (going
> from docx via pandoc markdown to jats xml; the other was about
> typesetting xml with ConTeXt.)

Do you plan to release the slides of these talks?

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] [LMTX] error updating luametatex

2020-04-16 Thread Pablo Rodriguez
On 4/16/20 1:14 AM, kaddour kardio wrote:
> running `mtx run ---generate` with 3 dashes fixed the issue.
> [...]
>     mtx-run --generate
> give me this error
>  unknown script 'cache.lua' or 'mtx-cache.lua'
Sorry, but I think the command reads:

mtxrun --generate

I mean, no hyphen or space inside "mtxrun".

Just in case it helps,

Pablo
--
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] [LMTX] error updating luametatex

2020-04-16 Thread Hans Hagen

On 4/16/2020 1:14 AM, kaddour kardio wrote:

running `mtx run ---generate` with 3 dashes fixed the issue.


strange ; nothing has changed in that code so why three dashes

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] Question: Are there any ConTeXt aware scientific pulishers yet

2020-04-16 Thread Henning Hraban Ramm


> Am 15.04.2020 um 22:52 schrieb denis.maier.li...@mailbox.org:
> 
> Hi,
> 
>> 1) Does anybody know of any scientific publisher or single journals
>> which accept papers/book chapters typeset in ConTeXt yet
> 
> I will use ConTeXt to typeset the Jewish Studies journal *Judaica* 
> (https://bop.unibe.ch/index.php/judaica/index). (The first issue should 
> appear soon.) However, we do not accept ConTeXt sources as we use jats xml as 
> our production format. (Actually, I don't expect any of our authors is using 
> ConTeXt.)

Interesting. Is ConTeXt handling Hebrew well?

> 
>> 2) If there are any is any of them convinced enought about ConTeXt to 
>> recommend use of ConTeXt or even provide template?
> 
> Yes, I gave two talks last year at the Public Knowledge Project Conference in 
> Barcelona. One was about our general workflow (going from docx via pandoc 
> markdown to jats xml; the other was about typesetting xml with ConTeXt.)

I’m using a Python script to convert DOCX to ConTeXt. The better the input, the 
better the output can be. Usually there’s a lot of manual work. (Last week I 
had an article whose author never grew out of the typewriter, i.e. every line 
was a paragraph, footnotes were just paragraphs at the end of his pages – of 
course my script couldn’t handle that well.)


>> 3) What would be needed and what could help to make them aware?
>> (difficult to properly formulate, if unclear dont bother)
> 
> Don't know. Perhaps more examples?

Even LaTeX is a niche; there are not enough users of ConTeXt for it to look 
reliable, I guess. You can’t really use it without involving yourself in the 
community.

And while I generally love working with ConTeXt, I’m cursing it often enough 
for unexpected/undocumented behaviour, unfinished features and scattered 
documentation. My book is intended to fix the latter, but there’s no progress – 
I got too many different projects and severe limitations of working capacity. 
And children at home...

Best, Hraban
___
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
___