[NTG-context] User-Defined Commands With Key-Value Options

2015-07-19 Thread Joas Yannick
Dear everyone,

I am currently typesetting the old (published in 1707) French Bible of
David Martin using
ConTeXt MkIV. The source code looks like this:

\startproduct martin1707
\startproject bibles % Page layout, fonts, language, etc.
\startbiblebook[number={1}, name={Genéſe}, abbreviation={Gen.},
title={Le premier livre de Moyſe dit la Genéſe}]
\startbiblechapter[number={1}]
\startbibleverse[number={1}]
Au commencement Dieu créa les cieux  la terre.
\stopbibleverse
\stopbiblechapter
\stopbiblebook
\startbiblebook[number={45}, name={Romains}, abbreviation={Rom.},
title={Epiſtre de ſaint Paul apoſtre aux romains}]
\startbiblechapter[number={12}]
\startbibleverse[number={1}]
Je vous exhorte donc, \bibleaddition{mes} fréres, par les
compaſſions de Dieu, que vous préſentiez vos corps en
ſacrifice
vivant, ſaint, agréable à Dieu, \bibleaddition{qui eſt}
vôtre
raiſonnable ſervice.
\stopbibleverse
\startbibleverse[number={2}]
Et ne vous conformez point à ce préſent ſiecle, mais ſoyez
transformez par le renouvellement de vôtre entendement,
afin que
vous éprouviez quelle eſt la volonté de Dieu, bonne, 
agréable,
 parfaite.
\stopbibleverse
\stopbiblechapter
\stopbiblebook
\stopproduct

As you may know, all the Bibles are divided into books, and each book into
chapters, and
each chapter into verses. The purpose of \startbiblebook,
\startbiblechapter, and \startbibleverse
is to control the formatting thereof respectively (as \startsection,
\startsubsection, etc., control
the formatting of sections, subsections, etc.)

Now, as you see. these commands are user-defined commands with key-value
options. My
goal is to define the way they do the formatting with Lua. But I do not
know how to do. I
know a bit about programming, so learning Lua is not a problem.

Thanking you in advance,
All the best,
Yours faithfully.
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] em-/en-dashes and newotf

2015-07-19 Thread Pablo Rodriguez
On 07/14/2015 07:11 PM, Hans Hagen wrote:
 On 7/14/2015 3:42 PM, Pablo Rodriguez wrote:
 Hans,

 checking beta from 2015.07.12 23:30 in Win7 64bit works fine (ligatures,
 no ligatures and dashes) with newotf.

 But I’m afraid that beta from 2015.07.14 10:37 doesn’t work disabling
 ligatures and enabling dashes in Linux 32bit.

 I’ll try to check the Linux 32bit ConTeXt with another computer.
 
 there is no dependency on the platform

Hans,

the problem was fixed when I remembered to remove the m-newotf.mkiv file
you sent to the list from my home directory. Sorry for the noise.

I’m still experiencing the issue with a particular font. Since the font
was generated with FontForge, I would like to know what the font is
missing to report the bug upstream.

Many thanks for your help,


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] fonts not found with newotf

2015-07-19 Thread Pablo Rodriguez
Hans,

as reported in a previous message, using beta from 2015.07.16 13:30,
enabling the newotf module in the following sample makes the Mechanica
fonts not being loaded in the final PDF document:

\usemodule[newotf]

\definefontfamily
   [txfont]
   [tt]
   [Mechanica]
   [tf=file:Mechanica.otf,
it=features:slanted,
sc=file:MechanicaSC.otf]

\setupbodyfont[txfont]

\starttext
\tt Test {\it amfe} {\sc amfe}
\stoptext

The attached newotf-error.log contains the error message.

Since both font files were generated with FontForge, I would like to
know what they are missing to report upstream to the FontForge developers.

Many thanks for your help,


Pablo
-- 
http://www.ousia.tk
fontsotf loading  loading '/home/ousia/ctxbeta/tex/texmf-fonts/ousia-fonts/Mechanica.otf', hash 'mechanica'
otf reader   fatal error in file '/home/ousia/ctxbeta/tex/texmf-fonts/ousia-fonts/Mechanica.otf': .../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:354: attempt to index field 'cid' (a nil value)
stack traceback:
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1853: in function '__newindex'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:354: in function .../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:353
[C]: in function 'lpegmatch'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:553: in function 'parseprivates'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:1549: in function 'readnoselect'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:1677: in function 'cff'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1737: in function 'readdata'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1772: in function .../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1755
[C]: in function 'xpcall'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1855: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1884: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:257: in function 'load'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:543: in function 'otftotfm'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:571: in function 'reader'
.../ctxbeta/tex/texmf-context/tex/context/base/font-def.lua:301: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:489: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-def.lua:415: in function 'read'
.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1162: in function .../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:1049
fontsotf loading  loading failed due to read error
fontsdefining  forced type 'otf' of 'Mechanica' not found
fontsdefining  font with asked name 'Mechanica' is not found using lookup 'file'
fontsdefining  unknown font 'Mechanica', loading aborted
fontsdefining  unable to define 'Mechanica.otf' as 'txfont-12pt-tt-tf-0--0'
fontsotf loading  loading '/home/ousia/ctxbeta/tex/texmf-fonts/ousia-fonts/Mechanica.otf', hash 'mechanica'
otf reader   fatal error in file '/home/ousia/ctxbeta/tex/texmf-fonts/ousia-fonts/Mechanica.otf': .../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:354: attempt to index field 'cid' (a nil value)
stack traceback:
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1853: in function '__newindex'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:354: in function .../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:353
[C]: in function 'lpegmatch'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:553: in function 'parseprivates'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:1549: in function 'readnoselect'
.../ctxbeta/tex/texmf-context/tex/context/base/font-cff.lua:1677: in function 'cff'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1737: in function 'readdata'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1772: in function .../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1755
[C]: in function 'xpcall'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1855: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otr.lua:1884: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:257: in function 'load'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:543: in function 'otftotfm'
.../ctxbeta/tex/texmf-context/tex/context/base/font-otl.lua:571: in function 'reader'
.../ctxbeta/tex/texmf-context/tex/context/base/font-def.lua:301: in function 'loadfont'
.../ctxbeta/tex/texmf-context/tex/context/base/font-ctx.lua:489: in function 'loadfont'

[NTG-context] footnotes in floating tables

2015-07-19 Thread Henry House
I am using the following to style floating tables and am having some
difficulties with footnotes in the tables.

\enableregime[utf]
\setupbodyfont[modern]
\setupbodyfont[11pt]

\setupfloats[location=middle,spacebefore=0ex,spaceafter=8ex]

\setupcaptions[location=top,inbetween={\blank[0cm]},spaceafter=2ex,spacebefore=1ex,headstyle=\sc]
\setupTABLE[frame=off,offset=0ex]
\setupTABLE[c][distance=0.6em]
\def\tableheadrulethickness{1.0pt}

\defineframed[footnoteframed]\setupframed[footnoteframed][width=\hsize,frame=off,align=right,top=\hbox\bgroup,bottom=\egroup]
% Use the set of symbols that has become customary in many publications for 
footnote marks, whose
% origin seems to be lost in the misty dawn of history:
\defineconversion[tablefootnoteconversion][*,†,‡,§,\textbar\textbar,¶]

\starttext
%%% Begin title page.
\startalignment[center]
{\ssb Title}
\stopalignment
%%% End title page.

Hello.

{
\placetable[top,page][table]{
Caption 1.
}{
\bTABLE%
\bTR{}\bTD{}X \eTD\bTD{}Y\eTD\eTR%
\bTR{}\bTD{}1 \eTD\bTD{}2\eTD\eTR%
\eTABLE%
}
}

{
\setupfootnotes[conversion=tablefootnoteconversion] % MkII
% 
\setupnotation[footnote][numberconversion=tablefootnoteconversion] % MkIV
\startlocalfootnotes

\setupTABLE[r][1][bottomframe=on,align=low,rulethickness=\tableheadrulethickness]
\setupTABLE[r][each][align={flushleft,verytolerant,hyphenated}] % 
Hyphenate words in table body
\setupTABLE[r][1][align={flushleft,low,verytolerant,nothyphenated}] % 
but not in header row.
\placetable[top,page][table]{
Table 2 caption.\footnote{Footnote in caption. Footnote in caption.
Footnote in caption. Footnote in caption. Footnote in caption. 
Footnote in caption.
}\footnote{Second footnote in caption.}
\placelocalfootnotes
}{
\placelegend{
\bTABLE%
\bTR{}\bTD{}A\note[Footnote_mark_1] 
\eTD\bTD{}B\note[Footnote_mark_2]\eTD\eTR%
\bTR{}\bTD{}1 \eTD\bTD{}2\eTD\eTR%
\eTABLE%
\footnotetext[Footnote_mark_1]{Footnote to column A. Footnote 
to column A. Footnote to column A. Footnote to column 
A.}\footnotetext[Footnote_mark_2]{Footnote to column B.}
}{
\footnoteframed{\placelocalfootnotes}
\stoplocalfootnotes
}
}
}

\stoptext

MkII --- this comes close to what I want.

- Captions are centered above the TABLE, more or less, and long captions
  are constrained to a width having reasonable relationship to the width
  of the TABLE.
- Footnotes in the caption appear in a block of reasonable width at the
  bottom of the caption above the TABLE.
- Footnotes in the TABLE appear in a block below the TABLE whose left
  margin matches the TABLE's left margin.
- Symbols are being used for footnote marks.

Problems:

- I'd like the very short caption of the first table to be centered above
  the TABLE, but what I actually get seems to be paragraph with an
  invisible right margin that is centered over the TABLE, but at the text
  does not reach the paragraph's right margin, it looks misaligned. The
  same misaligment occurs in the second table's caption, though it is
  not so objectionable there as the footnotes' texts fill the width.
- The block of footnote texts of the TABLE is not wrapped at a reasonable
  width --- they seem to be left-aligned, but their right margin runs off
  the page.
- I'd like one numbering scheme for the for the whole table (caption and
  TABLE), such that the caption's notes are numbered *, † and the TABLE's
  notes are ‡, §. What I actually get is *, † for both, i.e., the
  numbering resets between caption and TABLE.
- I'd like commas separating multiple footnote marks next to each other,
  as in the caption in the example.
- Minor: I'd like to suppress the table from being placed on the the first
  page of the document as it floats above the title block, confusingly. A
  minor problem as realstically a table is unlikely to be placed this early
  in a real document.

MkIV (with change from \setupfootnotes to \setupnotation[footnote] as
noted) --- there are several new problems.

- The caption's footnotes are not printed, though their marks are.
- The TABLE's footnote marks are not printed (unknown references), but the
  notes themselves are (though wrongly).
- The texts of all the footnotes in the TABLE are run together into a
  single line that doesn't break at all.
___
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 / 

Re: [NTG-context] fonts not found with newotf

2015-07-19 Thread Hans Hagen

On 7/19/2015 1:27 PM, Pablo Rodriguez wrote:

Hans,

as reported in a previous message, using beta from 2015.07.16 13:30,
enabling the newotf module in the following sample makes the Mechanica
fonts not being loaded in the final PDF document:

 \usemodule[newotf]

 \definefontfamily
[txfont]
[tt]
[Mechanica]
[tf=file:Mechanica.otf,
 it=features:slanted,
 sc=file:MechanicaSC.otf]

 \setupbodyfont[txfont]

 \starttext
 \tt Test {\it amfe} {\sc amfe}
 \stoptext

The attached newotf-error.log contains the error message.

Since both font files were generated with FontForge, I would like to
know what they are missing to report upstream to the FontForge developers.


there seems to be a cid entry operator seen when populating a private 
dictionary in the cff section


you can add this in line 552 of font-cff:

cid   = {
-- actually an error
},

and the font will probably load then, unless there is a fundamental flaw 
(i don't know where to get that font)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] User-Defined Commands With Key-Value Options

2015-07-19 Thread Hans Hagen

On 7/19/2015 1:24 PM, Joas Yannick wrote:

Dear everyone,

I am currently typesetting the old (published in 1707) French Bible of
David Martin using
ConTeXt MkIV. The source code looks like this:

\startproduct martin1707
 \startproject bibles % Page layout, fonts, language, etc.
 \startbiblebook[number={1}, name={Genéſe}, abbreviation={Gen.},
title={Le premier livre de Moyſe dit la Genéſe}]
 \startbiblechapter[number={1}]
 \startbibleverse[number={1}]
 Au commencement Dieu créa les cieux  la terre.
 \stopbibleverse
 \stopbiblechapter
 \stopbiblebook
 \startbiblebook[number={45}, name={Romains}, abbreviation={Rom.},
title={Epiſtre de ſaint Paul apoſtre aux romains}]
 \startbiblechapter[number={12}]
 \startbibleverse[number={1}]
 Je vous exhorte donc, \bibleaddition{mes} fréres, par les
 compaſſions de Dieu, que vous préſentiez vos corps en
ſacrifice
 vivant, ſaint, agréable à Dieu, \bibleaddition{qui eſt}
vôtre
 raiſonnable ſervice.
 \stopbibleverse
 \startbibleverse[number={2}]
 Et ne vous conformez point à ce préſent ſiecle, mais ſoyez
 transformez par le renouvellement de vôtre entendement,
afin que
 vous éprouviez quelle eſt la volonté de Dieu, bonne, 
agréable,
  parfaite.
 \stopbibleverse
 \stopbiblechapter
 \stopbiblebook
\stopproduct

As you may know, all the Bibles are divided into books, and each book
into chapters, and
each chapter into verses. The purpose of \startbiblebook,
\startbiblechapter, and \startbibleverse
is to control the formatting thereof respectively (as \startsection,
\startsubsection, etc., control
the formatting of sections, subsections, etc.)

Now, as you see. these commands are user-defined commands with key-value
options. My
goal is to define the way they do the formatting with Lua. But I do not
know how to do. I
know a bit about programming, so learning Lua is not a problem.


So how would you like to use lua? Is the data stored in lua?

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] bug in blank pagebreak?

2015-07-19 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\definepagebreak
[right:pagebreak]
[yes, blank, right]
%~ [yes, header, footer, right]

\setuppagenumbering
[location=inmargin]

\setupheadertexts
[Header text]

\setuphead
[chapter]
[page=right:pagebreak,
 header=empty]

\starttext
\chapter{First Chapter}
\dorecurse{12}{\input zapf\par}
\stoptext

With beta from 2015.07.16 13:30, footer from page 1 and header from page
2 are gone.

But if I redefine the pagebreak with header, footer instead of
blank, both missing header and footer are placed in their right places.

Isn’t it a bug? Or am I missing something?

Many thanks for your help,


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___