Re: [NTG-context] ePub issues: XML structure

2020-03-12 Thread Axel Kielhorn


> Am 12.03.2020 um 08:09 schrieb Henning Hraban Ramm :
> 
>> Am 2020-03-11 um 22:42 schrieb Axel Kielhorn :
>> 
>> Actually your workshop is the reason I plan to attend the meeting.
> 
> Nice to hear, you’re welcome!

As a preparation I have updated my german intro at:

https://github.com/AKielhorn/Context-Intro

> 
>> I hope Corona does not interfere.
> 
> me too! Yesterday the DANTE board wrote they’re still considering.
> Well, my bed is paid for, and won’t get refunded.

We’ll see.

Greetings Axel

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ePub issues: XML structure

2020-03-12 Thread Henning Hraban Ramm
> Am 2020-03-11 um 22:42 schrieb Axel Kielhorn :
> 
>> Am 11.03.2020 um 20:59 schrieb Henning Hraban Ramm :
>> 
>> Hi Axel,
>> will I meet you by chance at the DANTE in Lübeck?
>> 
>> In that case it would be nice if you could assist me with my "ConTeXt for 
>> beginners workshop" to tell something about Lua & XML.
>> 
>> Greetlings, Hraban
> 
> Actually your workshop is the reason I plan to attend the meeting.

Nice to hear, you’re welcome!

> I hope Corona does not interfere.

me too! Yesterday the DANTE board wrote they’re still considering.
Well, my bed is paid for, and won’t get refunded.

> Greetling[1], Axel
> 
> [1] There are no Tikzgreetlings, as far as I know.

;)
While I got used to TikZ in a LaTeX project, I’m not very fond of TikZlings 
(funny, but not as funny as their creators seem to deem them).

(My greetlings are just a translation of the “Grüßlinge” that we used in one of 
my youth groups. I’m fading them out.)

Best, Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ePub issues: XML structure

2020-03-11 Thread Axel Kielhorn


> Am 11.03.2020 um 20:59 schrieb Henning Hraban Ramm :
> 
> Hi Axel,
> will I meet you by chance at the DANTE in Lübeck?
> 
> In that case it would be nice if you could assist me with my "ConTeXt for 
> beginners workshop" to tell something about Lua & XML.
> 
> Greetlings, Hraban

Actually your workshop is the reason I plan to attend the meeting.

I hope Corona does not interfere.

Greetling[1], Axel

[1] There are no Tikzgreetlings, as far as I know.


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ePub issues: XML structure

2020-03-11 Thread Henning Hraban Ramm
Hi Axel,
will I meet you by chance at the DANTE in Lübeck?

In that case it would be nice if you could assist me with my "ConTeXt for 
beginners workshop" to tell something about Lua & XML.

Greetlings, Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ePub issues: XML structure

2020-03-06 Thread Henning Hraban Ramm

> Am 2020-03-04 um 07:55 schrieb Henning Hraban Ramm :
> 
> While the first book in a series of four is now ready with a lot of manual 
> corrections, in the second one the XML structure is messed up: the chapter 
> title structure comes only after the chapter content, and index entry tags 
> are empty with the actual entry behind like this:
> 
> Ein sentimentales Rührstück ist Rico, 
> Oskar und die Tieferschatten dennoch nicht. Die beiden 
> Hauptdarsteller  internal="396">Anton Petzold (Rico) und  detail="index" internal="397">Juri Winkler (Oskar) füllen 
> ihre Rollen ganz wunderbar aus...
> 
> In ConTeXt code I marked the actors with
> \def\NPers#1#2{\index{#2, #1}#1 #2}
> as \NPers{Anton}{Petzold}.
> 
> But since that just uses \index, the XML tag should catch the contents, don’t 
> you think?

Coming back to this. I recognized that of course the name behind 
 is completely correct and according to my definition of 
\NPers.
But the content of \index (here: "Petzold, Anton") is still missing, while the 
command creates this  structure.

Since you (Hans) say the export only looks at the output, then it makes sense 
that is empty, since there’s nothing to see.

Actually my XSLT already looks for the :


Petzold, Anton
76,77


And the lookup actually works, so I don’t know why I’m complaining. Didn’t 
understand my own workflow any more.

Now to solve the title structure mystery…


Best, Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] epub and pdf not the same

2020-03-04 Thread Wolfgang Schuster

Hans van der Meer schrieb am 04.03.2020 um 13:23:
On 3 Mar 2020, at 22:04, Rik Kabel > wrote:


Instructions for creating the .epub from the export are contained in 
the log file.


In the log comes:
    create epub with: mtxrun --script epub --make "kookboek" --purge 
--rename --svgmath

This I did.

The log gives:
 adding: mimetype (stored 0%)
  adding: META-INF/ (stored 0%)
  adding: META-INF/container.xml (deflated 32%)
  adding: OEBPS/ (stored 0%)
  adding: OEBPS/nav.xhtml (deflated 49%)
  adding: OEBPS/images/ (stored 0%)
  adding: OEBPS/kookboek.opf (deflated 65%)
  adding: OEBPS/styles/ (stored 0%)
  adding: OEBPS/styles/kookboek-styles.css (deflated 35%)
  adding: OEBPS/styles/kookboek-defaults.css (deflated 80%)
  adding: OEBPS/styles/kookboek-images.css (deflated 7%)
  adding: OEBPS/cover.xhtml (deflated 38%)
  adding: OEBPS/kookboek-div.html (deflated 67%)
  adding: OEBPS/toc.ncx (deflated 53%)
mtx-epub     | epub archive made using zip: kookboek.epub


But, the resulting epub is bad. Compare the output as pdf with the 
output as epub and it is immediately clear that something is wrong in 
the production of the epub. See also the corresponding -raw.xml. 
Unless I am making a gross mistake.


You make things easier when you show your TeX file.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] epub and pdf not the same

2020-03-04 Thread Hans van der Meer

On 3 Mar 2020, at 22:04, Rik Kabel  wrote:Instructions for creating the .epub from the export are contained in the log file.In the log comes:    create epub with: mtxrun --script epub --make "kookboek" --purge --rename --svgmathThis I did.The log gives: adding: mimetype (stored 0%)  adding: META-INF/ (stored 0%)  adding: META-INF/container.xml (deflated 32%)  adding: OEBPS/ (stored 0%)  adding: OEBPS/nav.xhtml (deflated 49%)  adding: OEBPS/images/ (stored 0%)  adding: OEBPS/kookboek.opf (deflated 65%)  adding: OEBPS/styles/ (stored 0%)  adding: OEBPS/styles/kookboek-styles.css (deflated 35%)  adding: OEBPS/styles/kookboek-defaults.css (deflated 80%)  adding: OEBPS/styles/kookboek-images.css (deflated 7%)  adding: OEBPS/cover.xhtml (deflated 38%)  adding: OEBPS/kookboek-div.html (deflated 67%)  adding: OEBPS/toc.ncx (deflated 53%)mtx-epub        | epub archive made using zip: kookboek.epubBut, the resulting epub is bad. Compare the output as pdf with the output as epub and it is immediately clear that something is wrong in the production of the epub. See also the corresponding -raw.xml. Unless I am making a gross mistake.

kookboek.epub
Description: application/epub


kookboek.pdf
Description: Adobe PDF document


kookboek-raw.xml
Description: XML document
dr. Hans van der Meer___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] ePub issues: XML structure

2020-03-04 Thread Hans Hagen

On 3/4/2020 7:55 AM, Henning Hraban Ramm wrote:

Not only Hans van der Meer is producing (or trying to produce) ePubs at the 
moment; I reviewed my XSLT workflow 
(https://wiki.contextgarden.net/Epub_Sample) since my publisher colleagues and 
our distributor aren’t happy about just publishing PDFs as eBooks.

While the first book in a series of four is now ready with a lot of manual 
corrections, in the second one the XML structure is messed up: the chapter 
title structure comes only after the chapter content, and index entry tags are 
empty with the actual entry behind like this:

Ein sentimentales Rührstück ist Rico, Oskar und die Tieferschatten dennoch nicht. Die beiden 
Hauptdarsteller Anton Petzold (Rico) und Juri Winkler (Oskar) füllen ihre Rollen ganz wunderbar aus...

In ConTeXt code I marked the actors with
\def\NPers#1#2{\index{#2, #1}#1 #2}
as \NPers{Anton}{Petzold}.

But since that just uses \index, the XML tag should catch the contents, don’t 
you think?

I’ll come up with a MWE; don’t know if I’ll manage to reproduce the 
title/contents mixup though. The other book’s export is ok within the same 
project. It uses the same environment, but a slightly differing chapter setup. 
Any hints which setting could cause the re-ordering? (And I use \startchapter … 
\stopchapter of course.)
personally id i'd want an export i'd use a mode where i turn off all 
kind of fancy formatting


at some time i might even split off the export in the sense that when 
enabled some other layout features get disabled (for instance: when you 
make a chapter title setup that completely decouples the order, e.g. put 
it on some layer, you can't expect an export to work: export doesn't 
look at the input, it works with the output and reconstructs from that)


Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] ePub issues: XML structure

2020-03-03 Thread Henning Hraban Ramm
Not only Hans van der Meer is producing (or trying to produce) ePubs at the 
moment; I reviewed my XSLT workflow 
(https://wiki.contextgarden.net/Epub_Sample) since my publisher colleagues and 
our distributor aren’t happy about just publishing PDFs as eBooks.

While the first book in a series of four is now ready with a lot of manual 
corrections, in the second one the XML structure is messed up: the chapter 
title structure comes only after the chapter content, and index entry tags are 
empty with the actual entry behind like this:

Ein sentimentales Rührstück ist Rico, Oskar 
und die Tieferschatten dennoch nicht. Die beiden Hauptdarsteller 
Anton 
Petzold (Rico) und Juri Winkler (Oskar) füllen ihre Rollen ganz 
wunderbar aus...

In ConTeXt code I marked the actors with
\def\NPers#1#2{\index{#2, #1}#1 #2}
as \NPers{Anton}{Petzold}.

But since that just uses \index, the XML tag should catch the contents, don’t 
you think?

I’ll come up with a MWE; don’t know if I’ll manage to reproduce the 
title/contents mixup though. The other book’s export is ok within the same 
project. It uses the same environment, but a slightly differing chapter setup. 
Any hints which setting could cause the re-ordering? (And I use \startchapter … 
\stopchapter of course.)

Best, Hraban
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Epub export css buglets

2020-01-17 Thread Rik Kabel

On 1/10/2020 10:59, Rik Kabel wrote:

Here ya go, about as minimal as I can imagine:

\setupbackend [export=yes]
\setupexport  []
\starttext
!
\stoptext

and in the resulting export styles directory, I get:

g:\yoiks-export\styles>grep "namespace\|weight.*italic\|text-width" *.css
yoiks-defaults.css:@namespace context 
url('http://www.pragma-ade.com/context/export') ;
yoiks-defaults.css: font-weight : italic ;
yoiks-images.css:@namespace context url('%namespace%') ;
yoiks-styles.css:@namespace context url('%namespace%') ;
yoiks-styles.css:text-width : justify !important ;
yoiks-templates.css:@namespace context url('%namespace%') ;

So:

  * three unexpanded %namespace%s,
  * one invalid property (text-width),
  * and one incorrect property (font-weight should be font-style).

The *namespace* and *text-width* issues are now fixed, but the 
*font-weight : italic* fault in default.css remains.


I also note that the W3C CSS validator reports for styles.css:

   11     document, div.document     inherited is not a hyphens value :
   inherited

That validator (and others) also report a number of issues for the 
@counter-style rule, which seems to have changed significantly since 
this CSS was developed. Validators report a number of smaller issues as 
well.


I understand that export output is a low-priority feature.

--
Rik


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Epub export css buglets

2020-01-10 Thread Rik Kabel

On 1/9/2020 11:25, Hans Hagen wrote:

On 1/6/2020 7:08 PM, Rik Kabel wrote:

A couple of small issues with the css for epub output.

First, back-exp.lua creates, in \jobname-styles.css

    @namespace context url('%namespace%') ;

This should probably be:

    @namespace context url('http://www.pragma-ade.com/context/export') ;

That file also has:

    document,
    %namespace%div.document {
 font-size  : %size% !important ;
 max-width  : %width% !important ;
 text-width : %align% !important ;
 hyphens    : %hyphens% !important ;
    }

which contains the invalid css property text-width. Perhaps that 
should be text-align or text-justify.


Something else appears to be creating, in \jobname-defaults.css:

    pubfld[detail="title"],
    div.pubfld.title {
 display : inline ;
 font-weight : italic ;
    }

which incorrectly assigns italic to font-weight when of course it  is 
a font-style as far as css is concerned. This can be seen in file 
export-example.css in the distribution.

can you make a mwe ...



Here ya go, about as minimal as I can imagine:

   \setupbackend [export=yes]
   \setupexport  []
   \starttext
   !
   \stoptext

and in the resulting export styles directory, I get:

   g:\yoiks-export\styles>grep "namespace\|weight.*italic\|text-width" *.css
   yoiks-defaults.css:@namespace context 
url('http://www.pragma-ade.com/context/export') ;
   yoiks-defaults.css: font-weight : italic ;
   yoiks-images.css:@namespace context url('%namespace%') ;
   yoiks-styles.css:@namespace context url('%namespace%') ;
   yoiks-styles.css:text-width : justify !important ;
   yoiks-templates.css:@namespace context url('%namespace%') ;

So:

 * three unexpanded %namespace%s,
 * one invalid property (text-width),
 * and one incorrect property (font-weight should be font-style).

--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Epub export css buglets

2020-01-09 Thread Hans Hagen

On 1/6/2020 7:08 PM, Rik Kabel wrote:

A couple of small issues with the css for epub output.

First, back-exp.lua creates, in \jobname-styles.css

@namespace context url('%namespace%') ;

This should probably be:

@namespace context url('http://www.pragma-ade.com/context/export') ;

That file also has:

document,
%namespace%div.document {
 font-size  : %size% !important ;
 max-width  : %width% !important ;
 text-width : %align% !important ;
 hyphens: %hyphens% !important ;
}

which contains the invalid css property text-width. Perhaps that should 
be text-align or text-justify.


Something else appears to be creating, in \jobname-defaults.css:

pubfld[detail="title"],
div.pubfld.title {
 display : inline ;
 font-weight : italic ;
}

which incorrectly assigns italic to font-weight when of course it  is a 
font-style as far as css is concerned. This can be seen in file 
export-example.css in the distribution.

can you make a mwe ...



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Epub export css buglets

2020-01-06 Thread Rik Kabel

A couple of small issues with the css for epub output.

First, back-exp.lua creates, in \jobname-styles.css

   @namespace context url('%namespace%') ;

This should probably be:

   @namespace context url('http://www.pragma-ade.com/context/export') ;

That file also has:

   document,
   %namespace%div.document {
font-size  : %size% !important ;
max-width  : %width% !important ;
text-width : %align% !important ;
hyphens: %hyphens% !important ;
   }

which contains the invalid css property text-width. Perhaps that should 
be text-align or text-justify.


Something else appears to be creating, in \jobname-defaults.css:

   pubfld[detail="title"],
   div.pubfld.title {
display : inline ;
font-weight : italic ;
   }

which incorrectly assigns italic to font-weight when of course it  is a 
font-style as far as css is concerned. This can be seen in file 
export-example.css in the distribution.


--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Epub broken

2018-07-06 Thread Hans Hagen

On 7/6/2018 12:45 AM, Rik Kabel wrote:

On 7/5/2018 17:18, Hans Hagen wrote:

On 7/5/2018 4:47 PM, Rik Kabel wrote:

On 7/5/2018 10:27, Hans Hagen wrote:

On 7/4/2018 3:17 PM, Rik Kabel wrote:

The following example fails with recent betas, but not with TL18:

define fails


Sorry to be so terse in the original note. By failure, I mean that 
the generated .epub document is incorrect; parts are out of order, as:

new beta


Thank you, Hans, for the quick repair.

I understand that ePub is not a priority 
(https://www.mail-archive.com/ntg-context@ntg.nl/msg87829.html) but I 
would like to make a request to put into the queue. Currently references 
(via \reference or \definelabel[xyz] ... \xyz, perhaps other mechanisms 
as well) do not generate ID attributes where they are created, and so 
references to them (which do generate href=#...) link to nothing. Even 
creating an empty div with an appropriate class (labelname, 
enumerationname, reference?) and the id attribute would help. Currently 
there is no placeholder in the html file to locate the proper place to 
insert this information with an external filter.


i can add something for a reference (the problem with such things is 
that there is no real anchor for it and i don't want such features to 
(1) interfere with regular typesetting and (2) have even the least 
impact on performance of regular runs



Of course, once that is done, there are lots more. So it goes.

hm, lots sounds bad ...

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Epub broken

2018-07-05 Thread Rik Kabel

On 7/5/2018 17:18, Hans Hagen wrote:

On 7/5/2018 4:47 PM, Rik Kabel wrote:

On 7/5/2018 10:27, Hans Hagen wrote:

On 7/4/2018 3:17 PM, Rik Kabel wrote:

The following example fails with recent betas, but not with TL18:

define fails


Sorry to be so terse in the original note. By failure, I mean that 
the generated .epub document is incorrect; parts are out of order, as:

new beta


Thank you, Hans, for the quick repair.

I understand that ePub is not a priority 
(https://www.mail-archive.com/ntg-context@ntg.nl/msg87829.html) but I 
would like to make a request to put into the queue. Currently references 
(via \reference or \definelabel[xyz] ... \xyz, perhaps other mechanisms 
as well) do not generate ID attributes where they are created, and so 
references to them (which do generate href=#...) link to nothing. Even 
creating an empty div with an appropriate class (labelname, 
enumerationname, reference?) and the id attribute would help. Currently 
there is no placeholder in the html file to locate the proper place to 
insert this information with an external filter.


Of course, once that is done, there are lots more. So it goes.

--
Rik


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Epub broken

2018-07-05 Thread Hans Hagen

On 7/5/2018 4:47 PM, Rik Kabel wrote:

On 7/5/2018 10:27, Hans Hagen wrote:

On 7/4/2018 3:17 PM, Rik Kabel wrote:

The following example fails with recent betas, but not with TL18:

define fails


Sorry to be so terse in the original note. By failure, I mean that the 
generated .epub document is incorrect; parts are out of order, as:

new beta


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Epub broken

2018-07-05 Thread Rik Kabel

On 7/5/2018 10:27, Hans Hagen wrote:

On 7/4/2018 3:17 PM, Rik Kabel wrote:

The following example fails with recent betas, but not with TL18:

define fails


Sorry to be so terse in the original note. By failure, I mean that the 
generated .epub document is incorrect; parts are out of order, as:



(When one section is removed, the disorder is gone, so a smaller test 
file will not exhibit this problem.)


In a larger document, endnotes are scrambled as well, with two index 
marks for some and none for others. The generated .pdf (which is a 
throw-away when trying to produce epub) does not show the same problems.


The .epub file is attached.

--
RIk


test.epub
Description: application/epub
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Epub broken

2018-07-05 Thread Hans Hagen

On 7/4/2018 3:17 PM, Rik Kabel wrote:

The following example fails with recent betas, but not with TL18:

define fails



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Epub broken

2018-07-04 Thread Rik Kabel

The following example fails with recent betas, but not with TL18:

   \setupinteraction [state=start]
   \setuptagging [state=start]
   \setupbackend [export=yes,xhtml=yes]
   \setupexport  [title={Title}]
   \setupstructure   [state=start]
   \starttext
   \startchapter[title={Chapter title}]
   \startparagraph
  Chapter introduction.
   \stopparagraph
   \startsection[title={Section 1 title}]
   \startparagraph
  Section one text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 2 title}]
   \startparagraph
  Section two text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 3 title}]
   \startparagraph
  Section three text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 4 title}]
   \startparagraph
  Section four text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 5 title}]
   \startparagraph
  Section five text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 6 title}]
   \startparagraph
  Section six text.
   \stopparagraph
   \stopsection
   \startsection[title={Section 7 title}]
   \startparagraph
  Aaaa a aa aaa (aa aa) , aaa aa aaa    
 aaa aa aa    aa aa aaa . Aa  
aaa a,  a aa aa a, aa a, aa aa 
aaa -aa. aaa’a  aa  aaa aa—a aa , aa aaa a. 
Aaaa a aa aaa , aaa aa aaa     aaa aa 
aa    aa aa aaa . Aaaa a aa aaa , aaa 
aa aaa     aaa aa aa    aa aa aaa 
.
   \stopparagraph
   \stopsection
   \startsection[title={Section 8 title}]
   \startparagraph
  Aaaa a aa aaa (aa aa) , aaa aa aaa    
 aaa aa aa    aa aa aaa . Aa  
aaa a,  a aa aa a, aa a, aa aa 
aaa -aa. aaa’a  aa  aaa aa—a aa , aa aaa a 
aa aaa.
   \stopparagraph
   \stopsection
   \stopchapter
   \stoptext

--
Rik

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] ePub and Metapost

2015-10-20 Thread Fabrice Couvreur
Hi,
Is it possible to produce a epub file from a file containing a figure made with 
Metapost ? 
Thanks,
Fabrice

Envoyé de mon iPad___
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
___

Re: [NTG-context] epub-mkiv-demo.epub

2015-04-13 Thread Hans Hagen

On 4/13/2015 3:37 PM, Piotr Kopszak wrote:


ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.


we can probably catch that one


epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.


but this is crap .. i see no tex user adding an alternate to each formula

in fact, the epub script has the option to turn the mathml into svg, 
this was added after google decided to kick out mathml (ok, we could 
push some svg into the annotation-xml i guess)


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@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
___

Re: [NTG-context] epub-mkiv-demo.epub

2015-04-13 Thread Piotr Kopszak
Thanks Hans!

That did the trick, just a README mentioning mudraw as dependency in
the source directory would do, however the file which is generated
contains errors, at least according to epubcheck and kindlegen, which
prevents conversion of resulting epub file to mobi format, what I
would ultimately like to do.

epubcheck output

Validating against EPUB version 3.0 - custom validation
Validating using EPUB version 3.0 rules.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'duplicate resource: OEBPS/images/cow.svg'.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(42,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(54,198): MathML
should either have an alt text attribute or annotation-xml child
element.

Check finished with errors

epubcheck completed
---

kindlegen output
--
*
 Amazon kindlegen(Windows) V2.9 build 1029-0897292
 A command line e-book compiler
 Copyright Amazon.com and its Affiliates 2014
*

Info:I9026:option: (hidden) amazon creator tool or pipeline

Info:I9014:option: -verbose: Verbose output

Info(prcgen):I1048: Unpacking ePub file

Error(xmlmake):E27012: Item or process id already used: cow-svg
-

Any chance these might be fixed?

Best

Piotr


2015-04-11 12:52 GMT+02:00 Hans Hagen pra...@wxs.nl:
 On 4/11/2015 9:12 AM, Piotr Kopszak wrote:

 Hello list,

 I am trying to compile example epub file epub-mkiv-demo.tex which is
 provided with the recent beta, however I'm getting following errors
 when I run:mtxrun --script epub --make epub-mkiv-demo

 resolvers   | trees | analyzing 'home:texmf'
 mtx-epub| using specification file
 'epub-mkiv-demo-export/epub-mkiv-demo-pub.lua'
 mtx-epub| the 'mudraw' binary is not present


 install mudraw

 mtx-epub| cover page image 'cover.xhtml' is not present
 mtx-epub| saving dummy coverpage to

 'epub-mkiv-demo-export/cover.xhtml'...42015/tex/texmf-context/scripts/context/lua/mtx-epub.lua:606:
 bad argument #1 to 'gsub' (string expected, got nil)

 No epub file is generated.

 Any help would be greatly appreciated


 i'll add a check

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



-- 
http://okle.pl


epub-mkiv-demo.epub
Description: application/epub
___
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
___

Re: [NTG-context] epub-mkiv-demo.epub

2015-04-13 Thread Hans Hagen

On 4/13/2015 3:37 PM, Piotr Kopszak wrote:

Thanks Hans!

That did the trick, just a README mentioning mudraw as dependency in
the source directory would do, however the file which is generated
contains errors, at least according to epubcheck and kindlegen, which
prevents conversion of resulting epub file to mobi format, what I
would ultimately like to do.

epubcheck output

Validating against EPUB version 3.0 - custom validation
Validating using EPUB version 3.0 rules.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(26,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'assertion failed: Duplicate ID 'cow-svg''.
ERROR(RSC-005): epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo.opf(27,79):
Error while parsing file 'duplicate resource: OEBPS/images/cow.svg'.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(38,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(42,120): MathML
should either have an alt text attribute or annotation-xml child
element.
WARNING(ACC-009):
epub-mkiv-demo.epub/OEBPS/epub-mkiv-demo-div.xhtml(54,198): MathML
should either have an alt text attribute or annotation-xml child
element.

Check finished with errors


hm, last time i checked it was ok .. epub is such a mess (to put it 
mildly) ... one manages to satisfy one checker/viewer and in the end it 
breaks another (which is probably why there are so many converters ... 
vendors don't care as they love to lock you in)


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@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
___

[NTG-context] epub-mkiv-demo.epub

2015-04-11 Thread Piotr Kopszak
Hello list,

I am trying to compile example epub file epub-mkiv-demo.tex which is
provided with the recent beta, however I'm getting following errors
when I run:mtxrun --script epub --make epub-mkiv-demo

resolvers   | trees | analyzing 'home:texmf'
mtx-epub| using specification file
'epub-mkiv-demo-export/epub-mkiv-demo-pub.lua'
mtx-epub| the 'mudraw' binary is not present
mtx-epub| cover page image 'cover.xhtml' is not present
mtx-epub| saving dummy coverpage to
'epub-mkiv-demo-export/cover.xhtml'...42015/tex/texmf-context/scripts/context/lua/mtx-epub.lua:606:
bad argument #1 to 'gsub' (string expected, got nil)

No epub file is generated.

Any help would be greatly appreciated

Piotr

-- 
http://okle.pl
___
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
___

Re: [NTG-context] epub-mkiv-demo.epub

2015-04-11 Thread Hans Hagen

On 4/11/2015 9:12 AM, Piotr Kopszak wrote:

Hello list,

I am trying to compile example epub file epub-mkiv-demo.tex which is
provided with the recent beta, however I'm getting following errors
when I run:mtxrun --script epub --make epub-mkiv-demo

resolvers   | trees | analyzing 'home:texmf'
mtx-epub| using specification file
'epub-mkiv-demo-export/epub-mkiv-demo-pub.lua'
mtx-epub| the 'mudraw' binary is not present


install mudraw


mtx-epub| cover page image 'cover.xhtml' is not present
mtx-epub| saving dummy coverpage to
'epub-mkiv-demo-export/cover.xhtml'...42015/tex/texmf-context/scripts/context/lua/mtx-epub.lua:606:
bad argument #1 to 'gsub' (string expected, got nil)

No epub file is generated.

Any help would be greatly appreciated


i'll add a check

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

[NTG-context] ePUB creation problems

2015-03-18 Thread Gerben Wierda
I’m getting to the next phase of ePUB creation. My project now exports and with 
mtxrun —script epub, I can create an actual ePUB, but there are issues I need 
to fix.

One is the lack of a cover image. The command for epub creation works, but says:

(. /usr/local/src/ConTeXt/tex/setuptex  mtxrun --script epub --make 
prd_book)

mtx-epub| using specification file 'prd_book-export/prd_book-pub.lua'
mtx-epub| the 'mudraw' binary is not present
mtx-epub| cover page image 'cover.xhtml' is not present
mtx-epub| saving dummy coverpage to 'prd_book-export/cover.xhtml'

I’m using in the env file:
\setupbackend
 [export=yes]
\setupexport
   [title={Chess and the Art of Enterprise Architecture},
author={Gerben Wierda},
firstpage={9789081984058-CoverFront.jpeg},
   ]

So, what seems to be ignored is

\setupexport
   [title={Chess and the Art of Enterprise Architecture},
author={Gerben Wierda},
firstpage={9789081984058-CoverFront.jpeg},
   ]

What am I missing?

G___
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
___

Re: [NTG-context] ePUB creation problems

2015-03-18 Thread Hans Hagen

On 3/18/2015 1:00 PM, Gerben Wierda wrote:

I’m getting to the next phase of ePUB creation. My project now exports
and with mtxrun —script epub, I can create an actual ePUB, but there are
issues I need to fix.


attached a manual i'm on-and-off working on .. i have no time now for 
more info


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
-


epub-mkiv.pdf
Description: Adobe PDF document
___
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
___

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-19 Thread Keith Schultz
Hi Hans,

I have been playing with the on using LaTeX and later LuaLaTeX
for create epub or ebook. Though I have not got around to.


The idea was to set enviorments, macros and commands that would depending
on a switch that would output the need HTML and epub structure or
call the normal *TeX ones.

In ConTeXt maybe the mode-system could be used.
Like I said I have not investigated deeply, yet.

regards
Keith.
 
 Am 18.02.2015 um 17:54 schrieb Hans Hagen pra...@wxs.nl:
 
 On 2/17/2015 10:01 PM, Keith Schultz wrote:
 
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml
 with div/class tagging. The last one is supposed to work on all
 devices as it doesn't demands anything beyond css.
 If that is the case it is not very useful for a decent workflow. There
 would be to much to
 tweak to make good looking output.
 
 i'm not sure what you have in mind but context is a typesetting system and as 
 such cannot produce an epub simply because epub is a blob of xml (html) with 
 a css packages in a zip
 

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Henning Hraban Ramm

Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:

 On Tue, 17 Feb 2015, Hans Hagen wrote:
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
 div/class tagging. The last one is supposed to work on all devices as it 
 doesn't demands anything beyond css.
 
 The XML generated by ConTeXt is very well structured. So, an option is to 
 simply provide XLST stylesheets that transform ConTeXT-XML to 
 XHTML/HTML5/whatever.
 
 Such XLST transformation will be better than have ConTeXt chase a moving 
 target.

See e.g. http://wiki.contextgarden.net/Epub_Sample

I’ll try to update the pages about ConTeXt’s current export soon, since I have 
a new book in the pipeline.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/17/2015 10:01 PM, Keith Schultz wrote:



Am 17.02.2015 um 21:16 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:

On 2/17/2015 8:24 AM, Keith J. Schultz wrote:

Hi Axel, All,



[snip, snip]

IMHO : ConTeXt should not output XHMTL for epub, but HMTL5.
Yes, yes, I know XHMTL is part of HMTL5.


And html 5 is just html with some extras (and assuming javascript i
guess) ... marketing.

The html 5 standard is far more. For one is makes flash, java and more
obsolete. Far more than a marketing gag!


well, if javascript is used instead it's still fluent ... every time i 
played with e.g. jquery or libraries i had to make sure i used the 
latest and had to adapt code .. there will be something new (and maybe 
even different) every decade (if only because that generates money)



Another question for me is if ConTeXt should also output code for
the iBooks epub format, (Basicaly epub, but some extras).


Isn't a book supposed to be independent and kind of portable + long
term visible? So no way that a context epub will be specific for a
device. (I probably can't even get it on / test it on my outdated ipad
1 anyway.)

I was thinking more along the line of the spine.


ah, direct neural injection ...


There are thing you can do in/with ConTeXt that would work with iBooks
that do not in „ordinary“ epub books.

Then, there is the Kindle format one might want to consider!


Another lock-in device.


Another, question which needs investigation is if the ConTeXt output for
epub,
also, implementing the fallbacks for missing features which is required?


Context outputs three varants: regular xml, xhtml, and stupified xhtml
with div/class tagging. The last one is supposed to work on all
devices as it doesn't demands anything beyond css.

If that is the case it is not very useful for a decent workflow. There
would be to much to
tweak to make good looking output.


i'm not sure what you have in mind but context is a typesetting system 
and as such cannot produce an epub simply because epub is a blob of xml 
(html) with a css packages in a zip



I have not investigated how it handles dimensions, widths, font sizes,
spacing, etc.


structure normally doesn't carry that information


These are important in order to create output that adjust proper to the
 devices capabilities.
One should avoid absolute values.


there are hardly any values output ... but one can of course extend the 
css with font and color directives, probably different from the ones 
used in the pdf



Of course if we want to emulate the printed output then we could simply
create a pdf or very page as pdf and put in an epub wrapper.


i've seen impressive examples of pdf turned html (huge html files btw)

(fyi: i see pdf and html as independent things)

(and i don't believe in reflow of pdf: it's either a design for made up 
pages or a flexible adaptive one as in html; and till now i never wished 
a paper book to reflow itself anyway but maybe if i really would use an 
epub device ... who knows ... i don't own ebooks currently as i cannot 
share docs freely then like i share books and i consider ebooks to be 
way too expensive for fun)


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@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
___

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/17/2015 11:37 PM, Aditya Mahajan wrote:

On Tue, 17 Feb 2015, Hans Hagen wrote:


Context outputs three varants: regular xml, xhtml, and stupified xhtml
with div/class tagging. The last one is supposed to work on all
devices as it doesn't demands anything beyond css.


The XML generated by ConTeXt is very well structured. So, an option is
to simply provide XLST stylesheets that transform ConTeXT-XML to
XHTML/HTML5/whatever.

Such XLST transformation will be better than have ConTeXt chase a moving
target.


indeed, and the context wiki can provide useful examples

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@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
___

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Keith J. Schultz
Hi Hraban,

Good to know. I will investigate at another time and give feed back.
I am in the middle of moving, so I do not have much time.

We ought to think of making a export specific to epub in the long run!
 
regards
Keith.
 Am 18.02.2015 um 09:14 schrieb Henning Hraban Ramm te...@fiee.net:
 
 
 Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:
 
 On Tue, 17 Feb 2015, Hans Hagen wrote:
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
 div/class tagging. The last one is supposed to work on all devices as it 
 doesn't demands anything beyond css.
 
 The XML generated by ConTeXt is very well structured. So, an option is to 
 simply provide XLST stylesheets that transform ConTeXT-XML to 
 XHTML/HTML5/whatever.
 
 Such XLST transformation will be better than have ConTeXt chase a moving 
 target.
 
 See e.g. http://wiki.contextgarden.net/Epub_Sample
 
 I’ll try to update the pages about ConTeXt’s current export soon, since I 
 have a new book in the pipeline.
 
 Greetlings, Hraban
 ---
 http://www.fiee.net
 http://wiki.contextgarden.net
 https://www.cacert.org (I'm an assurer)
 
 ___
 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
 ___

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Henning Hraban Ramm

Am 2015-02-18 um 20:10 schrieb Keith J. Schultz keithjschu...@web.de:

 Hi Hraban,
 
 Good to know. I will investigate at another time and give feed back.
 I am in the middle of moving, so I do not have much time.
 
 We ought to think of making a export specific to epub in the long run!

For me, the regular export XML plus XSL conversion is the way to go; the „HTML“ 
is rather unusable.
The epub script is nice and all, it was important for me to get me running, but 
I guess I won’t use it in my final workflow.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-18 Thread Hans Hagen

On 2/18/2015 3:10 PM, Keith J. Schultz wrote:

Hi Hraban,

Good to know. I will investigate at another time and give feed back.
I am in the middle of moving, so I do not have much time.

We ought to think of making a export specific to epub in the long run!


The export is not really geared at that, as it's a representation of the 
rendering (although structured). The additional html output can be used 
for previewing and to what extend it's okay depends on the intended use.


Normally one starts from a neutral source (xml or tex) and then produces 
different output. So, for specific epub (or whatever) one can either 
start with the original code (xml) or manipulate what comes out of the 
export. The export is kind of standard so one can build all kind of 
scripts to convert it. There is no universal epub (rendering) solution, 
just as there is no universal pdf layout.


Of course the idea is that the default export is good enough for simple 
documents. What more gets provided depends on needs (and currently at 
least I have no need for epub other than a dedicated pdf suitable for 
displays).


Hans



regards
Keith.

Am 18.02.2015 um 09:14 schrieb Henning Hraban Ramm te...@fiee.net:


Am 2015-02-18 um 04:37 schrieb Aditya Mahajan adit...@umich.edu:


On Tue, 17 Feb 2015, Hans Hagen wrote:


Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
div/class tagging. The last one is supposed to work on all devices as it 
doesn't demands anything beyond css.


The XML generated by ConTeXt is very well structured. So, an option is to 
simply provide XLST stylesheets that transform ConTeXT-XML to 
XHTML/HTML5/whatever.

Such XLST transformation will be better than have ConTeXt chase a moving target.


See e.g. http://wiki.contextgarden.net/Epub_Sample

I’ll try to update the pages about ConTeXt’s current export soon, since I have 
a new book in the pipeline.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


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




--

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-17 Thread Hans Hagen

On 2/17/2015 8:24 AM, Keith J. Schultz wrote:

Hi Axel, All,

You have mentioned that most current ebook readers can not display MathML.

Well, the problem lies in the epub guidelines for the readers.

The problem is even worse. many readers do not even implement the full HTML5
standard. though that is the standard used in the latest epub stadnard.
The fact is to be considered epub readers the do not have to, it is a
problem
of the epub reader definition.

The problem is what should ConTeXt output?
Should it output code that implements according to the full epub standard
OR JUST
what is handled by most epub readers!

IMHO : ConTeXt should not output XHMTL for epub, but HMTL5.
Yes, yes, I know XHMTL is part of HMTL5.


And html 5 is just html with some extras (and assuming javascript i 
guess) ... marketing.



Another question for me is if ConTeXt should also output code for
the iBooks epub format, (Basicaly epub, but some extras).


Isn't a book supposed to be independent and kind of portable + long term 
visible? So no way that a context epub will be specific for a device. (I 
probably can't even get it on / test it on my outdated ipad 1 anyway.)



There are thing you can do in/with ConTeXt that would work with iBooks
that do not in „ordinary“ epub books.

Then, there is the Kindle format one might want to consider!


Another lock-in device.


Another, question which needs investigation is if the ConTeXt output for
epub,
also, implementing the fallbacks for missing features which is required?


Context outputs three varants: regular xml, xhtml, and stupified xhtml 
with div/class tagging. The last one is supposed to work on all devices 
as it doesn't demands anything beyond css.



Just some added thoughts.

Basically, you can only expect ConTeXts epub output to be a starting
point that
then has to be tweak.


Indeed, as it's all xml one can process it into something 'better'. 
There is no way we can adapt to every change in specs, so the best we 
can do is something generic.


Hans


regards
Keith.


Am 17.02.2015 um 07:11 schrieb Axel Kielhorn t...@axelkielhorn.de
mailto:t...@axelkielhorn.de:

[...]
Yes I know.
Let me rephrase the question:

Should the symbols used in epub be identical to those used in the pdf
or should the css determine the look of the symbols?
Especially when one considers that most current ebook readers can't
display MathML.

Even if I substitute the Symbols:

\definesymbol[uni1][•]
\definesymbol[uni2][–]
\definesymbol[uni3][*]
\definesymbol[uni4][·]

\setupitemgroup [itemize] [1] [symbol=uni1]
\setupitemgroup [itemize] [2] [symbol=uni2]
\setupitemgroup [itemize] [3] [symbol=uni3]
\setupitemgroup [itemize] [4] [symbol=uni4]

I get a result that neither ADE nor Calibre interprets as a list.
(Wrapping it in ul /ul doesn't help.)





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




--

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-17 Thread Keith Schultz

 Am 17.02.2015 um 21:16 schrieb Hans Hagen pra...@wxs.nl:
 
 On 2/17/2015 8:24 AM, Keith J. Schultz wrote:
 Hi Axel, All,
 
 
[snip, snip]
 IMHO : ConTeXt should not output XHMTL for epub, but HMTL5.
 Yes, yes, I know XHMTL is part of HMTL5.
 
 And html 5 is just html with some extras (and assuming javascript i guess) 
 ... marketing.
The html 5 standard is far more. For one is makes flash, java and more 
obsolete. Far more than a marketing gag! 
 
 Another question for me is if ConTeXt should also output code for
 the iBooks epub format, (Basicaly epub, but some extras).
 
 Isn't a book supposed to be independent and kind of portable + long term 
 visible? So no way that a context epub will be specific for a device. (I 
 probably can't even get it on / test it on my outdated ipad 1 anyway.)
I was thinking more along the line of the spine.
 
 There are thing you can do in/with ConTeXt that would work with iBooks
 that do not in „ordinary“ epub books.
 
 Then, there is the Kindle format one might want to consider!
 
 Another lock-in device.
 
 Another, question which needs investigation is if the ConTeXt output for
 epub,
 also, implementing the fallbacks for missing features which is required?
 
 Context outputs three varants: regular xml, xhtml, and stupified xhtml with 
 div/class tagging. The last one is supposed to work on all devices as it 
 doesn't demands anything beyond css.
If that is the case it is not very useful for a decent workflow. There 
would be to much to
tweak to make good looking output.

I have not investigated how it handles dimensions, widths, font sizes, 
spacing, etc.
These are important in order to create output that adjust proper to the
devices capabilities. 
One should avoid absolute values.

Of course if we want to emulate the printed output then we could simply
create a pdf or very page as pdf and put in an epub wrapper.


Not asking for anything, just mentioning it.

reagrds
Keith.

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

Re: [NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-17 Thread Aditya Mahajan

On Tue, 17 Feb 2015, Hans Hagen wrote:

Context outputs three varants: regular xml, xhtml, and stupified xhtml 
with div/class tagging. The last one is supposed to work on all devices 
as it doesn't demands anything beyond css.


The XML generated by ConTeXt is very well structured. So, an option is to 
simply provide XLST stylesheets that transform ConTeXT-XML to 
XHTML/HTML5/whatever.


Such XLST transformation will be better than have ConTeXt chase a moving 
target.


Aditya
___
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
___

[NTG-context] Epub format Was: Re: Context to epub: itemize

2015-02-16 Thread Keith J. Schultz
Hi Axel, All,

You have mentioned that most current ebook readers can not display MathML.

Well, the problem lies in the epub guidelines for the readers.

The problem is even worse. many readers do not even implement the full HTML5
standard. though that is the standard used in the latest epub stadnard.
The fact is to be considered epub readers the do not have to, it is a problem
of the epub reader definition.

The problem is what should ConTeXt output?
Should it output code that implements according to the full epub standard 
OR JUST 
what is handled by most epub readers!

IMHO : ConTeXt should not output XHMTL for epub, but HMTL5.
Yes, yes, I know XHMTL is part of HMTL5.

Another question for me is if ConTeXt should also output code for
the iBooks epub format, (Basicaly epub, but some extras).
There are thing you can do in/with ConTeXt that would work with iBooks
that do not in „ordinary“ epub books.

Then, there is the Kindle format one might want to consider!

Another, question which needs investigation is if the ConTeXt output for epub,
also, implementing the fallbacks for missing features which is required?

Just some added thoughts.

Basically, you can only expect ConTeXts epub output to be a starting point that
then has to be tweak.

regards
Keith.

 Am 17.02.2015 um 07:11 schrieb Axel Kielhorn t...@axelkielhorn.de:
 
 [...]
 Yes I know.
 Let me rephrase the question:
 
 Should the symbols used in epub be identical to those used in the pdf or 
 should the css determine the look of the symbols?
 Especially when one considers that most current ebook readers can't display 
 MathML.
 
 Even if I substitute the Symbols:
 
 \definesymbol[uni1][•]
 \definesymbol[uni2][–]
 \definesymbol[uni3][*]
 \definesymbol[uni4][·]
 
 \setupitemgroup [itemize] [1] [symbol=uni1]
 \setupitemgroup [itemize] [2] [symbol=uni2]
 \setupitemgroup [itemize] [3] [symbol=uni3]
 \setupitemgroup [itemize] [4] [symbol=uni4]
 
 I get a result that neither ADE nor Calibre interprets as a list.
 (Wrapping it in ul /ul doesn't help.) 
 

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

Re: [NTG-context] EPUB woes

2013-11-20 Thread Keith J. Schultz
Hi Mica,

Am 19.11.2013 um 22:39 schrieb Mica Semrick paperdig...@gmail.com:

 Keith,
 
 Maybe you should explore an XML format that can be transformed directly to 
 epub. You'd also be able to write a style sheet with ConTeXt that would out 
 put a PDF as well. I think TEI-Lite is a good starting point.
While XML is one approach and using XML-Styles and DocBook I could even 
do without ConTeXt completely. Yet, from a general
user standpoint this way of marking up ebooks is tedious. XML has 
become the standard for storing all kinds of data. A a storage
format it is great and allows for conversion to other formats for ages 
to come. YET, one has to know what XML is how to use it
how to make tools to process it. That is something that I would not 
like to enforce on the average author. 
 
 Since you can make your own commands in ConTeXt, it will never be able to 
 intelligently map all commands on to simple HTML.
How true. That is the problem with any system that is and can handle 
more complex structures than a simpler system.
That is why any module geared to creating ebooks has to only allow what 
is needed and can be done in any EREADER, 
(notice I wrote reader not / Book or EPub!)

My Idea is to use the Lua capabilities of ConTeXt to get the job done.
I will try to exemplify.

suggest MWE:
\usemodule[ebook]

\setupcss[…]{…}% see comment #1

\setupmapping[…]{…} % used for when author has his/her own ideas #2

%normal ConTeXt sets see comment #3

% possibly set a mode or set externally

\starttext
\startebook
\chapter… %see comment #4
\startparagraph{leftmargin=20%, …] % see 
comment #5
% text
\stopparagraph
\starttable…
\stoptable
…
\stopebook
\stoptext

OK, this pretty much looks like standard ConTeXt
Comments:
1) Here is where the author can define the CSS he wants
It will integrated into the CSS used for the ebook

2) The author can setup how the ebook commands are mapped to
 ConTeXt commands

3) Here are setups for the  NORMAL ConTeXt commands for producing PDFs

4)  if mode is PDF command is mapped to normal ConTeXt injected into 
stream
 if mode ebook, gather information for spine, etc, start a new file 
for the chapter
 start writing to this file as HTML 

5)  if in mode PDF map to ConTeXt command, whereby the leftmargin is 
used as the
 basis for the calculation .2\textwidth or if you wish

This approach is ebook centric. Allows for rapid prototyping and proofing of 
the ebook using a PDF
This approach alleviates the need to attempt to dumb down ConTeXt markup. 
Through the use mappings te author has the possibility of producing a higher 
quality PDF if wanted.
The system could be designed to produce a file with the ConTeXt commands that 
can be edited for even
higher quality PDFs of printed versions. 

There could be even XML or whatever mode in the ebook module.

Another advantage would be is that we are a module that will produce HTML out 
of a ConTeXt styled syntax
that can be directly converted to a PDF directly, without worrying about lose 
of formatting or using tools over
which features are supported or not. This is a straight forward approach.

True, enough, ConTeXt is not designed to be a  HTML editor. 

It is a matter of design policy! The philosophy of going from TeX/ConTeXt 
centric to HTML is IMHO far inferior than
going from HTML/ebook centric to ConTeXt. One can always make things more 
intricate/complicated and taking something
complicated and morphing onto a less sophisticated system.

What one has to keep in mind is that ConTeXt renders to PDF and that is what 
is not needed when producing a ebook.
The rendering is done by the ereader. ConTeXt does have any information about 
screen size or  orientation. ConTeXt is built upon 
a page morphology. ebooks are not! So any decent approach has to keep this in 
mind.

regards
Keith.

 
 
 On Mon, Nov 18, 2013 at 10:12 AM, Keith J. Schultz schul...@uni-trier.de 
 wrote:
 
 Am 18.11.2013 um 16:33 schrieb Hans Hagen pra...@wxs.nl:
 
 On 11/18/2013 4:11 PM, Keith J. Schultz wrote:
 Hi Hans,
 
 
 Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:
 
 On 11/18/2013 10:00 AM, Keith J. Schultz wrote:
 
   2) Now, what a EPub-READER must implement to handle is very
little. There are HARDLY ANY provisions that a certified 
 EPuB-READER has
  to implement any particular engine or features therein to 
 display/render
the information contain in the EPub-file/wrapper.
 
 right, and I'm not going to waste time on it 

Re: [NTG-context] EPUB woes

2013-11-20 Thread Aditya Mahajan

On Wed, 20 Nov 2013, Keith J. Schultz wrote:


\usemodule[ebook]

\setupcss[…]{…}% see comment #1

\setupmapping[…]{…} % used for when author has his/her own ideas #2

%normal ConTeXt sets see comment #3

% possibly set a mode or set externally

\starttext
\startebook
\chapter… %see comment #4
\startparagraph{leftmargin=20%, …] % see 
comment #5
% text
\stopparagraph
\starttable…
\stoptable
…
   \stopebook
\stoptext


To me, the biggest advantage of a TeX based system is the ease of 
extensibility. If you want to restrict to a specific subset, then might as 
well use XML:


document
book
chapter
paragraph leftmargin=20%
 text
/paragraph
/book
/document

or using one of the existing XML schemas rather than inventing your own 
(perhaps even HTML5).


As far as ConTeXt is concerned, you can process the above XML quite 
easily. Come to think of it, it may be a useful to provide a module that

maps HTML5 to PDF.

Aditya___
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
___

Re: [NTG-context] EPUB woes

2013-11-20 Thread Bill Meahan

On 11/20/2013 8:59 AM, Aditya Mahajan wrote:


As far as ConTeXt is concerned, you can process the above XML quite 
easily. Come to think of it, it may be a useful to provide a module that

maps HTML5 to PDF.

Aditya


I would vote for that approach. It is pretty much analogous to what I 
have decided to do. I'm doing my actual writing in HTML. creating CSS 
for ebooks and ConTeXt environment files for PDF. I'll probably hack the 
html2latex Perl script to do the mapping. Pandoc will /not/ meet my 
needs because Markdown does not distinguish between emphasized text and 
italic text and Pandoc compels all other input markup to behave like 
Markdown. Textile would be perfect but only outputs HTML well. The 
RedCloth implementation does output LaTeX but ignores CSS-style classes 
applied to paragraphs et. al.


My needs are much simpler than the majority of people on this list. I 
have no need for math, no need for indexes, no need for bibliographies, 
footnotes or citations. BUT I want really top-notch visual output 
whether in PDF or printed on dead trees. The latter is usually the 
result of giving the printer process PDF files anyway so for the visuals 
I want, PDF is the common denominator and TeX (whether LaTeX or ConTeXt) 
is the most reasonable path, InDesign is not for poverty-stricken 
wretches like me.


Unfortunately (for many reasons) the market for the stuff I write is 
hell-bent to replace printed books and even replace high-quality 
electronic presentation with formats in which the reader chooses almost 
everything, regardless of whether it compliments the text or not. EPUB 
(especially EPUB3) does appear to /want/ to provide 
author/designer-determined presentation but it can still be ignored or 
overridden by the reader. I don't want to  even imagine the visual 
discordance of reading something like /Jane Eyre/ with double-spaced 
Comic Sans but if the e-reader allows it


I'll crawl back under my rock, now.

--
Bill Meahan, Westland, Michigan

 
 


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


Re: [NTG-context] EPUB woes

2013-11-20 Thread Keith J. Schultz
Hi,

You do not understand my point. I one uses XML why use ConTeXt.
Yet, I one wants to use ConTeXt and do ebooks and they have experience why 
force them
to XML. 

As I stated the idea use ConTeXt to do the markup with commands that will 
ensure proper input of
HTML5  for making ebooks that will render well on MOST ereaders and at the same 
time be typeset
by ConTeXt to good quality PDF! 

ereaders need the html code to adhere to special guidelines in order to create 
a high quality display for the ebook.
That is why special commands are needed to restirct the features available! 

regards
Keith.

Am 20.11.2013 um 14:59 schrieb Aditya Mahajan adit...@umich.edu:

[snip, snip]
 
 To me, the biggest advantage of a TeX based system is the ease of 
 extensibility. If you want to restrict to a specific subset, then might as 
 well use XML:
 
 document
 book
 chapter
 paragraph leftmargin=20%
 text
 /paragraph
 /book
 /document
 
 or using one of the existing XML schemas rather than inventing your own 
 (perhaps even HTML5).
 
 As far as ConTeXt is concerned, you can process the above XML quite easily. 
 Come to think of it, it may be a useful to provide a module that
 maps HTML5 to PDF.
 
 Aditya___
 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
 ___

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


Re: [NTG-context] EPUB woes

2013-11-20 Thread Jan Tosovsky
On 2013-11-20 Bill Meahan wrote:
 On 11/20/2013 8:59 AM, Aditya Mahajan wrote:
 
  As far as ConTeXt is concerned, you can process the above XML quite
  easily. Come to think of it, it may be a useful to provide a module
  that maps HTML5 to PDF.
 
 
 I would vote for that approach. It is pretty much analogous to what I
 have decided to do. I'm doing my actual writing in HTML. creating CSS
 for ebooks and ConTeXt environment files for PDF.
 ...
 
 My needs are much simpler than the majority of people on this list. I
 have no need for math, no need for indexes, no need for bibliographies,
 footnotes or citations. BUT I want really top-notch visual output
 whether in PDF or printed on dead trees. 

This is exactly my situation ;-)

Two outputs ideally from the same data. But thanks to my XML background and
experience in the single source publishing it was clear from the very
beginning that I need a well structured and also semantically rich
vocabulary like DocBook.

Generating ePub3 outputs is very straighforward (things gets complicated
when you need customize it). It is same for PDF outputs. These outputs are
generated using XSL-FO processors. But to be honest, outputs are not so
visually appealing as they lack many microtypographic features (expansion,
hanging punctuation etc).

This is the reason why I do a noise here in this forum.

There is a db-context tool (set of XSLT stylesheets):
http://dblatex.sourceforge.net/releases/download.html

It can convert DocBook XML into the ConTeXt source. I do some direct (local)
changes into it to avoid manual post-processing (which gets lost with every
generating - I still do some corrections in my source).

This solution requires some experience in XML processing, but I encourage
anybody who need multiple outputs from a single data to investigate it a
bit. It is so powerfull ;-)

Jan



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


Re: [NTG-context] EPUB woes

2013-11-19 Thread Mica Semrick
Keith,

Maybe you should explore an XML format that can be transformed directly to
epub. You'd also be able to write a style sheet with ConTeXt that would out
put a PDF as well. I think TEI-Lite is a good starting point.

Since you can make your own commands in ConTeXt, it will never be able to
intelligently map all commands on to simple HTML.


On Mon, Nov 18, 2013 at 10:12 AM, Keith J. Schultz schul...@uni-trier.dewrote:


 Am 18.11.2013 um 16:33 schrieb Hans Hagen pra...@wxs.nl:

 On 11/18/2013 4:11 PM, Keith J. Schultz wrote:

 Hi Hans,


 Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:

 On 11/18/2013 10:00 AM, Keith J. Schultz wrote:

 2) Now, what a EPub-READER must implement to handle is very
  little. There are HARDLY ANY provisions that a certified EPuB-READER
 has
  to implement any particular engine or features therein to
 display/render
  the information contain in the EPub-file/wrapper.


 right, and I'm not going to waste time on it till i have a decent ebook
 reader that behaves well

 The point you are missing is that the ereaders are behaving well. They are
 following the epub
  standard, and that to the letter of the standard. The problem is
 that the standard does not
 enforce any particular implementation. If you look at the slow progress of
 the standard that
 actually requires a full implementation of the HTML5 standard. That  wait
 will very long.


 sure, and every time i see an epub novel i realize that for something like
 that one really can stick to rather dumb html ... the point is that one
 cannot expect context to output simple everywhere accepted html from
 complex rendered input ...

 I agree fully. But, Since there are those that wish to produce epubs aka
 ebooks, they should not be doing complex
 layout. One can always go from simple to complicated in needed, if there
 were commands dedicated to epub/ebooks/html.
 As I had pointed out in my last post below.


 Furthermore, ereaders are made by companies more interested in profits
 than spending a few Euros
 more to put decent HTML engines into their readers. Why they do not do
 that is beyond me!


 3. Modify the way in which ConTeXt generates the XML files. Ideally, I
 should be able to write something like

 Would be nice if there where commands in ConTeXt or a module for defining
 what should go into the CSS and a
 mode epub where the ConTeXt commands are converted to suitible HTML5
 structures that are suitiable for
 most ereaders.
  Features:
1) margins in percentages
2) font sizes based on em
3) a new file for every chapter optional for sections user
 defined
 Just a few. Lots more can be found in any decent documentation on writing
 ebooks.


 context outputs xml and as a bonus provides a css too ... one can always
 convert that xml to his/her ebooks liking .. maybe at some point the
 mtx-epub script will do that


 I always to like to look at programming as modular and would think that a
 epub/ebook module would be nice that maps
 there are commands for layingout ebooks. these commands can then be mapped
 back to standard context commands.


 in that case code in xml and either processit by context or transform it
 into something ebooks can render

 For some interested in producing a epub then can use the conventions for
 producing ebooks and ConTeXt can provide the
 math conversions to regular page dimensions used in PDFs for proofing or
 creating a printed version. It would also make the
 creation of EPubs from ConTeXt a simple parsing exercise.


 so far i had no projects where epub was needes so it has a low priority
 and i still read paper books (or when i would have ebooks i wouldn't need
 to render them) ... pdfs views quite well on e.g. nexus 7 devices and i
 assume the upcoming sony high res ebook will also do pdf well

 Well I did start the discussion. Just offer my 2 Euro cents worth.
 Especially, since it comes up every now and then.
 Furthermore, I there was a simple way to create epubs/books with ConTeXt
 more would use this feature.
  I have used up enough of or time.

 regards
 Keith.




 ___
 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

 ___

___
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  : 

Re: [NTG-context] EPUB woes

2013-11-18 Thread Keith J. Schultz

Am 16.11.2013 um 17:51 schrieb Bill Meahan subscribed_li...@meahan.net:

 On 11/16/2013 11:00 AM, Keith J. Schultz wrote:
 Hi Bill,
 
 Using a PDF as a basis for creating an Epub ebook is actually a lost cause.
 EPUB is a container format that just wraps around your PDF. I do not know of 
 any
 ereader that can actually adjust the formatting/layout of a pdf in any 
 significantly
 useful way. You are stuck with the formatting in the PDF.
 
 For a EPUB-ebook to adjust properly you need to use HTML5 and CSS. Producing 
 PDF an sticking it into a
 EPUB or MOBI wrapper just does not make sense.
 
 regards
  Keith.
 
 You are totally misreading what I wrote!
Sorry.  But, from your original statement:
I have followed the steps on the wiki to the letter, using the export-example 
file provided with the standalone distribution. A PDF generated from the file 
is exactly what I would expect from an example. The generated epub, however, is 
useless - all the text is jammed together into one continuous block with no 
formatting whatsoever.

I assumed that the PDF was be put in the EPub- wrapper! According to the 
EPub standard this can be done!
I have to admit that I have not been following the progress done in ConTeXt 
for creating EPubs/eBooks.

Others have answered, and explain what you need to do to get a possibly 
working EPub.
See my comments in my replies to their posts.

regards
Keith. 


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

Re: [NTG-context] EPUB woes

2013-11-18 Thread Keith J. Schultz
Hi All,

I find that the ConTeXt approach to creating the EPub is flawed is a 
fundemental way!

NOT TECHNICALLY.

The EPub Standard is a big mess and if you really look at not a true standard 
in a
true sense.

Let me explain. 
1) The file structure is well documented and properly defines
 the way a EPub file MUST contain and how file therein must
 be structure and listed. (notice that I use the word MUST)

2) Now, what a EPub-READER must implement to handle is very
 little. There are HARDLY ANY provisions that a certified 
EPuB-READER has
 to implement any particular engine or features therein to 
display/render
 the information contain in the EPub-file/wrapper.

In other words it is simply a wrapper file format. and truly nothing more.
There is NO REQUIREMENT in the standard that perfectly valid xhtml or
HTML5 will be  properly displayed in a certified EPub Reader!

The standard has become more strict in recent years, yet still lacking.


Am 16.11.2013 um 18:37 schrieb Aditya Mahajan adit...@umich.edu:

[snip, snip]

 When you run `mtxrun --script epub --make test`, it just takes the files 
 specificied in the files field, and zips them in as a epub file.
 
 Now, in principle, any epub reader should support the any XHTML file; in 
 practice, they only support the default XHTML tags. The XML+CSS file that 
 ConTeXt generates are not handled correctly by most (all?) EPUB readers.
Here is where my critic of ConTeXt approach grabs. What good is if one 
produces a perfectly correct EPub, yet hardly any EPub reader can
handle. 
I remember correctly, an EPub Reader need not implement the handling of 
xhtml inorder to be certified or, if you wish, adhere to the standard.
The basic reason why xhtml is handled is because most html renders 
handle xhtml. 
Yet, the standard only requires that very basic html features be 
implemented and the author is required to offer fallbacks incase features are 
not
 supported.

 So there are three options:
 
 1. Wait until the EPUB readers catch up. It took almost 10-15 years for the 
 browsers to catch up with the HTML standards, and I don't have much hope for 
 EPUB readers here. Last I checked, none of them supported even MATHML-2.
Like I mentioned above a EPub reader is not REQUIRED to support it!
 
 2. Write a script (either using xmlproc, or using you favorite XML parser in 
 your favorite language) that converts the XML generated by ConTeXt into a 
 standard XHTML file. This is the easiest and the least time consuming 
 alternative.
AGAIN, as mentioned above there is no guarantee that it will be 
displayed properly.
Support/export of HTML5 would seem to me to be a better option, but 
then the HTML5 standard is not
complete and not fully supported by most newer ereaders, also.
 
 3. Modify the way in which ConTeXt generates the XML files. Ideally, I should 
 be able to write something like
Would be nice if there where commands in ConTeXt or a module for 
defining what should go into the CSS and a 
mode epub where the ConTeXt commands are converted to suitible HTML5 
structures that are suitiable for
most ereaders. 
Features: 
   1) margins in percentages
   2) font sizes based on em
   3) a new file for every chapter optional for sections 
user defined
Just a few. Lots more can be found in any decent documentation on 
writing ebooks.


regards
Keith.

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


Re: [NTG-context] EPUB woes

2013-11-18 Thread Hans Hagen

On 11/18/2013 10:00 AM, Keith J. Schultz wrote:


2) Now, what a EPub-READER must implement to handle is very
 little. There are HARDLY ANY provisions that a certified 
EPuB-READER has
  to implement any particular engine or features therein to 
display/render
 the information contain in the EPub-file/wrapper.


right, and I'm not going to waste time on it till i have a decent ebook 
reader that behaves well



3. Modify the way in which ConTeXt generates the XML files. Ideally, I should 
be able to write something like

Would be nice if there where commands in ConTeXt or a module for 
defining what should go into the CSS and a
mode epub where the ConTeXt commands are converted to suitible HTML5 
structures that are suitiable for
most ereaders.
Features:
1) margins in percentages
2) font sizes based on em
   3) a new file for every chapter optional for sections 
user defined
Just a few. Lots more can be found in any decent documentation on 
writing ebooks.


context outputs xml and as a bonus provides a css too ... one can always 
convert that xml to his/her ebooks liking .. maybe at some point the 
mtx-epub script will do that


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@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
___


Re: [NTG-context] EPUB woes

2013-11-18 Thread Keith J. Schultz
Hi Hans,


Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:

 On 11/18/2013 10:00 AM, Keith J. Schultz wrote:
 
  2) Now, what a EPub-READER must implement to handle is very
   little. There are HARDLY ANY provisions that a certified 
 EPuB-READER has
  to implement any particular engine or features therein to 
 display/render
   the information contain in the EPub-file/wrapper.
 
 right, and I'm not going to waste time on it till i have a decent ebook 
 reader that behaves well
The point you are missing is that the ereaders are behaving well. They 
are following the epub 
 standard, and that to the letter of the standard. The problem is that 
the standard does not 
enforce any particular implementation. If you look at the slow progress 
of the standard that 
actually requires a full implementation of the HTML5 standard. That  
wait will very long.

Furthermore, ereaders are made by companies more interested in profits 
than spending a few Euros
more to put decent HTML engines into their readers. Why they do not do 
that is beyond me!
 
 3. Modify the way in which ConTeXt generates the XML files. Ideally, I 
 should be able to write something like
  Would be nice if there where commands in ConTeXt or a module for 
 defining what should go into the CSS and a
  mode epub where the ConTeXt commands are converted to suitible HTML5 
 structures that are suitiable for
  most ereaders.
  Features:
1) margins in percentages
2) font sizes based on em
 3) a new file for every chapter optional for sections 
 user defined
  Just a few. Lots more can be found in any decent documentation on 
 writing ebooks.
 
 context outputs xml and as a bonus provides a css too ... one can always 
 convert that xml to his/her ebooks liking .. maybe at some point the mtx-epub 
 script will do that

I always to like to look at programming as modular and would think that 
a epub/ebook module would be nice that maps
there are commands for layingout ebooks. these commands can then be 
mapped back to standard context commands.
For some interested in producing a epub then can use the conventions 
for producing ebooks and ConTeXt can provide the
math conversions to regular page dimensions used in PDFs for proofing 
or creating a printed version. It would also make the
creation of EPubs from ConTeXt a simple parsing exercise.   

regards
Keith.
___
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
___


Re: [NTG-context] EPUB woes

2013-11-18 Thread Hans Hagen

On 11/18/2013 4:11 PM, Keith J. Schultz wrote:

Hi Hans,


Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:


On 11/18/2013 10:00 AM, Keith J. Schultz wrote:


2) Now, what a EPub-READER must implement to handle is very
 little. There are HARDLY ANY provisions that a certified 
EPuB-READER has
  to implement any particular engine or features therein to 
display/render
 the information contain in the EPub-file/wrapper.


right, and I'm not going to waste time on it till i have a decent ebook reader 
that behaves well

The point you are missing is that the ereaders are behaving well. They 
are following the epub
  standard, and that to the letter of the standard. The problem is that 
the standard does not
enforce any particular implementation. If you look at the slow progress 
of the standard that
actually requires a full implementation of the HTML5 standard. That  
wait will very long.


sure, and every time i see an epub novel i realize that for something 
like that one really can stick to rather dumb html ... the point is that 
one cannot expect context to output simple everywhere accepted html from 
complex rendered input ...



Furthermore, ereaders are made by companies more interested in profits 
than spending a few Euros
more to put decent HTML engines into their readers. Why they do not do 
that is beyond me!



3. Modify the way in which ConTeXt generates the XML files. Ideally, I should 
be able to write something like

Would be nice if there where commands in ConTeXt or a module for 
defining what should go into the CSS and a
mode epub where the ConTeXt commands are converted to suitible HTML5 
structures that are suitiable for
most ereaders.
Features:
1) margins in percentages
2) font sizes based on em
   3) a new file for every chapter optional for sections 
user defined
Just a few. Lots more can be found in any decent documentation on 
writing ebooks.


context outputs xml and as a bonus provides a css too ... one can always 
convert that xml to his/her ebooks liking .. maybe at some point the mtx-epub 
script will do that


I always to like to look at programming as modular and would think that 
a epub/ebook module would be nice that maps
there are commands for layingout ebooks. these commands can then be 
mapped back to standard context commands.


in that case code in xml and either processit by context or transform it 
into something ebooks can render



For some interested in producing a epub then can use the conventions 
for producing ebooks and ConTeXt can provide the
math conversions to regular page dimensions used in PDFs for proofing 
or creating a printed version. It would also make the
creation of EPubs from ConTeXt a simple parsing exercise.


so far i had no projects where epub was needes so it has a low priority 
and i still read paper books (or when i would have ebooks i wouldn't 
need to render them) ... pdfs views quite well on e.g. nexus 7 devices 
and i assume the upcoming sony high res ebook will also do pdf well


concerning modular: you can consider the context export to be modular .. 
convertable


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@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
___


Re: [NTG-context] EPUB woes

2013-11-18 Thread Keith J. Schultz

Am 18.11.2013 um 16:33 schrieb Hans Hagen pra...@wxs.nl:

 On 11/18/2013 4:11 PM, Keith J. Schultz wrote:
 Hi Hans,
 
 
 Am 18.11.2013 um 13:21 schrieb Hans Hagen pra...@wxs.nl:
 
 On 11/18/2013 10:00 AM, Keith J. Schultz wrote:
 
2) Now, what a EPub-READER must implement to handle is very
 little. There are HARDLY ANY provisions that a certified 
 EPuB-READER has
  to implement any particular engine or features therein to 
 display/render
 the information contain in the EPub-file/wrapper.
 
 right, and I'm not going to waste time on it till i have a decent ebook 
 reader that behaves well
  The point you are missing is that the ereaders are behaving well. They 
 are following the epub
  standard, and that to the letter of the standard. The problem is 
 that the standard does not
  enforce any particular implementation. If you look at the slow progress 
 of the standard that
  actually requires a full implementation of the HTML5 standard. That  
 wait will very long.
 
 sure, and every time i see an epub novel i realize that for something like 
 that one really can stick to rather dumb html ... the point is that one 
 cannot expect context to output simple everywhere accepted html from complex 
 rendered input ...
I agree fully. But, Since there are those that wish to produce epubs 
aka ebooks, they should not be doing complex
layout. One can always go from simple to complicated in needed, if 
there were commands dedicated to epub/ebooks/html.
As I had pointed out in my last post below.
 
  Furthermore, ereaders are made by companies more interested in profits 
 than spending a few Euros
  more to put decent HTML engines into their readers. Why they do not do 
 that is beyond me!
 
 3. Modify the way in which ConTeXt generates the XML files. Ideally, I 
 should be able to write something like
Would be nice if there where commands in ConTeXt or a module for 
 defining what should go into the CSS and a
mode epub where the ConTeXt commands are converted to suitible HTML5 
 structures that are suitiable for
most ereaders.
Features:
1) margins in percentages
2) font sizes based on em
   3) a new file for every chapter optional for sections 
 user defined
Just a few. Lots more can be found in any decent documentation on 
 writing ebooks.
 
 context outputs xml and as a bonus provides a css too ... one can always 
 convert that xml to his/her ebooks liking .. maybe at some point the 
 mtx-epub script will do that
 
  I always to like to look at programming as modular and would think that 
 a epub/ebook module would be nice that maps
  there are commands for layingout ebooks. these commands can then be 
 mapped back to standard context commands.
 
 in that case code in xml and either processit by context or transform it into 
 something ebooks can render
 
  For some interested in producing a epub then can use the conventions 
 for producing ebooks and ConTeXt can provide the
  math conversions to regular page dimensions used in PDFs for proofing 
 or creating a printed version. It would also make the
  creation of EPubs from ConTeXt a simple parsing exercise.
 
 so far i had no projects where epub was needes so it has a low priority and i 
 still read paper books (or when i would have ebooks i wouldn't need to render 
 them) ... pdfs views quite well on e.g. nexus 7 devices and i assume the 
 upcoming sony high res ebook will also do pdf well
Well I did start the discussion. Just offer my 2 Euro cents worth. 
Especially, since it comes up every now and then.
Furthermore, I there was a simple way to create epubs/books with 
ConTeXt more would use this feature. 

I have used up enough of or time.

regards
Keith.


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

[NTG-context] EPUB woes

2013-11-16 Thread Bill Meahan
I have been trying for a very long time to generate an epub document via 
context without success.


I have followed the steps on the wiki to the letter, using the 
export-example file provided with the standalone distribution. A PDF 
generated from the file is exactly what I would expect from an example. 
The generated epub, however, is useless - all the text is jammed 
together into one continuous block with no formatting whatsoever.


Adobe Digital Editions 2.0 crashes trying to open it. Sumatra and Sigil 
get it open but the results are as described above. Obviously I am 
missing a step or doing something wrong but I cannot see what.


Context Standalone from a couple of days ago. Windows 7-64 (Home 
Premium) but I got the same results several months ago on a Linux system 
so I do not think it is OS-related.


Sign me, Frustrated!

--
Bill Meahan, Westland, Michigan

 
  “Writing is like getting married. One should never

   commit oneself until one is amazed at one's luck.”

   —Iris Murdoch

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


Re: [NTG-context] EPUB woes

2013-11-16 Thread Keith J. Schultz
Hi Bill,

Using a PDF as a basis for creating an Epub ebook is actually a lost cause.
EPUB is a container format that just wraps around your PDF. I do not know of 
any 
ereader that can actually adjust the formatting/layout of a pdf in any 
significantly
useful way. You are stuck with the formatting in the PDF. 

For a EPUB-ebook to adjust properly you need to use HTML5 and CSS. Producing 
PDF an sticking it into a 
EPUB or MOBI wrapper just does not make sense. 

regards
Keith.


Am 16.11.2013 um 16:16 schrieb Bill Meahan subscribed_li...@meahan.net:

 I have been trying for a very long time to generate an epub document via 
 context without success.
 
 I have followed the steps on the wiki to the letter, using the export-example 
 file provided with the standalone distribution. A PDF generated from the file 
 is exactly what I would expect from an example. The generated epub, however, 
 is useless - all the text is jammed together into one continuous block with 
 no formatting whatsoever.
 
 Adobe Digital Editions 2.0 crashes trying to open it. Sumatra and Sigil get 
 it open but the results are as described above. Obviously I am missing a step 
 or doing something wrong but I cannot see what.
 
 Context Standalone from a couple of days ago. Windows 7-64 (Home Premium) but 
 I got the same results several months ago on a Linux system so I do not think 
 it is OS-related.
 
 Sign me, Frustrated!
 
 -- 
 Bill Meahan, Westland, Michigan
 
   “Writing is like getting married. One should never
   commit oneself until one is amazed at one's luck.”
 
   —Iris Murdoch
 
 ___
 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
 ___

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


Re: [NTG-context] EPUB woes

2013-11-16 Thread Wolfgang Schuster

Am 16.11.2013 um 16:16 schrieb Bill Meahan subscribed_li...@meahan.net:

 I have been trying for a very long time to generate an epub document via 
 context without success.
 
 I have followed the steps on the wiki to the letter, using the export-example 
 file provided with the standalone distribution. A PDF generated from the file 
 is exactly what I would expect from an example. The generated epub, however, 
 is useless - all the text is jammed together into one continuous block with 
 no formatting whatsoever.
 
 Adobe Digital Editions 2.0 crashes trying to open it. Sumatra and Sigil get 
 it open but the results are as described above. Obviously I am missing a step 
 or doing something wrong but I cannot see what.
 
 Context Standalone from a couple of days ago. Windows 7-64 (Home Premium) but 
 I got the same results several months ago on a Linux system so I do not think 
 it is OS-related.

When you use the export option context creates a xml file from your document. 
When you call not the epub script context creates epub file which contains this 
xml file which uses a custom format and not xhtml as you would expect. 

To get a epub file which can be used with most reader (a few programs on 
windows/mac/linux can read contexts output) you have to convert context xml 
file into valid xhtml.

What you have to do as well in your document to get proper tagged paragraphs is 
to add \startparagraph and \stopparagraph at the begin and end of each 
paragraph, otherwise context adds AFAIR br/ between them.

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
___


Re: [NTG-context] EPUB woes

2013-11-16 Thread Bill Meahan

On 11/16/2013 11:00 AM, Keith J. Schultz wrote:

Hi Bill,

Using a PDF as a basis for creating an Epub ebook is actually a lost cause.
EPUB is a container format that just wraps around your PDF. I do not know of any
ereader that can actually adjust the formatting/layout of a pdf in any 
significantly
useful way. You are stuck with the formatting in the PDF.

For a EPUB-ebook to adjust properly you need to use HTML5 and CSS. Producing 
PDF an sticking it into a
EPUB or MOBI wrapper just does not make sense.

regards
Keith.


You are totally misreading what I wrote!

I know there is no direct PDF - EPUB route and it's a fool's errand to 
think there is. However, with appropriate headers, ConTeXt is supposed 
to create either a PDF or and EPUB from a common source file marked up 
for ConTeXt. Hence, if I run


wwm$ context options export-example.tex

I expect to get a PDF *but* if I run

wwm$ mtxrun --script epub --make export-example.tex  - the same 
export-example.tex as above


I would /expect/ to get a valid EPUB file, or so I'm lead to believe.

At the moment, I'm simply trying it out using Hans' export-example.tex 
file that comes as part of the standard ConTeXt distribution, either 
Standalone or part of one of the other distributions. I haven't even 
opened the export-example.tex file in an editor (yet) in this round of 
trials and I've even run the script against it right in the /base/ 
directory where it is found in the distribution so I don't understand 
why it is not producing a valid EPUB. Once I've got that sorted out, I 
can try applying the lessons learned to my own documents.


--
Bill Meahan, Westland, Michigan

 
  “Writing is like getting married. One should never

   commit oneself until one is amazed at one's luck.”

   —Iris Murdoch

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


Re: [NTG-context] EPUB woes

2013-11-16 Thread Aditya Mahajan

On Sat, 16 Nov 2013, Bill Meahan wrote:


I would /expect/ to get a valid EPUB file, or so I'm lead to believe.

At the moment, I'm simply trying it out using Hans' export-example.tex file 
that comes as part of the standard ConTeXt distribution, either Standalone or 
part of one of the other distributions. I haven't even opened the 
export-example.tex file in an editor (yet) in this round of trials and I've 
even run the script against it right in the /base/ directory where it is 
found in the distribution so I don't understand why it is not producing a 
valid EPUB. Once I've got that sorted out, I can try applying the lessons 
learned to my own documents.


ConTeXt provides two types of exports. The first is an XML export. 
Consider a sample file:


~~~ {test.tex}
\setupbackend[export=yes]

\starttext
\startsection[title={This is a test}]
  \startparagraph
Some random text
\startitemize
  \item First
  \item Second
\stopitemize
  \stopparagraph
\stopsection

\stoptext
~~~

Running `context test.tex` generates a `test.export` file that looks as 
follows:


~~~ {test.export}
?xml version='1.0' encoding='UTF-8' standalone='yes' ?

!-- input filename   : test  --
!-- processing date  : Sat Nov 16 12:19:59 2013 --
!-- context version  : 2013.11.01 15:02  --
!-- exporter version : 0.30  --


 document language=en file=test date=Sat Nov 16 12:19:59 2013 
context=2013.11.01 15:02 version=0.30 
xmlns:m=http://www.w3.org/1998/Math/MathML;

  section detail=section location='aut:1'
sectionnumber1/sectionnumber
   sectiontitleThis is a test/sectiontitle
   sectioncontent
  paragraphSome random text itemgroup detail=itemize 
symbol=1itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentFirst/itemcontent/item 
itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentSecond/itemcontent/item/itemgroup/paragraph

   /sectioncontent
  /section
 /document
~~~

which is simply an XML representation of the document.

In prinicple, if one adds an appropriate CSS file with that XML, any 
recent browser will be able to display it. So, if you change the first 
line of `test.tex` to


~~~
\setupbackend[export=yes, xhtml=yes, css=yes]
~~~

and run `context test.tex`, you will get four additional files: 
`test.xhtml`, `test-styles.css`, `test-images.css`, and 
`test.specification`.


The `test.xhtml` file look as follows:

~~~{test.xhtml}
?xml version='1.0' encoding='UTF-8' standalone='yes' ?

!-- input filename   : test  --
!-- processing date  : Sat Nov 16 12:22:58 2013 --
!-- context version  : 2013.11.01 15:02  --
!-- exporter version : 0.30  --

?xml-stylesheet type=text/css href=test-styles.css?
?xml-stylesheet type=text/css href=test-images.css?
?xml-stylesheet type=text/css href=export-example.css?

 document language=en version=0.30 file=test 
xmlns:xhtml=http://www.w3.org/1999/xhtml; 
xmlns:m=http://www.w3.org/1998/Math/MathML; date=Sat Nov 16 12:22:58 
2013 context=2013.11.01 15:02

  xhtml:a name=aut_1section location=aut:1 detail=section
sectionnumber1/sectionnumber
   sectiontitleThis is a test/sectiontitle
   sectioncontent
  paragraphSome random text itemgroup symbol=1 
detail=itemizeitemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentFirst/itemcontent/item 
itemitemtagm:math display=inline!-- begin m:mrow 
--m:mo•/m:mo!-- end m:mrow 
--/m:math/itemtagitemcontentSecond/itemcontent/item/itemgroup/paragraph

   /sectioncontent
  /section/xhtml:a
 /document
~~~

Notice that apart from the three lines specifying the CSS files, the rest 
of the document is the same as in XML export. The two css files, 
`test-styles.css` and `test-images.css` include the relevant code for the 
style modifications and images in the document. The css file 
`export-example.css` comes with the ConTeXt distribution and has the 
default values for most ConTeXt elements.


If you open the `test.xhtml` file in any browser, it will work correctly 
(because an XHTML markup is extensible and can use any XML tags as long as 
the behavior of the tag is specified in a CSS file). This is, however, not 
a XHTML file that includes the default XHTML markup (h1, p, ul, 
etc.)


Now, lets come back to the last file generated by the export: 
`test.specification`. This is a lua file that contains:


~~~{test.specification}
return {
 [files]={ test-styles.css, test-images.css, export-example.css, 
test.xhtml },

 [identifier]=e6a91a13-4e08-9494-3817-bfffe872be2c,
 [images]={},
 [language]=en,
 [name]=test,
 [root]=test.xhtml,
}


When you run `mtxrun --script epub --make test`, it just takes the files 
specificied in the files field, and zips them in as a epub file.


Now, in principle, any epub reader should support the any XHTML file; in 
practice, they only support the default XHTML tags. The XML+CSS file that 

Re: [NTG-context] EPUB woes

2013-11-16 Thread Bill Meahan

On 11/16/2013 12:37 PM, Aditya Mahajan wrote:

On Sat, 16 Nov 2013, Bill Meahan wrote:


I would /expect/ to get a valid EPUB file, or so I'm lead to believe.



1. Wait until the EPUB readers catch up. It took almost 10-15 years 
for the browsers to catch up with the HTML standards, and I don't have 
much hope for EPUB readers here. Last I checked, none of them 
supported even MATHML-2.


2. Write a script (either using xmlproc, or using you favorite XML 
parser in your favorite language) that converts the XML generated by 
ConTeXt into a standard XHTML file. This is the easiest and the 
least time consuming alternative.


3. Modify the way in which ConTeXt generates the XML files. Ideally, I 
should be able to write something like


~~~
\setupparagraph[tag=p, class=default]
~~~

to tell context that \startparagraph ... \stopparagraph should 
translate to `p class=default ... /p. Last I checked the code 
that generates the XML file, there was no easy way to change the tags 
and classes.


I hope that the above description clarifies the situation.

Aditya


Thanks for the clarification.

--
Bill Meahan, Westland, Michigan

 
  “Writing is like getting married. One should never

   commit oneself until one is amazed at one's luck.”

   —Iris Murdoch

This message is digitally signed with an X.509 certificate
to prove it is from me and has not been altered since it was sent.

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

Re: [NTG-context] EPUB XHTML Format

2013-09-12 Thread Alan BRASLAU
On Thu, 5 Sep 2013 19:22:42
Aditya Mahajan adit...@umich.edu wrote:

 How easy is it to create a new export format. IIRC, context keeps track of 
 the entire document tree, and flushes the XML output only at the end. Is 
 it possible to make this pluggable so that users can write their own 
 transformers (in lua) on how the document tree can be written. This will 
 enable more output formats (opendocument and (shudder) latex).

Or, (gasp!) MSword .docx

Alan
___
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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-07 Thread Hans Hagen

On 9/6/2013 10:20 PM, Thangalin wrote:

Hi,

The best reader imho is iBooks on the iPad, nothing else, from what
I've seen, comes close. But that is one expensive eReader. :(


We'll just have everybody in the world who has a Kindle, Kobo, or other
reader exchange their existing hardware, and then purchase an iPad plus
iBook. Problem solved? ;-)

ConTeXT TeX reading xml - export - optional transform - EPUB + CSS*
you want 'direct epub html from context' (no xslt) but on the other
hand use xslt to map onto context while context can do xml directly
... chicken egg


Well, given that ConTeXt doesn't actually produce validating EPUB
documents, I suspect not many people will actually use that feature.
It's great in theory, but if it produces books that don't actually work
on the Kindle or Kobo, then it's unusable in practice -- never mind not
being able to add the books to online marketplaces (such as Amazon)
because, again, the output does not validate.


context doesn't produce epub (which at this moment is so floating that i 
would keep updating, which is fine if i'd use it myself or in projects 
at pragma, but not for the sake of keeping up) but does an export to xml 
(*.export)


as a bonus it can output some extra stuff so that in a browser that can 
deal with xml+css (and a few xhtml tags for hyperlinks) we can preview


then there is mtx-epub that can make an epub but that is a moving target 
(at some point we stopped extending waiting for a decent standard)


so, i'd never claim that context produces epub but it can be used in a 
workflow that involves epub as it outputs xml which can be transformed


supporting all variants of epub in the backend would be the same as 
hardcoding all kind of xml dts in the frontend (docbook, tei, whatever); 
instead we provide a general xml handler and a general xml export


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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-07 Thread Thangalin
Hi,

so, i'd never claim that context produces epub but it can be used in a
 workflow that involves epub as it outputs xml which can be transformed


That's a distinction that either might not matter or sometimes is lost:

http://tex.stackexchange.com/a/17642/2148
http://wiki.contextgarden.net/epub
ConTeXt has preliminary epub http://en.wikipedia.org/wiki/EPUBsupport...

Does ConTeXt refer to a suite of tools, or only the context command?
Either way, it appears that the line between the command and the tool set
is blurred a bit. This is completely understandable, too, as you wouldn't
want to write, the ConTeXt suite of tools includes a command, mtxrun, that
can produce EPUB files all the time when talking about EPUBs.


 supporting all variants of epub in the backend would be the same as
 hardcoding all kind of xml dts in the frontend (docbook, tei, whatever);
 instead we provide a general xml handler and a general xml export


That paragraph would be an excellent addition to the wiki; not sure where
though.

Kind regards.
___
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
___

Re: [NTG-context] EPUB XHTML Format

2013-09-06 Thread Mica Semrick
Another small note, since I just walked down the ePUB path: you'll be very
sad to find out that a lot of rendering engines for popular readers are not
consistent, won't render standard XHTML markup correctly (nest an ordered
list within an unordered list and then look at it in adobe digital editions
and several other readers). But it is just XHML + CSS! you'll cry, How
can they not render it correctly? I don't know, but it was an extremely
frustrating process. I even contacted adobe to try and report this nested
list bug to them... their suggestion was that I could *pay* them to work
with content experts who would help me correct my source so that it
would render correctly.

The best reader imho is iBooks on the iPad, nothing else, from what I've
seen, comes close. But that is one expensive eReader. :(


On Thu, Sep 5, 2013 at 3:00 PM, Thangalin thanga...@gmail.com wrote:

 Hi,

 handle XML+CSS well. However, most (all?) EPUB readers don't. So, the
 question is asking if instead ConTeXt could generate a XHTML


 Precisely.


  If you need both EPUB and PDF, start with a semantically rich XML
 vocabulary, e.g. DocBook. In this case you can relatively easy transfrom


 My database doesn't generate DocBook. It generates a custom XML document
 from which I generate a web page, and a LaTeX document (though soon to be
 ConTeXt!). There is no reason, technically, why I cannot convert the source
 XML to either DocBook or directly to EPUB. There are, however, problems
 doing that, which Aditya correctly surmises:


 - Automatic section numbering taking care of different conversions.
 - Automatic index generation and sorting
 - Inserting hyphenation points at the appropriate place in the generated
 output (so that the browser can effectively rely on TeX's hyphenation
 algorithm to do line-breaking).

 - Convert TeX math to MathML.

 The current ConTeXT XML source can translate a well formed ConTeXt
 document into a XML document with the above features.


 Those are exactly the issues that I would love to resolve using ConTeXt
 for generating an EPUB. (The MathML isn't as important to me, but I can see
 other people wanting such a feature.)

 What about accessibility? I expect that visually impaired people would
 depend on document structure rather than its visualisation.


 That is a good point. The current XML structure produced by ConTeXt (Hans
 correct me here if I'm mistaken) is not accessible, as it doesn't adhere to
 strict XHTML. I suspect that div tags would not be accessible -- the only
 way to provide true accessibility in EPUB format would be by using the
 strict XHTML tags.

 for instance, we have more levels than H1..H6, so how to do H7? if someone
 has to deal with that, he/she can as well transform all into H1 with some
 class which is a local solution then


 I realize there is not going to be a one-to-one map of all possible
 ConTeXt macros to XHTML. For someone who has 7 levels of nested sections
 they would either have to rewrite some Lua or perform some post-processing
 (e.g., with XSLT). I would posit that a document with 7 levels of nested
 sections is not going to be a common occurrence.

 When I talk about strict XHTML, I'm proposing that a _simple_ ConTeXt
 document (up to 6 header levels, numbered and unnumbered lists, images,
 text emphasis, etc.) should generate a simple, validating XHTML document.
 Trying to attain 100% coverage of ConTeXt transmogrification to XHTML is
 ridiculous when, I suspect, 80% coverage would meet most needs. :-)

 It is definitely possible to translate the ConTeXt EPUB output to XHTML.
 However, there are practical realities that hinder such an approach.
 Architecturally, if anyone is going to translate an XML document to EPUB
 format, it certainly won't be this way:

 *XML + XSLT - ConTeXT File - ConTeXt EPUB XML + XSLT - EPUB + CSS*

 It'll be this way, which is less time-consuming, less complex, and less
 susceptible to err:

 *XML + XSLT (or API) - EPUB + CSS*

 However, it does not, as we all know, produce as feature rich output as
 leveraging the ConTeXt abilities that Aditya mentioned, which was the point:

 *XML + XSLT - ConTeXT TeX - EPUB + CSS*

 Kindest regards.


 ___
 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

 ___

___
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 / 

Re: [NTG-context] EPUB XHTML Format

2013-09-06 Thread Hans Hagen

On 9/6/2013 12:00 AM, Thangalin wrote:


That is a good point. The current XML structure produced by ConTeXt
(Hans correct me here if I'm mistaken) is not accessible, as it doesn't
adhere to strict XHTML. I suspect that div tags would not be
accessible -- the only way to provide true accessibility in EPUB format
would be by using the strict XHTML tags.


html is not rich enough .. one ends up with abusing tags which in turn 
is confusing for accesibility ... i once saw an epub where h1 was used 
for the chapter number and h2 for the chapter title



When I talk about strict XHTML, I'm proposing that a _simple_ ConTeXt
document (up to 6 header levels, numbered and unnumbered lists, images,
text emphasis, etc.) should generate a simple, validating XHTML
document. Trying to attain 100% coverage of ConTeXt transmogrification
to XHTML is ridiculous when, I suspect, 80% coverage would meet most
needs.. :-)


in that case a few page transformation could do, isn't it?


*XML + XSLT - ConTeXT TeX - EPUB + CSS*


probably ok for novels but who there is no way to limit the user ... so 
in the end we still have a complex mix to deal with ... i'd rather have


ConTeXT TeX reading xml - export - optional transform - EPUB + CSS*

you want 'direct epub html from context' (no xslt) but on the other hand 
use xslt to map onto context while context can do xml directly ... 
chicken egg


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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-06 Thread Thangalin
Hi,

The best reader imho is iBooks on the iPad, nothing else, from what I've
 seen, comes close. But that is one expensive eReader. :(


We'll just have everybody in the world who has a Kindle, Kobo, or other
reader exchange their existing hardware, and then purchase an iPad plus
iBook. Problem solved? ;-)

ConTeXT TeX reading xml - export - optional transform - EPUB + CSS*
 you want 'direct epub html from context' (no xslt) but on the other hand
 use xslt to map onto context while context can do xml directly ... chicken
 egg


Well, given that ConTeXt doesn't actually produce validating EPUB
documents, I suspect not many people will actually use that feature. It's
great in theory, but if it produces books that don't actually work on the
Kindle or Kobo, then it's unusable in practice -- never mind not being able
to add the books to online marketplaces (such as Amazon) because, again,
the output does not validate.

Kind regards.
___
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
___

Re: [NTG-context] EPUB XHTML Format

2013-09-06 Thread Aditya Mahajan

On Fri, 6 Sep 2013, Thangalin wrote:


Hi,

never mind not being able to add the books to online marketplaces (such as

Amazon) because, again, the output does not validate.



I think the simplest thing to do would be to update the wiki and have a
note that informs readers that while ConTeXt can be used to generate an
EPUB, it is likely that that EPUB will be unusable for devices without
further transformation of the XML content. At least that way the knowledge
is out there and people are forewarned that not all EPUB documents are
equivalent.


It will also be nice to add a table that lists the EPUB readers (hardware 
and software) and tells whether ConTeXt produced EPUB documents work on 
them.


Aditya
___
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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-06 Thread Thangalin
Hi,

never mind not being able to add the books to online marketplaces (such as
 Amazon) because, again, the output does not validate.


I think the simplest thing to do would be to update the wiki and have a
note that informs readers that while ConTeXt can be used to generate an
EPUB, it is likely that that EPUB will be unusable for devices without
further transformation of the XML content. At least that way the knowledge
is out there and people are forewarned that not all EPUB documents are
equivalent.

Kindest regards.
___
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
___

Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Hans Hagen

On 9/4/2013 7:55 PM, Thangalin wrote:

Hi.

of course we could alternatively export all as div
class=tag-subtag-... but i don't like that too much; html itself
is not rich enough for our purpose

What about giving developers the ability to change the destination
element? For example:

\setuplist[chapter][
   xml={\starttag[h1]#1\stoptag}
]

Would produce, upon export:

h1Chapter/h1


export doesn't happen at that level; something like that would add an 
ugly overhead; it's way easier to make some xslt script that converts 
the rather systematic export to something like that and it only has to 
be written once by someone (not me)



Or (using export instead of xml; I don't care what it is named):

\setuplist[chapter][


export={\starttag[div]\startattribute[class]{chapter}#1\stopattribute\stoptag}}
]

Similarly, this would produce:

div class=chapterChapter/div


you use some tex syntax but it all happens in lua; also, the only way to 
provide some kind of different tagging is to support plugins (read: lua 
functions) that could override default behaviour (but again, it's quite 
easy to do that as a postprocessing step)



This would offer the flexibility of custom XML documents without
affecting the default behaviour.

   * Generates XHTML headers (including !DOCTYPE and html...)

not needed as we're 'standalone'

Having the ability to produce the !DOCTYPE... and htmnl elements
could be as simple as:

\setupexport[
   standalone=no,
]

   * Produces images as img tags, rather than float tags.

the css can deal with them (info is written to files for that)

Yes, but they aren't standard. There is an ecosystem of tools (e.g.,
Calibre, normalizing CSS templates, etc.), not to mention a widespread
knowledge-base, that groks the minimal XHTML specification. Plus, using
XML tags that are not in the minimal XHTML spec. means more testing on
more devices to make sure that their XHTML parsers render correctly.


most of the xml we get here is a funny mix of whatever tags and html 
(often for tables) and normaly there is way more structure than in the 
average html document; the export is meant to be close to the source and 
turning it into some html / div mixture makes it messy


for instance, we have more levels than H1..H6, so how to do H7? if 
someone has to deal with that, he/she can as well transform all into H1 
with some class which is a local solution then



xhtml has no typical tags .. it's xml + css (or xslt) ...
unfortunately browsers have

That is, a Strictly Conforming XHTML Document, as per:

http://www.w3.org/TR/2000/REC-xhtml1-2126/#docconf

the export of context is in fact just xml, and by tagging it as
xhtml we can apply css to it; but if someone has a workflow for
producing epub an option if to postprocess that xml file into
whatever epub one wants


indeed. that was the idea: export xml, tag it as xhtml (with the option 
to provide hyperlinks, an exception), provide some standard css as 
starter and then let users deal with matters the way they like; you can 
be pretty sure that what you want is not the same as what someone else 
wants; and if more people want it, they can together write a 
transformation script (or hire someone)


keep in mind that the export itself is already tricky enough and for me 
it doesn't pay off to provide tons of additional functionality (well, it 
doesn't pay of to export anyway)



I could transform the ConTeXt-generated XML into strictly conforming
XHTML, but it was a step I was hoping to avoid. Right now my process is:

 1. Convert XML data to a ConTeXt .tex file.
 2. Convert ConTeXt to either PDF or EPUB.
 3. Stylize EPUB using CSS.


but writing the transform that suits you is just one step (with yuou 
spending the time on it) while extending the export into a complete 
transformation and configuration thing would put the burden on me -)



I want to use ConTeXt here (instead of going directly from XML data to
EPUB) because ConTeXt provides functionality such as multiple indexes,
table-of-contents, and bundling the .epub. Having an extra step to
generate strictly conforming XHTML is architecturally painful as it
means transforming the document three times (XML - ConTeXt, ConTeXt -
XML, then XML - XHTML).


why is it painful? the export if quite generic and will not change; it 
is also flexible as it honors user defined sectioning and styling



Everytime we look into epub there's another issue ... it's not a
standard but reversed engineered application mess (happen soften
with xml: turn some application data structures into xml and call it
a standard)


Some book vendors only accept validating EPUBs. ConTeXt is documented as
being able to generate EPUBs. The documentation should state the EPUBs
do not validate and do not generate strictly conforming XHTML.


well, i, luigi and some others did tests: the thing is that epub is 
evolving 

Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Aditya Mahajan

On Thu, 5 Sep 2013, Hans Hagen wrote:


On 9/4/2013 11:20 AM, Hans Hagen wrote:


you get a representation in xml indeed, but not verbatim, but as close
as possible to the genaric (parent) structure elements in context


probably the most straightforward xhtml export is file with only

div class=section ...
div class=... ...
   div
/div

i.e. only divs and spans


How easy is it to create a new export format. IIRC, context keeps track of 
the entire document tree, and flushes the XML output only at the end. Is 
it possible to make this pluggable so that users can write their own 
transformers (in lua) on how the document tree can be written. This will 
enable more output formats (opendocument and (shudder) latex).


Aditya
___
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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Hans Hagen

On 9/5/2013 7:57 PM, Khaled Hosny wrote:

On Thu, Sep 05, 2013 at 09:57:59AM -0700, Thangalin wrote:

Hi,

div class=section ...

 div class=... ...
 div
/div

i.e. only divs and spans



I think that would be a more robust output format, technically, easier to
adapt, and more readily conform to the strict XHTML tag subset.


What about accessibility? I expect that visually impaired people would
depend on document structure rather than its visualisation.


For that purpose I'd make a nice special doc. But the basic export has 
at least the similar structure as the original. (After all, it's one of 
the reasons why we *can do* an export.


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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Hans Hagen

On 9/5/2013 8:20 PM, Aditya Mahajan wrote:


The typical ConTeXt document has a lot of structure, and the XML export
generates a well structured XML output. That can be directly used in
most modern browsers that handle XML+CSS well. However, most (all?) EPUB
readers don't. So, the question is asking if instead ConTeXt could
generate a XHTML


but how hard would it be to make an xslt tranformation from 
context.export to epub variants (ok, at some point i can look into it 
but only if there is a robust standard and i have devices to test it on)


and indeed the quality of the source is important

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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Khaled Hosny
On Thu, Sep 05, 2013 at 09:57:59AM -0700, Thangalin wrote:
 Hi,
 
 div class=section ...
  div class=... ...
  div
  /div
 
  i.e. only divs and spans
 
 
 I think that would be a more robust output format, technically, easier to
 adapt, and more readily conform to the strict XHTML tag subset.

What about accessibility? I expect that visually impaired people would
depend on document structure rather than its visualisation.

Regards,
Khaled
___
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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Michael Hallgren
Le 05/09/2013 20:24, Hans Hagen a écrit :
 On 9/5/2013 8:20 PM, Aditya Mahajan wrote:

 The typical ConTeXt document has a lot of structure, and the XML export
 generates a well structured XML output. That can be directly used in
 most modern browsers that handle XML+CSS well. However, most (all?) EPUB
 readers don't. So, the question is asking if instead ConTeXt could
 generate a XHTML

 but how hard would it be to make an xslt tranformation from
 context.export to epub variants (ok, at some point i can look into it
 but only if there is a robust standard and i have devices to test it on)

 and indeed the quality of the source is important


Sounds by far to be the cleanest approach.

Cheers,

mh


 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@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
 ___


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


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Hans Hagen

On 9/4/2013 11:20 AM, Hans Hagen wrote:


you get a representation in xml indeed, but not verbatim, but as close
as possible to the genaric (parent) structure elements in context


probably the most straightforward xhtml export is file with only

div class=section ...
div class=... ...
div
/div

i.e. only divs and spans


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


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Thangalin
Hi,

div class=section ...
 div class=... ...
 div
 /div

 i.e. only divs and spans


I think that would be a more robust output format, technically, easier to
adapt, and more readily conform to the strict XHTML tag subset.

The other issue I encountered was this:

\startfrontmatter
  \startstandardmakeup
Title page
  \stopstandardmakeup

  \startstandardmakeup
Copyright
  \stopstandardmakeup

  \completecontent
\stopfrontmatter


This produced *Title pageCopyright* as text without any markup, which
makes the EPUB output a bit difficult to parse. I thought the software
should output something like:

div class=frontmatter
  div id=standardmakeup1 class=standardmakeupTitle page/div
  div id=standardmakeup2 class=standardmakeupCopyright/div
  div class=contents!-- etc... --/div
/div


This way the title and copyright pages can be styled independently.

Kindest regards.
___
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
___

Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Aditya Mahajan

On Thu, 5 Sep 2013, honyk wrote:


On 2013-09-04 Thangalin wrote:


What needs to happen to take a minimal ConTeXt file (such as the
attached) to produce a minimum viable EPUB that:


It is always difficult to parse and further process not well structured
plain text without advanced semantics. Garbage in, garbage out.


The typical ConTeXt document has a lot of structure, and the XML export 
generates a well structured XML output. That can be directly used in most 
modern browsers that handle XML+CSS well. However, most (all?) EPUB 
readers don't. So, the question is asking if instead ConTeXt could 
generate a XHTML



If you need both EPUB and PDF, start with a semantically rich XML
vocabulary, e.g. DocBook. In this case you can relatively easy transfrom
(XSLT) input data into almost any format. These basic outputs like EPUB or
PDF (via XSL-FO) you can get out-of-the-box. The Context output can be
generated using dbcontext: http://dblatex.sourceforge.net/

In sum, use XML as your primary source and from it derive everything else.


I haven't used XML-only toolchains. Is it possible to handle:

- Automatic section numbering taking care of different conversions.
- Automatic index generation and sorting
- Inserting hyphenation points at the approriate place in the generated 
ouput (so that the browser can effectively rely on TeX's hyphenation 
algorithm to do linebreaking).

- Convert TeX math to MathML.

The current ConTeXT XML source can translate a well formed ConTeXt 
document into a XML document with the above features.


Aditya
___
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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Hans Hagen

On 9/5/2013 7:22 PM, Aditya Mahajan wrote:

On Thu, 5 Sep 2013, Hans Hagen wrote:


On 9/4/2013 11:20 AM, Hans Hagen wrote:


you get a representation in xml indeed, but not verbatim, but as close
as possible to the genaric (parent) structure elements in context


probably the most straightforward xhtml export is file with only

div class=section ...
div class=... ...
   div
/div

i.e. only divs and spans


How easy is it to create a new export format. IIRC, context keeps track
of the entire document tree, and flushes the XML output only at the end.
Is it possible to make this pluggable so that users can write their own
transformers (in lua) on how the document tree can be written. This will
enable more output formats (opendocument and (shudder) latex).


sure, but first i want to clean up some code (it's rather complex) ... 
in principle there is a document tree so one can plug into that; 
alternatively one can load the xml tree and mess with that (probably 
easier if we provide some styles for it)


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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread honyk
On 2013-09-04 Thangalin wrote:
 
 What needs to happen to take a minimal ConTeXt file (such as the
 attached) to produce a minimum viable EPUB that:
 

It is always difficult to parse and further process not well structured
plain text without advanced semantics. Garbage in, garbage out.

If you need both EPUB and PDF, start with a semantically rich XML
vocabulary, e.g. DocBook. In this case you can relatively easy transfrom
(XSLT) input data into almost any format. These basic outputs like EPUB or
PDF (via XSL-FO) you can get out-of-the-box. The Context output can be
generated using dbcontext: http://dblatex.sourceforge.net/

In sum, use XML as your primary source and from it derive everything else.

Jan

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


Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Thangalin
Hi,

handle XML+CSS well. However, most (all?) EPUB readers don't. So, the
 question is asking if instead ConTeXt could generate a XHTML


Precisely.


  If you need both EPUB and PDF, start with a semantically rich XML
 vocabulary, e.g. DocBook. In this case you can relatively easy transfrom


My database doesn't generate DocBook. It generates a custom XML document
from which I generate a web page, and a LaTeX document (though soon to be
ConTeXt!). There is no reason, technically, why I cannot convert the source
XML to either DocBook or directly to EPUB. There are, however, problems
doing that, which Aditya correctly surmises:


 - Automatic section numbering taking care of different conversions.
 - Automatic index generation and sorting
 - Inserting hyphenation points at the appropriate place in the generated
 output (so that the browser can effectively rely on TeX's hyphenation
 algorithm to do line-breaking).
 - Convert TeX math to MathML.

 The current ConTeXT XML source can translate a well formed ConTeXt
 document into a XML document with the above features.


Those are exactly the issues that I would love to resolve using ConTeXt for
generating an EPUB. (The MathML isn't as important to me, but I can see
other people wanting such a feature.)

What about accessibility? I expect that visually impaired people would
 depend on document structure rather than its visualisation.


That is a good point. The current XML structure produced by ConTeXt (Hans
correct me here if I'm mistaken) is not accessible, as it doesn't adhere to
strict XHTML. I suspect that div tags would not be accessible -- the only
way to provide true accessibility in EPUB format would be by using the
strict XHTML tags.

for instance, we have more levels than H1..H6, so how to do H7? if someone
 has to deal with that, he/she can as well transform all into H1 with some
 class which is a local solution then


I realize there is not going to be a one-to-one map of all possible ConTeXt
macros to XHTML. For someone who has 7 levels of nested sections they would
either have to rewrite some Lua or perform some post-processing (e.g., with
XSLT). I would posit that a document with 7 levels of nested sections is
not going to be a common occurrence.

When I talk about strict XHTML, I'm proposing that a _simple_ ConTeXt
document (up to 6 header levels, numbered and unnumbered lists, images,
text emphasis, etc.) should generate a simple, validating XHTML document.
Trying to attain 100% coverage of ConTeXt transmogrification to XHTML is
ridiculous when, I suspect, 80% coverage would meet most needs. :-)

It is definitely possible to translate the ConTeXt EPUB output to XHTML.
However, there are practical realities that hinder such an approach.
Architecturally, if anyone is going to translate an XML document to EPUB
format, it certainly won't be this way:

*XML + XSLT - ConTeXT File - ConTeXt EPUB XML + XSLT - EPUB + CSS*

It'll be this way, which is less time-consuming, less complex, and less
susceptible to err:

*XML + XSLT (or API) - EPUB + CSS*

However, it does not, as we all know, produce as feature rich output as
leveraging the ConTeXt abilities that Aditya mentioned, which was the point:

*XML + XSLT - ConTeXT TeX - EPUB + CSS*

Kindest regards.
___
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
___

Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Mica Semrick
I'd say use an xml source (docbook, TEI, or DITA) and then write a ConTeXt
stylesheet to typeset your XML. See http://wiki.contextgarden.net/TEI_xml

I think that TEI-lite is a nice, very general XML vocabulary...

Best,
Mica


On Thu, Sep 5, 2013 at 11:24 AM, Hans Hagen pra...@wxs.nl wrote:

 On 9/5/2013 8:20 PM, Aditya Mahajan wrote:

  The typical ConTeXt document has a lot of structure, and the XML export
 generates a well structured XML output. That can be directly used in
 most modern browsers that handle XML+CSS well. However, most (all?) EPUB
 readers don't. So, the question is asking if instead ConTeXt could
 generate a XHTML


 but how hard would it be to make an xslt tranformation from context.export
 to epub variants (ok, at some point i can look into it but only if there is
 a robust standard and i have devices to test it on)

 and indeed the quality of the source is important


 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@ntg.nl / http://www.ntg.nl/mailman/**
 listinfo/ntg-context 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/http://foundry.supelec.fr/projects/contextrev/
 wiki : http://contextgarden.net
 __**__**
 ___

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

Re: [NTG-context] EPUB XHTML Format

2013-09-04 Thread Hans Hagen

On 9/4/2013 3:19 AM, Thangalin wrote:

Hi,

The attached t.tex file produces the attached t.xhtml file. I have
looked at the following documents:

  * http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0..1
http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1
  * http://en.wikipedia.org/wiki/DTBook
  * http://www.idpf.org/epub/20/spec/OPS_2.0.1_draft.htm
  * http://www.w3.org/TR/xhtml11/doctype.html
  * http://www.w3.org/TR/html5/sections.html

It seems that the macros in t.tex are being written out as XML elements,
verbatim. It is my understanding that these XML elements, however, do
not conform to the minimal content models associated with XHTML 1.1.


you get a representation in xml indeed, but not verbatim, but as close 
as possible to the genaric (parent) structure elements in context


of course we could alternatively export all as div 
class=tag-subtag-... but i don't like that too much; html itself is 
not rich enough for our purpose



What needs to happen to take a minimal ConTeXt file (such as the
attached) to produce a minimum viable EPUB that:

  * Generates XHTML headers (including !DOCTYPE and html...)


not needed as we're 'standalone'


  * Produces images as img tags, rather than float tags.


the css can deal with them (info is written to files for that)

the only real problematic thing is hyperlinks as css has no provision 
for that so there's an option to inject a...



  * Uses typical XHTML tags for body elements (e.g., ol for ordered
lists).


xhtml has no typical tags .. it's xml + css (or xslt) ... unfortunately 
browsers have messed up html so much (extensions, too tolerant support 
for unmatched tags, different rendering models) that xhtml never really 
took off


the export of context is in fact just xml, and by tagging it as xhtml we 
can apply css to it; but if someone has a workflow for producing epub an 
option if to postprocess that xml file into whatever epub one wants 
(i.e. the export is generic and carries as much info as possible)



Ideally, I would like to do something such as:

  * context t.tex
  * mtxrun --script epub --make t.specification

to generate an EPUB that passes validation of epubcheck
http://code.google.com/p/epubcheck/wiki/Library, with an output XHTML
file that more closely matches the XHTML specification.


Everytime we look into epub there's another issue ... it's not a 
standard but reversed engineered application mess (happen soften with 
xml: turn some application data structures into xml and call it a standard)


I only tested (long ago already) with some firefox plugin (i don't have 
a recent epub device, only an old firts generation one which is dead 
slow, never relly used, probably broken by now) and i refuse to buy a 
new one till resolution is decent (and i only want generic devices, not 
something bound to some shop)



How can I help?


by testing

as i have no real use/demand for epub it's not something i look into on 
a daily basis


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@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
___


Re: [NTG-context] EPUB XHTML Format

2013-09-04 Thread Thangalin
Hi.

of course we could alternatively export all as div class=tag-subtag-...
 but i don't like that too much; html itself is not rich enough for our
 purpose


What about giving developers the ability to change the destination element?
For example:

\setuplist[chapter][
  xml={\starttag[h1]#1\stoptag}
]


Would produce, upon export:

h1Chapter/h1


Or (using export instead of xml; I don't care what it is named):

\setuplist[chapter][

export={\starttag[div]\startattribute[class]{chapter}#1\stopattribute\stoptag}}
]


Similarly, this would produce:

div class=chapterChapter/div


This would offer the flexibility of custom XML documents without affecting
the default behaviour.

  * Generates XHTML headers (including !DOCTYPE and html...)

 not needed as we're 'standalone'


Having the ability to produce the !DOCTYPE... and htmnl elements could
be as simple as:

\setupexport[
  standalone=no,
]



   * Produces images as img tags, rather than float tags.

 the css can deal with them (info is written to files for that)


Yes, but they aren't standard. There is an ecosystem of tools (e.g.,
Calibre, normalizing CSS templates, etc.), not to mention a widespread
knowledge-base, that groks the minimal XHTML specification. Plus, using XML
tags that are not in the minimal XHTML spec. means more testing on more
devices to make sure that their XHTML parsers render correctly.


 xhtml has no typical tags .. it's xml + css (or xslt) ... unfortunately
 browsers have


That is, a Strictly Conforming XHTML Document, as per:

http://www.w3.org/TR/2000/REC-xhtml1-2126/#docconf

the export of context is in fact just xml, and by tagging it as xhtml we
 can apply css to it; but if someone has a workflow for producing epub an
 option if to postprocess that xml file into whatever epub one wants


I could transform the ConTeXt-generated XML into strictly conforming XHTML,
but it was a step I was hoping to avoid. Right now my process is:

   1. Convert XML data to a ConTeXt .tex file.
   2. Convert ConTeXt to either PDF or EPUB.
   3. Stylize EPUB using CSS.

I want to use ConTeXt here (instead of going directly from XML data to
EPUB) because ConTeXt provides functionality such as multiple indexes,
table-of-contents, and bundling the .epub. Having an extra step to generate
strictly conforming XHTML is architecturally painful as it means
transforming the document three times (XML - ConTeXt, ConTeXt - XML, then
XML - XHTML).


 Everytime we look into epub there's another issue ... it's not a standard
 but reversed engineered application mess (happen soften with xml: turn some
 application data structures into xml and call it a standard)


Some book vendors only accept validating EPUBs. ConTeXt is documented as
being able to generate EPUBs. The documentation should state the EPUBs do
not validate and do not generate strictly conforming XHTML.

I have spent the last three weeks converting documents from LaTeX to
ConTeXt because the documentation stated that ConTeXt can produce EPUBs.
While true, the documentation did not mention its shortcomings. Had I known
in advance, I probably would have gone straight to EPUB using Java or, with
a little revulsion, PHP classes. ;-) That said, I probably should have
tested this feature sooner. :-)

as i have no real use/demand for epub it's not something i look into on a
 daily basis


How can I help resolve these issues?

Merely testing (which I am happy to do) isn't going to produce a strictly
conforming XHTML document.

Kindest regards.
___
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
___

[NTG-context] EPUB XHTML Format

2013-09-03 Thread Thangalin
Hi,

The attached t.tex file produces the attached t.xhtml file. I have looked
at the following documents:

   - http://en.wikipedia.org/wiki/EPUB#Open_Publication_Structure_2.0.1
   - http://en.wikipedia.org/wiki/DTBook
   - http://www.idpf.org/epub/20/spec/OPS_2.0.1_draft.htm
   - http://www.w3.org/TR/xhtml11/doctype.html
   - http://www.w3.org/TR/html5/sections.html

It seems that the macros in t.tex are being written out as XML elements,
verbatim. It is my understanding that these XML elements, however, do not
conform to the minimal content models associated with XHTML 1.1.

What needs to happen to take a minimal ConTeXt file (such as the attached)
to produce a minimum viable EPUB that:

   - Generates XHTML headers (including !DOCTYPE and html...)
   - Produces images as img tags, rather than float tags.
   - Uses typical XHTML tags for body elements (e.g., ol for ordered
   lists).

Ideally, I would like to do something such as:

   - context t.tex
   - mtxrun --script epub --make t.specification

to generate an EPUB that passes validation of
epubcheckhttp://code.google.com/p/epubcheck/wiki/Library,
with an output XHTML file that more closely matches the XHTML specification.

How can I help?

Kind regards.


t.tex
Description: TeX document


t.xhtml
Description: application/xhtml


epub-errors.log
Description: Binary data
___
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
___

Re: [NTG-context] Epub woes

2012-11-17 Thread Alan BRASLAU
On Sat, 17 Nov 2012 08:08:56 +0100
luigi scarso luigi.sca...@gmail.com wrote:

 ( IPDF is the output of the new iTEX from Knuth, see
 http://tug.org/TUGboat/tb31-2/tb98knut.pdf)

(The beginning sounds a bit like a description of ConTeXt!)

Earlier, I believe you shared the video with us!

Alan
___
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
___


Re: [NTG-context] Epub woes

2012-11-17 Thread Bill Meahan

On 11/17/2012 02:08 AM, luigi scarso wrote:

IDPF'reference
( IPDF is the output of the new iTEX from Knuth, see 
http://tug.org/TUGboat/tb31-2/tb98knut.pdf)







TYPO ALERT!  TYPO ALERT!  TYPO ALERT!


That should have been *IDPF* (International Digital Publishing Forum) 
which is the group that defines the epub standard.


Some day I'm goint to learn how to tpye.  ;)

--
Bill Meahan
Westland, Michigan USA

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


Re: [NTG-context] Epub woes

2012-11-17 Thread luigi scarso
On Sat, Nov 17, 2012 at 5:48 PM, Bill Meahan subscribed_li...@meahan.netwrote:

 On 11/17/2012 02:08 AM, luigi scarso wrote:

 IDPF'reference
 ( IPDF is the output of the new iTEX from Knuth, see
 http://tug.org/TUGboat/tb31-2/**tb98knut.pdfhttp://tug.org/TUGboat/tb31-2/tb98knut.pdf
 )





 TYPO ALERT!  TYPO ALERT!  TYPO ALERT!


 That should have been *IDPF* (International Digital Publishing Forum)
 which is the group that defines the epub standard.

 Some day I'm goint to learn how to tpye.  ;)

 :-)
Anyway thank for the link.
___
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
___

Re: [NTG-context] Epub woes

2012-11-16 Thread Keith J. Schultz
Hi All,

First off, I do not work with ConTexT, but with Lu(La)TeX.
I follow this list looking for pointers.

The way I understand how ConTexT produces output for
epubs is that it just creates HTML.

If ConTexT (or LuaTex) is to produce output for use in epubs
it should map the ConTexT structures to html and the epub format.

That is, it should produce separate files for each chapter.
Furthermore, it should be able to create files for the spine, ncx, css,
and cover page, etc automatically.  This with reduce the amount of 
postprocessing Considerable.

Furthermore, the method could be design to not only epub, but a 
mobi format.

I have just started out on my own ideas for a Lau(La)Tex way of using
it for the creation of ebooks and pdfs from the same source.

Just my two cents, worth. 

Sorry, if I am creating noise here.

regards
Keith.
___
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
___


Re: [NTG-context] Epub woes

2012-11-16 Thread Bill Meahan

On 11/15/2012 11:17 PM, Aditya Mahajan wrote:


Pandoc does generate ConTeXt output as well, which you can then 
process the usual way to generate pdf.


The advantage of pandoc is that **in addition** to latex/context 
output, you can generate docbook/epub/html/doc/troff/ and other output 
formats as well.


Aditya


I'm installing pandoc now. Looks pretty interesting. I suppose it's time 
I learned (extended) Markdown anyway. Thank goodness emacs has a mode 
for that. :)


Thanks for the info!

--
Bill Meahan
Westland, Michigan USA

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


Re: [NTG-context] Epub woes

2012-11-16 Thread Aditya Mahajan

On Fri, 16 Nov 2012, Bill Meahan wrote:


On 11/15/2012 11:17 PM, Aditya Mahajan wrote:


Pandoc does generate ConTeXt output as well, which you can then process the 
usual way to generate pdf.


The advantage of pandoc is that **in addition** to latex/context output, 
you can generate docbook/epub/html/doc/troff/ and other output formats as 
well.


Aditya


I'm installing pandoc now. Looks pretty interesting. I suppose it's time I 
learned (extended) Markdown anyway. Thank goodness emacs has a mode for 
that. :)


If you are using emacs, keep an eye for the org mode reader in pandoc.
https://github.com/jgm/pandoc/issues/476

Aditya
___
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
___


Re: [NTG-context] Epub woes

2012-11-16 Thread Zenlima

 Is there any reader able to read mathml ?

Try lucifox (is a part of lucifox addon for firefox)

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


Re: [NTG-context] Epub woes

2012-11-16 Thread Zenlima
 Try lucifox (is a part of lucifox addon for firefox)

arg.. to late.. try lucidor as a part of lucifox... :-D
___
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
___


Re: [NTG-context] Epub woes

2012-11-16 Thread Bill Meahan

On 11/16/2012 02:13 AM, luigi scarso wrote:


I just started working on the epub output of my lecture notes
again, since there were no readers able to output math until 2
weeks ago.

Is there any reader able to read mathml ?

--
luigi




If you use Google Chrome (Chromium), you can get Readium from the Google 
Web Store. It's the IPDF's reference implementation of the epub3 
standard including MathML


--
Bill Meahan
Westland, Michigan USA

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


Re: [NTG-context] Epub woes

2012-11-16 Thread luigi scarso
On Sat, Nov 17, 2012 at 12:41 AM, Bill Meahan
subscribed_li...@meahan.netwrote:

 On 11/16/2012 02:13 AM, luigi scarso wrote:


 I just started working on the epub output of my lecture notes
 again, since there were no readers able to output math until 2
 weeks ago.

 Is there any reader able to read mathml ?

 --
 luigi



 If you use Google Chrome (Chromium), you can get Readium from the Google
 Web Store. It's the IPDF's reference implementation of the epub3 standard
 including MathML

 IDPF'reference
( IPDF is the output of the new iTEX from Knuth, see
http://tug.org/TUGboat/tb31-2/tb98knut.pdf)
___
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
___

[NTG-context] Epub woes

2012-11-15 Thread Bill Meahan
I tried to generate an epub document using ConTeXt following the recipe 
on the wiki. Didn't work. So, I tried running the export-example.tex 
file that comes with the distribution, unmodified. Same bad results.


Cover is not generated
TOC is not generated (though it is noted this might be the state of 
the export)

Sectioning doesn't happen.
Paragraphing doesn't happen.
The resultant epub file cannot even be opened with FBReader.

Importing the epub into Sigil shows one big blob of text, with only the 
between word spacing that's present in the source file. The \quotation{} 
markup did get turned into quotation marks, chapter numbers were 
generated and the rest of the markup was stripped out.


Same behavior with both the TeXLive 2012 version of ConTeXt and a quite 
recent beta.


Up-to-date Ubuntu 12.04

Linux Escherton 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 
2012 i686 i686 i386 GNU/Linux


What am I doing wrong?

--
Bill Meahan
Westland, Michigan USA

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


Re: [NTG-context] Epub woes

2012-11-15 Thread Wolfgang Schuster

Am 15.11.2012 um 19:58 schrieb Bill Meahan subscribed_li...@meahan.net:

 I tried to generate an epub document using ConTeXt following the recipe on 
 the wiki. Didn't work. So, I tried running the export-example.tex file that 
 comes with the distribution, unmodified. Same bad results.
 
Cover is not generated
TOC is not generated (though it is noted this might be the state of the 
 export)
Sectioning doesn't happen.
Paragraphing doesn't happen.
The resultant epub file cannot even be opened with FBReader.
 
 Importing the epub into Sigil shows one big blob of text, with only the 
 between word spacing that's present in the source file. The \quotation{} 
 markup did get turned into quotation marks, chapter numbers were generated 
 and the rest of the markup was stripped out.
 
 Same behavior with both the TeXLive 2012 version of ConTeXt and a quite 
 recent beta.
 
 Up-to-date Ubuntu 12.04
 
 Linux Escherton 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012 
 i686 i686 i386 GNU/Linux
 
 What am I doing wrong?

You have to tag paragraphs with

\startparagraph
…
\stopparagraph

which are converted to p and /p otherwise you get br/ between paragraphs.

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
___


Re: [NTG-context] Epub woes

2012-11-15 Thread Bill Meahan

On 11/15/2012 02:24 PM, Wolfgang Schuster wrote:

You have to tag paragraphs with

\startparagraph
…
\stopparagraph

which are converted to p and /p otherwise you get br/ between paragraphs.

Wolfgang



Oh, my! I'll have to go back and change hundreds of paragraphs! :(

What about the chapter headings, mucked up metadata c? I am using 
\startchapter..\stopchapter already.


--
Bill Meahan
Westland, Michigan USA

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

Re: [NTG-context] Epub woes

2012-11-15 Thread Marcin Borkowski
Dnia 2012-11-15, o godz. 13:58:29
Bill Meahan subscribed_li...@meahan.net napisał(a):

 I tried to generate an epub document using ConTeXt following the
 recipe on the wiki. Didn't work. So, I tried running the
 export-example.tex file that comes with the distribution, unmodified.
 Same bad results.
 
  Cover is not generated
  TOC is not generated (though it is noted this might be the state
 of the export)
  Sectioning doesn't happen.
  Paragraphing doesn't happen.
  The resultant epub file cannot even be opened with FBReader.
 
 Importing the epub into Sigil shows one big blob of text, with only
 the between word spacing that's present in the source file. The
 \quotation{} markup did get turned into quotation marks, chapter
 numbers were generated and the rest of the markup was stripped out.
 
 Same behavior with both the TeXLive 2012 version of ConTeXt and a
 quite recent beta.
 
 Up-to-date Ubuntu 12.04
 
 Linux Escherton 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50
 UTC 2012 i686 i686 i386 GNU/Linux
 
 What am I doing wrong?
 

http://archive.contextgarden.net/message/20120809.130943.604f5b22.en.html

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University
___
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
___

Re: [NTG-context] Epub woes

2012-11-15 Thread Aditya Mahajan

On Thu, 15 Nov 2012, Bill Meahan wrote:

I tried to generate an epub document using ConTeXt following the recipe on 
the wiki. Didn't work. So, I tried running the export-example.tex file that 
comes with the distribution, unmodified. Same bad results.


   Cover is not generated
   TOC is not generated (though it is noted this might be the state of the 
export)

   Sectioning doesn't happen.
   Paragraphing doesn't happen.
   The resultant epub file cannot even be opened with FBReader.

Importing the epub into Sigil shows one big blob of text, with only the 
between word spacing that's present in the source file. The \quotation{} 
markup did get turned into quotation marks, chapter numbers were generated 
and the rest of the markup was stripped out.


Same behavior with both the TeXLive 2012 version of ConTeXt and a quite 
recent beta.


What am I doing wrong?


Have you considered using pandoc to generate epub?

If your text is relatively simple (no multiline math, no fancy image 
scaling, no complicated tables, etc.), then Markdown is a reasonable input 
format. You can use pandoc to translate the text to multiple output 
formats (including ConTeXt).


In general, I have found pandoc's XHTML export to be more predictable than 
that of ConTeXt. I have used pandoc's epub export only for short articles, 
but from what I remember, it does handle cover images and toc correctly.


Aditya
___
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
___


Re: [NTG-context] Epub woes

2012-11-15 Thread Bill Meahan

On 11/15/2012 07:13 PM, Aditya Mahajan wrote:


Have you considered using pandoc to generate epub?

If your text is relatively simple (no multiline math, no fancy image 
scaling, no complicated tables, etc.), then Markdown is a reasonable 
input format. You can use pandoc to translate the text to multiple 
output formats (including ConTeXt).


In general, I have found pandoc's XHTML export to be more predictable 
than that of ConTeXt. I have used pandoc's epub export only for short 
articles, but from what I remember, it does handle cover images and 
toc correctly.


Aditya
__

Nice idea Aditya but in this particular case it won't suffice.

I'm working on a rather long novel, not a technical document, and my 
/primary/ target electronic format is PDF. That PDF can be distributed 
electronically or submitted directly to a printer. In the current 
market, however, so many people want to read books on their smartphone, 
dedicated ebook reader or tablet an author really limits their market if 
they don't distribute an ebook version.


Of course, the two primary ebook formats (in terms of market) are epub 
and Kindle which is easy to generate from an epub. Sticking to ConTeXt 
allows me to generate PDF, Process PDF and epub from a single source. I 
can easily touch up the epub in Sigil if I need to.


For this kind of document, typography and excellent typesetting are 
extremely important (in the printed/PDF version, anyway). ConTeXt gives 
me that.


I'll keep pandoc in mind for some other documents, though. Thanks for 
the lead.


--
Bill Meahan
Westland, Michigan USA

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


Re: [NTG-context] Epub woes

2012-11-15 Thread Aditya Mahajan

On Thu, 15 Nov 2012, Bill Meahan wrote:


On 11/15/2012 07:13 PM, Aditya Mahajan wrote:


Have you considered using pandoc to generate epub?

If your text is relatively simple (no multiline math, no fancy image 
scaling, no complicated tables, etc.), then Markdown is a reasonable input 
format. You can use pandoc to translate the text to multiple output formats 
(including ConTeXt).


In general, I have found pandoc's XHTML export to be more predictable than 
that of ConTeXt. I have used pandoc's epub export only for short articles, 
but from what I remember, it does handle cover images and toc correctly.


Aditya
__

Nice idea Aditya but in this particular case it won't suffice.

I'm working on a rather long novel, not a technical document, and my 
/primary/ target electronic format is PDF. That PDF can be distributed 
electronically or submitted directly to a printer. In the current market, 
however, so many people want to read books on their smartphone, dedicated 
ebook reader or tablet an author really limits their market if they don't 
distribute an ebook version.


Of course, the two primary ebook formats (in terms of market) are epub and 
Kindle which is easy to generate from an epub. Sticking to ConTeXt allows me 
to generate PDF, Process PDF and epub from a single source. I can easily 
touch up the epub in Sigil if I need to.


For this kind of document, typography and excellent typesetting are 
extremely important (in the printed/PDF version, anyway). ConTeXt gives me 
that.


Pandoc does generate ConTeXt output as well, which you can then process 
the usual way to generate pdf.


The advantage of pandoc is that **in addition** to latex/context output, 
you can generate docbook/epub/html/doc/troff/ and other output formats as 
well.


Aditya
___
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
___


Re: [NTG-context] Epub woes

2012-11-15 Thread Andy Thomas
Please try the following example:

-- start code --

\setupbackend[export=yes,xhtml=test_00.xhtml]

\mainlanguage[de]
\language[de]

\setupexport
   [title={A nice book},
author={Andy Tom},
firstpage={huhn.jpg},
   ]



\starttext
Hello world!
\stoptext


-- end code --

The firstpage export value (huhn.jpg) is your cover image. Please put huhn.jpg 
or something else in the same directory as your tex file. I named the tex=file 
test_00.tex in my case.

After compiling with the latest context, you can run 'mtxrun --script epub 
--make test_00.specification' to generate the epub file.

Please note two more things: 
(1) The mtx-epub script was broken a couple of days ago. Well not actually 
broken, but somehow an old version sneaked in. If the author names and such do 
not get exported into the epub, this might as well be the case for you. The 
latest one (ver: 2012.11.14 11:37 MKIV  fmt: 2012.11.16) works fine again. 
(2) Calibre and other readers as well as e.g. the ipad have some nasty caching 
feature. In case you change little things and try to reload the same book in 
your reader, it might still show the old one from the cache. I found, that 
deleting the 'old' book first works most of the times.

I just started working on the epub output of my lecture notes again, since 
there were no readers able to output math until 2 weeks ago.

If I find some time later, I will update the epub page in the wiki.

I hope that helps.
 
Andy

On Nov 15, 2012, at 7:58 PM, Bill Meahan wrote:

 I tried to generate an epub document using ConTeXt following the recipe on 
 the wiki. Didn't work. So, I tried running the export-example.tex file that 
 comes with the distribution, unmodified. Same bad results.
 
Cover is not generated
TOC is not generated (though it is noted this might be the state of the 
 export)
Sectioning doesn't happen.
Paragraphing doesn't happen.
The resultant epub file cannot even be opened with FBReader.
 
 Importing the epub into Sigil shows one big blob of text, with only the 
 between word spacing that's present in the source file. The \quotation{} 
 markup did get turned into quotation marks, chapter numbers were generated 
 and the rest of the markup was stripped out.
 
 Same behavior with both the TeXLive 2012 version of ConTeXt and a quite 
 recent beta.
 
 Up-to-date Ubuntu 12.04
 
 Linux Escherton 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012 
 i686 i686 i386 GNU/Linux
 
 What am I doing wrong?
 
 -- 
 Bill Meahan
 Westland, Michigan USA
 
 ___
 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
 ___

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


Re: [NTG-context] Epub woes

2012-11-15 Thread luigi scarso
On Fri, Nov 16, 2012 at 7:49 AM, Andy Thomas andytho...@web.de wrote:




 I just started working on the epub output of my lecture notes again, since
 there were no readers able to output math until 2 weeks ago.

Is there any reader able to read mathml ?

-- 
luigi
___
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
___

Re: [NTG-context] Epub woes

2012-11-15 Thread Andy Thomas
Supposedly. I did not try it yet.

http://support.apple.com/kb/HT5321

Andy

On Nov 16, 2012, at 8:13 AM, luigi scarso wrote:

 
 
 
 On Fri, Nov 16, 2012 at 7:49 AM, Andy Thomas andytho...@web.de wrote:
 
 
 
 I just started working on the epub output of my lecture notes again, since 
 there were no readers able to output math until 2 weeks ago.
 Is there any reader able to read mathml ?
 
 -- 
 luigi
 
 ___
 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
 ___

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


  1   2   >