Re: [NTG-context] Log overful boxes

2021-03-03 Thread Hans Hagen

On 2/28/2021 6:46 PM, denis.ma...@ub.unibe.ch wrote:

How can you add information about underfulor overful boxes to the log? Ideally 
both vboxes and hboxes.

\starttext
\hbox to 10cm {abc}
\hbox to  0cm {abc}
\stoptext

gives me (in lmtx) this in th elog

Underfull \hbox (badness 1) detected at line 8
<2: lmroman12-regular @ 12.0pt> abc

\hbox[normal][16=1,17=1], width 284.52756, height 8.32343, depth 
0.11993, direction l2r

.\list
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+61 a
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+62 b

..\kern[font], amount 0.32382
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+63 c



Overfull \hbox (17.94214pt too wide) detected at line 9
<2: lmroman12-regular @ 12.0pt> abc

\hbox[normal][16=1,17=1], height 8.32343, depth 0.11993, direction l2r
.\list
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+61 a
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+62 b

..\kern[font], amount 0.32382
..\glyph[32768][16=1,17=1], language (n=1,l=2,r=3), hyphenationmode 63, 
options 128 , font <2: lmroman12-regular @ 12.0pt>, glyph U+63 c


and on the console just:

Underfull \hbox (badness 1) detected at line 8
<2: lmroman12-regular @ 12.0pt> abc

Overfull \hbox (17.94214pt too wide) detected at line 9
<2: lmroman12-regular @ 12.0pt> abc

but you can get details on the console with

  \tracingonline = 1

which is no fun with for instance

\starttext
\bgroup
\tracingonline1
\hbox to 0cm {\input tufte }
\egroup
\stoptext

but anyhow shows you a bit how tex sees it.

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

2021-03-03 Thread David van Diepen
Hello Hraban and Hans,

Thank you Hraban for your enthusiasm. Very nice to hear that this might
be useful for other people too, I was kind of hoping that actually. As
soon as I have some results I'll share them with you, we might be able
to collaborate. 

Thank you Hans for making this working piece of code, that's great!
That will get me started allright.

Kind regards, David

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

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


Re: [NTG-context] Genealogy and context

2021-03-03 Thread Hans Hagen

On 2/28/2021 7:32 PM, David van Diepen wrote:

Hello,

My son is very much interested in genealogy. He already has collected
information on thousands of people. Now it would be nice to be able to
present this information in the form of a book. There is a possibility
to have this done by a commercial service, however then it's not
possible to adapt the format or to insert custom text. Media can be
added but not in the way we like it.

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.

My question is: Where should I get started with a project in which a
document is generated automatically from data? As far as I know context
should be very suitable for this but I don't have any experience with
this. Until now I've used context to make documents without any data
being added automatically, except for the bibliography.

Thank you in advance,

David van Diepen

Example Gramps XML file is below:


http://gramps-project.org/xml/1.7.1/grampsxml.dtd;>
http://gramps-project.org/xml/1.7.1/;>
   
 
 
 
   
   
   
   Birth
   
   
   
 
 
   Death
   
   
   
 
 
   Marriage
   
   
   
 
   
   
   
   F
   
 Catharina
 Geldof
   
   
   
   
 
  
   M
   
 Cornelis
 Geldof
   
   
   
   
   
   
 
 
   F
   
 Maatje
 de Voogd
   
   
   
   
   
   
 
   
   
 
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
 
  


\startbuffer[test]

http://gramps-project.org/xml/1.7.1/;>
  



  
  
  id="E1746">

  Birth
  
  
  

id="E1747">

  Death
  
  
  

id="E6977">

  Marriage
  
  
  

  
  
  id="I0987">

  F
  
Catharina
Geldof
  
  
  
  

 id="I0049">

  M
  
Cornelis
Geldof
  
  
  
  
  
  

id="I0050">

  F
  
Maatje
de Voogd
  
  
  
  
  
  

  
  
id="F0016">

  
  
  
  
  

 

\stopbuffer

%  mapping

\startxmlsetups xml:mysetups
\xmlsetsetup{#1}{database|families|family|person|childref}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:mysetups}

\startxmlsetups xml:database
\xmlfirst{#1}{/families}
\stopxmlsetups

\startxmlsetups xml:families
\xmlall{#1}{/family}
\stopxmlsetups

\startxmlsetups xml:person
\starttabulate[|||]
\BC name\NC \xmlfirst{#1}{name/first/text()} \NC \NR
\BC surname \NC \xmlfirst{#1}{name/surname/text()} \NC \NR
\BC gender  \NC \xmlfirst{#1}{gender} \NC \NR
\stoptabulate
\stopxmlsetups

\startxmlsetups xml:childref
% \startsubsubject[title=Child]

\xmlfirst{main}{/database/people/person[@handle='\xmlatt{#1}{hlink}']}
% \stopsubsubject
\stopxmlsetups

\startxmlsetups xml:family
\xmldoif {#1}{/father} {
\startsubject[title=Father]

\xmlfirst{main}{/database/people/person[@handle='\xmlattribute{#1}{/father}{hlink}']}
\stopsubject
}
\xmldoif {#1}{/mother} {
\startsubject[title=Mother]

\xmlfirst{main}{/database/people/person[@handle='\xmlattribute{#1}{/mother}{hlink}']}
\stopsubject
}
\xmldoif {#1}{/childref} {
\startsubject[title=Children]
\xmlall{#1}{/childref}
\stopsubject
}
\stopxmlsetups

\starttext
% \xmlprocess{main}{somefile.xml}{}
\xmlprocessbuffer{main}{test}{}
\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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