Re: [NTG-context] Quick question about dual output pdf and epub

2020-03-04 Thread Henning Hraban Ramm
Am 2020-03-04 um 08:49 schrieb Jan U. Hasecke :
> Am 03.03.20 um 22:04 schrieb Rik Kabel:
>> Instructions for creating the .epub from the export are contained in the
>> log file.
> Has anyone ever got an epub that validates?

Only with a lot of manual corrections.

I use the "raw" XML export, a bunch of XSL templates and a shell script, but 
still need to put stuff in place manually (i.e. everything that’s just visually 
formatted like the inner title and imprint).

I’m working on enhancing my workflow to at least succeed with epubcheck. I’ll 
probably need more than XSLT to e.g. check for image files (since I don’t use 
the file extension in ConTeXt, the XML processor can’t know if it’s a JPEG, PNG 
or PDF) etc. Maybe use Python instead of Shell + XSLT.

Our eBook distributor (BookWire) has even higher demands or checks better than 
the official epubcheck. (There are even example files in the consortiums’s 
GitHub that don’t validate.)


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Quick question about dual output pdf and epub

2020-03-04 Thread Hans Hagen

On 3/4/2020 10:31 AM, luigi scarso wrote:



On Wed, Mar 4, 2020 at 9:51 AM Hans Hagen > wrote:



(in the meantime i actually gave away my ebook reader ... now i wait
till color shows up in e-ink which might give me a reason to play a bit
more)

https://news.lenovo.com/pressroom/press-releases/lenovo-unveils-preview-worlds-first-foldable-pc-thinkpad-x1-family/

sound quite interesting 
yes, but i wonder how the spine will hold (samsung already found out the 
hard way) .. ok, if we see it as a spine we can live with a middle area 
that degrades over time i guess (but it will not last for decades, like 
books do)


(Unfortunately these gadgets are too expensive to experiment and play 
around with.)


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] Quick question about dual output pdf and epub

2020-03-04 Thread luigi scarso
On Wed, Mar 4, 2020 at 9:51 AM Hans Hagen  wrote:

>
> (in the meantime i actually gave away my ebook reader ... now i wait
> till color shows up in e-ink which might give me a reason to play a bit
> more)
>
>
https://news.lenovo.com/pressroom/press-releases/lenovo-unveils-preview-worlds-first-foldable-pc-thinkpad-x1-family/

>
sound quite interesting 

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


Re: [NTG-context] Quick question about dual output pdf and epub

2020-03-04 Thread Hans Hagen

On 3/4/2020 8:49 AM, Jan U. Hasecke wrote:

Am 03.03.20 um 22:04 schrieb Rik Kabel:

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


Has anyone ever got an epub that validates?
last time i looked into it i found that there was no real consustency in 
checking (apart from device specific issues) so i gave up on that


anyway, an export is not per se an epub .. one might for instance add 
additional css


(in the meantime i actually gave away my ebook reader ... now i wait 
till color shows up in e-ink which might give me a reason to play a bit 
more)


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] Quick question about dual output pdf and epub

2020-03-03 Thread Jan U. Hasecke
Am 03.03.20 um 22:04 schrieb Rik Kabel:
> Instructions for creating the .epub from the export are contained in the
> log file.

Has anyone ever got an epub that validates?

juh
___
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] Quick question about dual output pdf and epub

2020-03-03 Thread Rik Kabel
Instructions for creating the .epub from the export are contained in the 
log file.


On 3/3/2020 15:58, Hans van der Meer wrote:

I followed your advice and added the setup:


You need
  \setupbackend[export=yes]
in your document.

This, however, does not result in an .epub file but an export directory 
containing an html and xhtml file (only partially conformant to the equivalent 
pdf).

Can I get the output as an .epub file? Some more changes needed?


On Tue, 3 Mar 2020 19:37:47 +0100
Hans van der Meer  wrote:


and then run with --mode=epub

I am running with:
mtxrun --autogenerate --mode=epub --script context "$1"
but no epub document is generated, just the same result.pdf I get without that 
mode.

You need

  \setupbackend[export=yes]

in your document. When you put the setup above in a "epub"
mode you create a epub-document only when you enable the mode
which is recommended because it can have side effects for
the normal PDF.

To avoid these side effects make an extra ConTeXt run
by enabling the mode to get the epub 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
___

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

___
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] Quick question about dual output pdf and epub

2020-03-03 Thread Wolfgang Schuster
On Tue, 3 Mar 2020 21:58:16 +0100
Hans van der Meer  wrote:

> I followed your advice and added the setup:
> 
> > You need
> >  \setupbackend[export=yes]
> > in your document. 
> 
> This, however, does not result in an .epub file but an export directory 
> containing an html and xhtml file (only partially conformant to the 
> equivalent pdf).
> 
> Can I get the output as an .epub file? Some more changes needed?

Your log file should have a line like this when you put the \setupbackend 
setting in your document:

backend > export > create epub with: mtxrun --script epub --make "test" 
[--purge --rename --svgmath]

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
___


Re: [NTG-context] Quick question about dual output pdf and epub

2020-03-03 Thread Hans van der Meer
I followed your advice and added the setup:

> You need
>  \setupbackend[export=yes]
> in your document. 

This, however, does not result in an .epub file but an export directory 
containing an html and xhtml file (only partially conformant to the equivalent 
pdf).

Can I get the output as an .epub file? Some more changes needed?

> 
> On Tue, 3 Mar 2020 19:37:47 +0100
> Hans van der Meer  wrote:
> 
>>> 
>>> and then run with --mode=epub
>> 
>> I am running with:
>>mtxrun --autogenerate --mode=epub --script context "$1"
>> but no epub document is generated, just the same result.pdf I get without 
>> that mode.
> 
> You need
> 
>  \setupbackend[export=yes]
> 
> in your document. When you put the setup above in a "epub"
> mode you create a epub-document only when you enable the mode
> which is recommended because it can have side effects for
> the normal PDF.
> 
> To avoid these side effects make an extra ConTeXt run
> by enabling the mode to get the epub 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
> ___

___
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] Quick question about dual output pdf and epub

2020-03-03 Thread Wolfgang Schuster
On Tue, 3 Mar 2020 19:37:47 +0100
Hans van der Meer  wrote:

> > 
> > and then run with --mode=epub
> 
> I am running with:
> mtxrun --autogenerate --mode=epub --script context "$1"
> but no epub document is generated, just the same result.pdf I get without 
> that mode.

You need

  \setupbackend[export=yes]

in your document. When you put the setup above in a "epub"
mode you create a epub-document only when you enable the mode
which is recommended because it can have side effects for
the normal PDF.

To avoid these side effects make an extra ConTeXt run
by enabling the mode to get the epub 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
___


Re: [NTG-context] Quick question about dual output pdf and epub

2020-03-03 Thread Hans van der Meer
> 
> and then run with --mode=epub

I am running with:
mtxrun --autogenerate --mode=epub --script context "$1"
but no epub document is generated, just the same result.pdf I get without that 
mode.

In .bashrc using:
# The current version of the ConTeXt luametatex in use:
CONTEXTLMTX=$HOME/TeX/context-lmtx ; export CONTEXTLMTX
CONTEXTCURRENT=$CONTEXTLMTX ; export CONTEXTCURRENT
MYTEXMFHOME=$HOME/TeX/texmf ; export MYTEXMFHOME
TEXMF=$MYTEXMFHOME:$CONTEXTCURRENT/tex ; export TEXMF
PATH=$CONTEXTCURRENT/tex/texmf-osx-64/bin:$PATH ; export PATH

Log shows: ConTeXt  ver: 2019.10.02 12:53 MKIV beta  fmt: 2019.10.2

I am doing something wrong here?

dr. Hans van der Meer


> On 28 Feb 2020, at 12:07, Hans Hagen  wrote:
> 
> On 2/28/2020 11:48 AM, Christoph Hintermüller wrote:
>> Hi
>> Hust not to miss something or mess up every thing.
>> Can i setup my document preamble such that i can without any switching
>> create pdf and epub output at the same time.
>> Want to provide my lecture notes in pdf and epub format.
>> In other words does it have any side effects on pdf output, if i put
>> \setuptoutput command preparing document for xhtml/epub output in my
>> document preamble/main document?
>> Or would i have to enclose this in some \ifelse conditional block? If
>> is there a possibility to control condition from mtxrun command line?
> Currently it is created at the same time but it runs slower. Indeed using 
> some mode makes sense because you might also want to have a different layout 
> (the simpler, the less possible side effects, actually when doing epub or 
> export using some very large page also makes sense as then there can be less 
> interference of page breaks and so).
> 
> \startmode [epub]
>  
> \stopmode
> 
> and then run with --mode=epub
> 
> 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
> ___

___
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] Quick question about dual output pdf and epub

2020-03-01 Thread Christoph Hintermüller
Hi Hans
[Inline Response to message by Hans Hagen, Fr, 2020-02-28 22:39 +0100:
Answers and comments below corresponding cited paragraphs.]

> It depends a bit. One can for instance make the mp images
> independent 
> (include mp code from a file) and then also make small independent
> pdf 
> files from them that then can be converted to svg using mutool /
> mudraw. 

What is i already do as MP images are created from Inkscape SVG images
by exporting them to EPS. which are further converted to MP using
pstoedit with some minor sed based postprocessing (removing defaultfont
instruction, modifying showtext macro to daw textetx). 

This works pleasingly well. I find it quite annoying if ebooks try to
enforce a specific branded font and font size, disallowing handicapped
readers for example to use the Dyslexic font or alike, set a wider
spacing of glyphs or use big fontsizes for better reading experience.
Thus i would be ok directly using the Inkscape SVG images or a
canonicalized version thereof unsing different font than set for the
rest of the document.
Thus as a first solution it would be ok for me switching between MP and
SVG image using  \startmode \stopmode.

> You can try that concept with
> 
> \startMPpage
> some mp code
> \stopMPage
> 
> If we're only talking of 'kind of stand alone images' (not
> backgrounds 
> behind texts and other ornamental mp images) I can think about some 
> mechanism that does that automatic. In the end much is possible
> (given 
> time and reason) and often not even that hard to do.
> 

Hm as said above I already take the opposit route to obtain MP images
cause of using same fonts on images as in the rest of the document
through  texttext macro. Thus it is rather strange to than backconvert
the MP image again into an SVG. The resulting SVG has the same fonts as
as i set for the pdfdocument but when users switch fonts on their reader or 
fontsize the fonts in the images will not change too so, having matching fonts 
as of now is of not much use. And it is questionable whether it ever will be 
unless minimum image size would automatically scaleup with fontsize and spacing 
too. And than it would require to strip the texts from the original SVG and 
overtype them using context/tex commands only. The latter would call for a 
context specific Exportmodule for Inkscape and others which would have to be 
coded first.

Best
Xristoph



___
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] Quick question about dual output pdf and epub

2020-02-28 Thread Hans Hagen

On 2/28/2020 2:52 PM, Christoph Hintermüller wrote:


Second am i right that i have to use also startmode and stopmode to
include svg image instead of metapost image in epub or is there some
other trick to make metapost image in epub. What would be the keywords
to use on wiki search.

Or are the two questions currently beyond possibilities of epub
support?
It depends a bit. One can for instance make the mp images independent 
(include mp code from a file) and then also make small independent pdf 
files from them that then can be converted to svg using mutool / mudraw. 
You can try that concept with


\startMPpage
   some mp code
\stopMPage

If we're only talking of 'kind of stand alone images' (not backgrounds 
behind texts and other ornamental mp images) I can think about some 
mechanism that does that automatic. In the end much is possible (given 
time and reason) and often not even that hard to do.


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] Quick question about dual output pdf and epub

2020-02-28 Thread Henning Hraban Ramm


> Am 2020-02-28 um 12:07 schrieb Hans Hagen :
> 
> On 2/28/2020 11:48 AM, Christoph Hintermüller wrote:
>> Hi
>> Hust not to miss something or mess up every thing.
>> Can i setup my document preamble such that i can without any switching
>> create pdf and epub output at the same time.
>> Want to provide my lecture notes in pdf and epub format.
>> In other words does it have any side effects on pdf output, if i put
>> \setuptoutput command preparing document for xhtml/epub output in my
>> document preamble/main document?

Yes, it has (or at least used to have) side effects if you enable XML output – 
hyphenation and line breaking is affected.


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

___
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] Quick question about dual output pdf and epub

2020-02-28 Thread Hans Hagen

On 2/28/2020 11:48 AM, Christoph Hintermüller wrote:

Hi
Hust not to miss something or mess up every thing.
Can i setup my document preamble such that i can without any switching
create pdf and epub output at the same time.

Want to provide my lecture notes in pdf and epub format.

In other words does it have any side effects on pdf output, if i put
\setuptoutput command preparing document for xhtml/epub output in my
document preamble/main document?

Or would i have to enclose this in some \ifelse conditional block? If
is there a possibility to control condition from mtxrun command line?

Best
Xristoph


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




--

-
  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] Quick question about dual output pdf and epub

2020-02-28 Thread Hans Hagen

On 2/28/2020 11:48 AM, Christoph Hintermüller wrote:

Hi
Hust not to miss something or mess up every thing.
Can i setup my document preamble such that i can without any switching
create pdf and epub output at the same time.

Want to provide my lecture notes in pdf and epub format.

In other words does it have any side effects on pdf output, if i put
\setuptoutput command preparing document for xhtml/epub output in my
document preamble/main document?

Or would i have to enclose this in some \ifelse conditional block? If
is there a possibility to control condition from mtxrun command line?
Currently it is created at the same time but it runs slower. Indeed 
using some mode makes sense because you might also want to have a 
different layout (the simpler, the less possible side effects, actually 
when doing epub or export using some very large page also makes sense as 
then there can be less interference of page breaks and so).


\startmode [epub]
  
\stopmode

and then run with --mode=epub

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] Quick question about dual output pdf and epub

2020-02-28 Thread Christoph Hintermüller
Hi 
Hust not to miss something or mess up every thing.
Can i setup my document preamble such that i can without any switching
create pdf and epub output at the same time.

Want to provide my lecture notes in pdf and epub format.

In other words does it have any side effects on pdf output, if i put
\setuptoutput command preparing document for xhtml/epub output in my
document preamble/main document?

Or would i have to enclose this in some \ifelse conditional block? If
is there a possibility to control condition from mtxrun command line?

Best 
Xristoph


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