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

Chapter


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:

Chapter


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 )

not needed as we're 'standalone'

Having the ability to produce the  and  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 and we had quite some conflicting validations (and specs) and 
we try as good as possi

Re: [NTG-context] Another issue with my magazine

2013-09-05 Thread Hans Hagen

On 9/4/2013 9:51 PM, Mikoláš Štrajt wrote:

On 2013-09-04 Hans Hagen wrote:

 > first of all you need to switch to mkiv ... more change on tips and
solutions then

OK. I have switched to mkiv. What now about my head whitespace problems.


well, first provide a mkiv example ... less code than the mkii one

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



   


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,



 
 


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,
> 
> 
> > 
> > 
> > 
> >
> > 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] Bug in \externalfigures in headers?

2013-09-05 Thread Wolfgang Schuster

Am 05.09.2013 um 18:04 schrieb Xan :

> Hi,
> 
> I just want to include logo in headers:

When you have nested command where each takes brackets (e.g. \foo[\bar[…]]) you 
have
to add curly braces around the inner command (e.g. \foo{\bar[…]}]). In your 
case you need
to write \setupheadertexts[{\externalfigure[…]}].

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] Defined command troubles

2013-09-05 Thread Wolfgang Schuster

Am 05.09.2013 um 17:42 schrieb Xan :

> Hi,
> 
> I just want to define a shortcut for framedtexts...
> 
> That's it:
> 
> \def\important{\dodoubleempty\doimportant}
> \def\doimportant[#1][#2]{\bgroup
>\ifsecondargument
>   \startframedtext[background=#2,frame=off,width=broad]%
>   #1
>\else
>   \startframedtext[background=screen,frame=off,width=broad]%
>   #1
>\fi
>\stopframedtext
>\egroup}
> 
> It works perfectly with \important[Anything] but not with 
> \important[Anything][red].

To set colors for the background you need “background 
color,backgroundcolor=”.

> By the other hand, I want to define 'important' for use with start and end 
> (startimportant ... \stopimportant) and not with single command. How can I 
> get it?

\defineframedtext
  [important]
  [background=screen,
   frame=off,
   width=broad]

\starttext

\startimportant
\input ward
\stopimportant

\startimportant[background=color,backgroundcolor=red]
\input ward
\stopimportant

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


[NTG-context] \underbar problem

2013-09-05 Thread Alan Bowen
In a lengthy document, \underbar occasionally has no effect. From the wiki,
I have learned that this can be rectified using
\inframed[frame=off]{\underbar{….}}. The problem is that this only works
for short text: lengthy text, say a paragraph, gets printed as a single
line.

Is there a way (a key?) that will allow \underbar to work with \inframed or
perhaps another way of getting \underbar to work 100% of the time?

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
___

[NTG-context] Defined command troubles

2013-09-05 Thread Xan
Hi,

I just want to define a shortcut for framedtexts...

That's it:

\def\important{\dodoubleempty\doimportant}
\def\doimportant[#1][#2]{\bgroup
\ifsecondargument
   \startframedtext[background=#2,frame=off,width=broad]%
   #1
\else
   \startframedtext[background=screen,frame=off,width=broad]%
   #1
\fi
\stopframedtext
\egroup}

It works perfectly with \important[Anything] but not with 
\important[Anything][red].

By the other hand, I want to define 'important' for use with start and end 
(startimportant ... \stopimportant) and not with single command. How can I get 
it?

Thanks,
Xan.
___
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 units and problem with libraries

2013-09-05 Thread Tomas Hala
Hi,

\definebodyfontenvironment works for the concrete fontsize, thanks, Wolfgang.
But - even if I read the short documentation at the ctx-garden - I am still
a bit confused, eg:

\text[4.61pt] works automatically but \text[4.651pt] not, only with the
defining command, similarly behave \text[0.75em] and \text[0.735em].
How the precisity has been defined? Two decimal places?

Scale points (this is only a theoretical topic) probably must be in some 
way rounded (how?) because \definebodyfontenvironment with values from 
50sp to 500367sp gives the changed font size but with values 500368 
and larger font size has been replaced by the default one. 

The command \definebodyfontenvironment[0.5cc] enables \text[0.5cc] as well as
\text[6dd] (similarly 6pt and 0.5pc) which lives for our expectations whereas
\definebodyfontenvironment[1cm] enables \text[1cm] and \text[12mm].
I thougt that is related with 20% scale of larger size but it works only
with 10 and 12, 20 and 24, 30 and 36, etc, not with 10, 12 and 14.4.

%% 

>From the conceptual point of view, I would like to ask why the behaviour
was changed between TL2011 and TL2012. The older one seems to me more
user friendly. The related question is how user can activate other units
(or all font sizes of a unit, as a whole) by some simple way. 
(My favourite units are cc and dd) 

Best regards,

Tomas Hala


Wed, Sep 04, 2013 ve 07:13:53PM +0200 Wolfgang Schuster napsal(a):
# 
# Am 04.09.2013 um 19:07 schrieb Tomas Hala :
# 
# > Hi all,
# > 
# > recently I installed TeXlive 2013. In a document, I ran into the problem 
# > with font sizes: only points and ems operates properly in contrast 
# > to other units giving the basic (12pt) size.
# 
# Add \definebodyfontenvironment[] for each size.
# 
# Wolfgang


--minimal example--
\starttext
\def\text[#1]{blah blah --- #1:  {\setupbodyfont[#1]blah blah}\par}

\text[0.5pc]
\text[8pt]
\text[0.7335em]
%\definebodyfontenvironment[4pc]
\definebodyfontenvironment[1cm]
%\definebodyfontenvironment[500367sp]
\text[12mm]
\text[1cm]
\text[50sp]
\text[0.5ex]

\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] Bug in \externalfigures in headers?

2013-09-05 Thread Aditya Mahajan

On Thu, 5 Sep 2013, Xan wrote:


\setupheadertexts[\externalfigure[logo-cepa-sud.png]][\pagenumber\ de \lastpage]


\setupheadertexts[{\externalfigure[logo-cepa-sud.png]}]
 [\pagenumber\ de \lastpage]


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






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
___


[NTG-context] Bug in \externalfigures in headers?

2013-09-05 Thread Xan
Hi,

I just want to include logo in headers:

%% ConTeXt template for exercises
%% ConTeXt MIV

%% Carregam símbols
\usesymbols[eur]

%% carregam les opcions d'entorn
\environment entorn-simple-estructurals
\environment entorn-simple-visuals

%% Capçaleres i peus
\setupheadertexts[\externalfigure[logo-cepa-sud.png]][\pagenumber\ de \lastpage]
\setupfootertexts[nomfitxer (versio, \currentdate)][]


%% el text
\starttext

%\title{Títol}

Text

%\startexercici
%\stopexercici

\stoptext


but when I run context I receive:

$ context plantilla-context.conTeXt 

mtx-context | run 1: luatex 
--fmt="/usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
 --jobname="plantilla-context" 
--lua="/usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
 --no-parse-first-line --c:currentrun=1 
--c:fulljobname="./plantilla-context.conTeXt" 
--c:input="./plantilla-context.conTeXt" --c:kindofrun=1 --c:maxnofruns=8 
"cont-yes.mkiv"
This is LuaTeX, Version beta-0.76.0-2013040516 (rev 4627) 
 \write18 enabled.
(/usr/local/bin/context/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2013.07.14 14:53 MKIV beta  fmt: 2013.7.18  int: english/english

system  > 'cont-new.mkiv' loaded
(/usr/local/bin/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
system  > files > jobname 'plantilla-context', input 
'./plantilla-context.conTeXt', result 'plantilla-context'
fonts   > latin modern fonts are not preloaded
languages   > language 'en' is active
(/mnt/magatzem/docencia/docencia-raw/docencia-fusio/Docencia/cursos-antics/2013-2014-CEPA-Sud/plantilles/plantilla-context.conTeXt
 (/usr/local/bin/context/tex/texmf-context/tex/context/base/symb-imp-eur.mkiv)
fonts   > symbols > library 'eur' loaded 
(entorn-simple-estructurals.tex) (entorn-simple-visuals.tex
fonts   > typescripts > unknown library 'loc'
fonts   > typescripts > unknown library 'cmr'
fonts   > preloading latin modern fonts (third stage)
{/usr/local/bin/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/local/bin/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{/usr/local/bin/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
fonts   > 'fallback modern rm 11pt' is loaded
)
! Argument of \syst_helpers_triple_empty_one_yes has an extra }.

system  > tex > error on line 1 in file 
/mnt/magatzem/docencia/docencia-raw/docencia-fusio/Docencia/cursos-antics/2013-2014-CEPA-Sud/plantilles/plantilla-context.conTeXt:
 Argument of  ...

 1 >>  %% ConTeXt template for exercises
 2 %% ConTeXt MIV
 3 
 4 %% Carregam símbols
 5 \usesymbols[eur]
 6 
 7 %% carregam les opcions d'entorn
 8 \environment entorn-simple-estructurals
 9 \environment entorn-simple-visuals
10 
11 %% Capçaleres i peus

 
\par 
 
}
 ...ss \layoutelementparameter \c!middletext \hss }
  \kern -\makeupwidth \hbox ...
\page_layouts_place_element_indeed ...ute to #1{#2
  }\layoutelementparameter \...
\page_layouts_place_text_line_right ...argin_left 
  \fi \ifdim \rightmarginwid...
\page_layouts_place_text_line_left_or_right ...ft 
  \namedlayoutelementparamet...
...
l.26 \stoptext

? x

mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: 
/usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.018 seconds, 0 scans with 
scantime 0.000 seconds, 0 shared scans, 17 found files, scanned paths: 
mkiv lua stats  > stored bytecode data: 330 modules (0.418 sec), 69 tables 
(0.011 sec), 399 chunks (0.429 sec)
mkiv lua stats  > cleaned up reserved nodes: 38 nodes, 10 lists of 441
mkiv lua stats  > node memory usage: 8 hlist, 1 vlist, 8 glue, 2 kern, 1 
penalty, 17 attribute, 30 glue_spec, 6 attribute_list, 12 temp, 14 if_stack, 1 
local_par, 12 dir
mkiv lua stats  > node list callback tasks: 6 unique task lists, 4 instances 
(re)created, 12 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded patterns: ca::53 en::2, load time: 0.000
mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.002 seconds loading
mkiv lua stats  > callbacks: 89 direct, 318 indirect, 407 total
mkiv lua stats  > randomizer: resumed with value 0.76534300286572
mkiv lua stats  > result saved in file: plantilla-context.pdf, compresslevel 3, 
objectcompreslevel 3
mkiv lua stats  > loaded fonts: 3 files: latinmodern-math.otf (experimental), 
lmroman10-regular.otf, lmsans10-regular.otf
mkiv lua stats  > fonts load time: 0.509 seconds 
mkiv lua stats  > luatex banner: this is luatex, v

Re: [NTG-context] EPUB XHTML Format

2013-09-05 Thread Thangalin
Hi,


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


  Title page
  Copyright
  



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



   


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
___


[NTG-context] Setting section margin

2013-09-05 Thread Lance Larsen
I would like to adjust the margin for sections, subsections, etc. I came
across a suggestion that you can use setuphead with the beforesection and
aftersection options to do something like this, but I tried this with MKIV,
and beforesection and aftersection appear to have no effect (see the example
below). Recent documentation doesn't show these as parameters for setuphead.
How do I do this with MKIV?

 

Example:

 

\setuphead[section] [margin=0.5in,
beforesection={\startnarrower[left=0.5in]}, aftersection={\stopnarrower}]

\setuphead[subsection] [margin=1in,
beforesection={\startnarrower[left=1.0in]}, aftersection={\stopnarrrower}]

 

\starttext

 

\chapter{chapter}

This is a chapter

 

\section{section}

This is a section

 

\section{subsection}

This is a subsection

 

\stoptext

 

-Lance Larsen

___
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  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  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 
> 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] Bug in \externalfigures in headers?

2013-09-05 Thread Xan
Thanks a lot, All of you for quick responses.

On Thu, 5 Sep 2013 18:04:36 +0200
Xan  ha escrit:

> Hi,
> 
> I just want to include logo in headers:
> 
> %% ConTeXt template for exercises
> %% ConTeXt MIV
> 
> %% Carregam símbols
> \usesymbols[eur]
> 
> %% carregam les opcions d'entorn
> \environment entorn-simple-estructurals
> \environment entorn-simple-visuals
> 
> %% Capçaleres i peus
> \setupheadertexts[\externalfigure[logo-cepa-sud.png]][\pagenumber\ de 
> \lastpage]
> \setupfootertexts[nomfitxer (versio, \currentdate)][]
> 
> 
> %% el text
> \starttext
> 
> %\title{Títol}
> 
> Text
> 
> %\startexercici
> %\stopexercici
> 
> \stoptext
> 
> 
> but when I run context I receive:
> 
> $ context plantilla-context.conTeXt 
> 
> mtx-context | run 1: luatex 
> --fmt="/usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en"
>  --jobname="plantilla-context" 
> --lua="/usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui"
>  --no-parse-first-line --c:currentrun=1 
> --c:fulljobname="./plantilla-context.conTeXt" 
> --c:input="./plantilla-context.conTeXt" --c:kindofrun=1 --c:maxnofruns=8 
> "cont-yes.mkiv"
> This is LuaTeX, Version beta-0.76.0-2013040516 (rev 4627) 
>  \write18 enabled.
> (/usr/local/bin/context/tex/texmf-context/tex/context/base/cont-yes.mkiv
> 
> ConTeXt  ver: 2013.07.14 14:53 MKIV beta  fmt: 2013.7.18  int: english/english
> 
> system  > 'cont-new.mkiv' loaded
> (/usr/local/bin/context/tex/texmf-context/tex/context/base/cont-new.mkiv)
> system  > files > jobname 'plantilla-context', input 
> './plantilla-context.conTeXt', result 'plantilla-context'
> fonts   > latin modern fonts are not preloaded
> languages   > language 'en' is active
> (/mnt/magatzem/docencia/docencia-raw/docencia-fusio/Docencia/cursos-antics/2013-2014-CEPA-Sud/plantilles/plantilla-context.conTeXt
>  (/usr/local/bin/context/tex/texmf-context/tex/context/base/symb-imp-eur.mkiv)
> fonts   > symbols > library 'eur' loaded 
> (entorn-simple-estructurals.tex) (entorn-simple-visuals.tex
> fonts   > typescripts > unknown library 'loc'
> fonts   > typescripts > unknown library 'cmr'
> fonts   > preloading latin modern fonts (third stage)
> {/usr/local/bin/context/tex/texmf/fonts/map/dvips/lm/lm-math.map}{/usr/local/bin/context/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{/usr/local/bin/context/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
> fonts   > 'fallback modern rm 11pt' is loaded
> )
> ! Argument of \syst_helpers_triple_empty_one_yes has an extra }.
> 
> system  > tex > error on line 1 in file 
> /mnt/magatzem/docencia/docencia-raw/docencia-fusio/Docencia/cursos-antics/2013-2014-CEPA-Sud/plantilles/plantilla-context.conTeXt:
>  Argument of  ...
> 
>  1 >>  %% ConTeXt template for exercises
>  2 %% ConTeXt MIV
>  3 
>  4 %% Carregam símbols
>  5 \usesymbols[eur]
>  6 
>  7 %% carregam les opcions d'entorn
>  8 \environment entorn-simple-estructurals
>  9 \environment entorn-simple-visuals
> 10 
> 11 %% Capçaleres i peus
> 
>  
> \par 
>  
> }
>  ...ss \layoutelementparameter \c!middletext \hss }
>   \kern -\makeupwidth \hbox 
> ...
> \page_layouts_place_element_indeed ...ute to #1{#2
>   }\layoutelementparameter 
> \...
> \page_layouts_place_text_line_right ...argin_left 
>   \fi \ifdim 
> \rightmarginwid...
> \page_layouts_place_text_line_left_or_right ...ft 
>   
> \namedlayoutelementparamet...
> ...
> l.26 \stoptext
> 
> ? x
> 
> mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
> mkiv lua stats  > used cache path: 
> /usr/local/bin/context/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
> mkiv lua stats  > resource resolver: loadtime 0.018 seconds, 0 scans with 
> scantime 0.000 seconds, 0 shared scans, 17 found files, scanned paths: 
> mkiv lua stats  > stored bytecode data: 330 modules (0.418 sec), 69 tables 
> (0.011 sec), 399 chunks (0.429 sec)
> mkiv lua stats  > cleaned up reserved nodes: 38 nodes, 10 lists of 441
> mkiv lua stats  > node memory usage: 8 hlist, 1 vlist, 8 glue, 2 kern, 1 
> penalty, 17 attribute, 30 glue_spec, 6 attribute_list, 12 temp, 14 if_stack, 
> 1 local_par, 12 dir
> mkiv lua stats  > node list callback tasks: 6 unique task lists, 4 instances 
> (re)created, 12 calls
> mkiv lua stats  > used backend: pdf (backend for directly generating pdf 
> output)
> mkiv lua stats  > loaded patterns: ca::53 en::2, load time: 0.000
> mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.002 seconds loading
> mkiv lua stats  > callbacks: 89 direct, 318 indirect, 407 total
> mkiv lua stats  > randomizer: resumed

Re: [NTG-context] Setting section margin

2013-09-05 Thread Aditya Mahajan



On Thu, 5 Sep 2013, Lance Larsen wrote:


I would like to adjust the margin for sections, subsections, etc. I came
across a suggestion that you can use setuphead with the beforesection and
aftersection options to do something like this, but I tried this with MKIV,
and beforesection and aftersection appear to have no effect (see the example
below). Recent documentation doesn't show these as parameters for setuphead.
How do I do this with MKIV?


See http://tex.stackexchange.com/a/109333/323

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
___