ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* User-Defined Command With Key-Value Options
@ 2015-07-19 10:45 joasyannick
  0 siblings, 0 replies; only message in thread
From: joasyannick @ 2015-07-19 10:45 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 2187 bytes --]

Dear everyone,


I am currently implementing the old French Bible of David Martin in ConTeXt MkIV.

The source code looks like this:


\startproduct martin1707
    \project bibles % Font settings, page layout, 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, the Bible is divided into books. These books are divided into chapters,

and the chapters into verses. The purpose of \start(\stop)biblebook, \start(\stop)biblechapter,

and \start(\stop)bibleverse is to format the books, chapters, and verses respectively (as the

commands \start(\stop)section, \start(\stop)subsection, etc., do).


As you see, theses commands are user-defined and take key-value options. My goal is to

define their semantics (the way they do the formatting) with Lua. But I do not knwo how

to do this. I know a bit about programming, and learning Lua is not a problem for me.


Thanking you in advance,

All the best.

[-- Attachment #1.2: Type: text/html, Size: 4996 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-19 10:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-19 10:45 User-Defined Command With Key-Value Options joasyannick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).