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

Joas Yannick joasyannick at gmail.com
Sun Jul 19 13:24:45 CEST 2015


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20150719/df1ebb73/attachment.html>


More information about the ntg-context mailing list