[NTG-context] \startcomment...\stopcomment with XML processing

2017-06-24 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\startbuffer[demo]

1
2
3
4
5

\stopbuffer

\startxmlsetups xml:initialize
 \xmlsetsetup{#1}{doc}{xml:doc}
\xmlsetsetup{\xmldocument}
{pre[contains(@class,'copy\letterpercent-code')]/code}
{xml:copy:code}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

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

\startxmlsetups xml:copy:code
%~ \startcomment[location=inmargin, color=yellow]
%~ \xmlpure{#1}
%~ \stopcomment
\comment[location=inmargin, color=yellow]{\xmlpure{#1}}
\stopxmlsetups

\setupinteraction[state=start]

\starttext
 \xmlprocessbuffer{main}{demo}{}
 \startcomment
1
2
3
4
5
\stopcomment
\stoptext

I don’t know why I cannot get \startcomment...\stopcomment with
\xmlpure{#1}.

This is the only way I have to get lines and spaces in comments.

Which is the right way to do it?

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] full expansion in widgets

2017-06-24 Thread Pablo Rodriguez
On 06/22/2017 11:13 PM, Henri Menke wrote:
> On Thu, 2017-06-22 at 20:03 +0200, Pablo Rodriguez wrote:
>> [...]
>> Would it be possible to have full expansion in PDF widgets? (I mean, the
>> attachment fields and annotation. and the fill-in text field.)
> 
> Full expansion doesn't help you here, because \input is protected
> (i.e. not expandable).  Either use \normalinput or do
> \expandafter\relax\input knuth  (this however leaves a literal \relax
> in PDF field).

Hi Henri,

many thanks for your reply.

Using \normalinput also requires complete expansion. Otherwise, I get
\TeX \ instead TEX.

Pablo
-- 
http://www.ousia.tk
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Adjusting column width dynamically to get rid of orphans and widows

2017-06-24 Thread Thomas Widmann
On 24 June 2017 at 01:19, Henri Menke  wrote:
>
> How about putting every entry into a box, making it unbreakable?  Of course, 
> you get unbalanced
> columns this way, but I think keeping the entries together is easier for the 
> reader.

Thanks for your suggestion, but I don't think that'd work. Firstly,
it'd require you to figure out whether an entry is longer than three
lines (and thus breakable) before putting it into a box.  Secondly,
unbalanced columns really aren't the done thing in dictionary
publishing.

Lots of published dictionaries are full of orphans and widows because
they're so hard to avoid without a lot of manual intervention, which
is why I'm keen to explore and novel ways to avoid them.

However, all ways I can think of requires typesetting the entries in
the last column multiple times, i.e.:

repeat
  adjust parameters (column width, looseness, ...)
  typeset column
until the column doesn't generate orphan/widow

Is this possible with ConTeXt/LuaTeX?

Thomas
-- 
Thomas Widmann
Director
Complexli Limited
+44 789 444 3009
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Initials and short paragraph

2017-06-24 Thread Martin Oppegaard
Thank you, I think I can make something with this.

On Tue, Jun 20, 2017 at 9:45 PM, Pablo Rodriguez  wrote:

> On 06/20/2017 10:15 PM, Martin Oppegaard wrote:
> > Thanks for the suggestions! Is there a way to get the amount of
> > horizontal space the initial takes so that can be put in manually in
> > front of the next paragraph?
>
> Martin,
>
> how about making the initial transparent?
>
> \definecolor[transparentblue][t=0, a=1]
> \setupwhitespace[medium]
> \starttext
> \placeinitial
> Knuth writes:
>
> \placeinitial \starteffect[hidden]K\stopeffect\input knuth
> \setupinitial[color=transparentblue]
>
> \placeinitial K\input knuth
> \stoptext
>
> The sample contains two methods.
>
> Just in case it helps,
>
> Pablo
> --
> http://www.ousia.tk
> 
> ___
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/
> listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> 
> ___
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___