ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Load context format at runtime (from luatex)
@ 2008-10-27 15:54 Mildred Ki'Lya
  2008-10-27 18:55 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Mildred Ki'Lya @ 2008-10-27 15:54 UTC (permalink / raw)
  To: Mailing list for ConTeXt users

Hi,

I would like to run (if possible) the context format at runtime. In
fact, I'd like to create a custom format for my own document and I want
my format to inherit ConTeXt (mostly because of utf-8 support).

At the beginning of my document, I added:

	\input format

And at the beginning of format.tex, I added:

	\input context

But now, when I execute the document using (pdf)luatex, I get an error
in some lua chunk:

pdfluatex document.tex
This is LuaTeX, Version snapshot-0.25.4-2008091110 (Web2C 7.5.7)
(document.tex (format.tex (/usr/share/texmf-dist/tex/context/base/context.tex
(/usr/share/texmf-dist/tex/context/base/syst-pln.tex)
(/usr/share/texmf-dist/tex/context/base/syst-prm.tex)
(/usr/share/texmf-dist/tex/context/base/luat-env.tex
! LuaTeX error [string "luas[0]"]:1: attempt to call field 'luafilechunk' (a ni
l value).
\ctxluabyteload ...nvironment.luafilechunk("#1") }
                                                  
\ ...fproductionrun \else \ctxluabyteload {#1}{#2}
                                                  \fi \global \everyloadluac...
l.168 \registerctxluafile{luat-env}{1.001}
                                          
?



If I use context instead of (pdf)luatex, it seems there is an infinite
loop when context.tex is loaded from my format in the
file /usr/share/texmf-dist/tex/context/base/syst-prm.tex

If I remove the inclusion of context in my format (the \input line) I
get another error (but I can't find where it is). The last lines looks
like:


context document.tex

MtxRun | loading configuration for /usr/share/texmf/web2c from /home/mildred/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028/trees/f7d1b3c25487ab1e1035aff1c53b90da
(./document.tex

ConTeXt  ver: 2008.05.21 15:21 MKIV  fmt: 2008.10.27  int: english/english

language       : language en is active
report >> utilityfile: not present
system         : cont-new loaded
(/usr/share/texmf-dist/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
(/usr/share/texmf-dist/tex/context/base/cont-new.mkiv
lua            : used config path - /usr/share/texmf/web2c/texmf.cnf
lua            : used cache path - /home/mildred/luatex-cache/context/6300afb4995fe38c77e9b86ed1ef1028
) (/usr/share/texmf-dist/tex/context/base/cont-mtx.tex))
system         : cont-old loaded
(/usr/share/texmf-dist/tex/context/base/cont-old.tex
loading        : Context Old Macros
)
system         : cont-fil loaded
(/usr/share/texmf-dist/tex/context/base/cont-fil.tex
loading        : Context File Synonyms
)
system         : cont-sys.rme loaded
(/usr/share/texmf-dist/tex/context/user/cont-sys.rme (/usr/share/texmf-dist/tex/context/base/type-tmf.tex) (/usr/share/texmf-dist/tex/context/base/type-siz.tex) (/usr/share/texmf-dist/tex/context/base/type-otf.tex))
bodyfont       : 12pt rm is loaded
specials       : tex loaded
system         : document.top loaded
(./document.top
specials       : loading definition file tpd
(/usr/share/texmf-dist/tex/context/base/spec-tpd.tex
specials       : loading definition file fdf
(/usr/share/texmf-dist/tex/context/base/spec-fdf.tex (/usr/share/texmf-dist/tex/context/base/spec-fdf.mkiv))
specials       : fdf loaded
)
specials       : fdf loaded
) (./format.tex)
! Missing } inserted.
<inserted text> 
                }
<to be read again> 
                   \endgroup 
\stopitemgroup ...mdepth }\egroup \else \endgroup 
                                                  \global \advance \itemdept...
l.28 
     
? 




Do you know how I can create my format based on ConTeXt? It doesn't
seems that easy :/ And I would prefer not to be dependant from ConTeXt
(that is if I want to use another format for my document instead of
ConTeXt, I want to be able to do that). And I also would prefer using
the generic (pdf)luatex instead of context.


Thanks.

Mildred


-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <mildred@jabber.fr>
│ Site: <http://ki.lya.online.fr>              GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Load context format at runtime (from luatex)
  2008-10-27 15:54 Load context format at runtime (from luatex) Mildred Ki'Lya
@ 2008-10-27 18:55 ` Hans Hagen
  2008-10-27 23:40   ` Mildred Ki'Lya
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2008-10-27 18:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mildred Ki'Lya wrote:
> Hi,
> 
> I would like to run (if possible) the context format at runtime. In
> fact, I'd like to create a custom format for my own document and I want
> my format to inherit ConTeXt (mostly because of utf-8 support).
> 
> At the beginning of my document, I added:
> 
> 	\input format
> 
> And at the beginning of format.tex, I added:
> 
> 	\input context
> 
> But now, when I execute the document using (pdf)luatex, I get an error
> in some lua chunk:

you cannot use context this way (at least not currently)

> pdfluatex document.tex
> This is LuaTeX, Version snapshot-0.25.4-2008091110 (Web2C 7.5.7)
> (document.tex (format.tex (/usr/share/texmf-dist/tex/context/base/context.tex
> (/usr/share/texmf-dist/tex/context/base/syst-pln.tex)
> (/usr/share/texmf-dist/tex/context/base/syst-prm.tex)
> (/usr/share/texmf-dist/tex/context/base/luat-env.tex
> ! LuaTeX error [string "luas[0]"]:1: attempt to call field 'luafilechunk' (a ni
> l value).
> \ctxluabyteload ...nvironment.luafilechunk("#1") }
>                                                   
> \ ...fproductionrun \else \ctxluabyteload {#1}{#2}
>                                                   \fi \global \everyloadluac...
> l.168 \registerctxluafile{luat-env}{1.001}
>                                           
> ?

when making the format, we also make a lua stub file (with code that 
implements file handling etc)

> Do you know how I can create my format based on ConTeXt? It doesn't

i have no clue what you mean with 'my own format based on context'

what you can do is copy cont-en.tex to cont-my.tex and load additional 
stuff before dumping (as long as you don't preload fonts in mkiv since 
they are not stored in the format)

> seems that easy :/ And I would prefer not to be dependant from ConTeXt
> (that is if I want to use another format for my document instead of
> ConTeXt, I want to be able to do that). And I also would prefer using
> the generic (pdf)luatex instead of context.

then you have to roll out your own code, (i.e why bother about context 
if you want to use your own code)

at some time in the future i will provide a system based on independent 
components, so that one can make a 'small context like thing' but it has 
a real low priority (unless someone pays for the effort)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Load context format at runtime (from luatex)
  2008-10-27 18:55 ` Hans Hagen
@ 2008-10-27 23:40   ` Mildred Ki'Lya
  2008-10-28  8:27     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Mildred Ki'Lya @ 2008-10-27 23:40 UTC (permalink / raw)
  To: ntg-context


Le Mon 27/10/2008 à 19:55 Hans Hagen à écrit:
> Mildred Ki'Lya wrote:
> > 
> > At the beginning of my document, I added:
> > 
> > 	\input format
> > 
> > And at the beginning of format.tex, I added:
> > 
> > 	\input context
> > 
> 
> you cannot use context this way (at least not currently)

Ok.
It seems that was the way to get the Plain TeX macros, so I thought it
would be the same for ConTeXt, apparently I was wrong.


> > Do you know how I can create my format based on ConTeXt?
> 
> i have no clue what you mean with 'my own format based on context'

I want to be able to tun a TeX document which uses macros that are
specific to the document I create. And I would like to separate the
macros from the actual document.
I thought that I could run my own set of macros (I guess this is called
a format, like Plain TeX, LaTeX, ConTeXt, ...). And to ease my work
(espacially around the utf-8 encoding) I wanted to use ConTeXt which
already provides high level features.

I guess I'm trying to do some kind of unsupported things.

> then you have to roll out your own code, (i.e why bother about
> context if you want to use your own code)

Because ConTeXt provides some high level features (like utf-8, I have
no idea how to read utf-8 documents in plain TeX).

> at some time in the future i will provide a system based on
> independent components, so that one can make a 'small context like
> thing' but it has a real low priority (unless someone pays for the
> effort)

That, I can understand :)

So, I'll dig a little bit more to see what I can do.
Thanks for the answers.

Mildred

-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <mildred@jabber.fr>
│ Site: <http://ki.lya.online.fr>              GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Load context format at runtime (from luatex)
  2008-10-27 23:40   ` Mildred Ki'Lya
@ 2008-10-28  8:27     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2008-10-28  8:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mildred Ki'Lya wrote:

> I want to be able to tun a TeX document which uses macros that are
> specific to the document I create. And I would like to separate the
> macros from the actual document.

you can define your own commands on top of context (as long as you don't 
overload essential low level macros)


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-10-28  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-27 15:54 Load context format at runtime (from luatex) Mildred Ki'Lya
2008-10-27 18:55 ` Hans Hagen
2008-10-27 23:40   ` Mildred Ki'Lya
2008-10-28  8:27     ` Hans Hagen

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).