Re: [NTG-context] outputting components in their own PDFs

2021-03-01 Thread denis.maier
What exactly do you need? You can just process each component on its own. With 
a makefile or shell script, batch file, that should be easy enough.
Or, do you need to have correct cross references, page numbers, etc.? I was 
asking a similar question two days ago, and  Hans showed me how to add 
information to the log file:


\writestatus{!}{SPLIT HERE: \the\realpageno}

You should be then able to extract the split points from the log file and 
extract the components from the complete PDF.

Or, if you know that you will need to split your document at certain structure 
elements (chapters, sections or so), it's even simpler.

The lua script below will split your PDF at each chapter. It uses pdftk for 
splitting, but it should be easy to adapt this to context's own mechanism 
mentioned by Hans in the other thread.

Denis


-- mit welchen Dateien arbeiten wir?

local base = assert(arg[1], "Keine Datei angegeben")
local pdf = base .. ".pdf"
local tuc = base .. ".tuc"


-- import .tuc-file /extension lua
local utilitydata = dofile(tuc)
local breakpoints = {}

local last_page = utilitydata.structures.counters.collected["realpage"][1][1]
print ("Letzte Seite: " .. last_page)

-- iterate over .tuc => get breakpoints
for index, content in pairs(utilitydata.structures.lists.collected) do
if (content["titledata"]["label"] == "chapter")
then
table.insert(breakpoints,content["references"]["realpage"])
end
end

-- welches sind die Breakpoints?
print("Wir haben folgende Breakpoints:")
for index, content in pairs(breakpoints) do
print (content)
end

-- wie viele Breakpoint haben wir?
function tablelength(T)
  local count = 0
  for _ in pairs(T) do count = count + 1 end
  return count
end

local breakpoints_length = tablelength(breakpoints)
print ("Wir haben " .. breakpoints_length .. " Breakpoints.")

-- Extraktionsbereiche festlegen
local extractions = {}

for index, breakpoint in pairs(breakpoints) do
region = {}
local startregion = breakpoint
local nextstartregion = breakpoints[index + 1]
local stopregion;
if (nextstartregion == nil)
then
  stopregion = last_page
else
  stopregion = nextstartregion - 1
end
region["start"] = startregion
region["stop"] = stopregion
table.insert(extractions,region)
end


print ("Wir extrahieren ...")
for index, region in pairs(extractions) do
  print("von " .. region["start"] .. " bis " .. region["stop"])
  local outputfile = "article" .. index .. ".pdf"
  local extract_command = "pdftk " .. pdf .. " cat " .. region["start"] .. "-" 
.. region["stop"] .. " output " .. outputfile
  os.execute(extract_command)
end



Von: ntg-context  Im Auftrag von Alan Bowen
Gesendet: Montag, 1. März 2021 22:38
An: mailing list for ConTeXt users 
Betreff: [NTG-context] outputting components in their own PDFs

I have a project-component setup and need to produce a single PDF file 
containing all the components as well as a PDF file for each component. The 
single file is easy. Is there a way to automate the generation of the PDF files 
for the individual components?

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

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


[NTG-context] outputting components in their own PDFs

2021-03-01 Thread Alan Bowen
I have a project-component setup and need to produce a single PDF file
containing all the components as well as a PDF file for each component. The
single file is easy. Is there a way to automate the generation of the PDF
files for the individual components?

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] Project Structure - inheritance rules for environments

2021-03-01 Thread Wolfgang Schuster

denis.ma...@ub.unibe.ch schrieb am 28.02.2021 um 23:09:

Hi,

I’m just having a look a project structure again. I am using the example 
given in the wiki: https://wiki.contextgarden.net/Project_structure, 
i.e., in my component I’m linking to the product, but not to the 
project. Now I was expecting that the component inherits the environment 
set in the project via the product. The wiki currently explains: “If you 
tex (compile) one single component (e.g. a chapter of a book) or product 
(e.g. one volume of a magazine), the environment file of the project is 
used.” That does not seem to be the case here. Can anyone confirm this? 
Is this a bug or does the wiki needs to be revised?


The \product command doesn't load any files because it doesn't make
any sense. Let us take a look at the following example. When you process
only a single component and \product would load the parent file you're
running in a problem because the parent file is now loading the previous
component file etc.

This would end in a loop and to prevent this \product lines are ignored.
There are ways to avoid this by redefining \component etc. when
the parent file is loaded but it's a mess to take care about all
combinations in which files are loaded.

The best thing you can do here is to load the environment file
in each product and component because the file is only loaded once
on the first call. When you use multiple environment files you
can collect them in a project file and use \project to load only
one file but this is seldom needed.

 begin product.tex
\startproduct *

\environment environment

\component component_1
\component component_2

\stopproduct
 end product.tex

 begin component_1.tex
\startcomponent *

\environment environment

...

\stopcomponent
 end component_1.tex

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] Genealogy and context

2021-03-01 Thread Henning Hraban Ramm

> Am 28.02.2021 um 19:32 schrieb David van Diepen :
> 
> Genealogical information is stored as structured data. I have added a
> fragment of an Gramps XML file below. In such a file there are events,
> people, families and other groupings of data and these are linked by
> handles.
> 
> What we would like to produce is a book with a number of blocks on
> every page describing a family: Father, mother, dates of birth and
> death, date of marriage, occupations and children. It would also be
> good it there are references to the grandparents. 

Hi David,

I’m also using Gramps (for my personal family tree and for research for a 
historical novel), and I always wondered if it wouldn’t be possible to create 
nicer family trees and other charts using ConTeXt/MetaPost. But I still can’t 
handle XML in ConTeXt nor MetaPost myself.

I’d suggest to first create a sample layout to have a clear target – how would 
you like to present your data?

Since Gramps XML is not very straightforward (many crossreferences) it _might_ 
make sense to use a preprocessor (XSLT) and convert it to XML or Lua tables 
that you can use with the bibliography module.
I’m quite sure it’s possible to do it completely in ConTeXt/Lua, but if you’d 
like to have configurable output, you’d probably create something similar to 
the bib module.

I’m looking forward to what you will create! (And I think it would be an 
excellent topic for a talk at the ConTeXt meeting and/or an article in the 
ConTeXt journal!)

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] Make LMTX load a custom library

2021-03-01 Thread Hans Hagen

On 3/1/2021 6:38 PM, Lukas/ConTeXt wrote:

Hello Hans,
is it possible to keep wincon.dll outside the LMTX installation tree?
I'd rather avoid anything in E:\tex-context\tex\* (or the installation 
dir in my comp).
I keep Lua DLLs (and other extensions) independently as they need to be 
accessible for many programs.
Or - is it possible to tell "mtxrun --generate" somehow to scan a 
specific directory, too (be it d:\Lukas\Lua\54\* in my case)?
The installer doesn't wipe the bin tree. In windows you can have the dll 
in some system path too and there's also


  package.extralibpath("d:/Lukas/Lua/54")

or you can add stuff to the configuration file. I admit that I haven't 
tested that in a while (I only occasionally use(d) the mysql library but 
either with ffi (mkiv) or with the built in one (lmtx), not some 
external lua specific wrapper).


The mentioned tracker shows you all the places where libs are searched.

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] lmtx update / teaser

2021-03-01 Thread Hans Hagen

On 3/1/2021 6:27 PM, Otared Kavian wrote:

Hi Hans,

Thank you for the new upload.

The teaser examples work fine, many thanks !
I have a question though: how can one center within a page a text, for example 
typeset in a circular shape? I tried with \startalignment, and also with 
\startplacefigure but none of these gives a centered circular shape.

Also I noticed that if one removes the comment at the end of 
\startshapedparagraph, or add a blank line after that, then the circular shape 
is destroyed: is this on purpose ?

\starttext

\startuseMPgraphic{circleBis}
lmt_parshape [
path   = fullcircle scaled 90mm,
offset = 2mm,
bottomskip = - 1.5LineHeight,
] ;
\stopuseMPgraphic

\startplacefigure[align=middle,number=no]
\framed[width=90mm,offset=2mm,align=normal]\bgroup
\startshapedparagraph
[list=circle,mp=circleBis,repeat=yes,method=repeat]%
\setupalign[verytolerant,stretch,last]\dontcomplain
{\darkred \samplefile{thuan}}
\stopshapedparagraph
\egroup
\stopplacefigure

\stoptext

We're talking parshapes here, think of

\parshape 2
  2mm 10cm
  4mm 12cm

or

\parshape 2
  options 1 % force a repeat
  2mm 10cm
  4mm 12cm

but then nicely wrapped in a macro. The circle is (cf metafun manual) 
converted into such a parshape. A parshape is forgotten when a new 
paragraph is started, but ... we have extra magic that revives them 
which is why the multi-page-par examples work too. The cycle and repeat 
methods do that (using abit diufferent tricks than the 20 year old one 
but not that different); these methods are independent of the parshape's 
repeat option itself, which is an engine feature.


Messing with left/right 'align' will also bring left/rightskip into the 
game so normally you will not do that. I admit it take a bit of 
imagination to get the picture. The 'last' keyword is some old context 
feature that centers the last line (which looks nicer in a circle) which

is using some parfillskip magic.

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] lmtx update / teaser

2021-03-01 Thread Otared Kavian
Hi Hans,

Thank you for the new upload.

The teaser examples work fine, many thanks !
I have a question though: how can one center within a page a text, for example 
typeset in a circular shape? I tried with \startalignment, and also with 
\startplacefigure but none of these gives a centered circular shape.

Also I noticed that if one removes the comment at the end of 
\startshapedparagraph, or add a blank line after that, then the circular shape 
is destroyed: is this on purpose ?

Best regards: Otared

% begin example-circular-shape.tex
\starttext

%\startuseMPgraphic{circle}
%   lmt_parshape [
%   path   = fullcircle scaled 136mm,
%   offset = 2mm,
%   bottomskip = - 1.5LineHeight,
%   ] ;
%\stopuseMPgraphic

\startuseMPgraphic{circleBis}
lmt_parshape [
path   = fullcircle scaled 90mm,
offset = 2mm,
bottomskip = - 1.5LineHeight,
] ;
\stopuseMPgraphic

\startalignment[middle]
%\startplacefigure[align=middle,number=no]
\start
\startshapedparagraph[list=circle,mp=circleBis,repeat=yes,method=repeat]%
\setupalign[verytolerant,stretch,last]
\dontcomplain
{\darkred \samplefile{thuan}}
\stopshapedparagraph
\stop
%\stopplacefigure
\stopalignment 

\stoptext
% end example-circular-shape.tex

> On 1 Mar 2021, at 15:44, Hans Hagen  wrote:
> 
> Hi,
> 
> I uploaded a new lmtx. As I'm currently going through the metafun todo files 
> I ended up at the fancy shape part (parshapes) running over multiple 
> paragraphs and decided to provide a (kind of low level) interface that 
> integrates that. The example code is a few decades old but still works ok (i 
> might try to improve them a bit some day). Anyway, here is a teaser:
> 
> \starttext
> 
> \startuseMPgraphic{circle}
>lmt_parshape [
>path   = fullcircle scaled 136mm,
>offset = 2mm,
>bottomskip = - 1.5LineHeight,
>] ;
> \stopuseMPgraphic
> 
> \start
> \startshapedparagraph[list=circle,mp=circle,repeat=yes,method=cycle]%
>\setupalign[verytolerant,stretch,last]\dontcomplain
>{\darkred \samplefile{tufte}}\par
>{\darkgreen   \samplefile{tufte}}\par
>{\darkblue\samplefile{tufte}}\par
>{\darkcyan\samplefile{tufte}}\par
>{\darkmagenta \samplefile{tufte}}\par
> \stopshapedparagraph
> \stop
> 
> \page
> 
> \start
> \startshapedparagraph[list=circle,mp=circle,repeat=yes,method=repeat]%
>\setupalign[verytolerant,stretch,last]\dontcomplain
>{\darkred \samplefile{tufte}}
>{\darkgreen   \samplefile{tufte}}
>{\darkblue\samplefile{tufte}}
>{\darkcyan\samplefile{tufte}}
>{\darkmagenta \samplefile{tufte}}
> \stopshapedparagraph
> \stop
> 
> \stoptext
> 
> The interface is still somewhat rough (no grouping for instance, not a real 
> envrionment so that might change) but seems to work ok. One can also go the 
> tex route and say:
> 
> \startparagraphshape[test]
>left 1mm right 1mm
>left 2mm right 2mm
>left 3mm right 3mm
>copy 8
>left 4mm right 4mm
>left 5mm right 5mm
>left 5mm hsize 10cm
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test]
>left 1mm right 1mm
>right 3mm
>left 5mm right 5mm
>repeat
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test]
>both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
>both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
> \stopparagraphshape
> 
> or
> 
> \startparagraphshape[test-repeat]
>both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
>both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
>repeat
> \stopparagraphshape
> 
> and use that with:
> 
> \startshapedparagraph[list=test]
>\dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
> \stopshapedparagraph
> 
> or
> 
> \startshapedparagraph[list=test-repeat]
>\dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
> \stopshapedparagraph
> 
> Some more info is in the lowlevel-paragrsph document (part of the low level 
> series).
> 
> This kind of features falls into the category 'fancy' (no one reqtested it), 
> nice for posters and covers. It might evolve depending on needs for fancy 
> features, but as said, it's currently a side track of metafun, so it's also 
> in the category 'fun'. It's code for 'controlled' usage.
> 
> 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  : 

Re: [NTG-context] Make LMTX load a custom library

2021-03-01 Thread Hans Hagen

On 3/1/2021 11:03 AM, Lukas/ConTeXt wrote:

Hello,

suppose having a custom DLL (actualy a Lua module) in:

   d:\Lukas\Lua\54\WinCon.dll

How exactly should I alter the path specification so LMTX be able to load 
WinCon.dll?


normally in something:

E:\tex-context\tex\texmf-win64\bin\lib\luametatex\wincon\wincon.dll

(mtxrun --generate)

maybe

\enabletrackers[resolvers.libraries]

gives you a clue

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] Project structure light

2021-03-01 Thread Wolfgang Schuster

denis.ma...@ub.unibe.ch schrieb am 01.03.2021 um 17:54:


Hi,

another question regarding project structure. I want to put each 
chapter of a book in a component or a distinct file loaded with 
\input, but I don’t want to have a full project structure. Just a main 
file and the chapters. Nevertheless, I want to load the environment 
file in each subfile. Is that possible or will that cause problems?




There is no problem with this method because environment files are 
loaded only once, all further attempts to load the same file are ignored.


Even though replacing \input with \component can be useful because 
\component doesn't generate a error when the given file doesn't exist.


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] Project structure light

2021-03-01 Thread Hans Hagen

On 3/1/2021 5:54 PM, denis.ma...@ub.unibe.ch wrote:

Hi,

another question regarding project structure. I want to put each chapter 
of a book in a component or a distinct file loaded with \input, but I 
don’t want to have a full project structure. Just a main file and the 
chapters. Nevertheless, I want to load the environment file in each 
subfile. Is that possible or will that cause problems?


Best,

Denis

main.tex

--

\environment test

\starttext

\input chapter1

\stoptext

--

chapter1.tex

--

\environment test

\starttext

Some text.

\stoptext

many of the manuals are that way, just look in the doc subtree for examples

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] Project structure light

2021-03-01 Thread denis.maier
Hi,
another question regarding project structure. I want to put each chapter of a 
book in a component or a distinct file loaded with \input, but I don't want to 
have a full project structure. Just a main file and the chapters. Nevertheless, 
I want to load the environment file in each subfile. Is that possible or will 
that cause problems?
Best,
Denis

main.tex
--
\environment test
\starttext
\input chapter1
\stoptext
--

chapter1.tex
--
\environment test
\starttext
Some text.
\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] Hyphenation pattern for Esperanto

2021-03-01 Thread Alain Delmotte

  
  
I forgot to write that I am ready to
answer your questions.
(En Esperanto one avoids to write the
dates as numbers, because the users do not all understand the
same way: 3/9/2021 is it third of September or ninth of March?)
  
Alain

Le 22/02/2021 à 17:26, Tomas Hala a
  écrit :


  Hi Alain,

in my email, I used official language codes: be=Belarussian, bg=Bulgarian, sr=Serbian.

The \installlanguage command is very important because it contains
definitions of the most frequently used typographic elements of the 
given language, for details see below.

Looking forward for both lang-txt files. The sooner you will send it, the better.

The best,

Tomáš

Mon, Feb 22, 2021 ve 03:01:41PM +0100 Alain Delmotte napsal(a):
#Hi Tomáš,
# 
#Thanks for your message.
# 
#First which country is "be"? If Belgium, pay attention that there are
#three languages: Dutch (Flemish) French (a little bit different from
#France French) and German (1% of the population).
# 
#Could you explain me the meaning of:
# 
#Le 21/02/2021 à 23:48, Tomas Hala a écrit :
# 
#  And this one is also needed:
# 
#  #  \installlanguage
#  #    [\s!esperanto]
#  #    [\c!spacing=\v!packed,
#  #     %\c!leftsentence=\emdash,
#  #     %\c!rightsentence=\emdash,
#  #     %\c!leftsubsentence=\emdash,
#  #     %\c!rightsubsentence=\emdash,
#  #     %\c!leftquote=\lowerleftdoubleninequote,
#  #     %\c!rightquote=\upperrightdoublesixquote,
#  #     %\c!leftquotation=\lowerleftdoubleninequote,
#  #     %\c!rightquotation=\upperrightdoublesixquote,
#  #     %\c!date={\v!year,~m.,\space,\v!month,\space,\v!day,~d.},
#  #     \s!patterns=eo,
#  #     \s!lefthyphenmin=2,
#  #     \s!righthyphenmin=2]

Values for \installlanguage:

* spacing: packed means no difference between interword and intersentence spaces.
* (left|right)sentence: punctuation marks -- very often dashes -- for included parts in some sentences.
* (left|right)quotation: definition of primary quotation marks. 
* (left|right)quote: definition of secondary (nested) quotation marks.
* (left|right)hyphenmin: number of characters at the end of a line and at the beginning of the next line when the word is hyphenated.
* date: how the date should be typically typeset: order, spacing, or other signs or abbreviation or texts.

Those I do not know for eo, have been marked with a percent sign.

#I have seen that the \lowerleftdoubleninequote,... are sometimes given by
#the character itself “ ”,...
#For the date, is it the order of the part of the date yyy mm dd?
# 
#I did prepare the file lang-txt.lua and did send it to two friends for
#checking, I wait for their answer (I hope not to long).
# 
#I also have the pattern for hyphenation, the one from TeXLive uses
#fonctions to shorten the length of the file.
# 
#For French, I'll do it and send it to you.
# 
#Thanks for taking care of this.
# 
#  Regards,
# 
#Alain


  


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/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 update / teaser

2021-03-01 Thread Hans Hagen

Hi,

I uploaded a new lmtx. As I'm currently going through the metafun todo 
files I ended up at the fancy shape part (parshapes) running over 
multiple paragraphs and decided to provide a (kind of low level) 
interface that integrates that. The example code is a few decades old 
but still works ok (i might try to improve them a bit some day). Anyway, 
here is a teaser:


\starttext

\startuseMPgraphic{circle}
lmt_parshape [
path   = fullcircle scaled 136mm,
offset = 2mm,
bottomskip = - 1.5LineHeight,
] ;
\stopuseMPgraphic

\start
\startshapedparagraph[list=circle,mp=circle,repeat=yes,method=cycle]%
\setupalign[verytolerant,stretch,last]\dontcomplain
{\darkred \samplefile{tufte}}\par
{\darkgreen   \samplefile{tufte}}\par
{\darkblue\samplefile{tufte}}\par
{\darkcyan\samplefile{tufte}}\par
{\darkmagenta \samplefile{tufte}}\par
\stopshapedparagraph
\stop

\page

\start
\startshapedparagraph[list=circle,mp=circle,repeat=yes,method=repeat]%
\setupalign[verytolerant,stretch,last]\dontcomplain
{\darkred \samplefile{tufte}}
{\darkgreen   \samplefile{tufte}}
{\darkblue\samplefile{tufte}}
{\darkcyan\samplefile{tufte}}
{\darkmagenta \samplefile{tufte}}
\stopshapedparagraph
\stop

\stoptext

The interface is still somewhat rough (no grouping for instance, not a 
real envrionment so that might change) but seems to work ok. One can 
also go the tex route and say:


\startparagraphshape[test]
left 1mm right 1mm
left 2mm right 2mm
left 3mm right 3mm
copy 8
left 4mm right 4mm
left 5mm right 5mm
left 5mm hsize 10cm
\stopparagraphshape

or

\startparagraphshape[test]
left 1mm right 1mm
right 3mm
left 5mm right 5mm
repeat
\stopparagraphshape

or

\startparagraphshape[test]
both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
\stopparagraphshape

or

\startparagraphshape[test-repeat]
both 1mm both 2mm both 3mm both 4mm both 5mm both 6mm
both 7mm both 6mm both 5mm both 4mm both 3mm both 2mm
repeat
\stopparagraphshape

and use that with:

\startshapedparagraph[list=test]
\dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
\stopshapedparagraph

or

\startshapedparagraph[list=test-repeat]
\dorecurse{8}{\showparagraphshape\samplefile{tufte} \par}
\stopshapedparagraph

Some more info is in the lowlevel-paragrsph document (part of the low 
level series).


This kind of features falls into the category 'fancy' (no one reqtested 
it), nice for posters and covers. It might evolve depending on needs for 
fancy features, but as said, it's currently a side track of metafun, so 
it's also in the category 'fun'. It's code for 'controlled' usage.


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] Make LMTX load a custom library

2021-03-01 Thread Lukas/ConTeXt
Hello,

suppose having a custom DLL (actualy a Lua module) in:

  d:\Lukas\Lua\54\WinCon.dll

How exactly should I alter the path specification so LMTX be able to load 
WinCon.dll?

My trials - without success so far - are:

1. Alter LUA_CPATH before running Ctx, so something like:

 (command line)
set LUA_CPATH=d:\Lukas\Lua\54\?.dll;%LUA_CPATH%
context.exe test.tex ...


2. Alter LUAINPUTS before running Ctx, so something like:

 (command line)
set LUAINPUTS=%LUAINPUTS%;d:\Lukas\Lua\54\?.dll;%LUA_CPATH%
context.exe test.tex ...


3. Changing the path at runtime, so something like:

 test.tex
\startluacode
  package.cpath = package.cpath .. ";d:/Lukas/Lua/54/?.dll"
  require "MyLib"
\stopluacode


But I'm still getting errors like:

"
...
token call, execute: 
...TX/tex/texmf-context/tex/context/base/mkiv/l-sandbox.lua:180: module 
'WinCon' not found:
no field package.preload['WinCon']
no file 'd:\Lukas\Lua\WinCon.lua'
no file 'd:\Lukas\Common\Statics\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\stdlib\modules\WinCon.lua'
no file 'd:\Lukas\Lua\3rdParty\LuaXML\WinCon.lua'
no file 'C:\Program Files (x86)\Lua\5.1\lua\WinCon.luac'
no file 'd:\Lukas\Lua\Geom'
...
"

Surprisingly, loader tries to locate a *.lua* only, whilst here I nedd to load 
a .dll;
and in genereal case, .lua, .luac and .dll may be required.

So - how to specify the path correctly, be it on the command line or within a 
.tex (LMTX run-time)?

Best regards,

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

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