ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: Latest beta: Problems with \startstructurelevel (bug?)
Date: Wed, 22 Jun 2011 14:51:39 +0200	[thread overview]
Message-ID: <op.vxg90d1itpjj8f@lpr> (raw)
In-Reply-To: <E5715D73-89DD-4ACB-A83E-9BC9AF3085AF@googlemail.com>

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

Hello,

thanks for the fix, but -

- but I'm still getting an error, although I've just downloaded the latest beta, I tried, I got errors, so I corrected the strc-lev.lua by your proposition and oops, still the same error.

So? -

(Related files are attached.)

Kind regards,

Lukas


On Wed, 22 Jun 2011 14:19:13 +0200, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

>
> Am 22.06.2011 um 09:56 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
>
>> Hello,
>>
>> I'm not able to compile the following code with the
>> "ConTeXt  ver: 2011.06.15 11:49 MKIV  fmt: 2011.6.15  int: english/english":
>>
>> ----
>> \definestructurelevels
>>   [Test]
>>   [subsection,
>>    subsubsection,
>>    subsubsubsection,
>>    ]
>>
>> \starttext
>>  \startstructurelevel[Test][title=Title]
>>    aaa
>>  \stopstructurelevel
>> \stoptext
>> ----
>
> strc-lev.lua:
>
> function sections.startautolevel(category)
>     category = category ~= "" and category or default
>     level = level + 1
>     local lc = levels[category]
>     if not lc or level > #lc then
> -       context.nostartstructurehead { format("%s:%s",category,level) }
> +       context.nostarthead { format("%s:%s",category,level) }
>     else
> -       context.dostartstructurehead { lc[level] }
> +       context.dostarthead { lc[level] }
>     end
>     insert(categories,category)
> end
>
> function sections.stopautolevel()
>     local category = remove(categories)
>     local lc = levels[category]
>     if not lc or level > #lc then
> -       context.nostopstructurehead { format("%s:%s",category,level) }
> +       context.nostophead { format("%s:%s",category,level) }
>     else
> -       context.dostopstructurehead { lc[level] }
> +       context.dostophead { lc[level] }
>     end
>     level = level - 1
> end
>
> 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
> ___________________________________________________________________________________
>


-- 
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: strc-lev.lua --]
[-- Type: application/octet-stream, Size: 1642 bytes --]

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

local format = string.format
local insert, remove = table.insert, table.remove

local sections = structures.sections
local default  = interfaces.variables.default

sections.levels = sections.levels or { }

local level, levels, categories = 0, sections.levels, { }

storage.register("structures/sections/levels", levels, "structures.sections.levels")

function sections.defineautolevels(category,list)
    levels[category] = utilities.parsers.settings_to_array(list)
end

function sections.startautolevel(category)
    category = category ~= "" and category or default
    level = level + 1
    local lc = levels[category]
    if not lc or level > #lc then
--       context.nostartstructurehead { format("%s:%s",category,level) }
       context.nostarthead { format("%s:%s",category,level) }
    else
--       context.dostartstructurehead { lc[level] }
       context.dostarthead { lc[level] }
    end
    insert(categories,category)
end

function sections.stopautolevel()
    local category = remove(categories)
    local lc = levels[category]
    if not lc or level > #lc then
--       context.nostopstructurehead { format("%s:%s",category,level) }
       context.nostophead { format("%s:%s",category,level) }
    else
--       context.dostopstructurehead { lc[level] }
       context.dostophead { lc[level] }
    end
    level = level - 1
end

[-- Attachment #3: test.log --]
[-- Type: application/octet-stream, Size: 5821 bytes --]

(test.mkiv

ConTeXt  ver: 2011.06.19 14:17 MKIV  fmt: 2011.6.22  int: english/english

system          > cont-new.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system          > beware: some patches loaded from cont-new.mkiv
)
system          > test.top loaded
system          > options > begin of optionfile
system          > options >
system          > options > % runtime options files (command line driven)
system          > options > \unprotect
system          > options > % feedback and basic job control
system          > options > % handy for special styles
system          > options > \startluacode
system          > options > document = document or { }
system          > options > document.arguments={
system          > options > }
system          > options > document.files={
system          > options >  "test.mkiv",
system          > options > }
system          > options > \stopluacode
system          > options > % process info
system          > options > \setupsystem[inputfile=test.mkiv]
system          > options > \setupsystem[\c!n=1,\c!m=1]
system          > options > % modes
system          > options > % options (not that important)
system          > options > \startsetups *runtime:options
system          > options > \stopsetups
system          > options > % styles and modules
system          > options > \startsetups *runtime:modules
system          > options > \stopsetups
system          > options > % done
system          > options > \protect \endinput
system          > options >
system          > options > end of optionfile
(test.top)
fonts           > latin modern fonts are not preloaded
languages       > language en is active
{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts           > preloading latin modern fonts (second stage)
(c:/ConTeXt/tex/texmf-context/tex/context/base/type-siz.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-otf.mkiv){c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}
fonts           > virtual math > unable to resolve name mapsfromchar
fonts           > fallback modern rm 12pt is loaded
system          > begin file test.mkiv at line 8
! Undefined control sequence.

system          > tex > error on line 1 in file test.mkiv: Undefined control sequence ...

 1 >>  \definestructurelevels
 2        [Test]
 3        [subsection,
 4         subsubsection,
 5         subsubsubsection,
 6         ]
 7     
 8     \starttext
 9       \startstructurelevel[Test][title=Title]
10         aaa
11       \stopstructurelevel

l.1 \dostartstructurehead
                         
<argument> ...res.sections.startautolevel("Test")}
                                                  
\secondoftwoarguments #1#2->#2
                              
l.9   \startstructurelevel[Test]
                                [title=Title]
? 
! Undefined control sequence.

system          > tex > error on line 1 in file test.mkiv: Undefined control sequence ...

 1 >>  \definestructurelevels
 2        [Test]
 3        [subsection,
 4         subsubsection,
 5         subsubsubsection,
 6         ]
 7     
 8     \starttext
 9       \startstructurelevel[Test][title=Title]
10         aaa
11       \stopstructurelevel

l.1 \dostopstructurehead
                        
\stopstructurelevel ...s.sections.stopautolevel()}
                                                  
l.11   \stopstructurelevel
                          
? 
backend         > xmp > using file 'c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1, subpage 1
system          > end file test.mkiv at line 12
 )<c:/ConTeXt/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf>
mkiv lua stats  > used config file          - selfautoparent:texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path           - c:/ConTeXt/tex/texmf-cache/luatex-cache/context/2448223e6631addb83df348d74153606
mkiv lua stats  > input load time           - 0.047 seconds
mkiv lua stats  > stored bytecode data      - 289 modules, 61 tables, 350 chunks
mkiv lua stats  > cleaned up reserved nodes - 33 nodes, 9 lists of 423
mkiv lua stats  > node memory usage         - 2 glue, 2 penalty, 9 attribute, 28 glue_spec, 3 attribute_list
mkiv lua stats  > node list callback tasks  - 6 unique task lists, 5 instances (re)created, 2359 calls
mkiv lua stats  > used backend              - pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded patterns           - en::2
mkiv lua stats  > callbacks                 - 2496 direct, 2975 indirect, 5471 total
mkiv lua stats  > randomizer                - resumed with value 0.78527176732688
mkiv lua stats  > lxml preparation time     - 0.000 seconds, 0 nodes, 15 lpath calls, 0 cached calls
mkiv lua stats  > result saved in file      - test.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           - 0.656 seconds 
mkiv lua stats  > luatex banner             - this is luatex, version beta-0.70.1-2011061421 (web2c 2011) (rev 4277)
mkiv lua stats  > control sequences         - 30572 of 165536
mkiv lua stats  > current memory usage      - 31 MB (ctx: 31 MB)
mkiv lua stats  > runtime                   - 2.875 seconds, 1 processed pages, 1 shipped pages, 0.348 pages/second


[-- Attachment #4: test.mkiv --]
[-- Type: application/octet-stream, Size: 202 bytes --]

\definestructurelevels
   [Test]
   [subsection,
    subsubsection,
    subsubsubsection,
    ]

\starttext
  \startstructurelevel[Test][title=Title]
    aaa
  \stopstructurelevel
\stoptext

[-- Attachment #5: 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
___________________________________________________________________________________

  reply	other threads:[~2011-06-22 12:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  7:56 Procházka Lukáš Ing. - Pontex s. r. o.
2011-06-22 12:19 ` Wolfgang Schuster
2011-06-22 12:51   ` Procházka Lukáš Ing. - Pontex s. r. o. [this message]
2011-06-22 12:59     ` Wolfgang Schuster
2011-06-22 13:09       ` Procházka Lukáš Ing. - Pontex s. r. o.
2011-06-22 13:11         ` luigi scarso
2011-06-22 13:17           ` Procházka Lukáš Ing. - Pontex s. r. o.
2011-06-23  6:25             ` Procházka Lukáš Ing. - Pontex s. r. o.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.vxg90d1itpjj8f@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).