Re: [NTG-context] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Wolfgang Schuster

Am 04.07.2014 um 00:51 schrieb Hans Hagen :

> On 7/4/2014 12:37 AM, Sanjoy Mahajan wrote:
>>> context --make does a --generate so you can skip that and the luatools
>>> run is not needed either (selfupdate is seldom needed too)
>> 
>> So 'context --make' is all one needs?  I'll update the wiki.
>> 
>>> we get a .5pt height difference somewhere (nothing else different in a
>>> trace) ... smells like a luatex bug (testing that now)
>> 
>> That is my suspicion as well.  But I couldn't reproduce it with plain
>> luatex.  Though maybe I needed to use equation numbers, however that is
>> done in plain tex (the context run doesn't show the problem without the
>> \placeformula).
>> 
>> I suspect some internal state is getting slightly corrupted and getting
>> progressively worse with the 30,000 repetitions.
> 
> here it happens after a pagebreak (a few lines overflow are ok)


It does also depend on the width of the text because when I use 48pt in the 
example below
the height of the brace is always the same but with 49pt the height increases 
after the first page.

\starttext

\dorecurse{100}
  {\startformula
   \mathord
 
{%\setbox\scratchbox\mathstylehbox{\Umathaccent\fam\zerocount"FE3DF{\hskip48pt}}%
  
\setbox\scratchbox\mathstylehbox{\Umathaccent\fam\zerocount"FE3DF{\hskip49pt}}%
  \the\userpageno:\the\ht\scratchbox}%
   \stopformula}

\stoptext

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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Hans Hagen

On 7/4/2014 12:37 AM, Sanjoy Mahajan wrote:

context --make does a --generate so you can skip that and the luatools
run is not needed either (selfupdate is seldom needed too)


So 'context --make' is all one needs?  I'll update the wiki.


we get a .5pt height difference somewhere (nothing else different in a
trace) ... smells like a luatex bug (testing that now)


That is my suspicion as well.  But I couldn't reproduce it with plain
luatex.  Though maybe I needed to use equation numbers, however that is
done in plain tex (the context run doesn't show the problem without the
\placeformula).

I suspect some internal state is getting slightly corrupted and getting
progressively worse with the 30,000 repetitions.


here it happens after a pagebreak (a few lines overflow are ok)


I've been finding many unexplained 0.5pt or so differences, which may be
related to the underbrace problem.  The context, so to speak, is that I
am putting in the last edits to the book, after having gone through and
checked every page many times.  So I want to ensure that none of the
small changes has a big effect, but I don't want to check every page
again (or I'll vomit).

Thus, I run my compare-pdfs.sh script on the previous and the latest
pdf. It renders each page to a B/W png (using mupdf) and then compares
corresponding pages using 'compare' (one of the ImageMagick tools).  Any
differing pixels are in red, and the shared pixels are in very light
gray.  Then all the pages with enough differences are viewed with 'feh',
in order of most-to-least differences.  And I check that nothing major
has changed.

What I keep finding is that pages long after where I make a small change
somehow get changed, with roughly one-pixel shifts to parts of the page.
I'm attaching an example pixel diff.  It shows changes on p.72 of the
mss.  However, the only change to the source code was on p.58 (and was
designed not to change any page breaks, which it didn't).  That same
page (p.72) often gets similar changes with all kinds of small changes.

[Note to me: In case I need to recreate the source for debugging
purposes, it's the change from rev 41ff54 to 2467d5]

In case the script is useful to others (earlier versions are in the
contexttest repository somewhere), I am attaching it.  I use it as
follows with a bash command line.  (The awk in the pipeline makes sure
that only pages with some difference make it to the viewer.)

DPI=72 compare-pdfs.sh old.pdf new.pdf | tee book-print.compare72dpi | awk '{if 
(($3 > 0.02)) print;}' | sort -nr -k3 | awk '{print $1}' | xargs -r feh

-Sanjoy




--

-
  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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread luigi scarso
On Fri, Jul 4, 2014 at 12:37 AM, Sanjoy Mahajan  wrote:

> > context --make does a --generate so you can skip that and the luatools
> > run is not needed either (selfupdate is seldom needed too)
>
> So 'context --make' is all one needs?  I'll update the wiki.
>
> > we get a .5pt height difference somewhere (nothing else different in a
> > trace) ... smells like a luatex bug (testing that now)
>
> That is my suspicion as well.  But I couldn't reproduce it with plain
> luatex.  Though maybe I needed to use equation numbers, however that is
> done in plain tex (the context run doesn't show the problem without the
> \placeformula).
>
> I suspect some internal state is getting slightly corrupted and getting
> progressively worse with the 30,000 repetitions.
>
> I've been finding many unexplained 0.5pt or so differences, which may be
> related to the underbrace problem.  The context, so to speak, is that I
> am putting in the last edits to the book, after having gone through and
> checked every page many times.  So I want to ensure that none of the
> small changes has a big effect, but I don't want to check every page
> again (or I'll vomit).
>
> Thus, I run my compare-pdfs.sh script on the previous and the latest
> pdf. It renders each page to a B/W png (using mupdf) and then compares
> corresponding pages using 'compare' (one of the ImageMagick tools).  Any
> differing pixels are in red, and the shared pixels are in very light
> gray.  Then all the pages with enough differences are viewed with 'feh',
> in order of most-to-least differences.  And I check that nothing major
> has changed.
>
> What I keep finding is that pages long after where I make a small change
> somehow get changed, with roughly one-pixel shifts to parts of the page.
> I'm attaching an example pixel diff.  It shows changes on p.72 of the
> mss.  However, the only change to the source code was on p.58 (and was
> designed not to change any page breaks, which it didn't).  That same
> page (p.72) often gets similar changes with all kinds of small changes.
>
> [Note to me: In case I need to recreate the source for debugging
> purposes, it's the change from rev 41ff54 to 2467d5]
>
> In case the script is useful to others (earlier versions are in the
> contexttest repository somewhere), I am attaching it.  I use it as
> follows with a bash command line.  (The awk in the pipeline makes sure
> that only pages with some difference make it to the viewer.)
>
> DPI=72 compare-pdfs.sh old.pdf new.pdf | tee book-print.compare72dpi | awk
> '{if (($3 > 0.02)) print;}' | sort -nr -k3 | awk '{print $1}' | xargs -r feh
>
> Thank you for the script.
Under linux you can also try diffpdf
$> aptitude search diffpdf
i   diffpdf
- compare two PDF
files textually or visually

p   diffpdf:i386
 - compare two PDF
files textually or visually


-- 
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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
> context --make does a --generate so you can skip that and the luatools 
> run is not needed either (selfupdate is seldom needed too)

So 'context --make' is all one needs?  I'll update the wiki.

> we get a .5pt height difference somewhere (nothing else different in a 
> trace) ... smells like a luatex bug (testing that now)

That is my suspicion as well.  But I couldn't reproduce it with plain
luatex.  Though maybe I needed to use equation numbers, however that is
done in plain tex (the context run doesn't show the problem without the
\placeformula).

I suspect some internal state is getting slightly corrupted and getting
progressively worse with the 30,000 repetitions.

I've been finding many unexplained 0.5pt or so differences, which may be
related to the underbrace problem.  The context, so to speak, is that I
am putting in the last edits to the book, after having gone through and
checked every page many times.  So I want to ensure that none of the
small changes has a big effect, but I don't want to check every page
again (or I'll vomit).

Thus, I run my compare-pdfs.sh script on the previous and the latest
pdf. It renders each page to a B/W png (using mupdf) and then compares
corresponding pages using 'compare' (one of the ImageMagick tools).  Any
differing pixels are in red, and the shared pixels are in very light
gray.  Then all the pages with enough differences are viewed with 'feh',
in order of most-to-least differences.  And I check that nothing major
has changed.

What I keep finding is that pages long after where I make a small change
somehow get changed, with roughly one-pixel shifts to parts of the page.
I'm attaching an example pixel diff.  It shows changes on p.72 of the
mss.  However, the only change to the source code was on p.58 (and was
designed not to change any page breaks, which it didn't).  That same
page (p.72) often gets similar changes with all kinds of small changes.

[Note to me: In case I need to recreate the source for debugging
purposes, it's the change from rev 41ff54 to 2467d5]

In case the script is useful to others (earlier versions are in the
contexttest repository somewhere), I am attaching it.  I use it as
follows with a bash command line.  (The awk in the pipeline makes sure
that only pages with some difference make it to the viewer.)

DPI=72 compare-pdfs.sh old.pdf new.pdf | tee book-print.compare72dpi | awk '{if 
(($3 > 0.02)) print;}' | sort -nr -k3 | awk '{print $1}' | xargs -r feh

-Sanjoy

#! /bin/bash

# Usage: $0 file1.pdf file2.pdf
#
#   compares file1.pdf and file2.pdf by rendering each page and using
#   the 'compare' ImageMagick utility
#
# Copyright 2007-2014 Sanjoy Mahajan.  Licensed under the GNU GPL version 3
# or (at your option) any later version.
#
# HISTORY
#   2014-06-22: Use mudraw instead of pdftoppm.  GPL v3+
#   2009-09-30: Fix capture of dB output; don't use a viewer; use pdftoppm
#   2007-01-15: First version
#

if [ -z "$DPI" ]; then
DPI=72
fi
ext=png

if [ -z "$1" -o -z "$2" ]; then
  echo "Usage: $0 file1.pdf file2.pdf"
  exit 3
fi

# generate the many page images in a temporary directory
d=`mktemp -d`
mkdir -p $d/a $d/b
mudraw -r $DPI -g -o $d/a/%03d.$ext $1
mudraw -r $DPI -g -o $d/b/%03d.$ext $2
wait

# find the union of the page numbers (in case one pdf has more pages)
pages=`ls $d/{a,b}/*.$ext | sed "s%.*/\([0-9][0-9]*\).$ext%\1%" | sort -un`
# compare each page
for p in $pages ; do
  if ! [ -e "$d/a/$p.$ext" ] ; then
echo "$p: missing from $1"
continue
  fi
  if ! [ -e "$d/b/$p.$ext" ] ; then
echo "$p: missing from $2"
continue
  fi
  echo -n "$d/diff-$p.$ext $p "
  compare -metric mae $d/{a,b}/$p.$ext $d/diff-$p.$ext 2>&1
done
___
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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Hans Hagen

On 7/3/2014 11:03 PM, Sanjoy Mahajan wrote:

math-stc.mkvi:

\unexpanded\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#text%
   ...
- \ifx\currentmathtext\empty
+ \ifx\m_math_stackers_text_middle\empty
 \setbox\scratchboxthree\emptyhbox
   \else


Thanks for looking into this, Wolfgang.

I made this change to math-stc.mkvi in the 2014.05.17 beta, then remade
the MkIV format with

   mtxrun --selfupdate
   mtxrun --generate
   luatools --generate
   context --make


context --make does a --generate so you can skip that and the luatools 
run is not needed either (selfupdate is seldom needed too)



Then I ran context on my test file (with 3 as the \dorecurse count).

However, the offset underbraces remain.  I'm attaching a image from
p. 2128, by which point the offset is 20 or 30pt.  I am fairly sure I am
running the newly created version, because remaking the format included
these lines:

   open source > 1 > 256 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi
   loading > ConTeXt Math Macros / Stackers
   close source> 1 > 256 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi

and the log output from running the minimal.tex shows that the the fmt
is indeed dated 2014.7.3:

   mtx-context | run 1: luatex 
--fmt="/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
 --jobname="minimal" 
--lua="/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
 --no-parse-first-line --c:currentrun=1 --c:fulljobname="./minimal.tex" --c:input="./minimal.tex" --c:kindofrun=1 
--c:maxnofruns=8 "cont-yes.mkiv"
   This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972)
\write18 enabled.
   open source > 1 > 1 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/cont-yes.mkiv

   ConTeXt  ver: 2014.05.17 23:46 MKIV beta  fmt: 2014.7.3  int: english/english


we get a .5pt height difference somewhere (nothing else different in a 
trace) ... smells like a luatex bug (testing that now)


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] Problem with module lettrine

2014-07-03 Thread MANUEL GONZALEZ SUAREZ
Thanks, Hans and Akira. 
With the command \ placeinitial  it works fine, but with the module lettrine I 
can not to do it. 
Thanks again and goodbye.

De: ntg-context-boun...@ntg.nl  en nombre de Akira 
Kakuto 
Enviado: jueves, 03 de julio de 2014 12:03
Para: ntg-context@ntg.nl
Asunto: [NTG-context]  Problem with module lettrine

> I send a minimal example to know why it looks bad the initial letter using
> the module lettrine . I am using TeXLive 2013 under Windows XP.

mtx-context | current version: 2014.06.27 10:53

gives an attached one on windows.

Best,
Akira
___
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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
> math-stc.mkvi:
>
> \unexpanded\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#text%
>   ...
> - \ifx\currentmathtext\empty
> + \ifx\m_math_stackers_text_middle\empty
> \setbox\scratchboxthree\emptyhbox
>   \else

Thanks for looking into this, Wolfgang.

I made this change to math-stc.mkvi in the 2014.05.17 beta, then remade
the MkIV format with

  mtxrun --selfupdate
  mtxrun --generate
  luatools --generate
  context --make

Then I ran context on my test file (with 3 as the \dorecurse count).

However, the offset underbraces remain.  I'm attaching a image from
p. 2128, by which point the offset is 20 or 30pt.  I am fairly sure I am
running the newly created version, because remaking the format included
these lines:

  open source > 1 > 256 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi
  loading > ConTeXt Math Macros / Stackers
  close source> 1 > 256 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/math-stc.mkvi

and the log output from running the minimal.tex shows that the the fmt
is indeed dated 2014.7.3:

  mtx-context | run 1: luatex 
--fmt="/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
 --jobname="minimal" 
--lua="/home/sanjoy/context/2014.05.17-beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
 --no-parse-first-line --c:currentrun=1 --c:fulljobname="./minimal.tex" 
--c:input="./minimal.tex" --c:kindofrun=1 --c:maxnofruns=8 "cont-yes.mkiv"
  This is LuaTeX, Version beta-0.79.1 (TeX Live 2014/dev) (rev 4972) 
   \write18 enabled.
  open source > 1 > 1 > 
/home/sanjoy/context/2014.05.17-beta/tex/texmf-context/tex/context/base/cont-yes.mkiv

  ConTeXt  ver: 2014.05.17 23:46 MKIV beta  fmt: 2014.7.3  int: english/english


-Sanjoy

___
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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Wolfgang Schuster

Am 03.07.2014 um 12:49 schrieb Sanjoy Mahajan :

> I thought the problem might lie with the general
> \definemathunderextensible (math-stc.mkvi), because underbrace is
> defined as
> 
> \definemathunderextensible  [vfenced] [underbrace]["FE3DF]  % 
> ["023DF]
> 
> Other underextensibles include \underbar:
> 
> \definemathunderextensible  [vfenced] [underbar]  ["FE33F]
> % ["203E]
> 
> So I tried my example replacing \underbrace with \underbar but the
> alignment comes out fine (and \overbrace works fine too).  So that
> debugging idea didn't work, except to indicate that something special
> about underbrace isn't working right.
> 
> Does anyone have suggestions for further debugging ideas?

math-stc.mkvi:

\unexpanded\def\math_stackers_make_double#top#bottom#category#codepoint#codeextra#text%
  {\begingroup
   \edef\currentmathstackers{#category}%
   \mathstackersparameter\c!left\relax
   \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
 {\edef\currentmathstackers{#category}%
  \edef\m_math_stackers_text_middle {#text}%
  %
  ...
  %
- \ifx\currentmathtext\empty
+ \ifx\m_math_stackers_text_middle\empty
\setbox\scratchboxthree\emptyhbox
  \else
\setmathtextbox\scratchboxthree\hbox{\math_stackers_middletext}%
  \fi
  ...
  \fi}%
  \mathstackersparameter\c!right\relax
  \edef\p_limits{\mathstackersparameter\c!mathlimits}%
  \ifx\p_limits\v!yes
\expandafter\endgroup\expandafter\limits
  \else
\expandafter\endgroup
  \fi}

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] ConTeXt epub workflow

2014-07-03 Thread Jan Tosovsky
On 2014-07-02 Idris Samawi Hamid ادريس   سماوي حامد wrote:
> 
> I have an urgent project that needs three outputs: pdf, epub, and
> kindle. The formatting needs are pretty basic. 
> 
> What is the recommended, more efficient workflow for this sort of
> thing?

For multichannel publishing it is a must to keep your data in semantically
rich form. I strongly recommend switching from non structural macros to
self-validating XML markup (DocBook, DITA). This 'Single Source Publishing'
approach opens new possibilities. Besides ePUB (you can convert/degrade it
to MOBI in Calibre) and PDF you can get a lot of other outputs
out-of-the-box (Webhelp, CHM, JavaHelp, LaTeX, ConTeXt, ...).

But to be honest, both setting up and customizing the workflow require a
specific skill set so it is IMHO not well suited for 'urgent' projects...

Btw, there is a special user group with many related topics on linked.in:
https://www.linkedin.com/groups/Ebooks-Elearning-Epub-3-HTML5-2414597?gid=24
14597

Regards, 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] Support for Optional Content Groups

2014-07-03 Thread Chris Chapman
Thanks Hans and Wolfgang! Yes, it looks like most PDF viewers don't handle 
layers right now, but I'm fine with Acrobat for this use case. 

Chris Chapman
Pentandra


- Original Message -
> From: "Hans Hagen" 
> To: "mailing list for ConTeXt users" 
> Sent: Thursday, July 3, 2014 11:54:27 AM
> Subject: Re: [NTG-context] Support for Optional Content Groups
> 
> On 7/3/2014 5:55 PM, Chris Chapman wrote:
> > I am new to ConTeXt (coming from LaTeX), and am really impressed. Great
> > work!
> >
> > I am working on a document that has layers that I want to be screen-only,
> > similar in approach to this:
> > http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf
> >
> > I am assuming that Optional Content Groups would be the best way to do
> > this. How would I set something up like this in ConTeXt/LuaTeX? I know I
> > could make a screen-only version and a print version of the output pdf,
> > but I want to have my cake and eat it too ;)
> 
> (also see wolfgangs mail)
> 
> I tried this in acrobat:
> 
> \defineviewerlayer[visibleandprint]  [printable=yes,state=start]
> \defineviewerlayer[visibleandnotprint]   [printable=no, state=start]
> \defineviewerlayer[notvisibleandprint]   [printable=yes,state=stop]
> \defineviewerlayer[notvisibleandnotprint][printable=no, state=stop]
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \startviewerlayer[visibleandprint]   visible and print
> \stopviewerlayer \blank
> \startviewerlayer[visibleandnotprint]visible and not print
> \stopviewerlayer \blank
> \startviewerlayer[notvisibleandprint]not visible and print
> \stopviewerlayer \blank
> \startviewerlayer[notvisibleandnotprint] not visible and not print
> \stopviewerlayer \blank
> 
> \stoptext
> 
> and found out that we need an extra piece of info for acrobat to be
> happy. I'll upload a beta with that addition.
> 
> I wonder if other viewers handle layers well.
> 
> 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] Support for Optional Content Groups

2014-07-03 Thread Hans Hagen

On 7/3/2014 5:55 PM, Chris Chapman wrote:

I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!

I am working on a document that has layers that I want to be screen-only, 
similar in approach to this:
http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf

I am assuming that Optional Content Groups would be the best way to do this. 
How would I set something up like this in ConTeXt/LuaTeX? I know I could make a 
screen-only version and a print version of the output pdf, but I want to have 
my cake and eat it too ;)


(also see wolfgangs mail)

I tried this in acrobat:

\defineviewerlayer[visibleandprint]  [printable=yes,state=start]
\defineviewerlayer[visibleandnotprint]   [printable=no, state=start]
\defineviewerlayer[notvisibleandprint]   [printable=yes,state=stop]
\defineviewerlayer[notvisibleandnotprint][printable=no, state=stop]

\setupinteraction[state=start]

\starttext

\startviewerlayer[visibleandprint]   visible and print 
\stopviewerlayer \blank
\startviewerlayer[visibleandnotprint]visible and not print 
\stopviewerlayer \blank
\startviewerlayer[notvisibleandprint]not visible and print 
\stopviewerlayer \blank
\startviewerlayer[notvisibleandnotprint] not visible and not print 
\stopviewerlayer \blank


\stoptext

and found out that we need an extra piece of info for acrobat to be 
happy. I'll upload a beta with that addition.


I wonder if other viewers handle layers well.

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
-


print-001.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] Support for Optional Content Groups

2014-07-03 Thread Wolfgang Schuster

Am 03.07.2014 um 17:55 schrieb Chris Chapman :

> I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!
> 
> I am working on a document that has layers that I want to be screen-only, 
> similar in approach to this: 
> http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf
> 
> I am assuming that Optional Content Groups would be the best way to do this. 
> How would I set something up like this in ConTeXt/LuaTeX? I know I could make 
> a screen-only version and a print version of the output pdf, but I want to 
> have my cake and eat it too ;)


You can test if the layers are hidden when you print the following example, I 
tried the Adobe Reader on my Mac and they where still visible.

\setupinteraction[state=start]

\defineoverlay[PageBackground] [\startMPcode fill fullsquare 
xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{orange} ; \stopMPcode]
\defineoverlay[FrameBackground][\startMPcode fill fullsquare 
xyscaled(OverlayWidth,OverlayHeight) withcolor \MPcolor{green} ;  \stopMPcode]

%\setupbackgrounds[page][background=color,backgroundcolor=orange] % doesn’t 
work because you can only hide the background together with the text
\setupbackgrounds[page][background=PageBackground]

\setupviewerlayer[printable=no]

\defineviewerlayer[mylayer]

%\showlayoutcomponents % use this to enable/disable certain text areas

\starttext

\input knuth

\startviewerlayer[mylayer]
\input ward
\stopviewerlayer

\input tufte

\startframedtext[width=max,background=FrameBackground]
\input weisman
\stopframedtext

\stoptext

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
___


[NTG-context] Support for Optional Content Groups

2014-07-03 Thread Chris Chapman
I am new to ConTeXt (coming from LaTeX), and am really impressed. Great work!

I am working on a document that has layers that I want to be screen-only, 
similar in approach to this: 
http://tex.stackexchange.com/questions/167846/implementing-full-page-screen-only-print-only-in-pdf

I am assuming that Optional Content Groups would be the best way to do this. 
How would I set something up like this in ConTeXt/LuaTeX? I know I could make a 
screen-only version and a print version of the output pdf, but I want to have 
my cake and eat it too ;)

Thanks in advance,

Chris Chapman
___
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] How to create a PDF/A file with mkii?

2014-07-03 Thread luigi scarso
On Thu, Jul 3, 2014 at 2:00 PM, luigi scarso  wrote:

>
>
>
> On Wed, Jul 2, 2014 at 10:54 PM, Otared Kavian  wrote:
>
>> Hi Luigi,
>>
>> I did a test with mkiv (see the tex file attached), and then tested the
>> resulting pdf file on the site you mentioned,
>>
>> http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx
>>
>> Unfortunately it says that the PDF produced by mkiv is not conform:
>>
>> test-PDF-A-1b.pdf does not conform to PDF/A.
>>
>> Validating file "test-PDF-A-1b.pdf" for conformance level pdfa-1a
>> Invalid content of XMP packet header attribute 'id':
>> 'dtlnfbrryjnvabnrajbkrpyw'.
>> dc:description :: Wrong value type. Expected type 'lang alt'.
>> The XMP property 'pdfaid:conformance' has the invalid value 'B'. Required
>> is 'A'.
>> The key MarkInfo is required but missing.
>> A device-specific color space (DeviceGray) without an appropriate output
>> intent is used.
>> The document does not conform to the requested standard.
>> The document contains device-specific color spaces.
>> The document's meta data is either missing or inconsistent or corrupt.
>> The document doesn't provide appropriate logical structure information.
>> Done.
>>
>> So, I don’t know how to solve the issue of creating a PDF/A.
>>
>> Thanks for any hint.
>> Best regards: OK
>>
>> This pass acrobat xi preflight for pdf/a-1b
> Note that the icc files
> default_cmyk.icc
> default_gray.icc
> default_rgb.icc
> ISOcoated_v2_300_eci.icc
> must be in
> tex/texmf-context/colors/icc/profiles
> and must match with the colorprofiles.xml in
> tex/texmf-context/colors/icc/context
>
>
> \setupinteraction
>   [title=TITLE,
>subtitle=SUBTITLE,
>author=AUTHOR,
>keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]
>
> %% For PDF/A
> \setupbackend[
> format={pdf/a-1b:2005},
> profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
> intent=ISO coated v2 300\letterpercent\space (ECI)]
>
> \starttext
>
> \chapter[chap:testing]{Testing}
>
> \input knuth
>
> \input tufte
>
> \input knuth
>
> \input tufte
>
> \input knuth
>
> \input tufte
>
> \stoptext
>
>
>
> This pass pdf/a-1a
>
> \setupinteraction
>   [title=TITLE,
>subtitle=SUBTITLE,
>author=AUTHOR,
>keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]
>
> %% For PDF/A
> \setupbackend[
> format={pdf/a-1a:2005},
> profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
> intent=ISO coated v2 300\letterpercent\space (ECI)]
>
> %% Tagged PDF
> %% method=auto ==> default tags by Adobe
> %% \setupbackend[export=yes] it's necessary now to activate the tags
> %% probably it could be optional
> \setupbackend[export=yes]
> \setupstructure[state=start,method=auto]
>
> \starttext
>
> \startchapter[title=Testing chapter]
>
> \input knuth
> \startsection[title=Testing section]
>
> \bTABLE
>
> \bTR\bTD 1 \eTD \bTD 2 \eTD \eTR
>
> \bTR \bTD[nx=2] 3 \eTD\eTR
>
> \eTABLE
> \stopsection
> \stopchapter
>
>
> \stoptext
>
>
>> --
> luigi
>

Update: this also works ---  and it's better

\setupbackend
  [format={pdf/a-1a:2005},
   profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
   intent={ISO coated v2 300\letterpercent\space (ECI)}]

%% Tagged PDF
%% method=auto ==> default tags by Adobe
\setuptagging[state=start]
\setupstructure[state=start,method=auto]

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

[NTG-context] Problem with module lettrine

2014-07-03 Thread Akira Kakuto

I send a minimal example to know why it looks bad the initial letter using
the module lettrine . I am using TeXLive 2013 under Windows XP.


mtx-context | current version: 2014.06.27 10:53

gives an attached one on windows.

Best,
Akira


test.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] How to create a PDF/A file with mkii?

2014-07-03 Thread luigi scarso
On Wed, Jul 2, 2014 at 10:54 PM, Otared Kavian  wrote:

> Hi Luigi,
>
> I did a test with mkiv (see the tex file attached), and then tested the
> resulting pdf file on the site you mentioned,
>
> http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx
>
> Unfortunately it says that the PDF produced by mkiv is not conform:
>
> test-PDF-A-1b.pdf does not conform to PDF/A.
>
> Validating file "test-PDF-A-1b.pdf" for conformance level pdfa-1a
> Invalid content of XMP packet header attribute 'id':
> 'dtlnfbrryjnvabnrajbkrpyw'.
> dc:description :: Wrong value type. Expected type 'lang alt'.
> The XMP property 'pdfaid:conformance' has the invalid value 'B'. Required
> is 'A'.
> The key MarkInfo is required but missing.
> A device-specific color space (DeviceGray) without an appropriate output
> intent is used.
> The document does not conform to the requested standard.
> The document contains device-specific color spaces.
> The document's meta data is either missing or inconsistent or corrupt.
> The document doesn't provide appropriate logical structure information.
> Done.
>
> So, I don’t know how to solve the issue of creating a PDF/A.
>
> Thanks for any hint.
> Best regards: OK
>
> This pass acrobat xi preflight for pdf/a-1b
Note that the icc files
default_cmyk.icc
default_gray.icc
default_rgb.icc
ISOcoated_v2_300_eci.icc
must be in
tex/texmf-context/colors/icc/profiles
and must match with the colorprofiles.xml in
tex/texmf-context/colors/icc/context


\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

%% For PDF/A
\setupbackend[
format={pdf/a-1b:2005},
profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
intent=ISO coated v2 300\letterpercent\space (ECI)]

\starttext

\chapter[chap:testing]{Testing}

\input knuth

\input tufte

\input knuth

\input tufte

\input knuth

\input tufte

\stoptext



This pass pdf/a-1a

\setupinteraction
  [title=TITLE,
   subtitle=SUBTITLE,
   author=AUTHOR,
   keyword={{KEYWORD1, KEYWORD2}, KEYWORD3}]

%% For PDF/A
\setupbackend[
format={pdf/a-1a:2005},
profile={default_cmyk.icc,default_rgb.icc,default_gray.icc},
intent=ISO coated v2 300\letterpercent\space (ECI)]

%% Tagged PDF
%% method=auto ==> default tags by Adobe
%% \setupbackend[export=yes] it's necessary now to activate the tags
%% probably it could be optional
\setupbackend[export=yes]
\setupstructure[state=start,method=auto]

\starttext

\startchapter[title=Testing chapter]

\input knuth
\startsection[title=Testing section]

\bTABLE

\bTR\bTD 1 \eTD \bTD 2 \eTD \eTR

\bTR \bTD[nx=2] 3 \eTD\eTR

\eTABLE
\stopsection
\stopchapter


\stoptext


> --
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] Problem with module lettrine

2014-07-03 Thread Hans Hagen

On 7/3/2014 12:32 PM, MANUEL GONZALEZ SUAREZ wrote:

Hi.
I send a minimal example to know why it looks bad the initial letter
using the module lettrine . I am using TeXLive 2013 under Windows XP.
Thank you.


search the wiki and test suite for 'initials'

-
  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] underbraces get progressively more misaligned (w/ minimal example)

2014-07-03 Thread Sanjoy Mahajan
I thought the problem might lie with the general
\definemathunderextensible (math-stc.mkvi), because underbrace is
defined as

\definemathunderextensible  [vfenced] [underbrace]["FE3DF]  % 
["023DF]

Other underextensibles include \underbar:

\definemathunderextensible  [vfenced] [underbar]  ["FE33F]
% ["203E]

So I tried my example replacing \underbrace with \underbar but the
alignment comes out fine (and \overbrace works fine too).  So that
debugging idea didn't work, except to indicate that something special
about underbrace isn't working right.

Does anyone have suggestions for further debugging ideas?

-Sanjoy
___
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] Problem with module lettrine

2014-07-03 Thread MANUEL GONZALEZ SUAREZ
Hi.
I send a minimal example to know why it looks bad the initial letter using the 
module lettrine . I am using TeXLive 2013 under Windows XP.
Thank you.




examplelettrine.pdf
Description: examplelettrine.pdf
\usemodule[lettrine]
\starttext
\section{First}

\lettrine[Lines=3]{N}{ow we} \input knuth


\stoptext___
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] Hash (#) in URL

2014-07-03 Thread Christoph Reller
On Thu, Jul 3, 2014 at 11:36 AM, Christoph Reller <
christoph.rel...@gmail.com> wrote:

> Hi,
>
> Is occurrence of the # character in an URL not supported?
>
> \setupinteraction[state=start]
> \starttext
> \useURL[here][http://en.wikipedia.org/wiki/ConTeXt#Versions]
> \from[here]
> \stoptext
>
> Regards,
> Christoph
>

Oh, the following works:

\useURL[here][http://en.wikipedia.org/wiki/ConTeXt\#Versions
]

Sorry for the noise,
Christoph
___
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] Hash (#) in URL

2014-07-03 Thread Christoph Reller
Hi,

Is occurrence of the # character in an URL not supported?

\setupinteraction[state=start]
\starttext
\useURL[here][http://en.wikipedia.org/wiki/ConTeXt#Versions]
\from[here]
\stoptext

Regards,
Christoph
___
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] ConTeXt epub workflow

2014-07-03 Thread Hans Hagen

On 7/2/2014 11:18 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

On Wed, 02 Jul 2014 15:12:10 -0600, Idris Samawi Hamid ادريس   سماوي
حامد  wrote:


What is the recommended, more efficient workflow for this sort of
thing? Should I start with markdown and then generate context and epub
(then convert epub=>kindle I presume)? Or does one context file with
pdf and epub outputs work well? Many years ago I did some documents in
ConTeXt with both print and screen pdfs from a single source. Can we
do the latter in ConTeXt now?



Er, Can we do the *former* in ConTeXt? Viz., generate both pdf and epub
from a single source.


you can generate a pdf + export in xml from the same source; if you know 
what epub you want (and how it should look like) you can use a 
combination of transformation and css


the main boundary condition is that you tag wisely (and i think this is 
not an issue in your case as you always tag); there is some deduction 
built in with respect to where paragraphs begin and end so often it 
helps to tag paragraphs too (depends on the document)


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] ConTeXt epub workflow

2014-07-03 Thread Hans Hagen

On 7/2/2014 11:12 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:

Dear gang,

I have an urgent project that needs three outputs: pdf, epub, and
kindle. The formatting needs are pretty basic. In your experience:

What is the recommended, more efficient workflow for this sort of thing?
Should I start with markdown and then generate context and epub (then
convert epub=>kindle I presume)? Or does one context file with pdf and
epub outputs work well? Many years ago I did some documents in ConTeXt
with both print and screen pdfs from a single source. Can we do the
latter in ConTeXt now? Does anyone have any examples?


the export is xml reflecting the structure etc and as the whole idea of 
xml is that it can be transformed one can map that to anything needed


there is mtx-epub but i need to look into that again as one problem with 
epub is that all these substandards and devices differ a bit


context can produce xhtml which then with a css can be viewed in full 
blown browsers (i used mozilla) although for some constructs (like 
hyperlinks) html like thingies have to be used (not part of css)


as xhtml is not becoming the standard it should be, i'm considering a 
variant output where everything is a  or  which then even 
more moves things to css (outputting html tags makes no sense as we then 
would end up in tag abuse due to the limited number of tags)



According to

http://wiki.contextgarden.net/epub

There is no support for graphics in ConTeXt epub output. Are there
workarounds?


all relevant info is embedded and output (with a css mapping to graphics 
that one can supply as png/jpg/whatever)



In any case, all advice for an efficient workflow for this project will
be greatly appreciated!


(luigi is working on some stuff that transforms the export into wiki 
pages for the garden, e.g. the new publications manual)


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] ConTeXt epub workflow

2014-07-03 Thread Hans Hagen

On 7/3/2014 9:14 AM, Gour wrote:

Aditya Mahajan  writes:


In the long run, I think that the "easiest" way to generate multiple
output formats for non-trivial input text is to use XML as your input
format.


Although I do not like XML-based format as input for writing, I wonder
how is ConTeXt handling XML format *today* ?


there are manuals (mkiv) and examples in in the test suite

mkvi xml support is completely different (tree based filtering) from 
mkii (sequential, streaming)


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] ConTeXt epub workflow

2014-07-03 Thread Keith McKay

Dear Idris

If your document is simple I would consider the following workflow. I 
use this method for simple novels to produce both ePubs and Kindle 
output relatively quickly from a word docs which authors send me.


Load the word doc into OpenOffice and save in OpenOffice format (.odt). 
Using the Writer2ePub extension in OpenOffice convert to ePub. You will 
get a reasonable looking ePub if you have taken a little care to style 
the document beforehand. Load the ePub into Sigil and tidy up the ePub. 
I Usually split the ePub into Chapters, embed fonts and add any images 
where I want them to go at this point. Once you are happy with the ePub 
you should test it on the various eReaders to make sure it looks as 
expected, don't be surprised to see differences and you may have to 
create different ePubs for the different eReaders. I have to do that for 
iBooks and Kobo eReaders. The idpf have an online ePub validator for 
ePubs which you should use to check for ePub standard compliance. Adobe 
Digital Editions is a useful tool here. You can now convert it into 
Kindle format using Kindle Previewer. If it requires changes, do that in 
Sigil and then run through Kindle Previewer again.


To get pdf output I have been experimenting with pandoc quite recently 
with some success. I take the ePub and rename as a zip file and open it 
to expose its directory structure. Using pandoc I convert it to ConText 
code and tidy up a wee bit but, on the whole, Pandoc gives a not bad 
conversion even if images are present. Again you will probably have to 
tidy up the Context code and play about with fonts etc.


This workflow looks a wee bit complicated but it does work well once you 
get the hang of it. I had originally tried using the Context to ePub but 
as previous correspondents have intimated you only get xml output rather 
than xhtml which is what eReaders require.


If you need help feel free to email me privately.

Best Wishes
Keith McKay
Hamilton, Scotland

On 02/07/2014 22:12, Idris Samawi Hamid ادريس سماوي حامد wrote:

Dear gang,

I have an urgent project that needs three outputs: pdf, epub, and 
kindle. The formatting needs are pretty basic. In your experience:


What is the recommended, more efficient workflow for this sort of 
thing? Should I start with markdown and then generate context and epub 
(then convert epub=>kindle I presume)? Or does one context file with 
pdf and epub outputs work well? Many years ago I did some documents in 
ConTeXt with both print and screen pdfs from a single source. Can we 
do the latter in ConTeXt now? Does anyone have any examples?


According to

http://wiki.contextgarden.net/epub

There is no support for graphics in ConTeXt epub output. Are there 
workarounds?


In any case, all advice for an efficient workflow for this project 
will be greatly appreciated!


Best wishes
Idris


___
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] ConTeXt epub workflow

2014-07-03 Thread Gour
Aditya Mahajan  writes:

> In the long run, I think that the "easiest" way to generate multiple
> output formats for non-trivial input text is to use XML as your input
> format.

Although I do not like XML-based format as input for writing, I wonder
how is ConTeXt handling XML format *today* ?


Sincerely,
Gour

-- 
He who is satisfied with gain which comes of its own accord, who 
is free from duality and does not envy, who is steady in both 
success and failure, is never entangled, although performing actions.

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