ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with \nolist
@ 2010-11-28 17:29 Procházka Lukáš
  2010-11-28 18:00 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Procházka Lukáš @ 2010-11-28 17:29 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

Hello,

I'm receiving errors when compiling the following code (although a .pdf is created):

---
\starttext
   \placecontent

   \section{AAA \nolist{aaa}}
\stoptext
---

Error message:

---
structure       : section @ level 3 : 0.0.1 -> AAA \nolist {aaa}
! Undefined control sequence.
l.1 AAA \nolist
                 {aaa}
\structuretitle ...a {structures.sections.title()}

\getstructureheadtitle ... \relax \structuretitle
                                                   \else \normalexpanded {\no...
\doplaceheadtextcomponent ...setstrut \begstrut #1
                                                   \endstrut }\xdef \localhea...
\@@ns::normal ...eadtextwidth \fi \noindent \fi #2
                                                   }
\placestructureheadnumbertext ...uctureheadtitle }
                                                   }\fi \endheadplacement {\g...
...
l.4   \section{AAA \nolist{aaa}}
---

I'm trying to get something similar as described in contextref.pdf on the page 213. What's the problem?

Latest ctx minimals.

Best regards,

Lukas

[-- Attachment #2: t-NoList.log --]
[-- Type: application/octet-stream, Size: 5683 bytes --]

(D:/Lukas/ConTeXt/Samples/t-NoList.mkiv
jobcontrol      > resuming randomizer with 0.73406170842616

ConTeXt  ver: 2010.11.27 14:27 MKIV  fmt: 2010.11.28  int: english/english

system          : cont-new loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.tex
systems         : beware: some patches loaded from cont-new.tex
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv))
system          : cont-fil.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-fil.mkiv
loading         : ConTeXt File Synonyms
)
system          : cont-sys.rme loaded
(c:/ConTeXt/tex/texmf-context/tex/context/user/cont-sys.rme (c:/ConTeXt/tex/texmf-context/tex/context/base/type-def.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-lua.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-siz.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-otf.mkiv))
system          : cont-err loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-err.tex
systems         : no file 'cont-sys.tex', using 'cont-sys.rme' instead
)
system          : t-NoList.top loaded
%
%	begin of optionfile
%
%	% runtime options files (command line driven)
%	\unprotect
%	% feedback and basic job control
%	\nonstopmode
%	% handy for special styles
%	\startluacode
%	document = document or { }
%	document.arguments={
%	 ["halt-on-error"]=true,
%	 ["nonstopmode"]=true,
%	}
%	document.files={
%	 "D:/Lukas/ConTeXt/Samples/t-NoList.mkiv",
%	}
%	\stopluacode
%	% process info
%	\setupsystem[inputfile=D:/Lukas/ConTeXt/Samples/t-NoList.mkiv]
%	\setupsystem[\c!n=1,\c!m=1]
%	% modes
%	% options (not that important)
%	\startsetups *runtime:options
%	\setupoutput[pdftex]
%	\stopsetups
%	% styles and modules
%	\startsetups *runtime:modules
%	\stopsetups
%	% done
%	\protect \endinput
%
%	end of optionfile
%
(t-NoList.top
){c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
bodyfont        : 12pt rm is loaded
fonts           : preloading latin modern fonts (first stage)
language        : language en is active
publications    : loading formatting style from bxml-apa
(c:/ConTeXt/tex/texmf-context/tex/context/base/bxml-apa.mkiv)
systems         : begin file D:/Lukas/ConTeXt/Samples/t-NoList.mkiv at line 1
structure       : section @ level 3 : 0.0.1 -> AAA \nolist {aaa}
! Undefined control sequence.
l.1 AAA \nolist
                {aaa}
\structuretitle ...a {structures.sections.title()}
                                                  
\getstructureheadtitle ... \relax \structuretitle 
                                                  \else \normalexpanded {\no...
\doplaceheadtextcomponent ...setstrut \begstrut #1
                                                  \endstrut }\xdef \localhea...
\@@ns::normal ...eadtextwidth \fi \noindent \fi #2
                                                  }
\placestructureheadnumbertext ...uctureheadtitle }
                                                  }\fi \endheadplacement {\g...
...
l.4   \section{AAA \nolist{aaa}}
                                
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

backends        > using xmp file 'c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1, subpage 1
systems         : end file D:/Lukas/ConTeXt/Samples/t-NoList.mkiv at line 5
 )<c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf>
mkiv lua stats : used config file          - c:/ConTeXt/tex/texmf/web2c/texmfcnf.lua
mkiv lua stats : used cache path           - c:/ConTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c
mkiv lua stats : input load time           - 0.109 seconds
mkiv lua stats : stored bytecode data      - 257 modules, 56 tables, 313 chunks
mkiv lua stats : cleaned up reserved nodes - 33 nodes, 9 lists of 411
mkiv lua stats : node memory usage         - 18 glue_spec
mkiv lua stats : node list callback tasks  - 6 unique task lists, 5 instances (re)created, 353 calls
mkiv lua stats : used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats : loaded patterns           - en::2
mkiv lua stats : language load time        - 0.156 seconds , nofpatterns: 1
mkiv lua stats : callbacks                 - direct: 515, indirect: 4501, total: 5016
mkiv lua stats : lxml preparation time     - 0.000 seconds, 0 nodes, 15 lpath calls, 0 cached calls
mkiv lua stats : result saved in file      - t-NoList.pdf
mkiv lua stats : loaded fonts              - 33 files: stmary10.afm lmmono12-regular.otf lmmono8-regular.otf lmmono9-regular.otf lmroman12-bold.otf lmroman12-regular.otf lmroman7-bold.otf lmroman7-regular.otf lmroman9-bold.otf lmroman9-regular.otf lmsans12-regular.otf lmsans8-regular.otf lmsans9-regular.otf eufb10.tfm eufb7.tfm eufm10.tfm eufm7.tfm msam10.tfm msam7.tfm msbm10.tfm msbm7.tfm lmex10.tfm lmmi12.tfm lmmi7.tfm lmmi9.tfm lmmib10.tfm lmmib7.tfm lmsy10.tfm lmsy7.tfm lmsy9.tfm rm-lmr12.tfm rm-lmr7.tfm rm-lmr9.tfm
mkiv lua stats : fonts load time           - 1.516 seconds 
mkiv lua stats : luatex banner             - this is luatex, version beta-0.64.0-2010111223 (web2c 2010) (rev 3956)
mkiv lua stats : control sequences         - 29998 of 165536
mkiv lua stats : current memory usage      - 32 MB (ctx: 33 MB)
mkiv lua stats : runtime                   - 4.844 seconds, 1 processed pages, 1 shipped pages, 0.206 pages/second


[-- Attachment #3: t-NoList.mkiv --]
[-- Type: application/octet-stream, Size: 72 bytes --]

\starttext
  \placecontent

  \section{AAA \nolist{aaa}}
\stoptext

[-- Attachment #4: t-NoList.pdf --]
[-- Type: application/pdf, Size: 4859 bytes --]

[-- Attachment #5: Type: text/plain, Size: 486 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] 12+ messages in thread

* Re: Problem with \nolist
  2010-11-28 17:29 Problem with \nolist Procházka Lukáš
@ 2010-11-28 18:00 ` Wolfgang Schuster
  2010-11-28 20:54   ` Procházka Lukáš
  2010-11-30 16:51   ` Problem with context.startsection (was: Problem with \nolist) Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 2 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2010-11-28 18:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


Am 28.11.2010 um 18:29 schrieb Procházka Lukáš:

> Hello,
> 
> I'm receiving errors when compiling the following code (although a .pdf is created):
> 
> [...]
> ! Undefined control sequence.
> l.1 AAA \nolist
>                {aaa}
> [...]
> 
> I'm trying to get something similar as described in contextref.pdf on the page 213. What's the problem?

Exactly what the error message tells you, the command \nolist is not defined in MkIV.

You can find a solution to a similar problem here:

http://wiki.contextgarden.net/MkIV_Differences#Nomarking.2FSelect

A alternative is to use the start/stop-commands where you can set a different
test for the table of contents with

\startsection[title={AAA aaa},list={AAA}]

...

\stopsection

Wolfgang


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

[-- Attachment #2: Type: text/plain, Size: 486 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] 12+ messages in thread

* Re: Problem with \nolist
  2010-11-28 18:00 ` Wolfgang Schuster
@ 2010-11-28 20:54   ` Procházka Lukáš
  2010-11-30 16:51   ` Problem with context.startsection (was: Problem with \nolist) Procházka Lukáš Ing. - Pontex s. r. o.
  1 sibling, 0 replies; 12+ messages in thread
From: Procházka Lukáš @ 2010-11-28 20:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

... Thanks.

Lukas


On Sun, 28 Nov 2010 19:00:37 +0100, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

>
> Am 28.11.2010 um 18:29 schrieb Procházka Lukáš:
>
>> Hello,
>>
>> I'm receiving errors when compiling the following code (although a .pdf is created):
>>
>> [...]
>> ! Undefined control sequence.
>> l.1 AAA \nolist
>>                {aaa}
>> [...]
>>
>> I'm trying to get something similar as described in contextref.pdf on the page 213. What's the problem?
>
> Exactly what the error message tells you, the command \nolist is not defined in MkIV.
>
> You can find a solution to a similar problem here:
>
> http://wiki.contextgarden.net/MkIV_Differences#Nomarking.2FSelect
>
> A alternative is to use the start/stop-commands where you can set a different
> test for the table of contents with
>
> \startsection[title={AAA aaa},list={AAA}]
>
> ...
>
> \stopsection
>
> Wolfgang


___________________________________________________________________________________
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] 12+ messages in thread

* Re: Problem with context.startsection (was: Problem with \nolist)
  2010-11-28 18:00 ` Wolfgang Schuster
  2010-11-28 20:54   ` Procházka Lukáš
@ 2010-11-30 16:51   ` Procházka Lukáš Ing. - Pontex s. r. o.
  2010-11-30 17:13     ` Wolfgang Schuster
  2010-11-30 21:38     ` Problem with context.startsection Peter Münster
  1 sibling, 2 replies; 12+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2010-11-30 16:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

On Sun, 28 Nov 2010 19:00:37 +0100, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

> \startsection[title={AAA aaa},list={AAA}]
>
> ...
>
> \stopsection
>

... OK, the example above works well when called from ConTeXt. But from Lua? - This Lua code seems to be wrong:

---
\enableregime[cp1250]

\starttext
   \placecontent % = TOC

   \startsection[title=TI,list=LI] % That's OK -
     sss
   \stopsection

   \startluacode
     context.startsection{title = "ti", list = "li"} % - but this is wrong
      ttt
     context.stopsection()
   \stopluacode
\stoptext
---

Normally, I don't have problem to call Lua, but in this case... Where's my mistake?

Kind regards,

Lukas


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: t.mkiv --]
[-- Type: application/octet-stream, Size: 259 bytes --]

\enableregime[cp1250]

\starttext
  \placecontent % = TOC

  \startsection[title=TI,list=LI]
    sss
  \stopsection

  \startluacode
    context.startsection{title = "ti", list = "li"}
    ttt
    context.stopsection()
  \stopluacode
\stoptext

[-- Attachment #3: Type: text/plain, Size: 486 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] 12+ messages in thread

* Re: Problem with context.startsection (was: Problem with \nolist)
  2010-11-30 16:51   ` Problem with context.startsection (was: Problem with \nolist) Procházka Lukáš Ing. - Pontex s. r. o.
@ 2010-11-30 17:13     ` Wolfgang Schuster
  2010-11-30 21:38     ` Problem with context.startsection Peter Münster
  1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2010-11-30 17:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 30.11.2010 um 17:51 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:

> On Sun, 28 Nov 2010 19:00:37 +0100, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:
> 
>> \startsection[title={AAA aaa},list={AAA}]
>> 
>> ...
>> 
>> \stopsection
>> 
> 
> ... OK, the example above works well when called from ConTeXt. But from Lua? - This Lua code seems to be wrong:
> 
> ---
> \enableregime[cp1250]
> 
> \starttext
>  \placecontent % = TOC
> 
>  \startsection[title=TI,list=LI] % That's OK -
>    sss
>  \stopsection
> 
>  \startluacode
>    context.startsection{title = "ti", list = "li"} % - but this is wrong

You forgot the braces:

context.startsection({title = "title", list = "list"})

Wolfgang

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Problem with context.startsection
  2010-11-30 16:51   ` Problem with context.startsection (was: Problem with \nolist) Procházka Lukáš Ing. - Pontex s. r. o.
  2010-11-30 17:13     ` Wolfgang Schuster
@ 2010-11-30 21:38     ` Peter Münster
  2010-12-01  7:23       ` Procházka Lukáš Ing. - Pontex s. r. o.
  2010-12-01  9:22       ` Hans Hagen
  1 sibling, 2 replies; 12+ messages in thread
From: Peter Münster @ 2010-11-30 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Nov 30 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> \enableregime[cp1250]

Remove this line, see also page 6 of
http://meeting.contextgarden.net/2010/talks/2010-09-15-documentworkflow/workflows.pdf

(ok, there seems to be a bug with \enableregime[], but if Hans could drop
support for 8-bit encodings, then he would have more time for other things ;)


>     context.startsection{title = "ti", list = "li"} % - but this is wrong

Use "--" instead of "%" in lua mode.


>      ttt

Should be: tex.print"ttt"

Cheers, Peter

-- 
Contact information: http://pmrb.free.fr/contact/
___________________________________________________________________________________
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] 12+ messages in thread

* Re: Problem with context.startsection
  2010-11-30 21:38     ` Problem with context.startsection Peter Münster
@ 2010-12-01  7:23       ` Procházka Lukáš Ing. - Pontex s. r. o.
  2010-12-01  9:22       ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2010-12-01  7:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

... Thanks, that was really silly mistake of mine - I was "Luaing" the original ctx code so I forgot to enclose the ttt into the context("ttt"); that was the problem.

Braces were OK - statement:

context.startsection({title = "ti", list = "li"})

may be shortened to:

context.startsection{title = "ti", list = "li"}

- that's OK in Lua.

On Tue, 30 Nov 2010 22:38:41 +0100, Peter Münster <pmlists@free.fr> wrote:

>>     context.startsection{title = "ti", list = "li"} % - but this is wrong
>
> Use "--" instead of "%" in lua mode.
>

(I wrote "%" this to the mail only.)

>
>>      ttt
>
> Should be: tex.print"ttt"

Or: context("ttt")

>
> Cheers, Peter
>

Lukas

___________________________________________________________________________________
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] 12+ messages in thread

* Re: Problem with context.startsection
  2010-11-30 21:38     ` Problem with context.startsection Peter Münster
  2010-12-01  7:23       ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2010-12-01  9:22       ` Hans Hagen
  2010-12-01 11:59         ` \enableregime (was: Re: Problem with context.startsection) Peter Münster
  1 sibling, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2010-12-01  9:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 30-11-2010 10:38, Peter Münster wrote:
> On Tue, Nov 30 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
>
>> \enableregime[cp1250]
>
> Remove this line, see also page 6 of
> http://meeting.contextgarden.net/2010/talks/2010-09-15-documentworkflow/workflows.pdf
>
> (ok, there seems to be a bug with \enableregime[], but if Hans could drop
> support for 8-bit encodings, then he would have more time for other things ;)

support for 8 bit is rather trivial so what is the problem?


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

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

* \enableregime (was: Re: Problem with context.startsection)
  2010-12-01  9:22       ` Hans Hagen
@ 2010-12-01 11:59         ` Peter Münster
  2010-12-01 12:13           ` Procházka Lukáš Ing. - Pontex s. r. o.
  2010-12-01 14:31           ` \enableregime Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: Peter Münster @ 2010-12-01 11:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Dec 01 2010, Hans Hagen wrote:

> support for 8 bit is rather trivial so what is the problem?

Test file:

\enableregime[cp1250]
\starttext
bla
\stoptext


Error:

! LuaTeX error ...text/tex/texmf-context/tex/context/base/regi-ini.lua:100:
  attempt to call global 'translate' (a nil value).

Peter

-- 
Contact information: http://pmrb.free.fr/contact/
___________________________________________________________________________________
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] 12+ messages in thread

* Re: \enableregime (was: Re: Problem with context.startsection)
  2010-12-01 11:59         ` \enableregime (was: Re: Problem with context.startsection) Peter Münster
@ 2010-12-01 12:13           ` Procházka Lukáš Ing. - Pontex s. r. o.
  2010-12-01 14:31           ` \enableregime Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2010-12-01 12:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

I had the same problem several days ago; Wolfgang answered but I cannot remember the mail thread.

It requires a small patch in c:\ConTeXt\tex\texmf-context\tex\context\base\regi-ini.lua - see the attachment.

Or maybe it's been patched in the newest ctx minimals.

Note that if you replace reg-ini.lua manually, you'll probably need to delete the lua-cache (c:\ConTeXt\tex\texmf-cache\luatex-cache\context\f53042fa2e1c106bc7e3383ec8c3a00c in my case) directory as well.

Cheers,

Lukas


On Wed, 01 Dec 2010 12:59:45 +0100, Peter Münster <pmlists@free.fr> wrote:

> On Wed, Dec 01 2010, Hans Hagen wrote:
>
>> support for 8 bit is rather trivial so what is the problem?
>
> Test file:
>
> \enableregime[cp1250]
> \starttext
> bla
> \stoptext
>
>
> Error:
>
> ! LuaTeX error ...text/tex/texmf-context/tex/context/base/regi-ini.lua:100:
>   attempt to call global 'translate' (a nil value).
>
> Peter
>


-- 
Ing. Lukáš Procházka [mailto:LPr@pontex.cz]
Pontex s. r. o.      [mailto:pontex@pontex.cz] [http://www.pontex.cz]
Bezová 1658
147 14 Praha 4

Tel: +420 244 062 238
Fax: +420 244 461 038

[-- Attachment #2: regi-ini.lua --]
[-- Type: application/octet-stream, Size: 3298 bytes --]

if not modules then modules = { } end modules ['regi-ini'] = {
    version   = 1.001,
    comment   = "companion to regi-ini.mkiv",
    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
    copyright = "PRAGMA ADE / ConTeXt Development Team",
    license   = "see context related readme files"
}

local utf = unicode.utf8
local char, utfchar, gsub = string.char, utf.char, string.gsub

--[[ldx--
<p>Regimes take care of converting the input characters into
<l n='utf'/> sequences. The conversion tables are loaded at
runtime.</p>
--ldx]]--

regimes          = regimes or { }
local regimes    = regimes

regimes.data     = regimes.data or { }
local data       = regimes.data

regimes.utf      = regimes.utf or { }

regimes.synonyms = regimes.synonyms or { }
local synonyms   = regimes.synonyms

if storage then
    storage.register("regimes/synonyms", synonyms, "regimes.synonyms")
else
    regimes.synonyms = { }
end

-- setmetatable(regimes.data,_empty_table_)

regimes.currentregime = "utf"

--[[ldx--
<p>We will hook regime handling code into the input methods.</p>
--ldx]]--

function regimes.number(n)
    if type(n) == "string" then return tonumber(n,16) else return n end
end

function regimes.setsynonym(synonym,target)
    synonyms[synonym] = target
end

function regimes.truename(regime)
    context((regime and synonyms[synonym] or regime) or regimes.currentregime)
end

function regimes.load(regime)
    regime = synonyms[regime] or regime
    if not data[regime] then
        environment.loadluafile("regi-"..regime, 1.001)
        if data[regime] then
            regimes.utf[regime] = { }
            for k,v in next, data[regime] do
                regimes.utf[regime][char(k)] = utfchar(v)
            end
        end
    end
end

function regimes.translate(line,regime)
    regime = synonyms[regime] or regime
    if regime and line then
        local rur = regimes.utf[regime]
        if rur then
            return (gsub(line,"(.)",rur)) -- () redundant
        end
    end
    return line
end

-- function regimes.enable(regime)
--     regime = synonyms[regime] or regime
--     if data[regime] then
--         regimes.currentregime = regime
--         local translate = regimes.translate
--         resolvers.filters.install('input',function(s)
--             return translate(s,regime)
--         end)
--     else
--         regimes.disable()
--     end
-- end
--
-- function regimes.disable()
--     regimes.currentregime = "utf"
--     resolvers.filters.install('input',nil)
-- end

local sequencers = utilities.sequencers

function regimes.process(s)
    return regimes.translate(s,regimes.currentregime)
end

function regimes.enable(regime)
    regime = synonyms[regime] or regime
    if data[regime] then
        regimes.currentregime = regime
        sequencers.enableaction(resolvers.openers.textfileactions,"regimes.process")
    else
        sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")
    end
end

function regimes.disable()
    regimes.currentregime = "utf"
    sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")
end

utilities.sequencers.prependaction(resolvers.openers.textfileactions,"system","regimes.process")
utilities.sequencers.disableaction(resolvers.openers.textfileactions,"regimes.process")

[-- Attachment #3: Type: text/plain, Size: 486 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] 12+ messages in thread

* Re: \enableregime
  2010-12-01 11:59         ` \enableregime (was: Re: Problem with context.startsection) Peter Münster
  2010-12-01 12:13           ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2010-12-01 14:31           ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2010-12-01 14:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 1-12-2010 12:59, Peter Münster wrote:
> \enableregime[cp1250]
> \starttext
> bla
> \stoptext

ok, will be fixed

-- 

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


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

* \enableregime
  2002-11-09 16:47 itemize headstyle SC? Hans Hagen
@ 2002-11-17  5:11 ` Bruce D'Arcus
  0 siblings, 0 replies; 12+ messages in thread
From: Bruce D'Arcus @ 2002-11-17  5:11 UTC (permalink / raw)



On Saturday, November 9, 2002, at 11:47 AM, Hans Hagen wrote:
>
>> Also, what command do I use to invoke a character encoding regime?
>> \usemodule doesn't seem to work...
>
> \enableregime[..]

Can't get this to work.  Let's start from the beginning then.  I have 
an encoding file I want to use that is not in the standard ConTeXt 
package.  Where do I put this file, and how do I insure that texexec 
finds it?

Bruce

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

end of thread, other threads:[~2010-12-01 14:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-28 17:29 Problem with \nolist Procházka Lukáš
2010-11-28 18:00 ` Wolfgang Schuster
2010-11-28 20:54   ` Procházka Lukáš
2010-11-30 16:51   ` Problem with context.startsection (was: Problem with \nolist) Procházka Lukáš Ing. - Pontex s. r. o.
2010-11-30 17:13     ` Wolfgang Schuster
2010-11-30 21:38     ` Problem with context.startsection Peter Münster
2010-12-01  7:23       ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-12-01  9:22       ` Hans Hagen
2010-12-01 11:59         ` \enableregime (was: Re: Problem with context.startsection) Peter Münster
2010-12-01 12:13           ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-12-01 14:31           ` \enableregime Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2002-11-09 16:47 itemize headstyle SC? Hans Hagen
2002-11-17  5:11 ` \enableregime Bruce D'Arcus

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