Quick question about dual output pdf and epub
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
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
On 2/28/2020 11:48 AM, Christoph Hintermüller wrote: 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 -----------------------------------------------------------------
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
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 ___________________________________________________________________________________
On Tue, 3 Mar 2020 19:37:47 +0100
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.
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
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 ___________________________________________________________________________________
On Tue, 3 Mar 2020 21:58:16 +0100
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?
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
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 ___________________________________________________________________________________
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 -----------------------------------------------------------------
On Wed, Mar 4, 2020 at 9:51 AM Hans Hagen
(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-worl...
sound quite interesting .... -- luigi
On 3/4/2020 10:31 AM, luigi scarso wrote:
On Wed, Mar 4, 2020 at 9:51 AM Hans Hagen
mailto:j.hagen@xs4all.nl> 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-worl...
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 -----------------------------------------------------------------
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
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. dr. Hans van der Meer
Hans van der Meer schrieb am 04.03.2020 um 13:23:
On 3 Mar 2020, at 22:04, Rik Kabel
mailto:context@rik.users.panix.com> 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
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 -----------------------------------------------------------------
participants (8)
-
Christoph Hintermüller
-
Hans Hagen
-
Hans van der Meer
-
Henning Hraban Ramm
-
Jan U. Hasecke
-
luigi scarso
-
Rik Kabel
-
Wolfgang Schuster