Re: [NTG-context] use of preceding-sibling in xmlsetsetup

2015-10-19 Thread Thomas A. Schmitz

On 10/17/2015 11:19 AM, mf wrote:

"reverse-sibling" is ConTeXt specific and very useful: it's a "reversed
preceding-sibling", so that you find the nearest sibling at index [1].
I've used it successfully in a \doif statement, but I failed in
translating it in a \xmlsetsetup statement, to tell ConTeXt: "this
setup is for an element p whose nearest preceding sibling p has class
'incipit'".


In that case, why don't you show the code where you've used it 
successfully and maybe we can take it from there.


Thomas
___
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 lineheight in embedded xtables

2015-10-19 Thread Thomas A. Schmitz

Hi,

I have a small problem with adjusting the height of embedded xtables. 
Here's my example (the colors are there just to see that all the setups 
are read and applied):


\startbuffer[test]


  

  First line of text


	  This is the translation. It is slightly longer than the width of the 
paragraph.


  
  

  Second line of text

  


  

  third line of text


  An even longer translation which should span three rows of the table.

  
  

  fourth line of text

  
  

  fifth line of text.

  


\stopbuffer

\startxmlsetups xml:somesetups
   \xmlsetsetup{#1}{text|bilingual|bilingualrow|bilingualcell}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:somesetups}

\startxmlsetups xml:text
   \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:bilingual
\startembeddedxtable [Bilingual]
  \xmlflush{#1}
\stopembeddedxtable
\stopxmlsetups

\startxmlsetups xml:bilingualrow
  \startxrow 
[height=\the\baselineskip,background=color,backgroundcolor=gray]

\xmlflush{#1}
\stopxrow
\stopxmlsetups

\startxmlsetups xml:bilingualcell
\startxcell [width=0.4\textwidth,align=normal,ny=\xmlattdef{#1}{ny}{1}]
\xmlflush{#1}
\stopxcell
\stopxmlsetups

\setupxtable [Bilingual]
[option=stretch,
 frame=on,
align=normal,
 columndistance=1em,
 foregroundcolor=darkred]

\starttext
   \xmlprocessbuffer{main}{test}{}
\stoptext

Problem: while the fist table  follows the height 
assignment for table rows, in the second table, the lines are much 
higher. When I try to reproduces in a TeX file and apply the 
height=\the\baselineskip to every row individually, it works. What's 
going wrong here?


All best

Thomas
___
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] ntg-context Digest, Vol 136, Issue 30

2015-10-19 Thread massifr
Here's the (complete) code:

\startbuffer[test]

  Dear list,
  this paragraph should not be indented, because it 
follows the “incipit”
  of the letter.
  This one and the following ones should be indented.
  You may question whether “Dear list,” should be a paragraph of his own,
  but my text is already formatted like that and I can’t do anything 
  about it.

\stopbuffer

\startxmlsetups xml:somesetups
  \xmlsetsetup{#1}{text}{xml:text}
  \xmlsetsetup{#1}{p}{xml:p}
  \xmlsetsetup{#1}{p[@class='incipit']}{xml:p:noindent}
  % the following lpath expression does not work
  % \xmlsetsetup{#1}{p[reverse-sibling::p[1]/attribute('class') == 
'incipit']}{xml:p:noindent}
\stopxmlsetups

\xmlregistersetup{xml:somesetups}

\startxmlsetups xml:text
  \indenting[{yes,first,12pt}]
  \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:p
  \doif{\xmlattribute{#1}{reverse-sibling::p[1]}{class}}{incipit}{\noindent}
  \xmlflush{#1}\par
\stopxmlsetups

\startxmlsetups xml:p:noindent
  \noindent\xmlflush{#1}\par
\stopxmlsetups

\starttext
  \xmlprocessbuffer{main}{test}{}
\stoptext

It's the example of the original message of this thread, with the 
modifications posted in the second message.

In the \startxmlsetups section I tried to put that condition in a
\xmlsetsetup, but I commented it out because it did not work.

Here's where I found an example with reverse-sibling:
https://www.mail-archive.com/ntg-context%40ntg.nl/msg77364.html
I was searching for "sibling" in the mailing list archive to see whether
"sibling expressions" had been implemented.

Greetings,
Massi

> On 10/17/2015 11:19 AM, mf wrote:
> > "reverse-sibling" is ConTeXt specific and very useful: it's a "reversed
> > preceding-sibling", so that you find the nearest sibling at index [1].
> > I've used it successfully in a \doif statement, but I failed in
> > translating it in a \xmlsetsetup statement, to tell ConTeXt: "this
> > setup is for an element p whose nearest preceding sibling p has class
> > 'incipit'".
> 
> In that case, why don't you show the code where you've used it 
> successfully and maybe we can take it from there.
> 
> Thomas
> 
___
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] PDF/UA Support

2015-10-19 Thread Andrew Dunning
Dear list,

I am beginning to see increasing need for PDF/UA (ISO 14289) files. Earlier 
this year, the US Access Board announced an update to the rules for the 
accessibility of electronic documents produced by the government that embraces 
the standard, which I expect will make it much more prominent.

XeTeX cannot produce PDF/UA, and it seems unlikely that it ever will, but 
unless I am misreading the documentation it appears that ConTeXt has already 
implemented the necessary functionality. If this is so, it would be helpful to 
have a page discussing its use in parallel to 
, and I would even suggest making PDF/UA 
the default for documents that do not have conflicting commands. The PDF 
Association seems to be pushing this as the future of the format; if this is 
so, this is an opportunity to bring ConTeXt to much greater prominence.

All best,

Andrew Dunning
PhD Candidate
Centre for Medieval Studies
University of Toronto
http://andrewdunning.ca

___
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] PDF/UA Support

2015-10-19 Thread Hans Hagen

On 10/19/2015 5:50 PM, Andrew Dunning wrote:

Dear list,

I am beginning to see increasing need for PDF/UA (ISO 14289) files. Earlier 
this year, the US Access Board announced an update to the rules for the 
accessibility of electronic documents produced by the government that embraces 
the standard, which I expect will make it much more prominent.

XeTeX cannot produce PDF/UA, and it seems unlikely that it ever will, but unless I am 
misreading the documentation it appears that ConTeXt has already implemented the 
necessary functionality. If this is so, it would be helpful to have a page discussing 
its use in parallel to , and I would even 
suggest making PDF/UA the default for documents that do not have conflicting 
commands. The PDF Association seems to be pushing this as the future of the format; 
if this is so, this is an opportunity to bring ConTeXt to much greater prominence.


Indeed context supports tagged pdf already for a while, although only 
acrobat can do something with it. Making it default is not really an 
option as there is overhead involved (a bit more runtime and much larger 
filesize) that makes no sense when proofing documents and in workflows 
for print, but enabling is easy with


\setuptagging[state=start]

Btw, this feature relates to export to XML. Personally I wonder why this 
UA is such a hype, probably because publishers are reluctant to embed 
the document source in the pdf, which make much more sense when 
alternative rendering is needed.


Feel free to add information to the wiki (I have no time for that myself 
now). Probably much that applies to the export also applies to tagging.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Improving Pandoc Support for ConTeXt

2015-10-19 Thread Andrew Dunning
Dear list,

Pandoc, if you have not heard of it before, is a rather brilliant program for 
converting text between different markup languages: it allows, in essence, for 
technology-independent writing. It has been mentioned a few times on this list, 
with Pablo Rodríguez recently developing a set of templates for typesetting its 
XHTML output (at https://github.com/ousia/from-pandoc-to-context). One of its 
aims is to ease the process of producing a high-quality PDF; it has the 
strongest support for LaTeX at the moment, but it seems to me that ConTeXt 
would ultimately provide a more reliable and lightweight solution. The basic 
support is already in place; it only needs to be more thoroughly updated to 
take advantage of MkIV.

I am working on improving Pandoc's generic ConTeXt template, at 
; the 
initial proposal is at , 
which aims to show more of ConTeXt’s potential to the user through making 
variables available that configure its options. I am still new to ConTeXt 
(having used LaTeX for several years), and could not find a recent starter 
document. The example at  is 
from 2006, and clearly does not exhibit the system’s full potential. I would be 
grateful to know of any potential areas for improvement.

If you feel even more inclined to develop the Pandoc support for ConTeXt, its 
writer can be found at 
. 
In my experience, ConTeXt is much easier to use than LaTeX, but it is more 
difficult to get started with initially due to the lack of resources for new 
users; it is my hope that full support for it in Pandoc will provide one way of 
delving into it more deeply.

All best,

Andrew Dunning
PhD Candidate
Centre for Medieval Studies
University of Toronto
http://andrewdunning.ca

___
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] PDF/UA Support

2015-10-19 Thread Andrew Dunning

> On 19 Oct 2015, at 5:33 PM, Hans Hagen  wrote:
> 
> Indeed context supports tagged pdf already for a while, although only acrobat 
> can do something with it. Making it default is not really an option as there 
> is overhead involved (a bit more runtime and much larger filesize) that makes 
> no sense when proofing documents and in workflows for print, but enabling is 
> easy with
> 
> \setuptagging[state=start]

Thank you! Would it also be possible to have something to the effect of 
`\setupbackend[format={pdf/ua:2014}` to set up the appropriate options?


> Btw, this feature relates to export to XML. Personally I wonder why this UA 
> is such a hype, probably because publishers are reluctant to embed the 
> document source in the pdf, which make much more sense when alternative 
> rendering is needed.

I agree that I would prefer to see PDFs given alongside good HTML, but the 
reality is that this will not happen for some time to come, and in the meantime 
PDFs remain inaccessible to anyone with a print disability (and inconvenient 
for the rest of us). If we can improve this situation, it is only right that we 
do so. If we can in the process encourage wider adoption of ConTeXt, even 
better.

All best,

Andrew Dunning

___
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] PDF/UA Support

2015-10-19 Thread Alan BRASLAU
My understanding of PDF/UA is a very valid requirement to make texts
accessible through standard tools, in particular but not limited to
users having visual deficiencies, for example. This is the reason, not
hype, behind the US government pushing this standard.

Alternative rendering (via web browsers, for example) will remain
inferior for most uses as it will not benefit from much of what the TeX
engine can produce, so this cannot really be the motivation.

For reasons of Universal Accessibility, it would be a good idea for
ConTeXt to indeed activate tagging by default. The argument of runtime
and filesize (when proofing and in automatic workflows) is somewhat
weak for one can ALWAYS deactivate this tagging for such cases. May I
suggest that Hans reconsider his stand on this issue for the sake of
promotion of ConTeXt as a very advanced typesetting tool.

Alan


On Mon, 19 Oct 2015 22:35:46 -0400
Andrew Dunning  wrote:

> > On 19 Oct 2015, at 5:33 PM, Hans Hagen  wrote:
> > 
> > Indeed context supports tagged pdf already for a while, although
> > only acrobat can do something with it. Making it default is not
> > really an option as there is overhead involved (a bit more runtime
> > and much larger filesize) that makes no sense when proofing
> > documents and in workflows for print, but enabling is easy with
> > 
> > \setuptagging[state=start]  
> 
> Thank you! Would it also be possible to have something to the effect
> of `\setupbackend[format={pdf/ua:2014}` to set up the appropriate
> options?
> 
> 
> > Btw, this feature relates to export to XML. Personally I wonder why
> > this UA is such a hype, probably because publishers are reluctant
> > to embed the document source in the pdf, which make much more sense
> > when alternative rendering is needed.  
> 
> I agree that I would prefer to see PDFs given alongside good HTML,
> but the reality is that this will not happen for some time to come,
> and in the meantime PDFs remain inaccessible to anyone with a print
> disability (and inconvenient for the rest of us). If we can improve
> this situation, it is only right that we do so. If we can in the
> process encourage wider adoption of ConTeXt, even better.
> 
> All best,
> 
> Andrew Dunning
___
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
___