[NTG-context] issue with \definebreakpoint

2015-03-22 Thread Pablo Rodriguez
Dear list,

for a document I’m writing, I have the following sample:

\setuppapersize[A6]
\definebreakpoint [compound] [–]% en-dash
\setbreakpoints[compound]
\starttext
I hyphenate pseudo–classes and pseudo–elements in a justified paragraph.

\startalign[middle]
But not when centered: pseudo–classes and pseudo–elements.
\stopalign
\stoptext

I need to be able to hyphenate after the en-dash when the paragraph is
justified.

The problem is that I need to deactivate this breaking point when the
aligment isn’t justified (or at least when it is centered).

Is there a way to achieve 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] issue with \definebreakpoint

2015-03-22 Thread Wolfgang Schuster

 Am 22.03.2015 um 13:33 schrieb Pablo Rodriguez oi...@gmx.es:
 
 Dear list,
 
 for a document I’m writing, I have the following sample:
 
 \setuppapersize[A6]
 \definebreakpoint [compound] [–]% en-dash
 \setbreakpoints[compound]
 \starttext
 I hyphenate pseudo–classes and pseudo–elements in a justified paragraph.
 
 \startalign[middle]
 But not when centered: pseudo–classes and pseudo–elements.
 \stopalign
 \stoptext
 
 I need to be able to hyphenate after the en-dash when the paragraph is
 justified.
 
 The problem is that I need to deactivate this breaking point when the
 aligment isn’t justified (or at least when it is centered).
 
 Is there a way to achieve it?

1. Disable breakpoints with the \resetbreakpoints command.

2. Allow ConTeXt wider margins for entered text with the “broad” keyword for 
\setupalign.

\setuppapersize[A6]

\definebreakpoint [compound] [–]% en-dash
\setbreakpoints[compound]

\starttext

I hyphenate pseudo–classes and pseudo–elements in a justified paragraph.

\blank

\startalign[middle]
But not when centered: pseudo–classes and pseudo–elements.
\stopalign

\blank

\startalign[middle]\resetbreakpoints
But not when centered: pseudo–classes and pseudo–elements.
\stopalign

\blank

\startalign[middle,broad]
But not when centered: pseudo–classes and pseudo–elements.
\stopalign

\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] problem with interaction and TOC

2015-03-22 Thread Pablo Rodriguez
On 03/22/2015 12:46 PM, Wolfgang Schuster wrote:
 Am 22.03.2015 um 11:53 schrieb Pablo Rodriguez:
 [...]
\startbuffer[demo]
doc
h1span label=contextConTeXt/a/h1
span label=contextConTeXt/a
span label=texTeX/a
span label=latexLaTeX/a
/doc
\stopbuffer
 
 You’re mixing tags, each span ends with /a.

Many thanks for your reply, Wolfgang.

You’re totally right. I wonder how ConTeXt compiled that.


\startxmlsetups xml:logo
\uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii
\ifx\ascii\empty\else\getvalue{\ascii}\fi
\stopxmlsetups

\startxmlsetups xml:context
\ConTeXt
\stopxmlsetups
 [...]
 Is there a fix for xml:logo or is xml:context the proper fix?
 
 You need a expandable version for your logo tags.
 
\startxmlsetups xml:logo
\getvalue{\utfupper{\xmlatt{#1}{label}}}
\stopxmlsetups
 
 You can also modify this and provide a text which appears when you try
 to show a logo which isn’t defined.
 
\startxmlsetups xml:logo
\executeifdefined{\utfupper{\xmlatt{#1}{label}}}{{\tttf ???}}
\stopxmlsetups

This is exactly what I needed.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] packed lists in XML

2015-03-22 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\startbuffer[demo]
doc
pstandard list:/p
ul
li
pitem from loose list/p
/li
li
pitem from loose list/p
/li
/ul
ppacked list:/p
ul
liitem from tight list/li
liitem from tight list/li
/ul
/doc
\stopbuffer

\startxmlsetups xml:initialize
\xmlsetsetup{#1}{ul|li|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:ul
\startitemize
\xmlflush{#1}
\stopitemize
\stopxmlsetups

\startxmlsetups xml:ul:packed
\startitemize[packed]
\xmlflush{#1}
\stopitemize
\stopxmlsetups

\startxmlsetups xml:li
\startitem
\xmlflush{#1}
\stopitem
\stopxmlsetups

\startxmlsetups xml:p
\xmldoifnotselfempty {#1} {
\dontleavehmode
\ignorespaces
\xmlflush{#1}
\removeunwantedspaces
}
\par
\stopxmlsetups

\starttext
 \xmlprocessbuffer{main}{demo}{}
\stoptext

Standard lists are defined in XML code with ul/li/p and packed lists
remove the final /p from the path.

How can I associate the each XML list to its right ConTeXt code?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] problem with interaction and TOC

2015-03-22 Thread Wolfgang Schuster

 Am 22.03.2015 um 11:53 schrieb Pablo Rodriguez oi...@gmx.es:
 
 On 03/22/2015 12:27 AM, Hans Hagen wrote:
 On 3/21/2015 10:49 PM, Pablo Rodriguez wrote:
 Dear list,
 
 I have the following sample:
 
 \setupinteraction[state=start]
 \starttext
 \placelist[chapter]
 %~ \uppercasestring{context}\to\ascii
 %~ \chapter{\getvalue{\ascii}}
 \chapter{ConTeXt}
 \stoptext
 
 ConTeXt complains about an error in the first line.
 
 What am I doing wrong? (Sorry, but I wanted to test the commented lines,
 but I don’t know why the simplified example doesn’t work.)
 
 \uppercasestring{context}\to\ascii
 \chapter{\meaning\ascii}  % \getvalue{\ascii}}
 \chapter{\WORD{ConTeXt}}
 
 so, \ascii is made undefined at some time
 
 Many thanks for your reply, Hans.
 
 I’m afraid that my ignorance prevents me for understanding your reply.
 
 What I was trying to solve was this:
 
\startbuffer[demo]
doc
h1span label=contextConTeXt/a/h1
span label=contextConTeXt/a
span label=texTeX/a
span label=latexLaTeX/a
/doc
\stopbuffer

You’re mixing tags, each span ends with /a.

\setupinteraction[state=start]
 
\startxmlsetups xml:initialize
\xmlsetsetup{#1}{h1|span}{xml:*}
\xmlsetsetup{#1}{span[@label]}{xml:logo}
\xmlsetsetup{#1}{span[@label='context']}{xml:context}
\stopxmlsetups
 
\xmlregistersetup{xml:initialize}
 
\startxmlsetups xml:h1
\placecontent[criterium=all]
\chapter{\xmlflush{#1}}
\stopxmlsetups
 
\startxmlsetups xml:logo
\uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii
\ifx\ascii\empty\else\getvalue{\ascii}\fi
\stopxmlsetups
 
\startxmlsetups xml:context
\ConTeXt
\stopxmlsetups
 
\starttext
 \xmlprocessbuffer{main}{demo}{}
\stoptext
 
 xml:logo doesn’t work when it has to be parsed in a heading.
 
 Is there a fix for xml:logo or is xml:context the proper fix?

You need a expandable version for your logo tags.

   \startxmlsetups xml:logo
   \getvalue{\utfupper{\xmlatt{#1}{label}}}
   \stopxmlsetups

You can also modify this and provide a text which appears when you try to show 
a logo which isn’t defined.

   \startxmlsetups xml:logo
   \executeifdefined{\utfupper{\xmlatt{#1}{label}}}{{\tttf ???}}
   \stopxmlsetups

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] setting columns in a text frame.

2015-03-22 Thread John Culleton
I am attempting to emulate a layout of a
customer's book that was set in InDesign.
I have columns inside a \textframe inside an
\intermezzo. I can't get the columns to break.
I get one long column and the seocnd column is
blank.
here is my code:
---
 \setupframed[framecorner=round, frameradius=1em,
background=screen, backgroundscreen=0.70,
backgroundcorner=round, backgroundradius=1em,
corner=round, radius=1em] \starttext
\placeintermezzo[center,none]{}
\starttext
\startframedtext[] [width=\hsize]
\centerline{\ss\tfb  Interest in Green, Organic,
and Local Foods Is Exploding}
\definecolumns[example][n=2]
\startcolumns[example] Organic foods, locally
sourced foods, and sustainable living or green
enterprises have become part of our mainstream
lifestyles. Organic foods are produced without
the use of conventional pesticides, artificial
fertilizers, human waste, or sewage sludge and
are processed without ionizing radiation or food
additives. There is a growing belief that eating
\column organic is better for our bodies and
better for the planet. Green food producers and
processors are becoming increasingly
environmentally friendly. More importantly, data
suggest that these markets have exceeded 60
percent in compound annual growth. This suggests
a significant demand that specialty food
entrepreneurs can meet. \stopcolumns
\stopframedtext \stoptext

Is this combination of features a bridge too far?

-- 
John Culleton
Wexford Press
Free list of books for self-publishers:
http://wexfordpress.net/shortlist.html
Updated PDF e-book: Create Book Covers with
Scribus 1.4.5 coming soon at
http://www.booklocker.com/!
___
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 interaction and TOC

2015-03-22 Thread Pablo Rodriguez
On 03/22/2015 12:27 AM, Hans Hagen wrote:
 On 3/21/2015 10:49 PM, Pablo Rodriguez wrote:
 Dear list,

 I have the following sample:

  \setupinteraction[state=start]
  \starttext
  \placelist[chapter]
  %~ \uppercasestring{context}\to\ascii
  %~ \chapter{\getvalue{\ascii}}
  \chapter{ConTeXt}
  \stoptext

 ConTeXt complains about an error in the first line.

 What am I doing wrong? (Sorry, but I wanted to test the commented lines,
 but I don’t know why the simplified example doesn’t work.)
 
 \uppercasestring{context}\to\ascii
 \chapter{\meaning\ascii}  % \getvalue{\ascii}}
 \chapter{\WORD{ConTeXt}}
 
 so, \ascii is made undefined at some time

Many thanks for your reply, Hans.

I’m afraid that my ignorance prevents me for understanding your reply.

What I was trying to solve was this:

\startbuffer[demo]
doc
h1span label=contextConTeXt/a/h1
span label=contextConTeXt/a
span label=texTeX/a
span label=latexLaTeX/a
/doc
\stopbuffer

\setupinteraction[state=start]

\startxmlsetups xml:initialize
\xmlsetsetup{#1}{h1|span}{xml:*}
\xmlsetsetup{#1}{span[@label]}{xml:logo}
\xmlsetsetup{#1}{span[@label='context']}{xml:context}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:h1
\placecontent[criterium=all]
\chapter{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:logo
\uppercasestring\xmlatt{#1}{label}\xmlatt{#1}{name}\to\ascii
\ifx\ascii\empty\else\getvalue{\ascii}\fi
\stopxmlsetups

\startxmlsetups xml:context
\ConTeXt
\stopxmlsetups

\starttext
 \xmlprocessbuffer{main}{demo}{}
\stoptext

xml:logo doesn’t work when it has to be parsed in a heading.

Is there a fix for xml:logo or is xml:context the proper fix?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] issue with \definebreakpoint

2015-03-22 Thread Pablo Rodriguez
On 03/22/2015 01:47 PM, Wolfgang Schuster wrote:
 Am 22.03.2015 um 13:33 schrieb Pablo Rodriguez:
 [...]
 The problem is that I need to deactivate this breaking point when the
 aligment isn’t justified (or at least when it is centered).

 Is there a way to achieve it?
 
 1. Disable breakpoints with the \resetbreakpoints command.
 
 2. Allow ConTeXt wider margins for entered text with the “broad” keyword for 
 \setupalign.

Many thanks for your reply, Wolfgang.

\resetbreakpoints is what I needed in my text.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Alignment on the baseline in a itemize environment with \dfrac{}{}

2015-03-22 Thread Wolfgang Schuster

 Am 22.03.2015 um 13:10 schrieb Fabrice Couvreur fabrice1.couvr...@gmail.com:
 
 The alignment of the second item on the baseline is not correct if I use the 
 command \dfrac{}{}.
 How to solve this problem without using the command \framed ?
 Best regards,
 Fabrice
 
 \starttext
 \startitemize[columns,A,joinedup,three][stopper={)},style=bold]
 \item  $f^{\prime}(x) = \dfrac{- 1}{(x + 1)^2}$
 \item  $f^{\prime}(x) = 1$
 \item  $f^{\prime}(x) = \dfrac{1}{x + 1}$
 \stopitemize
 \stoptext

1. You change your formulas.

\starttext
\startitemize[columns,A,joinedup,three][stopper={)},style=bold,grid=line]
\item  $f^{\prime}(x) = - 1 / (x + 1)^2$
\item  $f^{\prime}(x) = 1$
\item  $f^{\prime}(x) = 1 / (x + 1)$
\stopitemize
\stoptext


2. You enable grid snapping for the columns in the itemize environment with the 
grid key.

\starttext
\startitemize[columns,A,joinedup,three][stopper={)},style=bold,grid=line]
\item  $f^{\prime}(x) = \dfrac{- 1}{(x + 1)^2}$
\item  $f^{\prime}(x) = 1$
\item  $f^{\prime}(x) = \dfrac{1}{x + 1}$
\stopitemize
\stoptext


3. You increase the line height for the columns in the itemize environment.

\setupmixedcolumns[itemgroupcolumns][before={\setupinterlinespace[big]}]

\starttext
\startitemize[columns,A,joinedup,three][stopper={)},style=bold]
\item  $f^{\prime}(x) = \dfrac{- 1}{(x + 1)^2}$
\item  $f^{\prime}(x) = 1$
\item  $f^{\prime}(x) = \dfrac{1}{x + 1}$
\stopitemize
\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] about installation instructions in the wiki

2015-03-22 Thread Pablo Rodriguez
Dear list,

composing an explanation about ConTeXt, I came to the name of the
distrubtion. I think it is “ConTeXt Suite” (I would also capitalize the
first letter from the second word).

If I’m not wrong, the wiki article that offers installation instructions
has the title “ConTeXt Standalone”.

I wonder whether it would be better to move “ConTeXt Standalone” to
“ConTeXt Suite” (and also subpages) and redirect all pages to the new
destinations.

Otherwise, we can’t prevent that people call the “ConTeXt Suite”
“ConTeXt Standalone” instead. (I know it isn’t a question of forcing
anyone, but of diseminating a newer name :-).)

Best,


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] setting columns in a text frame.

2015-03-22 Thread Wolfgang Schuster

 Am 22.03.2015 um 15:34 schrieb John Culleton j...@wexfordpress.com:
 
 I am attempting to emulate a layout of a
 customer's book that was set in InDesign.
 I have columns inside a \textframe inside an
 \intermezzo. I can't get the columns to break.
 I get one long column and the seocnd column is
 blank.
 here is my code:
 ---
 \setupframed[framecorner=round, frameradius=1em,
 background=screen, backgroundscreen=0.70,
 backgroundcorner=round, backgroundradius=1em,
 corner=round, radius=1em] \starttext
 \placeintermezzo[center,none]{}
 \starttext
 \startframedtext[] [width=\hsize]
 \centerline{\ss\tfb  Interest in Green, Organic,
 and Local Foods Is Exploding}
 \definecolumns[example][n=2]
 \startcolumns[example] Organic foods, locally
 sourced foods, and sustainable living or green
 enterprises have become part of our mainstream
 lifestyles. Organic foods are produced without
 the use of conventional pesticides, artificial
 fertilizers, human waste, or sewage sludge and
 are processed without ionizing radiation or food
 additives. There is a growing belief that eating
 \column organic is better for our bodies and
 better for the planet. Green food producers and
 processors are becoming increasingly
 environmentally friendly. More importantly, data
 suggest that these markets have exceeded 60
 percent in compound annual growth. This suggests
 a significant demand that specialty food
 entrepreneurs can meet. \stopcolumns
 \stopframedtext \stoptext
 
 Is this combination of features a bridge too far?

\starttext

\startframedtext[width=max]
\startmixedcolumns[boxedcolumns]
\input knuth
\stopmixedcolumns
\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] hyphen in class (from XML)

2015-03-22 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\startbuffer[demo]
span class=tex-logoTeX/span
\stopbuffer

\setupinteraction[state=start]

\startxmlsetups xml:initialize
\xmlsetsetup{#1}{span[contains(@class,'tex-logo')]}{xml:tex:logo}
\stopxmlsetups

\xmlregistersetup{xml:initialize}

\startxmlsetups xml:tex:logo
\TeX
\stopxmlsetups

\stopxmlsetups

\starttext
 \xmlprocessbuffer{main}{demo}{}
\stoptext

Unless I remove the hyphen from the class and from the setups (or
replace both hyphens with an underscore hyphen), I won’t get the \TeX logo.

Have I hit a bug or is it a feature?

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Alignment on the baseline in a itemize environment with \dfrac{}{}

2015-03-22 Thread Fabrice Couvreur
The alignment of the second item on the baseline is not correct if I use the
command \dfrac{}{}.
How to solve this problem without using the command \framed ?
Best regards,
Fabrice

\starttext
\startitemize[columns,A,joinedup,three][stopper={)},style=bold]
\item  $f^{\prime}(x) = \dfrac{- 1}{(x + 1)^2}$
\item  $f^{\prime}(x) = 1$
\item  $f^{\prime}(x) = \dfrac{1}{x + 1}$
\stopitemize
\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] mkiv versus mkii: whitespace issues

2015-03-22 Thread Wolfgang Schuster

 Am 21.03.2015 um 19:49 schrieb Gerben Wierda gerben.wie...@rna.nl:
 
 On 20 Mar 2015, at 18:33, Wolfgang Schuster schuster.wolfg...@gmail.com 
 wrote:
 
 
 Am 20.03.2015 um 14:43 schrieb Gerben Wierda gerben.wie...@rna.nl:
 
 Sorry to ask again, but is there no solution?
 
 Can you send a *working* minimal example!
 
 I don’t know how. It happens with my project. I can’t publish my entire 
 project’s source code as it is for a book that is sold commercially.
 
 I’ll look into trying to make a minimal example. But so far I haven’t been 
 able to.

The initial is the problem but you can fix this when you replace \GotoPar with 
a different mechanism.

 begin example
\showgrid

\definelist[chaptertext][style=\itx]

\define[1]\ChapterAbstract{\doflushatpar{\writetolist[chaptertext]{}{#1}}}

\starttext

\title{\headtext{content}}

\placelist[chapter,chaptertext]

\chapter{Knuth}

\ChapterAbstract{\input ward }

\placeinitial\input knuth

\stoptext
 end example

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
___