Aditya Mahajan | 6 May 15:39 2011
Picon

Error with export=yes

Hi,

The following gives an error:

\setupbackend[export=yes]
\starttext test \stoptext

! LuaTeX error 
...minimals/texmf-context/tex/context/base/util-prs.lua:125: bad argument 
#2 to 'lpegmatch' (string expected, got boolean).

system          > tex > error on line 0 in file : LuaTeX error  ...

<empty file>

<*> ./test

?

Any ideas on how to fix this?

Also, I looked at back-exp.mkiv and it appears that xhtml export is 
possible. If so, what is the command to enable it. (I am guessing 
\setupexport[export=yes, xhtml=yes] but cannot test it due to the above 
error).

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

(Continue reading)

Hans Hagen | 6 May 16:07 2011
Picon

Re: Error with export=yes

On 6-5-2011 3:39, Aditya Mahajan wrote:
> \setupbackend[export=yes]
> \starttext test \stoptext

I'll fix it. You can set an xhtml file as well as some css.

\setupbackend[export=yes]
\setupbackend[export=yes,xhtml=yes]
\setupbackend[export=yes,xhtml=whatever.xhtml]
\setupbackend[export=yes,css={whatever.css,somemore.css}]

So, you can have dual output: pdf and xhtml. Normally the xml + css will 
do but if you also want interactivity then you need the xhtml option 
(adds some 'a' wrappers). I will also add an epub option for producing 
those epub zip files.

I can send you an example (cld-mkvi) if needed that shows an example of 
css hooked into such output. That manual starts with:

\setupbackend
   [export=cld-mkiv-export.xml,
    xhtml=cld-mkiv-export.xhtml,
    css={cld-mkiv-export.css,mathml.css}]

There's an article in the eurotex proceedings about these issues. I 
don't know if Mojca has put the presentation somewhere online.

Hans

-----------------------------------------------------------------
(Continue reading)

Aditya Mahajan | 6 May 16:45 2011
Picon

Re: Error with export=yes

On Fri, 6 May 2011, Hans Hagen wrote:

> On 6-5-2011 3:39, Aditya Mahajan wrote:
>> \setupbackend[export=yes]
>> \starttext test \stoptext
>
> I'll fix it. You can set an xhtml file as well as some css.
>
> \setupbackend[export=yes]
> \setupbackend[export=yes,xhtml=yes]
> \setupbackend[export=yes,xhtml=whatever.xhtml]
> \setupbackend[export=yes,css={whatever.css,somemore.css}]

Ah, thanks.

> So, you can have dual output: pdf and xhtml. Normally the xml + css will do 
> but if you also want interactivity then you need the xhtml option (adds some 
> 'a' wrappers). I will also add an epub option for producing those epub zip 
> files.

That will be great.

> I can send you an example (cld-mkvi) if needed that shows an example of css 
> hooked into such output. That manual starts with:
>
> \setupbackend
>  [export=cld-mkiv-export.xml,
>   xhtml=cld-mkiv-export.xhtml,
>   css={cld-mkiv-export.css,mathml.css}]

(Continue reading)

Reviczky, Adam | 7 May 02:57 2011
Picon

Re: Error with export=yes

> \setupbackend
>    [export=cld-mkiv-export.xml,
>     xhtml=cld-mkiv-export.xhtml,
>     css={cld-mkiv-export.css,mathml.css}]
> 
> There's an article in the eurotex proceedings about these issues. I 
> don't know if Mojca has put the presentation somewhere online.

Since this worked nicely on a simple "hello world" example, I thought I'm trying it out on a few documents I have.

The logs are attached, do I need to make a minimal out of it?

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________
Hans Hagen | 7 May 12:24 2011
Picon

Re: Error with export=yes

On 7-5-2011 2:57, Reviczky, Adam wrote:
>> \setupbackend
>>     [export=cld-mkiv-export.xml,
>>      xhtml=cld-mkiv-export.xhtml,
>>      css={cld-mkiv-export.css,mathml.css}]
>>
>> There's an article in the eurotex proceedings about these issues. I
>> don't know if Mojca has put the presentation somewhere online.
>
> Since this worked nicely on a simple "hello world" example, I thought I'm trying it out on a few documents I have.
>
> The logs are attached, do I need to make a minimal out of it?

fixed in next beta

(you can replace gmatch by string.gmatch as a fast fix)

-----------------------------------------------------------------
                                           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 <at> 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
(Continue reading)

Reviczky, Adam | 9 May 04:13 2011
Picon

Re: Error with export=yes

> fixed in next beta
> 
> (you can replace gmatch by string.gmatch as a fast fix)

Thanks, that fixed the problem for one, but still it fails on my thesis with:

! LuaTeX error /usr/share/texmf/tex/context/base/back-exp.lua:868: attempt to index field '?' (a nil value).

<empty file>

I hope it is not because of my tex file.
Log attached.

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________
Reviczky, Adam | 9 May 04:57 2011
Picon

Re: Error with export=yes

Further, using an example with dingbats:

%%%
\setupbackend[export=cld-mkiv-export.xml,xhtml=cld-mkiv-export.xhtml,css={cld-mkiv-export.css,mathml.css}]

\starttext
Hello world! \getnamedglyphdirect{name:dingbats}{a79}
\stoptext
%%%

Produces a broken xhtml (XML Parsing Error: not well-formed), the pdf is fine of course.
The end-mark is exported to "������" in xhtml.

Not sure if that's anything to fix, just wanted to let you know.

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________
Hans Hagen | 9 May 13:24 2011
Picon

Re: Error with export=yes

On 9-5-2011 4:57, Reviczky, Adam wrote:
> Further, using an example with dingbats:
>
> %%%
> \setupbackend[export=cld-mkiv-export.xml,xhtml=cld-mkiv-export.xhtml,css={cld-mkiv-export.css,mathml.css}]
>
> \starttext
> Hello world! \getnamedglyphdirect{name:dingbats}{a79}
> \stoptext
> %%%
>
> Produces a broken xhtml (XML Parsing Error: not well-formed), the pdf is fine of course.
> The end-mark is exported to "������" in xhtml.

I don't get tha there.

> Not sure if that's anything to fix, just wanted to let you know.

Anyhow,

\setupbackend[export=yes]

\definefontsynonym [Dingbats] [name:dingbats] [features=dingbats]

\starttext

Hello world!
(\getnamedglyphdirect{Dingbats}{a79})
(\getnamedglyphdirect{Dingbats*dingbats}{a79})
(\getglyphdirect{Dingbats*dingbats}{\number"2756})
(Continue reading)

Reviczky, Adam | 9 May 13:32 2011
Picon

Re: Error with export=yes

> Anyhow,
> 
> \setupbackend[export=yes]
> 
> \definefontsynonym [Dingbats] [name:dingbats] [features=dingbats]
> 
> \starttext
> 
> Hello world!
> (\getnamedglyphdirect{Dingbats}{a79})
> (\getnamedglyphdirect{Dingbats*dingbats}{a79})
> (\getglyphdirect{Dingbats*dingbats}{\number"2756})
> ({\definedfont[Dingbats]\char"2756})
> 
> \stoptext
> 
> (1) will export 'v'
> (2) ok in next beta
> (3) ok
> (4) ok

This is strange, attached my export and log.
PDF is still fine.

Do I miss something from context?

Adam
Attachment (test.export): application/octet-stream, 612 bytes
Attachment (test.log): text/x-log, 6517 bytes
(Continue reading)

Hans Hagen | 9 May 13:52 2011
Picon

Re: Error with export=yes

On 9-5-2011 1:32, Reviczky, Adam wrote:
>> Anyhow,
>>
>> \setupbackend[export=yes]
>>
>> \definefontsynonym [Dingbats] [name:dingbats] [features=dingbats]
>>
>> \starttext
>>
>> Hello world!
>> (\getnamedglyphdirect{Dingbats}{a79})
>> (\getnamedglyphdirect{Dingbats*dingbats}{a79})
>> (\getglyphdirect{Dingbats*dingbats}{\number"2756})
>> ({\definedfont[Dingbats]\char"2756})
>>
>> \stoptext
>>
>> (1) will export 'v'
>> (2) ok in next beta
>> (3) ok
>> (4) ok
>
> This is strange, attached my export and log.
> PDF is still fine.
>
> Do I miss something from context?

no clue

-----------------------------------------------------------------
(Continue reading)

Reviczky, Adam | 9 May 14:53 2011
Picon

Re: Error with export=yes

> no clue

So it looks like having the urw zapfding fonts from texlive mess this up (uzdr.afm, uzdr.pfb and uzdr.pfm).
Don't you have them? Why is it a problem if context finds those?

Without those fonts, I have this in the log:

fonts           > names > font database has matching configuration and file hashes
fonts           > defining > font with asked name 'dingbats' is not found using lookup 'name'
fonts           > defining > unknown font dingbats, loading aborted
fonts           > defining > unable to define dingbats as \**currentsymbolfont**
fonts           > names > font database has matching configuration and file hashes
fonts           > defining > font with asked name 'dingbats' is not found using lookup 'name'
fonts           > defining > unknown font dingbats, loading aborted
fonts           > defining > unable to define dingbats as \**currentsymbolfont**
fonts           > names > font database has matching configuration and file hashes
fonts           > defining > font with asked name 'dingbats' is not found using lookup 'name'
fonts           > defining > unknown font dingbats, loading aborted
fonts           > defining > unable to define dingbats as \**thedefinedfont**

But now the export is fine, on the other hand the pdf misses those characters.

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
(Continue reading)

Hans Hagen | 9 May 15:01 2011
Picon

Re: Error with export=yes

On 9-5-2011 2:53, Reviczky, Adam wrote:
>> no clue
>
> So it looks like having the urw zapfding fonts from texlive mess this up (uzdr.afm, uzdr.pfb and uzdr.pfm).
> Don't you have them? Why is it a problem if context finds those?
>
> Without those fonts, I have this in the log:
>
> fonts>  names>  font database has matching configuration and file hashes
> fonts>  defining>  font with asked name 'dingbats' is not found using lookup 'name'
> fonts>  defining>  unknown font dingbats, loading aborted
> fonts>  defining>  unable to define dingbats as \**currentsymbolfont**
> fonts>  names>  font database has matching configuration and file hashes
> fonts>  defining>  font with asked name 'dingbats' is not found using lookup 'name'
> fonts>  defining>  unknown font dingbats, loading aborted
> fonts>  defining>  unable to define dingbats as \**currentsymbolfont**
> fonts>  names>  font database has matching configuration and file hashes
> fonts>  defining>  font with asked name 'dingbats' is not found using lookup 'name'
> fonts>  defining>  unknown font dingbats, loading aborted
> fonts>  defining>  unable to define dingbats as \**thedefinedfont**

i use a system font

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
(Continue reading)

Hans Hagen | 9 May 17:12 2011
Picon

Re: Error with export=yes

Hi,

Something else to play with, making an epub archive. At some point I 
will add support for images etc. At the end of a run you will see:

export > saving specification in 'oeps.specification' (mtxrun --script 
epub --make oeps.specification)

The mentioned mtxrun call will make an archive.

Hans

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

Reviczky, Adam | 9 May 17:28 2011
Picon

Re: Error with export=yes

> Something else to play with, making an epub archive. At some point I
> will add support for images etc. At the end of a run you will see:
> 
> export > saving specification in 'oeps.specification' (mtxrun --script
> epub --make oeps.specification)
> 
> The mentioned mtxrun call will make an archive.

Excellent, didn't expect that so soon.
I'm on it!

Cheers
Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________

Reviczky, Adam | 9 May 18:48 2011
Picon

Re: Error with export=yes

> export > saving specification in 'oeps.specification' (mtxrun --script
> epub --make oeps.specification)

Somehow I can't get this working yet, this doesn't get triggered at my end, do I forget something?

shouldn't also
back-exp.lua line 406:
-        handle:write(" url='",file,"'")
+        handle:write(" url='",url,"'")

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________

Wolfgang Schuster | 9 May 18:55 2011

Re: Error with export=yes


Am 09.05.2011 um 18:48 schrieb Reviczky, Adam:

>> export > saving specification in 'oeps.specification' (mtxrun --script
>> epub --make oeps.specification)
> 
> Somehow I can't get this working yet, this doesn't get triggered at my end, do I forget something?

Do you set a value for the xhtml key?

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________

Reviczky, Adam | 9 May 19:05 2011
Picon

Re: Error with export=yes

> Do you set a value for the xhtml key?

Yeah, I figured that out now, epub is generated now, still playing with it, trying with calibre ..

Thanks
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________

Reviczky, Adam | 9 May 19:30 2011
Picon

Re: Error with export=yes

I still must miss something, because the epub doesn't seem to contain anything.

So here's a simple example:

\setupbackend[export=yes,xhtml=test.xhtml]
\starttext
Hello world!
\stoptext

Then after running context:

mtxrun --script epub --make test.specification
table={
 ["files"]={ "test.xhtml" },
 ["identifier"]="89a4fe19-4610-b806-b0dd-5fad6ede3dde",
 ["name"]="test",
 ["root"]="test.xhtml",
}
  adding: mimetype (stored 0%)
  adding: META-INF/ (stored 0%)
  adding: META-INF/container.xml (deflated 32%)
  adding: OPS/ (stored 0%)
  adding: OPS/test.opf (deflated 49%)

mtx-epub        | epub archive: test.tree/test.epub

The xhtml seems to be missing from OPS, but even putting that in there doesn't give me a working epub (even
though it increases the epub size).

Help?
(Continue reading)

Reviczky, Adam | 9 May 19:45 2011
Picon

Re: Error with export=yes

> The xhtml seems to be missing from OPS, but even putting that in there doesn't give me a working epub (even
though it increases the epub size).

Right, adding a title solves that, but still empty when trying to open it ...
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context <at> 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
___________________________________________________________________________________

Hans Hagen | 9 May 22:01 2011
Picon

Re: Error with export=yes

On 9-5-2011 7:30, Reviczky, Adam wrote:

> The xhtml seems to be missing from OPS, but even putting that in there doesn't give me a working epub (even
though it increases the epub size).

new beta

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


Gmane