Re: [NTG-context] Hyphenation, OTF font and tagging

2015-11-09 Thread Rik Kabel

On 2015-11-09 07:34, Thomas A. Schmitz wrote:

On 11/09/2015 08:42 AM, Christoph Reller wrote:

MWE:

\setuptagging[state=start] %<- correct when commenting this line
\starttypescript[sans][myfont]
\definefontsynonym[Sans][file:MyriadPro-Regular]
\stoptypescript
\definetypeface[Body][ss][sans][myfont]
\setupbodyfont[Body,ss,10pt]
\starttext
\input knuth
\input tufte
\input reich
\input linden
\input darwin
\stoptext

Any feedback is welcome. @Hans: I can provide the Myriad font if this 
helps.


It's not specific to Myriad, I get the same problem with other fonts 
as well, such as Adobe Garamond or Optima (but not Minion Pro or 
Sabon). It's a bug with the new font loading mechanism; if you add


\usemodule [oldotf]

to your document, the problem goes away. Hans will probably write 
"fixed in next beta."


Thomas
And this appears to be the same issue I reported (on 20151022) with 
tagging and ebgaramond, so no need for an Adobe-licensed font for testing.


--
Rik
___
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] New btx code problem with quote protrusion, redux

2015-11-02 Thread Rik Kabel

On 2015-11-02 04:05, Hans Hagen wrote:

On 11/2/2015 9:53 AM, Hans Hagen wrote:


\definefontfeature [default][protrusion=quality]


btw that is bad, should be:

\definefontfeature [default][default][protrusion=quality]

as adding protrusion out of some quality argument doesn't go well with 
removing kerns and ligatures


Hans

Yes, definitely. Thank you for pointing that out. And thank you, in 
advance, for the fix.


--
Rik
___
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] More ebgaramond issues (newotf, finding fonts and kerning)

2015-11-02 Thread Rik Kabel

On 2015-11-02 07:19, Hans Hagen wrote:


i have a fix in the next beta but keep in mind that eb is a moving 
target and that each version of the font is different


Hans


I understand that eb is a moving target. Except for the recognition of 
the 12italic, however, this looked more like a newotf issue, and that is 
why I thought it important to document.


Thank you for the upcoming fix.

--
Rik

___
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] More ebgaramond issues (newotf, finding fonts and kerning)

2015-11-01 Thread Rik Kabel

Three problems with ebgaramond.

 * With the new otf loading facility, kerning is not done.
 * With the new otf loading facility, the regular 8pt face is not
   found. If one is changing font size via \tfxx, the font size is not
   changed. If one is changing font size via \switchbodyfont[8pt],
   Latin Modern 8pt is substituted.
 * With the oldotf module loaded kerning is as expected for the 12pt
   regular face, the 8pt regular face, and the 8pt italic face. The
   12pt italic face, however, is not kerned.

   %\usemodule[oldotf]% uncomment to see previous otf handling
   \showfontkerns
   \setupbodyfont[ebgaramond]
   \def\Test{Vowel Tavern Tomato {\it Vowel Tavern Tomato}\par}
   \starttext
   \Test
   {\tfxx
   \Test}
   \switchtobodyfont[8pt]
   \Test
   \stoptext

This was tested on W10/64 using ConTeXt  ver: 2015.10.09 21:28 MKIV 
beta  fmt: 2015.11.1  int: english/english, with EBGaramond files 
version 0.016 (April 2014) installed in C:\Windows\Fonts. Same results 
with luajittex (This is LuajitTeX, Version beta-0.80.0 (TeX Live 
2015/W32TeX) (rev 5238)) and luatex (This is LuaTeX, Version beta-0.81.1 
(TeX Live 2015/W32TeX) (rev 5442)).


Is this a problem with my font installation, or is it a general problem?

--
Rik

___
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] Regression with label inright placement

2015-10-26 Thread Rik Kabel

On 2015-10-26 07:03, Wolfgang Schuster wrote:

\showframe

\starttext

\startnarrower
\inright[scope=local]{Right}\input ward
\stopnarrower

\blank

\startnarrower
\inright{Right}\input ward
\stopnarrower

\stoptext

Okay, unrelated to the label mechanism.

However, for explicitly placed margin data, as a workaround I can set 
default placement with \setupinmargin[right][scope=global]; with 
\setuplabel  I find no such option, so a fix is still needed.


--
Rik
___
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] Regression with label inright placement

2015-10-25 Thread Rik Kabel
The following code, a slight addition to test suite 
descriptions/labels-003.tex, when using ConTeXt from 20150904  and 
earlier works properly. Between that release and 20151004 something 
changed, and it fails with the labels shifted to reflect the temporarily 
narrowed text.


   \definelabel[MyLabel][way=bytext,text=OEPS]

   \starttext
\setuplabel[MyLabel][alternative=intext]
\MyLabel[labelname1] This is some text after \in[labelname1].
\blank
\MyLabel[labelname2] This is some text after \in[labelname2].
\blank
\setuplabel[MyLabel][alternative=inleft]
\MyLabel[labelname1] This is some text after \in[labelname1].
\blank
\MyLabel[labelname2] This is some text after \in[labelname2].
\blank
\setuplabel[MyLabel][alternative=inright]
\MyLabel[labelname1] This is some text after \in[labelname1].
\blank
\MyLabel[labelname2] This is some text after \in[labelname2].
\blank
\startnarrower
\MyLabel[labelname1] This is some text after \in[labelname1].
\blank
\MyLabel[labelname2] This is some text after \in[labelname2].
\stopnarrower
   \stoptext

Oeps indeed!
--
Rik
___
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] Obtaining features from EBGaramond font in ConTeXt

2015-10-23 Thread Rik Kabel

On 2015-10-23 15:19, josephcan...@gmail.com wrote:


Is there any place I could find docs on \definecharacterspacing 
command please ? Could not find any occurrence on the Wiki.


The best description I have seen of it is in Wolfgang’s message on the 
mailing list at 
http://www.mail-archive.com/ntg-context%40ntg.nl/msg77942.html (or 
http://www.ntg.nl/pipermail/ntg-context/2015/081569.html if you prefer 
pipermail navigation). Basically, define the spacings you want with 
\definecharacterspacing[myspacing][…][…=…,…=…] and put them in play with 
\setcharacterspacing[myspacing]. Do it within a group to have it apply 
only within that group, or apply it globally.


Sorry, no help here for the installation issue.

--
Rik
___
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] Obtaining features from EBGaramond font in ConTeXt

2015-10-23 Thread Rik Kabel

On 2015-10-23 03:44, josephcan...@gmail.com wrote:

Hello all,

Wondered if you could figure out what I did wrong with specifying the 
font.

Asked question on TexExchange.org already, with samples.

http://tex.stackexchange.com/questions/274471/obtaining-features-from-ebgaramond-font-in-context

I use texlive 2015 on Windows 8.1

Many thanks,

Best regards

Joseph Canedo


First, some small changes to your example. Remove the enableregime 
directive; ConTeXt MKIV, which you appear to be using, does not use 
this. It is from ConTeXt MKII. Next, modify the definefontfeature and 
definefontfamily commands as shown. (The default features for the font 
are in the file type-imp-ebgaramond.mkiv.) That should be it to get started.


   \language[fr] % french hyphenation

   
*\definefontfeature[myfeatures][ss02=yes,cv01=yes,cv03=yes,ss05=yes,cv91=yes]*

   
*\definefontfamily[mainfont][serif][EBGaramond][features={default,myfeatures}]**
   *\setupbodyfont[mainfont, 8pt]*
   *
   \starttext

   session
   univers
   Que
   Quelconque
   Joseph
   ¶

   \stoptext


TL15 has problems with EBGaramond. The best you will get is:


With a more recent standalone version, you will get:


If you are setting older texts, you may also want to take advantage of 
ConTeXt’s ability to automatically provide space before large 
punctuation characters using the definecharacterspacing command.


One other note. Character variant 01 (cv01) is a very dull sword. The 
rules for the use of long-ſ are much too complex for it to handle. For a 
good overview of the issues, see Andrew West’s article in the TUGboat at 
https://www.tug.org/TUGboat/tb32-1/tb100west.pdf. In my opinion you are 
better off learning to insert it as needed in the text.


--
Rik
___
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] New btx code problem with quote protrusion, redux

2015-10-23 Thread Rik Kabel

On 2015-10-23 14:40, Rik Kabel wrote:
At Wolfgang’s request, a new thread for this subject. I have cleaned 
up the example from the July 5 posting, but the problems are the same 
as shown there. In July Alan suggested that there might a bug here, 
but nothing has been done to address it since then. Wolfgang suggested 
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg35580.html) that 
method=font is required for proper protrusion handling for quotations.


 1. When \setupdelimitedtext[quotation][method=font] is present /and
//there is //no citation//in a footnote within a startquotation
block and a bibliography is produced/, compilation proceeds normally.
 2. When \setupdelimitedtext[quotation][method=font] is present /and
//there is a citation//in a footnote within a startquotation block
and a bibliography is produced,/ the compilation complains of a
missing right curly. When allowed to continue to completion the
protrusion for the opening quotation marks does not match the
protrusion for similar marks not produced through \startquotation.
Citations in footnotes outside quotation blocks are not a problem.
Without a bibliography (\placelistofpublications)
 3. When \setupdelimitedtext[quotation][method=font] is present, the
[right] option of \startblockquotation is treated as text within
the quotation. This can be resolved by adding “leftmargin=” to the
\setupdelimitedtext[quotation] command (but that complicates
matters when you want other alignments). Similarly, the [left] and
[middle] options are ignored as options and appear as text.
 4. When “method=font” is not present, protrusion for block quotations
(\startblockquotation … \stopblockquotation) is greater than and
not aligned with other protrusion.
 5. When “method=font” is not present, protrusion for non-block
quotations (\quotation{…}) is not done at all.
 6. With the older bibliography system, footnotes in citations in
quotation blocks do not cause a halt in compilation.
 7. With the older bibliography system, item 3 is still a problem,
that is, method=font appears to be inimical to the left, right,
and middle options for \startblockquotation without regard to the
bibliography system in use.

Further testing shows that the failure to compile issue (#1 and #2 
above) is tied to processing @ARTICLE bib entries. The failure occurs in 
and out of footnotes and startquotation blocks. I really was too deep 
into a wrong view of the problem to see that before. That is pretty 
clearly a bug.


The issue with method=font and left, right, middle (#3, #4, #5 above) is 
still problematic. This is not tied to the bibliography system.


--
Rik
___
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] New btx code problem with quote protrusion, redux

2015-10-23 Thread Rik Kabel
At Wolfgang’s request, a new thread for this subject. I have cleaned up 
the example from the July 5 posting, but the problems are the same as 
shown there. In July Alan suggested that there might a bug here, but 
nothing has been done to address it since then. Wolfgang suggested 
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg35580.html) that 
method=font is required for proper protrusion handling for quotations.


1. When \setupdelimitedtext[quotation][method=font] is present /and
   //there is //no citation//in a footnote within a startquotation
   block and a bibliography is produced/, compilation proceeds normally.
2. When \setupdelimitedtext[quotation][method=font] is present /and
   //there is a citation//in a footnote within a startquotation block
   and a bibliography is produced,/ the compilation complains of a
   missing right curly. When allowed to continue to completion the
   protrusion for the opening quotation marks does not match the
   protrusion for similar marks not produced through \startquotation.
   Citations in footnotes outside quotation blocks are not a problem.
   Without a bibliography (\placelistofpublications)
3. When \setupdelimitedtext[quotation][method=font] is present, the
   [right] option of \startblockquotation is treated as text within the
   quotation. This can be resolved by adding “leftmargin=” to the
   \setupdelimitedtext[quotation] command (but that complicates matters
   when you want other alignments). Similarly, the [left] and [middle]
   options are ignored as options and appear as text.
4. When “method=font” is not present, protrusion for block quotations
   (\startblockquotation … \stopblockquotation) is greater than and not
   aligned with other protrusion.
5. When “method=font” is not present, protrusion for non-block
   quotations (\quotation{…}) is not done at all.
6. With the older bibliography system, footnotes in citations in
   quotation blocks do not cause a halt in compilation.
7. With the older bibliography system, item 3 is still a problem, that
   is, method=font appears to be inimical to the left, right, and
   middle options for \startblockquotation without regard to the
   bibliography system in use.


\showframe

\definefontfeature [default][protrusion=quality]
\setupalign[hz,hanging]

% The next line should allow \startquotation to protrude quotes properly
\setupdelimitedtext[quotation][method=font]

%==
% For testing with old regime, enable next and disable following
%\setupbibtex[database=sample.bib] % requires sample.bib in current 
directory

%--
% For testing with new regime, disable above and enable following
\definebtxdataset  [sample] % finds and uses distribution sample.bib
\usebtxdataset [sample.bib]
%==

\starttext
\startparagraph
  There is a citation in the footnote to this standard 
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}

\stopparagraph

\startparagraph
\startquotation[right]
  There is a citation in the footnote to this block 
quotation\footnote{This footnote has a citation \cite[hh2010a].}

\stopquotation
\stopparagraph

\startparagraph
\startquotation[right]
  There is no citation in the footnote to this block 
quotation\footnote{This footnote has no citation.}

\stopquotation
\stopparagraph

\startparagraph
  \quotation{There is a citation in the footnote to this non-block 
quotation paragraph\footnote{This footnote has a citation 
\cite[Eijkhout1991].}}

\stopparagraph

\startparagraph
  \quotation{There is no citation in the footnote to this non-block 
quotation paragraph\footnote{This footnote has no citation.}}

\stopparagraph

\startparagraph
  “There is a citation in the footnote to this standard 
paragraph\footnote{This footnote has a citation \cite[Eijkhout1991].}”

\stopparagraph

\startparagraph
  “There is no citation in the footnote to this standard 
paragraph\footnote{This footnote has no citation.}”

\stopparagraph

\blank[big]

%==
% For testing with old regime, enable next and disable following
%\placepublications
%--
% For testing with new regime, disable above and enable following
\placelistofpublications
%==

\stoptext

--
Rik
___
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] New btx code problem with quote protrusion

2015-10-22 Thread Rik Kabel

On 2015-07-05 19:21, Alan BRASLAU wrote:
On Sun, 5 Jul 2015 18:52:40 -0400  > Rik Kabel <cont...@rik.users.panix.com> wrote: > >> Is this a bug, 
or simply something not yet ready with the new regime, >> or am I doing 
something wrong? > > This looks like a bug/interference in a situation 
that was not tested... > > 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 > 
___ 
> This is still a problem. Is it a bug that will be addressed, or is 
the fix coming with a new release of the new bibliography system, or is 
it something that has to be worked around?


I also note that the method=font option for \setupdelimited text appears 
to be incompatible with the left option for \startquotation. The 
document compiles, but [left] appears as part of the text and is not 
acted on (and similarly for right and middle).


--
Ri
___
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 setuptagging and ebgaramond font, also hsize question

2015-10-22 Thread Rik Kabel
With the following example, there are no hyphens where words are broken 
across lines. When the \setuptagging line is removed, or the state 
changed to stop, hyphens appear as expected. So far I have only seen 
this with the ebgaramond font using a current standalone beta (ConTeXt  
ver: 2015.10.09 21:28 MKIV beta  fmt: 2015.10.21) running on Windows 10 
Pro x64.


With TL15 ConTeXt ver: 2015.05.18 12:26 MKIV current fmt: 2015.10.10 
int: english/english hyphens are printed with or without 
\setuptagging[state=start].


I also notice that the \hsize directive is ignored after the 4th 
iteration of zapf. That is, the first four paragraphs are constrained to 
the specifice hsize, and the remaining iterations are set at the full 
textwidth. This occurs with all fonts and without regard to the tagging 
setup. That is, remove the first two lines of the example and that 
problem persists.


   \setuptagging[state=start]
   \setupbodyfont[ebgaramond]
   \starttext
   \hsize7cm
   \input zapf \par
   \input zapf \par
   \input zapf \par
   \input zapf \par
   \input zapf \par
   \input zapf \par
   \stoptext

What am I doing wrong?
--
Rik
___
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] Regression with \doboundtext in \writetolist

2015-10-11 Thread Rik Kabel

On 2015-10-11 06:11, Hans Hagen wrote:

On 10/11/2015 5:21 AM, Rik Kabel wrote:

The following example works with older versions of ConTeXt, such as the
version from 20150325 in my repository. It fails with TL15 and later,
including the current standalone beta.

% macros=mkvi
\setwidthof {99}\to\IDWidth\relax
\def\STWidth{\dimexpr\textwidth-\IDWidth+1cm}
\definelist[OList]
\setuplist
[OList][criterium=all,alternative=c,pagecommand=\gobbleoneargument]

\starttexdefinition OLister #ID#String
{\writetolist[OList]{}{\hbox{\simplealignedbox{\IDWidth}{left}{#ID\quad}
{\doboundtext{#String}{\STWidth}{…}
\stoptexdefinition

\starttext
\OLister1{Some list testing text xxx xxx xxx xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
\OLister2{Yet another list testing text xxx xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
\OLister3{A list testing text xxx xxx xxx xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
\OLister4{Different list testing text xxx xxx xxx xxx xxx xxx xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
\subject{List half width}
\startcolumns[n=2]
\placelist[OList]
\stopcolumns
\stoptext

With the 20150325 ConTeXt, there are .tuc file entries like:

["second"]="\\hbox {\\simplealignedbox {\\IDWidth
}{left}{2\\quad }{\\doboundtext {Yet another list testing text xxx
xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
xxx}{\\STWidth }{…}}}",

but with more recent versions, the corresponding entry is:

["second"]="\\hbox {\\simplealignedbox {12.6pt}{left}{2\\quad
}{\\hbox {\\setbox \\scratchbox \\hbox {Yet another list testing
text xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
xxx xxx}\\scratchdimen \\dimexpr \\textwidth -12.6pt+1cm\\relax
\\box \\scratchbox }}}",



\unexpanded\def\STWidth{\dimexpr\textwidth-\IDWidth+1cm}

Yes, expansion needs to be delayed to get the current dimension when the 
list is placed. My error—thank you for the correction. But the 
regression is not resolved. The .tuc file now contains:


   ["second"]="\\hbox {\\simplealignedbox {12.6pt}{left}{2\\quad
   }{\\hbox {\\setbox \\scratchbox \\hbox {Yet another list testing
   text xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
   xxx xxx}\\scratchdimen \\STWidth \\relax \\box \\scratchbox }}}",

Still no mention of dobounded text is carried into the list.
--
Rik
___
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] Regression with \doboundtext in \writetolist

2015-10-10 Thread Rik Kabel
The following example works with older versions of ConTeXt, such as the 
version from 20150325 in my repository. It fails with TL15 and later, 
including the current standalone beta.


   % macros=mkvi
   \setwidthof {99}\to\IDWidth\relax
   \def\STWidth{\dimexpr\textwidth-\IDWidth+1cm}
   \definelist[OList]
   \setuplist
   [OList][criterium=all,alternative=c,pagecommand=\gobbleoneargument]

   \starttexdefinition OLister #ID#String
   {\writetolist[OList]{}{\hbox{\simplealignedbox{\IDWidth}{left}{#ID\quad}
   {\doboundtext{#String}{\STWidth}{…}
   \stoptexdefinition

   \starttext
   \OLister1{Some list testing text xxx xxx xxx xxx xxx xxx xxx xxx xxx
   xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
   \OLister2{Yet another list testing text xxx xxx xxx xxx xxx xxx xxx
   xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
   \OLister3{A list testing text xxx xxx xxx xxx xxx xxx xxx xxx xxx
   xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
   \OLister4{Different list testing text xxx xxx xxx xxx xxx xxx xxx
   xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx}
   \subject{List half width}
   \startcolumns[n=2]
   \placelist[OList]
   \stopcolumns
   \stoptext

With the 20150325 ConTeXt, there are .tuc file entries like:

   ["second"]="\\hbox {\\simplealignedbox {\\IDWidth
   }{left}{2\\quad }{\\doboundtext {Yet another list testing text xxx
   xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
   xxx}{\\STWidth }{…}}}",

but with more recent versions, the corresponding entry is:

   ["second"]="\\hbox {\\simplealignedbox {12.6pt}{left}{2\\quad
   }{\\hbox {\\setbox \\scratchbox \\hbox {Yet another list testing
   text xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx
   xxx xxx}\\scratchdimen \\dimexpr \\textwidth -12.6pt+1cm\\relax
   \\box \\scratchbox }}}",

--
Rik
___
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] Register sort method for unicode quotes

2015-10-05 Thread Rik Kabel
Is there a sort method that can be specified for register sorts that 
will ignore unicode quote marks (“‘’”) in the same way that primes ("') 
are ignored. This was asked in 2010 
(http://www.mail-archive.com/ntg-context@ntg.nl/msg51348.html) and not 
answered. It is still a problem.


Is there a sort method that can be applied as well to sorted lists to do 
this?


   \definesorting[Sort][Sorts]
   \starttext
   \placelistofSorts[criterium=all]
   \placeindex[n=1,method=default]
   \index{"Hope" is the thing with feathers}
   \index{Hope is the thing with feathers}
   \index{Hop is the thing with feathers}
   \index{“Hope” is the thing with feathers}
   \Sort["Hope" is]{"Hope" is the thing with feathers}
   \Sort[“Hope” is]{“Hope” is the thing with feathers}
   \Sort[Hope is]{Hope is the thing with feathers}
   \Sort[Hop is]{Hop is the thing with feathers}
   \Sort[Dope is]{Dope is the thing with feathers}
   \Sort[Rope is]{Rope is the thing with feathers}
   \stoptext

--
Rik
___
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] Questions on registers, and on processors used with registers

2015-10-04 Thread Rik Kabel

A few questions on registers, and on processors used with registers:

Can processors be used on entries in \setregisterentry? My tests so far 
have not been successful.


Can processors be used on one level of a two-level register 
{\index{Name+Processor->quotation precis}? Again, no success with attempts.


Can something other than page numbers be the indexed item?

I have a book with many quotations, each identified by a number 
(generated by \definelabel). For an index of quotations, it would be 
more useful to point to that quotation number than the page number.


Perhaps the last requirement would be served by building a list with the 
quote number and quotation precis, suppressing the page numbers with 
pagenumber=\gobbleoneargument. But placelist does not seem to behave as 
one would hope. The example in the wiki for setuplist (shown below) does 
not print the numbers (1., 2.) in the first braced argument to writetolist.


   \definelist[Reprints][criterium=all]

   \starttext
  \section{Sec 1}
  \writetolist[Reprints]{1.}{List entry A}
  \subsection{Subsec 1}
  \writebetweenlist[Reprints]{\hrule}
  \writetolist[Reprints]{2.}{List entry B}
  \completelist[Reprints]
   \stoptext

I would prefer a register solution to take advantage of similar 
formatting (column support and such) provided there, since this will 
appear with the book’s standard indices.


--
Rik
___
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] Question on register sort order and default method

2015-09-27 Thread Rik Kabel
Why does the sort order (for registers, lists of synonyms, and so on) 
differ when no method is specified compared to when method=default is 
specified? That is, should not the default method applied when no method 
is specified be that named ‘default’?


   \setupregister[index][n=1]
   \starttext
   \index{Abc, def}\index{Abcdef, ghi}\index{abc, def}\index{abcdef, ghi}

   \subject{Placeindex with no explicit method}
   \placeindex

   \subject{Placeindex with \quote{default} method}
   \placeindex[method=default]

   \stoptext

Where can documentation of the four defined methods (apparently: first, 
last, before, after, and default) be found? Where can documentation on 
the use of method mapping and cases, and unicode ordering, be found, or 
at least something not as cryptic as found on the mailing list 
[1]?


[1] http://www.mail-archive.com/ntg-context%40ntg.nl/msg50454.html
--
Rik
___
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] \emptylines non-functional

2015-09-08 Thread Rik Kabel

On 2015-09-08 17:52, Hans Hagen wrote:

\def\spac_lines_empty[#1]%
  {\endgraf
   \begingroup
   \forgetall
   \scratchcounter\iffirstargument#1\else3\fi\relax
   \ifhmode
  \crlf
  \advance\scratchcounter\minusone
   \fi
   \dorecurse\scratchcounter{\strut\crlf}%
   \endgroup}
Hmmm. I think that the mode test and added \crlf can go, but the 
decrement has to be there, at least if my test with and without \crlf  
in the example tests that properly, so:


\def\spac_lines_empty[#1]%
  {\endgraf
   \begingroup
   \forgetall
   \scratchcounter\iffirstargument#1\else3\fi\relax
   \advance\scratchcounter\minusone
   \dorecurse\scratchcounter{\strut\crlf}%
   \endgroup}

Of course, I did not run through more tests and do not know if anything 
else depends on this that should be tested.

--
Rik
___
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] Strange problem with EBGaramond st ligature and 20150901 beta

2015-09-03 Thread Rik Kabel

Please help with the strangest problem I have come across.

The following document fails (does not complete, hangs) when the 
following conditions hold:


 * ConTeXt  ver: 2015.09.01 11:10 MKIV beta  fmt: 2015.9.3  int:
   english/english
 * \mainlanguage[en] or fr
 * Font EBGaramond otf from EBGaramond-0.016.zip
   https://bitbucket.org/georgd/eb-garamond/downloads
 * Font features clig and hlig
 * Font style \it or \sl
 * Text string (among others) astro istar istra ister istor istro istur

The problem is the same with \usemodule[newotf] and without.

The problem does not occur with:

 *   ConTeXt  ver: 2015.08.30 17:07 MKIV beta  fmt: 2015.8.30 int:
   english/english.
 * \mainlanguage la or de.
 * \tf or \sc or \bd (there is no bold in the font).

The issue appears to be related to the st ligature, but only in 
conjunction with some other letters.


Can somebody else reproduce the problem. For the record, this is running 
on Windows 10 Pro 64-bit.


The problem document:

  \definefontfeature [ff:ebg][default][
   clig=yes,hlig=yes,  %% 1 %%
   ]
  \definefontfamily  [mainface][serif][ebgaramond]
  [features=ff:ebg]
  \setupbodyfont [mainface]
   % \mainlanguage[la]%% 2 %%
  \mainlanguage[fr]%% 3 %%
   \starttext
  \it  %% 4 %%
   % \tf  %% 5 %%
  astro%% 6 %%
   % aStro%% 7 %%
   % asTor%% 8 %%
   \stoptext


--
Rik
___
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: Paragraph formatting on new page after placefigure

2015-08-25 Thread Rik Kabel

On 2015-08-25 03:41, Andreas Becker wrote:

ConTeXt version: 2015.08.21 19:57

In the PDF output of the following code, the first text line on the second page 
only
spans half the textwidth. However, below the figure, the text should span the
whole width.

\starttext
\placefigure[right][]{caption}
{
\externalfigure[nop][width=0.5\textwidth,height=19cm]
}
\input lorem
\input lorem
\input lorem
\stoptext



Andreas,

This is a long-recognized issue that appears to have no resolution. It 
was previously raised by Gerhard Kugler in March 2007 (figure occupies 
space into next page 
http://www.mail-archive.com/ntg-context%40ntg.nl/msg21273.html) and by 
me in March 2014 (Caption whitespace overflows page 
http://www.mail-archive.com/ntg-context%40ntg.nl/msg73904.html) and 
possibly by others I did not come across.


The only resolution I have found is to reduce the size of the figure 
enough to prevent the reserved space from intruding on the text area of 
the next page.


--
Rik Kabel
___
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] \switchtobodyfont issue, also with newotf

2015-08-21 Thread Rik Kabel

On 2015-08-21 09:10, Hans Hagen wrote:
mostly changed names of the fonts, a missing directive (i'll add a 
fallback for that) and such ... patched in the next beta



Hans,

This morning's release fixed the newotf module problem, but not the font 
face problem. Was that to be expected?


--
Rik
___
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] \switchtobodyfont issue, also with newotf

2015-08-20 Thread Rik Kabel
While working to get italic smallcaps in a secondary font face, I came 
across an issue with \switchbodyfont. When this is used in a certain 
way, the \tf font-style is changed, but not the \it, \bf, and so on.


The example below compiles cleanly as presented, and the problem is not 
present. Each test line shows the expected font name and text.


When the Oops! line is uncommented, the only test line for the test font 
that is correct is the \tf line. Other lines use the default font face 
in the specified font styles, but the font features are a mix (note that 
some are onum, some lining, and that long-s t ligatures are inconsistent).


When the newotf module is enabled, the example fails to compile without 
errors, but produces similar results to non-newotf when the errors are 
ignored.


This is not a problem with individual fonts—I have tried a variety of 
fonts both as default and secondary and get the same result.


   %\usemodule[newotf]
 \setupwhitespace[medium]
 \define\testAlphabet{\purefontname\font\quad
ABCDEFGHIJKLmnopqrsſtuvwxyz \ 012345789}
 \starttypescript[Secondary]
   \definetypeface[Secondary][rm][serif][ebgaramond][default]
   % \definetypeface[Secondary][rm][serif][palatino][default]
   % \definetypeface[Secondary][rm][serif][libertine][default]
 \stoptypescript
 \setupbodyfont [modern, 10pt]
   %\setupbodyfont [palatino, 10pt]
 \starttext
   % {\switchtobodyfont[Secondary]Oops!\par}%  Oops!
  Default tf: {\tf \testAlphabet}\par
  Default bf: {\bf \testAlphabet}\par
  Default it: {\it \testAlphabet}\par
  Default sl: {\sl \testAlphabet}\par
  Default bi: {\bi \testAlphabet}\par
  Default bs: {\bs \testAlphabet}\par
  Default sc: {\sc \testAlphabet}\par
  Default xx: {\it\setff{smallcaps}\testAlphabet}\par
  \switchtobodyfont[Secondary]
  Secondary tf: {\tf \testAlphabet}\par
  Secondary bf: {\bf \testAlphabet}\par
  Secondary it: {\it \testAlphabet}\par
  Secondary sl: {\sl \testAlphabet}\par
  Secondary bi: {\bi \testAlphabet}\par
  Secondary bs: {\bs \testAlphabet}\par
  Secondary sc: {\sc \testAlphabet}\par
  Secondary xx: {\it\setff{smallcaps}\testAlphabet}\par
   \stoptext

Have I failed to properly specify the secondary typeface? Do I need a 
more complete typescript? Or is there a bug here?

--
Rik
___
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] Text around a figure in a framedtext

2015-08-13 Thread Rik Kabel

On 2015-08-13 11:19, Fabrice Couvreur wrote:

Hi,
Sorry to revive this discussion (which I initiated), but the text in 
the following code does not wrapped around the figure.

Why ?
Fabrice


\setupcolors
  [state=start]

\definecolor[MyColorB][c=0.00, m=0.62, y=1.00, k=0.00]
\definecolor[MyColorA][.75(MyColorB,white)]

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   width=\textwidth,
   height=fit,
   location=left,
   style=italic]

\defineoverlay
  [MyFrame]
  [\useMPgraphic{MyFrame}]

\definelabel
  [Définition]
  [headstyle=\bf\smallcaps]

\startuseMPgraphic{MyFrame}
path b ;
picture p ;
p := textext.rt(\white\Définition) ;
p := p shifted (2BodyFontSize,OverlayHeight-ypart center 
p+.25ExHeight) ;

b := boundingbox p leftenlarged .5EmWidth rightenlarged .5EmWidth ;
fill OverlayBox withcolor \MPcolor{MyColorA} ;
fill b withcolor \MPcolor{MyColorB} ;
draw p ;
\stopuseMPgraphic

\starttext

\startMyText

\starthanging[location=right]
{\startMPcode
  path p ;
  p := fullcircle xscaled 4cm yscaled 2cm ;
  fill p withcolor  cmyk(0,0.62,1,0) ;
  path q ; q := fullcircle scaled 1cm shifted (1cm, ypart 
center p) ;

  fill q withcolor blue ;
  picture r ;
  r := textext(\white E)shifted (-0.75cm,ypart center p) ;
  picture s ;
  s := textext(\white A)shifted (1cm, ypart center p) ;
  draw r ;
  draw s ;
  draw p ;
  draw q ;
 \stopMPcode}
Soit A une partie d'un ensemble E.

Si $n_E$ et $n_A$ sont respectivement les nombres d'éléments de E et 
de A, la {\bi proportion} des éléments de A dans E est le quotient 
$p=\frac{n_A}{n_E}$.

\stophanging

\stopMyText


Wolfgang wrote on the list a few days ago 
(http://www.mail-archive.com/ntg-context%40ntg.nl/msg79347.html):


   The \starthangaround environment reserves space for the image etc.
   onlyfor the first paragraph

   while \placefigure includes more paragraphs if necessary.

--
Rik
___
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] (again) bug with bidi direction and \about references

2015-08-12 Thread Rik Kabel

On 2014-03-04 11:07, Khaled Hosny wrote:

On Mon, Mar 03, 2014 at 07:49:07PM +0100, Pablo Rodriguez wrote:

Hi Hans,

sorry for telling again, but I’m afraid that the following sample shows
a serious buggy interaction between \setupdirections[bidi=on] and \about
references.

\setupdirections[bidi=on]

No problem with \setupdirections[bidi=on,method=two] (which I still
think should be the default, but Hans is not convinced).

Regards,
Khaled


Khaled,

I too had to rely on method=two as well to get around the problem with 
references appearing at the bottom left of some pages, but this seems to 
be resolved with the recent betas and the changes Hans has made at 
Talal's urging.


Perhaps you could test to see if resolves your cases.

--
Rik
___
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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel mailto:cont...@rik.users.panix.com
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart-n]
\defineconversionset[backpart:pagenumber][][backpart-n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang


Wolfgang,

This is clearly a superior solution to my index-only attempt, handling 
all references to backmatter pages without regard to their being in the 
index or in text references.


However, the page number adjustment via \setupheadertexts is handled 
only at the top center (default location) of each page. Can you suggest 
how to modify this to support an un-processed page number in the right 
margin of the footer of backmatter pages? I currently use:


   \setupheadertexts[][chapter][part][]
   \setuppagenumbering [alternative=doublesided,location={footer,margin}]

and I do not see where 
{\convertedcounter[userpage][numberconversionset=number]} or something 
else to restore un-processed numbers might work, despite trying with 
\setupfootertexts, \setuppagenumbering, \setuppagenumbering, and related 
commands.


--
Rik

___
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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-03 18:18, Rik Kabel wrote:
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register entries, 
but not for references.)


\defineprocessor[xx][style=slanted,after=n]
\starttext
\section[xxx]{Processor testing}
Why cannot a processor be applied to a reference? \at[xx-xxx]
\stoptext



Anyone?

--
Rik
___
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] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2015-08-11 Thread Rik Kabel
The example below documents the problems. In short, \definelabel 
suppresses paragraph indent when the label is at the beginning of a 
paragraph and fails to print the label or generate references with 
alternative=inmargin (or inright, or inleft) when in a footnote.


\defineenumeration fails to work in a footnote.


   \setupindenting[yes,small]
   \definelabel   [ID][
   %\defineenumeration[ID][
   text=,
   after=,
   before=,
   headcolor=red,
   alternative=inright,
  ]
   \starttext
   \starttitle[title={Label testing}]
   \startsubject[title={Problems with \tex{definelabel}}]

  This is a test. It is only a test.

  \ID[id1]This paragraph should be indented, with an ID number
in the margin. When \tex{ID} is placed at the beginning of the
paragraph, as it is here, the paragraph is not indented.

  This paragraph has a footnote.\footnote{%
  \ID[id2]The ID number is not printed in the margin with
{\tt alternative=inright}, {\tt alternative=inmargin},
or {\tt alternative=inleft}. Without any {\tt
alternative} the ID number is printed where the macro
appears. The positioning is unsatisfactory using {\tt
alternative=right}.%
} The footnote has an ID number which should be printed in the
right margin.

  This \ID[id3]paragraph has an ID, but it is not at the beginning
of the paragraph and the paragraph is properly indented. The
value of the ID number indicates that \tex{ID} in the footnote
of the previous paragraph incremented the associated counter,
but the failure of the references (\tex{in} and \tex{at}) to id2
suggests that there are other problems.

  \dorecurse{3}{
ID id#1 is \in[id#1] and is on page \at[id#1].\par}

  References for footnotes are generated without \tt{alternative=}.

   \stopsubject
   \startsubject[title={Problems with \tex{defineenumeration}}]

  When \tex{definelabel} is changed to \tex{defineenumeration},
the example fails to compile. It does not properly handle
the \tex{ID} in the footnote, complaining of an extra \} or
forgotten \tex{endgroup}.

   \stopsubject
   \stoptitle
   \stoptext

--
Rik
___
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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 14:49, Wolfgang Schuster wrote:

Rik Kabel mailto:cont...@rik.users.panix.com
4. August 2015 00:18
Should processors work with references? I would think that they 
should, but the following fails. (My backmatter page numbers need to 
be marked to distinguish them from bodymatter pages. I can automate 
applying a processor based on the location for index register 
entries, but not for references.)

\defineprocessor [bodypart] [style=bold]
\defineprocessor [backpart] [style=italic]

\defineconversionset[bodypart:pagenumber][][bodypart-n]
\defineconversionset[backpart:pagenumber][][backpart-n]

\setupheadertexts[{\convertedcounter[userpage][numberconversionset=number]}]

\starttext

\startbodymatter

\chapter[sec:knuth]{Knuth}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbodymatter

\startbackmatter

\chapter[sec:zapf]{Zapf}

\at{page}[sec:knuth]\par
\at{page}[sec:zapf]

\stopbackmatter

\stoptext

Wolfgang

Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?


--
Rik


___
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] \defineprocessor and \at

2015-08-11 Thread Rik Kabel

On 2015-08-11 15:48, Wolfgang Schuster wrote:

Rik Kabel mailto:cont...@rik.users.panix.com
11. August 2015 21:41
On 2015-08-11 14:49, Wolfgang Schuster wrote:
Thank you, Wolfgang, for that. But it still does not handle the after 
key, as I had in my example, and which works in a processor for index 
entries. Is there no way to do this?
The processor mechanism has no after key and I have no idea what it is 
shoudl do.


My apologies, Wolfgang and list. The key I use is right, as in the 
following snippet from my environment. I should have checked my files 
instead of relying on memory when I replied.


When I add it to your solution it does work.

   \defineprocessor[Back][
   style=slanted,
   right=n,
  ]
   \defineprocessor[notBack][
  style=normal,
 ]

   \defineregister[Index]
   \setupregister [Index][n=2,
   command=\Word,
   balance=no,
   compress=yes,
  ]

   \starttexdefinition unexpanded index
  \dosingleempty\dostartindex
   \stoptexdefinition
   \starttexdefinition dostartindex [#sortkey]
  \doifmodeelse{*backpart}
 {\Index[Back-#sortkey]}
 {\Index[notBack-#sortkey]}
   \stoptexdefinition
   \starttexdefinition unexpanded seeindex
  \seeIndex
   \stoptexdefinition


   \starttexdefinition doIndex #INDEXTERM
  \expanded{\index{#INDEXTERM}}
   \stoptexdefinition

With this, I can use \index[Macintyre]{McIntyre, John} in the main text 
or an endnote and the indexing will identify the section. My simple use 
of the processor did not work, however, for references.


--
Rik
___
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] Label at start of paragraph suppresses indentation

2015-08-03 Thread Rik Kabel


A label at the start of a paragraph suppresses indentation. Should it?

   \setupindenting[yes,small]
   \definelabel[xx][text=,alternative=inright]
  Paragraph one.

  \xx{}Paragraph two.

  Paragraph\xx{} three.
   \stoptext

--
Rik
___
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] \defineprocessor and \at

2015-08-03 Thread Rik Kabel
Should processors work with references? I would think that they should, 
but the following fails. (My backmatter page numbers need to be marked 
to distinguish them from bodymatter pages. I can automate applying a 
processor based on the location for index register entries, but not for 
references.)


   \defineprocessor[xx][style=slanted,after=n]
   \starttext
   \section[xxx]{Processor testing}
   Why cannot a processor be applied to a reference? \at[xx-xxx]
   \stoptext

--
Rik
___
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] Solved, was Re: Register customization for backmatter page numbers

2015-08-01 Thread Rik Kabel

On 2015-08-01 13:54, Pablo Rodriguez wrote:

Hi Rik,

sorry for top-posting, but I’m not sure whether I understand your request.

I wonder whether the following sample points in the right direction:

 \setuppapersize[A6]
 \setuppagenumber[way=bypart, prefix=yes, prefixset=chapter]
 \startsectionblockenvironment[bodypart]
 \setuppagenumber[number=1]
 \stopsectionblockenvironment
 \startsectionblockenvironment[appendix]
 \setuppagenumber[number=1]
 \stopsectionblockenvironment
 \starttext
 \completecontent
 \startbodymatter
 \dorecurse{5}{\chapter{Chapter}\recurselevel\index{bar}}
 \stopbodymatter
 \startappendices
 \dorecurse{5}{\chapter{Appendix}\recurselevel\index{foo}}
 \title{Index}
 \placeindex
 \stopappendices
 \stoptext

Just in case it helps,

Pablo


On 08/01/2015 04:20 AM, Rik wrote:

List,

I have a book with frontmatter, bodymatter, and backmatter. The
frontmatter is pagenumbered with lc roman, and the bodymatter and
backmatter are numbered, all by block.

The backmatter contain a glossary, pagenotes, bibliography, and an
index. In addition to the frontmatter and the bodymatter, both the
glossary and the pagenotes contain items that are indexed.

I need to distinguish pagenumbers that appear in the index so that the
reader can identify where in the book the page is located. For the
frontmatter, that is not a problem. For items that appear in the
bodymatter or backmatter, however, page numbers are not unique.

One method that has been suggested is to prefix the pagenumber displayed
in the index with a mark to indicate that the page is in the backmatter,
or to italicize it, or to use an alternate font. I have looked at the
defineconversionset and defineprocessor documentation and find no way to
mark index entries appropriately.

Can anyone suggest a way to do this, or some other method? Perhaps a
pagecommand that compares the register item real page number to the
highest real page number of the body? I would prefer a solution that
does not require changing the register commands (\index) in the text.

Continuous numbering across the frontmatter, bodymatter, and backmatter
is not wanted, although as a last resort I might be able to argue for
continuous numbering in the bodymatter and backmatter.
Thank you, Pablo. That does meet the requirements as stated, but having 
the chapter number as a prefix for the body entries is overly verbose 
and will not pass muster. (Failure of my specifications.)


I have found a solution, however. By placing these in the environment:

   \defineprocessor[Back][style=slanted,right=n]
   \defineprocessor[Front][style=normal]
   \def\Where{Front}
   \def\Index{\index[\Where-]}

And this at the start of the backmatter:

   \def\Where{Back}

I can index items with \Index{item} and the value of \Where when the 
entry is processed will be used. This meets the requirement that no 
change to the indexing is required in the text (except to change \index 
to \Index), and I can further distinguish notes from glossary entries if 
needed. I could even eliminate that last change by defining my own 
register Index and using \def\index{\Index[\Where-] (and an appropriate 
\placeregister).


I still haven't played with this a lot, so I don't know yet if it will 
handle all the optional bits of register entries, but it should suffice 
for my current needs.


--
Rik

___
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] Solved, was Re: Register customization for backmatter page numbers

2015-08-01 Thread Rik Kabel

On 2015-08-01 14:42, Rik Kabel wrote:

On 2015-08-01 13:54, Pablo Rodriguez wrote:

Hi Rik,

sorry for top-posting, but I’m not sure whether I understand your request.

I wonder whether the following sample points in the right direction:

 \setuppapersize[A6]
 \setuppagenumber[way=bypart, prefix=yes, prefixset=chapter]
 \startsectionblockenvironment[bodypart]
 \setuppagenumber[number=1]
 \stopsectionblockenvironment
 \startsectionblockenvironment[appendix]
 \setuppagenumber[number=1]
 \stopsectionblockenvironment
 \starttext
 \completecontent
 \startbodymatter
 \dorecurse{5}{\chapter{Chapter}\recurselevel\index{bar}}
 \stopbodymatter
 \startappendices
 \dorecurse{5}{\chapter{Appendix}\recurselevel\index{foo}}
 \title{Index}
 \placeindex
 \stopappendices
 \stoptext

Just in case it helps,

Pablo


On 08/01/2015 04:20 AM, Rik wrote:

List,

I have a book with frontmatter, bodymatter, and backmatter. The
frontmatter is pagenumbered with lc roman, and the bodymatter and
backmatter are numbered, all by block.

The backmatter contain a glossary, pagenotes, bibliography, and an
index. In addition to the frontmatter and the bodymatter, both the
glossary and the pagenotes contain items that are indexed.

I need to distinguish pagenumbers that appear in the index so that the
reader can identify where in the book the page is located. For the
frontmatter, that is not a problem. For items that appear in the
bodymatter or backmatter, however, page numbers are not unique.

One method that has been suggested is to prefix the pagenumber displayed
in the index with a mark to indicate that the page is in the backmatter,
or to italicize it, or to use an alternate font. I have looked at the
defineconversionset and defineprocessor documentation and find no way to
mark index entries appropriately.

Can anyone suggest a way to do this, or some other method? Perhaps a
pagecommand that compares the register item real page number to the
highest real page number of the body? I would prefer a solution that
does not require changing the register commands (\index) in the text.

Continuous numbering across the frontmatter, bodymatter, and backmatter
is not wanted, although as a last resort I might be able to argue for
continuous numbering in the bodymatter and backmatter.
Thank you, Pablo. That does meet the requirements as stated, but 
having the chapter number as a prefix for the body entries is overly 
verbose and will not pass muster. (Failure of my specifications.)


I have found a solution, however. By placing these in the environment:

\defineprocessor[Back][style=slanted,right=n]
\defineprocessor[Front][style=normal]
\def\Where{Front}
\def\Index{\index[\Where-]}

And this at the start of the backmatter:

\def\Where{Back}

I can index items with \Index{item} and the value of \Where when the 
entry is processed will be used. This meets the requirement that no 
change to the indexing is required in the text (except to change 
\index to \Index), and I can further distinguish notes from glossary 
entries if needed. I could even eliminate that last change by defining 
my own register Index and using \def\index{\Index[\Where-] (and an 
appropriate \placeregister).


I still haven't played with this a lot, so I don't know yet if it will 
handle all the optional bits of register entries, but it should 
suffice for my current needs.



And a more robust solution that takes into account index sort keys:

   % macros=mkvi
   \starttexdefinition unexpanded index
  \dosingleempty\doStartindex
   \stoptexdefinition
   \starttexdefinition doStartindex [#sortkey]
  \doifmodeelse{*backpart}
 {\Index[Back-#sortkey]}
 {\Index[notBack-#sortkey]}
   \stoptexdefinition
   \defineprocessor[Back][style=slanted,right=n]
   \defineprocessor[notBack] [style=normal]
   \defineregister [Index]
   \setupregister  [Index]   [n=2,command=\Word,balance=no,compress=yes]


--
rik
___
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] Section heading colors lost with \startbodymatter

2015-07-27 Thread Rik Kabel
This worked (the numbers were darkgray and there was a red dot 
separator) until the last beta or two. With the new betas, those colors 
disappear in the bodymatter mode and in appendices mode


   % When start/stop bodymatter is enabled, the number color and
   %   separator colors are lost. When they are disabled, all is
   %   as expected
   %
   \defineseparatorset[reddot][][{\color[red]{·}}]
   \setuphead[chapter][sectionseparatorset=reddot,numbercolor=darkgray]
   \setuphead[section][sectionseparatorset=reddot,numbercolor=darkgray]
   \starttext
   % \startbodymatter % enable and lose colors
\startchapter[title={Chapter}]
  \startsection[title={Section}]
  \stopsection
\stopchapter
   % \stopbodymatter  % enable and lose colors
   \stoptext


--
Rik
___
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 definelabel and footnotes

2015-07-27 Thread Rik Kabel
I have a document with hundreds of labels generated by \definelabel. 
They are used to index quotations in the text. Some of these occur in 
notes. Previously I had all such notes at the end of the book, as 
endnotes, but an editor requested a version with the notes as 
traditional footnotes. When the notes with labels appear in footnotes, 
the labels are not printed. The MWE below demonstrates the problem. I 
would expect to see a red 2 at the end of the first line of the footnote.


I have tried to use \defineenumeration instead of \definelabel, but I 
cannot get a comparable result to what I have with definelabel.


Is this a bug in the footnote typesetting, or a problem with my 
expectations?


   \setuppapersize[A6]
   \definelabel   [Qi][text=,alternative=inright,headcolor=red]
   \definenote[pagenote]
   \setupnotation [pagenote][way=bypage,numberconversion=set 2]
   \definenote[endnote]
   \setupnotation [endnote][way=bytext,location=none,conversion=numbers]
   \starttext
  {\Qi}An index in the margin.\par
  Text with a numbered endnote with an index\endnote{%
{\Qi}The numbered endnote with its index. The numbered endnote
 with its index. The numbered endnote with its index.%
  } and a marked pagenote with an index.\pagenote{%
{\Qi}The marked pagenote, but where is the index? The marked
 pagenote, but where is the index? The marked pagenote, but
 where is the index?%
  }\par
   \page
  The endnote follows.\par
  \placenotes[endnote]
   \stoptext

--
Rik Kabel
___
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] Section heading colors lost with \startbodymatter

2015-07-27 Thread Rik Kabel

On 2015-07-27 19:28, Rik Kabel wrote:
This worked (the numbers were darkgray and there was a red dot 
separator) until the last beta or two. With the new betas, those 
colors disappear in the bodymatter mode and in appendices mode


% When start/stop bodymatter is enabled, the number color and
%   separator colors are lost. When they are disabled, all is
%   as expected
%
\defineseparatorset[reddot][][{\color[red]{·}}]
\setuphead[chapter][sectionseparatorset=reddot,numbercolor=darkgray]
\setuphead[section][sectionseparatorset=reddot,numbercolor=darkgray]
\starttext
% \startbodymatter % enable and lose colors
\startchapter[title={Chapter}]
  \startsection[title={Section}]
  \stopsection
\stopchapter
% \stopbodymatter  % enable and lose colors
\stoptext


--
Rik

Duh! All color is gone, not just section heads. New MWE:

   \starttext
  %\startbodymatter % enable and lose colors
Some text \color[red]{and some red text}.
  %\stopbodymatter  % enable and lose colors
   \stoptext

--
Rik
___
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] Section heading colors lost with \startbodymatter

2015-07-27 Thread Rik Kabel

On 2015-07-27 22:50, Rik Kabel wrote:

On 2015-07-27 19:28, Rik Kabel wrote:
This worked (the numbers were darkgray and there was a red dot 
separator) until the last beta or two. With the new betas, those 
colors disappear in the bodymatter mode and in appendices mode


% When start/stop bodymatter is enabled, the number color and
%   separator colors are lost. When they are disabled, all is
%   as expected
%
\defineseparatorset[reddot][][{\color[red]{·}}]
\setuphead[chapter][sectionseparatorset=reddot,numbercolor=darkgray]
\setuphead[section][sectionseparatorset=reddot,numbercolor=darkgray]
\starttext
% \startbodymatter % enable and lose colors
\startchapter[title={Chapter}]
  \startsection[title={Section}]
  \stopsection
\stopchapter
% \stopbodymatter  % enable and lose colors
\stoptext


--
Rik

Duh! All color is gone, not just section heads. New MWE:

\starttext
  %\startbodymatter % enable and lose colors
Some text \color[red]{and some red text}.
  %\stopbodymatter  % enable and lose colors
\stoptext


Actually, some color can come through, as in the following example. The 
\setupmarginrules color remains even in bodymatter mode (the \setupbar 
color does not).


   \setupmarginrules[rulethickness=1pt]
   \setupmarginrules[1][rulecolor=red]
   \setupbar[overstrike][color=red]
   \define[1]\RR {\startmarginrule[1]\RRR#1\stopmarginrule}
   \definehighlight [RRR][style={\setbar[overstrike]}]
   \starttext
   % \startbodymatter % enable and lose colors
Some text \color[red]{and some red text}.\par

   Here is some text that shows all color is not gone.
  \RR{Here is some text that shows all color is not gone.
   Here is some text that shows all color is not gone.}
   Here is some text that shows all color is not gone.\par

   % \stopbodymatter  % enable and lose colors
   \stoptext

--
RIk
___
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] em-/en-dashes and newotf

2015-07-14 Thread Rik Kabel

On 2015-07-12 12:52, Hans Hagen wrote:

On 7/12/2015 6:42 PM, Rik Kabel wrote:

On 2015-07-12 10:38, Pablo Rodriguez wrote:

On 07/12/2015 04:12 PM, Hans Hagen wrote:

[...]
maybe some file is not loaded ... i uploaded a variant that might work
better

Many thanks for the new beta.

I’m afraid that this sample doesn’t work with latest beta either:

 \usemodule[newotf]

 \definefontfeature[noliga][liga=no]

 \starttext
 \startTEXpage[offset=1em]
 fiflff no--liga:
 \addfeature[noliga]fiflff

 --- em--dash
 \stopTEXpage
 \stoptext

I may be wrong, but I think that the non-deactivated OpenType 
feature is

related to the non-activated em- and en-dashes.

To the list members: could you test the sample above and tell em- and
en-dashes work and if no-liga disables ligatures? Adding architecture
may help.

I’m on Linux 32bits.

Many thanks for your help,


Pablo

Same result as Pablo: the ligatures remain even with liga=no, and the
hyphens are not replaced by appropriate dashes. Win64 8.1 with ConTeXt
2015.07.12 15:40 build and LuaTeX 0.80.1 rev 5274. My texmf-local
contains only a locally-updated version of t-smartref.mkvi.

I also have other problems with newotf and definefontfeature that I will
put in a separate message.


i just checked the distribution on a vm and it works ok so best first 
figure out why the tex ligs don't show up (when that relevant file is 
not loaded well other overloads might also fail so that can be the 
reason then for other issues)


Hans


Thank you, Hans, for the fixes to feature handling in 2015-07-15 10:37. 
Now both the dashes and ligatures in this thread and the failed build 
with script=hebr (whatever the relationship to the particular script) 
work as expected.


--
Rik
___
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] newotf definefontfeatures problem with script=hebr

2015-07-12 Thread Rik Kabel
The following code fails; however, it succeeds without newotf, and it 
succeeds with newotf if the defined font feature (*hebrew) is removed 
from the \definefont command. The characters that demonstrate the 
problem are HEBREW LETTER LAMED combined with HEBREW POINT HOLAM, 
followed by HEBREW LETTER ALEF (U05DC with combining U05B9 followed by 
U05D0). I have not come across other combinations that cause the 
problem, but I have not done an exhaustive search.


   \usemodule [newotf]
   \setupdirections   [bidi=global]
   \definefontfeature [hebrew] [default] [lang=heb,ccmp=yes,script=hebr]

   \definefont[Hebrew] [sileot*hebrew]
   \starttext
  \startTEXpage
This is okay:{\hfill\Hebrew לא}

This is okay:{\hfill{\Hebrew לֹ}}

This fails:{\hfill{\Hebrew לֹא}}
  \stopTEXpage
   \stoptext

It reports:

   error:
   C:/ConTeXt/tex/texmf-context/tex/context/base/font-ots.lua:1586:
   attempt to index a number value

   tex errortex error on line 13 in file
   C://Users/rik/Desktop/newotf-features.tex: ?

   inserted text \par

   to be read again
   \vss
   \pack_framed_do_bottom ...amedparameter \c!bottom
   \raggedbottomcommand
   to be read again \localendstrut \pack_framed_do_bottom
  \egroup
   \stopfittingpage -\removeunwantedspaces \egroup
 \egroup \doif
   {\fittingpage...
   l.13   \stopTEXpage

The same problem occurs in the same way with the following fonts, most 
of which are shipped with Windows:


   Arial Regular
   Arial Bold
   Arial Narrow
   David Regular
   David Bold
   Ezra SIL Regular
   Ezra SIL SR Regular
   Keter YG Medium
   Levenim MT Regular
   Levenim MT Bold
   Taamey David CLM
   Tahoma Regular
   Tahoma Bold
   Times New Roman Regular
   Times New Roman Bold


___
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] em-/en-dashes and newotf

2015-07-12 Thread Rik Kabel

On 2015-07-12 10:38, Pablo Rodriguez wrote:

On 07/12/2015 04:12 PM, Hans Hagen wrote:

[...]
maybe some file is not loaded ... i uploaded a variant that might work
better

Many thanks for the new beta.

I’m afraid that this sample doesn’t work with latest beta either:

 \usemodule[newotf]

 \definefontfeature[noliga][liga=no]

 \starttext
 \startTEXpage[offset=1em]
 fiflff no--liga:
 \addfeature[noliga]fiflff

 --- em--dash
 \stopTEXpage
 \stoptext

I may be wrong, but I think that the non-deactivated OpenType feature is
related to the non-activated em- and en-dashes.

To the list members: could you test the sample above and tell em- and
en-dashes work and if no-liga disables ligatures? Adding architecture
may help.

I’m on Linux 32bits.

Many thanks for your help,


Pablo
Same result as Pablo: the ligatures remain even with liga=no, and the 
hyphens are not replaced by appropriate dashes. Win64 8.1 with ConTeXt 
2015.07.12 15:40 build and LuaTeX 0.80.1 rev 5274. My texmf-local 
contains only a locally-updated version of t-smartref.mkvi.


I also have other problems with newotf and definefontfeature that I will 
put in a separate message.


--
Rik Kabel
___
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] em-/en-dashes and newotf

2015-07-11 Thread Rik Kabel

On 2015-07-11 17:30, Hans Hagen wrote:

On 7/11/2015 5:09 PM, Pablo Rodriguez wrote:

Hans,

with the following sample:

 \usemodule[newotf]

 %~ \setupbodyfont
 %~ [palatino]

 \starttext
 --- em--dash (with en--dash inside)
 \stoptext

I discovered that em- and en-dashes aren’t enabled by default.

Is this intended?


works ok here

Hmmm. Fails here with newotf, works without. Context 2015.07.10T00:05 on 
Win 8.1 64-bit, with and without jit.


--
Rik
___
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] newotf, problem with .ttc fonts

2015-07-11 Thread Rik Kabel
It appears that the newotf mechanism does not handle .ttc fonts. The 
following MWE uses fonts found on Windows 8.1:


 \usemodule [newotf]
   %% the following fonts, all .ttc, fail in the same way:
   % C:/ConTeXt/tex/texmf-context/tex/context/base/font-oup.lua:651:
   bad argument #1 to '(for generator)' (table expected, got nil)
   %\definefont[testfont] [MSMincho sa 1]
   %\definefont[testfont] [MingLiU sa 1]
   %\definefont[testfont] [Gulim sa 1]
   %\definefont[testfont] [Batang sa 1]
   %\definefont[testfont] [msyh sa 1]  % Microsoft YaHei
   %\definefont[testfont] [msjh sa 1]  % Microsoft JhengHei
   %\definefont[testfont] [SimSun sa 1]
   %% the following, none .ttc, work:
   %\definefont[testfont] [arialuni sa 1] % Arial Unicode MS
   %\definefont[testfont] [yugothic sa 1] % Yu Gothic
   %\definefont[testfont] [yumin sa 1] % Yu Mincho
   %\definefont[testfont] [kaiu sa 1] % DFKai-SB Regular
   %\definefont[testfont] [simfang sa 1] % FangSong Regular
   %\definefont[testfont] [simhei sa 1] % SimHei Regular
 \definefont[testfont] [simkai sa 1] % KaTi Regular

   \starttext
  Confucius’ {\em Analects} ({\testfont 論語} {\em LunYu}).
   \stoptext

Without the new module, this works with all of the test fonts.
--
Rik
___
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] New btx code problem with quote protrusion

2015-07-05 Thread Rik Kabel

List folk:

In the MWE below, everything builds cleanly if the \setupdelimitedtext 
line is removed. With it removed, however, quote marks protrusion looks 
poor when nearby quote marks in non-quotation text is allowed to 
protrude. The happens when there is a citation in a footnote in the 
quoted text.


Is this a bug, or simply something not yet ready with the new regime, or 
am I doing something wrong?


   % The next line should allow \startquotation to protrude quotes
   \setupdelimitedtext[quotation][method=font]
   % However, it causes the new bib code to fail when there is a
   %   footnote containing a citation in the quote. See
   % http://www.mail-archive.com/ntg-context@ntg.nl/msg35580.html
   \definefontfeature [default][protrusion=quality]
   \setupalign[hz,hanging]
   \usebtxdataset [xx.bib]
   \starttext
   \startparagraph\noindent
  There is a citation in the footnote to this standard
   paragraph\footnote{This footnote has a citation \cite[One].}
   \stopparagraph
   \startquotation[right]
  There is a citation in the footnote to this block
   quotation\footnote{This footnote has a citation \cite[Two].}
   \stopquotation
   \startparagraph\noindent
   “There is a citation in the footnote to this standard
   paragraph\footnote{This footnote has a citation \cite[One].}”
   \stopparagraph
   \placelistofpublications
   \stoptext

And the corresponding xx.bib file:

   @BOOK{One,
  author   = {A. N. Author},
  title= {A Book Title},
  year = {2017},
  publisher= {Self},
  address  = {sine loco},
   }

   @ARTICLE{Two,
  author   = {N. O. Author},
  title= {A Pipe},
  journal  = {The Journal},
  year = {2018},
  volume   = {32},
  number   = {3},
  pages= {42--69},
   }

--
Rik Kabel


___
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] Simple but can't find

2015-04-30 Thread Rik Kabel

On 2015-04-30 15:54, henman wrote:



I've searched the garden for how to do the simple function of 
including a context macro file into another one for text and formats 
that I want to reuse.



But, I can find nothing when I searched for intuitive words such as 
include, import , use and file , etc



What is the command name?


The \input command is used regularly in ConTeXt examples. It is 
documented in the wiki at http://wiki.contextgarden.net/Command/input. 
It is, essentially, the TeX \input command.


--
Rik
___
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 margin figures and whitespace in text

2015-04-26 Thread Rik Kabel

On 2015-04-26 14:01, Hans Hagen wrote:

On 4/26/2015 3:32 AM, Rik Kabel wrote:

I have two problems with figures placed into the left or right margin.
When the figure is in a group, extra whitespace is inserted between the
paragraphs that precede and follow the placefigure command. This happens
for figures placed by startplacefigure/stopplacefigure and tradiitonal
placefigure commands, and paragraphs placed by
startparagraph/stopparagraph or marked by par or newlines.

When the figure is not in a group, whitespace called for by
\setupwhitespace is lost, except when the paragraphs are marked by
traditional means. That is, whitespace is lost when
startparagraph/stopparagraph is used.

Interestingly, when that is changed to bpar/epar, the problem for
ungrouped figures disappears, but as I understand it, bpar/epar is not a
real substitute for startparagraph/stopparagraph.

There is probably a simple explanation, but it eludes me. I prefer to be
able to use startparagraph/stopparagraph, and it is sometimes desirable
to place a figure into a group in order to prevent unique settings from
leaking out.


you can test with this in cont-new.mkiv

\unprotect

\def\page_sides_inject_dummy_lines
  {\begingroup
   \scratchcounter\pageshrink
   \divide\scratchcounter \baselineskip
   \advance\scratchcounter \plusone
   \parskip\zeropoint
   \dorecurse\scratchcounter{\hbox to \hsize{}}%
   \kern-\scratchcounter\baselineskip
   \penalty\zerocount
   \endgroup}

\def\page_sides_prepare_space
  {\par
  %\whitespace
   \begingroup
   \forgetall
   \reseteverypar
   \verticalstrut
   \vskip-\struttotal
   \endgroup}

\protect

Thank you, Hans. That works well, both on the example and on a more 
complex real document.


--
Rik
___
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 margin figures and whitespace in text

2015-04-25 Thread Rik Kabel
I have two problems with figures placed into the left or right margin. 
When the figure is in a group, extra whitespace is inserted between the 
paragraphs that precede and follow the placefigure command. This happens 
for figures placed by startplacefigure/stopplacefigure and tradiitonal 
placefigure commands, and paragraphs placed by 
startparagraph/stopparagraph or marked by par or newlines.


When the figure is not in a group, whitespace called for by 
\setupwhitespace is lost, except when the paragraphs are marked by 
traditional means. That is, whitespace is lost when 
startparagraph/stopparagraph is used.


Interestingly, when that is changed to bpar/epar, the problem for 
ungrouped figures disappears, but as I understand it, bpar/epar is not a 
real substitute for startparagraph/stopparagraph.


There is probably a simple explanation, but it eludes me. I prefer to be 
able to use startparagraph/stopparagraph, and it is sometimes desirable 
to place a figure into a group in order to prevent unique settings from 
leaking out.


The following should demonstrate the problem. Turning on grid setting 
makes it worse. I get the same result with current betas and older versions.


   \useMPlibrary   [dum]
   %\showgrid
   \setuplayout[%grid=yes,
 backspace=151pt,leftmargin=117pt]
   \setupwhitespace[big]
   \define\Paragraph{\startparagraph\input khatt-en\stopparagraph}
   \starttext
   {
  \subject{Start/stop paragraphs and figures}
  \subsubject{Group, extra whitespace}
  \Paragraph
  \Paragraph
  \begingroup
\startplacefigure[location={leftmargin,none}]
  \externalfigure[A]
\stopplacefigure
  \endgroup
  \Paragraph
  \Paragraph
  \subsubject{No group, no whitespace}
  \Paragraph
  \Paragraph
  \startplacefigure[location={leftmargin,none}]
\externalfigure[A]
  \stopplacefigure
  \Paragraph
  \Paragraph
  \Paragraph
   }
  \page
   {
  \subject{Start/stop paragraphs, traditional figures}
  \subsubject{Group, extra whitespace}
  \Paragraph
  \Paragraph
  {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
  \Paragraph
  \Paragraph
  \subsubject{No group, no whitespace}
  \Paragraph
  \Paragraph
  \placefigure[leftmargin,none]{}{\externalfigure[A]}
  \Paragraph
  \Paragraph
  \Paragraph
   }
  \page
   {
  \subject{Traditional paragraphs, start/stop figures}
  \subsubject{Group, extra whitespace}
  \input khatt-en\par
  \input khatt-en\par
  \begingroup% or \bgroup or {
\startplacefigure[location={leftmargin,none}]
  \externalfigure[A]
\stopplacefigure
  \endgroup% or \egroup or }
  \input khatt-en\par
  \input khatt-en\par
  \subsubject{Okay}
  \input khatt-en\par
  \input khatt-en\par
  \startplacefigure[location={leftmargin,none}]
\externalfigure[A]
  \stopplacefigure
  \input khatt-en\par
  \input khatt-en\par
  \input khatt-en\par
   }
  \page
   {
  \subject{Traditional paragraphs, traditional figures}
  \subsubject{Group, extra whitespace}
  \input khatt-en\par
  \input khatt-en\par
  {\placefigure[leftmargin,none]{}{\externalfigure[A]}}
  \input khatt-en\par
  \input khatt-en\par
  \subsubject{Okay}
  \input khatt-en\par
  \input khatt-en\par
  \placefigure[leftmargin,none]{}{\externalfigure[A]}
  \input khatt-en\par
  \input khatt-en\par
  \input khatt-en\par
   }
   \stoptext

--
Rik
___
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] Oddity with \definereferenceformat

2015-04-19 Thread Rik Kabel
A reference to the text of a multi-line heading takes on the line breaks 
of the heading when \definereferenceformat[about] is used.


   \definereferenceformat[about][type=title,left=,right=]
   \starttext
   \startsection[reference={sec:one},
  title={Three\\line\\title}]
   \startparagraph
   See \about[sec:one].
   \stopparagraph
   \stopsection
   \stoptext

Can this be repaired? Or, am I doing it wrong?

--
Rik
___
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] Caption location with vertical \startplacefigure

2015-04-16 Thread Rik Kabel
How can I get the caption for the vertical figures (figures 2 and 4 in 
the example) aligned below the figures with the caption width limited to 
the figure width? Sorry for the noise -- I am sure I am missing 
something simple, but I cannot find it at this point. (Running current 
beta and earlier versions, so it does not appear to be a regression.)


 \showframe
 \setuppapersize[A4][A3,landscape]
 \useMPlibrary[dum]
   %% Enable the first set of three for wider picture margins,
   %% and the second set of three for standard picture margins
 \def\FullWidth{\the\dimexpr(\textwidth+2\margindistance)}
 \def\PicWidth{\the\dimexpr((\FullWidth-2em)/3)}
 \def\RPicMaxWidth{\the\dimexpr(\PicWidth-\margindistance)}
   %\def\FullWidth{\textwidth}
   %\def\PicWidth{\the\dimexpr((\FullWidth-2em)/3)}
   %\def\RPicMaxWidth{\the\dimexpr(\PicWidth)}

 \setupcombinations[width=\FullWidth]

 \definefloat [rightFigure][rightFigures]
  [figure]
 \setupfloat  [rightFigure]
  [
   location=right, % this does nothing!
   maxwidth=\RPicMaxWidth,
  ]
 \setupcaption[rightFigure]
  [
   width=\PicWidth,
   location=bottom,
   align=middle,
  ]

 \definefloat [leftFigure][leftFigures]
  [figure]
 \setupfloat  [leftFigure]
  [
   location=left, % this does nothing!
   maxwidth=\textwidth,
  ]
 \setupcaption[leftFigure]
  [
   width=\PicWidth,
   location=bottom,
   align=middle,
  ]

 \define\testtext{\dorecurse{5}{This is some text to fill up the
   space. }This is some text to fill up the space.\par}

 \starttext

   \testtext

   \startplacefigure[title={You see this caption!}]
 \startcombination[3*1]
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf a.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf b.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf c.} Subfigure
  \stopcaption
 \stopcombination
\stopplacefigure

   {\em\testtext}

   \startplacerightFigure[title={Can you see this one?},
   location=right,
 ]
 \startcombination[1*2]
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf a.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf b.} Subfigure
  \stopcaption
 \stopcombination
   \stopplacerightFigure

   \dorecurse{5}{\testtext}

   \page

   \testtext

   \startplacefigure[title={You see this caption!}]
 \startcombination[3*1]
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf a.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf b.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf c.} Subfigure
  \stopcaption
 \stopcombination
\stopplacefigure

   {\em\testtext}

   \startplaceleftFigure[title={Can you see this one?},
   location=left,
 ]
 \startcombination[1*2]
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf a.} Subfigure
  \stopcaption
   \startcontent
\externalfigure[dummy][width=\PicWidth]
  \stopcontent
  \startcaption
{\bf b.} Subfigure
  \stopcaption
 \stopcombination
   \stopplaceleftFigure

   \dorecurse{5}{\testtext}

   \stoptext


--
Rik
___
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] \hyphenatedurl problem

2015-04-13 Thread Rik Kabel

On 2015-04-13 13:19, Pablo Rodriguez wrote:

On 04/11/2015 07:20 AM, Rik wrote:

With versions from 20150325 and earlier, the following example code
produced nicely wrapped URLs. With current betas, the URLs do not wrap.

Hi Rik,

with beta from 2015.04.12 15:41, urls are wrapped.

Just in case it helps,


Pablo




(Perhaps this is what Wolfgang meant when he wrote, in a reply in the
thread _Turning off French character spacing_:

 The \url and \hyphenatedurl need to be fixed

but I do not know that for sure.)

 \setupinteraction[state=start]
 \starttexdefinition href #1
   \goto{\hyphenatedurl{#1}}[url(#1)]
 \stoptexdefinition
 
\useURL[aUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable]
 
\useURL[bUrl][https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable][][\hyphenatedurl{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}]
 \starttext
 goto href macro:
 
\href{https://Some.awfullylong.net/url_with_lots_of_places_to.html?make=a_reasonable}\par
 useURL without hyphenatedurl \from[aUrl]\par
 useURL with hyphenatedurl \from[bUrl]\par
 \stoptext

Yes, I saw that this morning before I headed out.

Thank you, Hans, for the fix.

--
Rik
___
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] authors in the toc

2015-04-11 Thread Rik Kabel

On 2015-04-11 03:27, Wolfgang Schuster wrote:


Am 10.04.2015 um 19:33 schrieb Rik Kabel cont...@rik.users.panix.com 
mailto:cont...@rik.users.panix.com:


Another bump. The example on the wiki still fails.

On 2014-10-02 13:42, Rik Kabel wrote:

On 2014-10-02 05:18, Wolfgang Schuster wrote:
There is a example on the wiki. You have to set your own values 
with the second argument of the \startchapter etc. command, to 
display the entry in the roc you have to write your own layout 
where you access it with the \structurelistuservariable command.


http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content

Wolfgang

This example fails for me using the current (2014-09-27) standalone 
beta and with TL14. The failure is that the list of authors is 
presented as a grid without contents.


Changing any of the lines in the example that construct the table 
cells, such as


\bTD \structureuservariable{author} \eTD

to

\bTD xx \structureuservariable{author} \eTD

results in a table with the new text, but no user variable text, 
showing that the \structureuservariable commands are not returning 
any text in this example.


Has something relevant changed since the example was prepared 
(2010-11 or earlier)?


(A pointer to useful descriptions of \structureuservariable and 
\structurelistuservariable would also be welcome. In the wiki, the 
startsection command description describes the former, but I have 
come across no comprehensive description for either in the 
documentation.)


You have to expand the whole content of the sort entry with

  \expanded{\author[…]{…}}

Wolfgang


Thank you for the fix. Wiki updated.

--
Rik
___
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] A couple of setupcaptions questions revisited

2015-04-11 Thread Rik Kabel

Bumping another old unsolved mystery.

On 2014-04-22 22:40, Rik Kabel wrote:
 On 2011-08-05, Wolfgang wrote with regard to section numbering not
 appearing in float captions when numbering is off for the section but
 called for by the chapter
 (http://www.mail-archive.com/ntg-context%40ntg.nl/msg57811.html):

 For the moment replace “number=no” with “incrementnumber=no”.


 and later that day
 (http://www.mail-archive.com/ntg-context%40ntg.nl/msg57814.html):

 There is a bug but it takes time to find it, unless it is found and
 fixed use incrementnumber.

 BTW: A *minimal* example your problem is **this**:

 \setupformulas[way=bysection,prefixsegments=chapter]
 %\setuphead[subsection][number=no]
 \setuphead[subsection][incrementnumber=no] \starttext
 \chapter{Chapter 1} \chapter{Chapter 2} \section{Section}
 \subsection{Subsection} \placeformula \startformula a^2+b^2=c^2
 \stopformula \stoptext

 This bug appears to still be with us. Has a solution since been
 proffered? If not, is a resolution in sight?

--
Rik Kabel
___
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] Forms and JavaScript

2015-04-02 Thread Rik Kabel

On 2015-04-02 03:42, Henning Hraban Ramm wrote:

Hello,

while trying to create some interactive forms using latest beta (MkIV), I found 
that JavaScripts are only then copied into the PDF, if there’s a \goto 
referencing a JS function.

According to the old widgets manual I thought I could set default values of 
fields calling JS functions or variables as [JS(MyFunc)], but that doesn’t work.


\starttext

\setupinteraction   [state=start]

\startJSpreamble{formtest}
% this JS code is only copied to the PDF if the \goto below is uncommented!
var d = new Date();
var df = this.getField(Datum);
var CurDate = util.printd(dd.mm., d);
df.value = CurDate;

function toggleField(){
var f = this.getField(Datum);
f.display = ! f.display;
}
\stopJSpreamble

%\goto{toggle}[JS(toggleField)]
\blank

\setupfield[MMshortString][reset,horizontal][height=5mm, width=50mm, frame=off, 
bottomframe=on]

\definefield[Datum][line][MMshortString][][JS(CurDate)] % JS(CurDate) ends up 
verbatim in the field


Date: \field[Datum]


\stoptext


Greetlings, Hraban


Greetlings Hraban,

This appears to be a pdf reader problem. On Win 8.1, Windows Reader and 
Chrome both show an editable field; Firefox and Sumatra show a 
non-editable field.


--
Rik
___
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] Spurious registers log entry?

2015-03-30 Thread Rik Kabel

On 2015-03-29 17:47, Rik Kabel wrote:

The following code:

\setupregister[index][n=1]
\starttext
\index{A}\index{A+A}AA\seeindex{AA}{A+A}.
\placeindex
\stoptext

generates the following log entry.

structureregisters  invalid see entry in register
'index', reference 'AA'

No similar entry is produced for a non-+ target. This does not appear 
to cause a problem in the output, but the log message
is annoying, and may point to incorrect logic in the source 
(strc-reg.lua).



Nice fix, thank you.

--
Rik
___
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] Spurious registers log entry?

2015-03-29 Thread Rik Kabel

The following code:

   \setupregister[index][n=1]
   \starttext
   \index{A}\index{A+A}AA\seeindex{AA}{A+A}.
   \placeindex
   \stoptext

generates the following log entry.

   structureregisters  invalid see entry in register 'index',
   reference 'AA'

No similar entry is produced for a non-+ target. This does not appear to 
cause a problem in the output, but the log message

is annoying, and may point to incorrect logic in the source (strc-reg.lua).

--
rik
___
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] Change behavior for \getbuffer

2015-03-27 Thread Rik Kabel
The behavior of \getbuffer has changed with the new beta. With the 
following sample code, one line of text is produced with the 2015-03-25 
beta. Two lines of text are produced with the more recent betas.


   \startbuffer
   A
   \stopbuffer
   \starttext
   A \getbuffer
   \stoptext

--
rik
___
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] Numbers in appendix roman, but want arabic

2015-02-13 Thread Rik Kabel

On 2015-02-13 03:45, Mikael P. Sundqvist wrote:

Hi,

with the example below, I have two problems (that are probably
related). In the appendix, the Theorem is numbered Theorem II
instead of Theorem 2, i.e. roman numbers are used instead of arabic
ones.

Also, when I refer to Theorem 1 from the appendix , it says Theorem
I. Again with roman number instead of arabic. I would prefer Theorem
1.

So, the question reads: How can I get arabic numbers also in the appendix?

(The appendix itself has the letter A as I want it to)

/Mikael

\starttext

\defineenumeration[Theorem]


\defineconversionset [bodypart:sectioncounter] [n,n,n] [n]
\defineconversionset [appendix:sectioncounter] [n,n,A] [n]
\setuphead[chapter,section][sectionconversionset=sectioncounter]

\chapter{Foo}
\startTheorem[thm:main]
This is a theorem.
\stopTheorem


\startappendices
\title{Appendix}

\section{This is the first appendix}

\startTheorem
This is another theorem.
\stopTheorem

What if we refer to the first theorem, Theorem~\in[thm:main]?

\stopappendices
\stoptext
___

In a document that has figures numbered by chapter, I use the following 
so that I get

Figure J.5 instead of J.V -- perhaps this will provide a starting point:

   %%-%%
   %% This ensures that appendix figures have numeric, not Roman,
   numbers %%
   %%-%%

   \defineconversionset [appendix:floatconversionset] [] [n]
   \setupcaption[numberconversionset=floatconversionset]


--
rik
___
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] \preventmode does not work

2014-11-19 Thread Rik Kabel
(This is a bump, with an improved example, of my earlier note on the 
subject.)


In MKIV, \preventmode does not work. It appears to do the opposite of 
what is intended, and enable the specified mode. It also does not 
prevent the explicit enablement of a mode (as can be seen by 
uncommenting the commented line in the MWE).


I have not tested it with MKII , where it might work. (Will ConTeXt 
online ever be restored?)


This goes back to TL14 and likely earlier.

Do I misunderstand what \preventmode should do, or have I misused it?

And why are there {curlies} instead of [squares] around the mode name in 
\doifmode and friends?


MWE, run context MWE.tex:

   \starttext
   \preventmode[X]
   %\enablemode[X]
   \doifmode{X}{!}
   \stoptext

--
Rik Kabel
___
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] Strange behavior of a macro with ConTeXt ver : 2014.11.12 9:46 p.m. MKIV beta

2014-11-15 Thread Rik Kabel

On 2014-11-15 06:18, Fabrice Couvreur wrote:

Background=whatever,



Please change B to b and retry.

--
rik
___
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] \startitem and \startparagraph

2014-10-17 Thread Rik Kabel

On 2014-10-17 03:50, Hans Hagen wrote:

On 10/17/2014 3:02 AM, Rik Kabel wrote:

What is the proper way to delimit paragraphs within an itemized list
using \start..\stop tagging (as for epub and such)? When I wrap
paragraphs with \startparagraph..\stopparagraph within the
\startitem..\stopitem, there is an unwanted newline inserted between the
bullet and the item text.

Or, is it not recommend to wrap paragraphs that are in enumerations?

I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make
sure to tag all your structural elements with \start...-\stop..., e.g.
\startchapter, but even \startparagraph!” I also note the appearance of
\startcontent..\stopcontent and \stopcaption..\startcaption and such,
suggesting to me that semantic tagging may be a useful thing to add to
new documents in order to support new output formats.

\starttext
\startitemize
   \startitem
 \startparagraph
   Item one paragraph one.
 \stopparagraph
 \startparagraph
   Item one paragraph two.
 \stopparagraph
 \startparagraph
   Item one paragraph three.
 \stopparagraph
   \stopitem
   \startitem
 \startparagraph
   Item two paragraph one.
 \stopparagraph
 \startparagraph
   Item two paragraph two.
 \stopparagraph
 \startparagraph
   Item two paragraph three.
 \stopparagraph
   \stopitem
\stopitemize


\starttext
\startitemize
  \startitem
\bpar
  Item one paragraph one.
\epar % \stopparagraph
\bpar
  Item one paragraph two.
\epar
\bpar
  Item one paragraph three.
\epar
  \stopitem
  \startitem
\bpar
  Item two paragraph one.
\epar
\bpar
  Item two paragraph two.
\epar
\bpar
  Item two paragraph three.
\epar
  \stopitem
\stopitemize
\stoptext


Thank you, Hans, for that.

Can you explain when \startparagraph..\stopparagraph should be preferred 
for tagging, and when \bpar..\epar? There is clearly a difference 
between them.


Is there any setup associated with \bpar..\epar as there is 
\defineparagraph for \startparagraph..\stopparagraph?


--
Rik Kabel
___
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] Prevent page break in middle of paragraph

2014-10-17 Thread Rik Kabel

On 2014-10-16 16:03, Ben Moon wrote:

Hi,
I'm trying to get a thesis in a final shape and encounter a page break
(... Über 70 % der pagebreak) in the middle of a paragraph where there
still seems to be plenty of space to finish that paragraph.
If I add a few lines to the text it works ok. Also \page[no] doesn't
work or \vbox and \setpenalties\widowpenalties{100}\maxdimen I
couldn't get working neither. Though the last one got closest.
Here's the minimal example I could come up with, sorry for it beeing a
bit lengthy:


With the current (2014-10-17) standalone beta the complete paragraph 
appears on page 2 and section 1.2 begins at the top of the next page. 
Perhaps there are some simple patches that Hans or others can supply for 
the version you are using, otherwise an update may be called for.


--
Rik
___
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] \startitem and \startparagraph

2014-10-16 Thread Rik Kabel
What is the proper way to delimit paragraphs within an itemized list 
using \start..\stop tagging (as for epub and such)? When I wrap 
paragraphs with \startparagraph..\stopparagraph within the 
\startitem..\stopitem, there is an unwanted newline inserted between the 
bullet and the item text.


Or, is it not recommend to wrap paragraphs that are in enumerations?

I ask because http://wiki.contextgarden.net/Epub_Sample suggests “Make 
sure to tag all your structural elements with \start...-\stop..., e.g. 
\startchapter, but even \startparagraph!” I also note the appearance of 
\startcontent..\stopcontent and \stopcaption..\startcaption and such, 
suggesting to me that semantic tagging may be a useful thing to add to 
new documents in order to support new output formats.


   \starttext
   \startitemize
  \startitem
\startparagraph
  Item one paragraph one.
\stopparagraph
\startparagraph
  Item one paragraph two.
\stopparagraph
\startparagraph
  Item one paragraph three.
\stopparagraph
  \stopitem
  \startitem
\startparagraph
  Item two paragraph one.
\stopparagraph
\startparagraph
  Item two paragraph two.
\stopparagraph
\startparagraph
  Item two paragraph three.
\stopparagraph
  \stopitem
   \stopitemize

   \startitemize
  \item
  Item three paragraph one.

  Item three paragraph two.

  Item three paragraph three.
  \item
  Item four paragraph one.

  Item four paragraph two.

  Item four paragraph three.
   \stopitemize
   \stoptext

--
Rik Kabel
___
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] Slanted, double-quoted quotations

2014-10-15 Thread Rik Kabel

On 2014-10-15 09:06, Sander Maijers wrote:

Hi,

I'm using beta 2014.09.27. The code below produces a slanted, unquoted 
quotation, whereas I intend to produce a slanted, double-quoted 
quotation. How can I fix it?


\definedelimitedtext[quotationsl][
  style=slanted,
  left={\symbol[leftquotation]},
  right={\symbol[rightquotation]},
  location=text,
]

\setupdelimitedtext[quotationsl][style=slanted,left={\symbol[leftquotation]},right={\symbol[rightquotation]}]

\starttext
\quotationsl{This should be slanted and double-quoted.}
\stoptext

Best,
Sander Maijers


Looks like a bug.

Modifying the parenthesis example at 
http://wiki.contextgarden.net/Command/setupdelimitedtext demonstrates 
that when a style other than normal is specified, the left and right 
settings are ignored  and style settings in deeper levels ignored as 
well. (There may be other keys that are ignored as well, and others that 
set this off.) I tried a number of combinations. The following is one 
that shows the problem. Without the style settings, it works as 
described in the wiki.


   \definedelimitedtext[parenthesis][location=text]
   \setupdelimitedtext [parenthesis:1] [left={(}, right={)}]
   \setupdelimitedtext [parenthesis:2] [style=slanted, left={[}, right={]}]
   \setupdelimitedtext [parenthesis:3] [style=normal, left={\{},
   right={\}}]
   \starttext
   \parenthesis{My outer layer \parenthesis{my inner layer
   \parenthesis{my innermost layer}}}
   \stoptext

--
rik
___
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] Slanted, double-quoted quotations

2014-10-15 Thread Rik Kabel

On 2014-10-15 13:38, Hans Hagen wrote:

On 10/15/2014 4:58 PM, Rik Kabel wrote:

On 2014-10-15 09:06, Sander Maijers wrote:

Hi,

I'm using beta 2014.09.27. The code below produces a slanted, unquoted
quotation, whereas I intend to produce a slanted, double-quoted
quotation. How can I fix it?

\definedelimitedtext[quotationsl][
  style=slanted,
  left={\symbol[leftquotation]},
  right={\symbol[rightquotation]},
  location=text,
]

\setupdelimitedtext[quotationsl][style=slanted,left={\symbol[leftquotation]},right={\symbol[rightquotation]}] 



\starttext
\quotationsl{This should be slanted and double-quoted.}
\stoptext

Best,
Sander Maijers


Looks like a bug.


it's deliberate and has always been the case in mkiv


Modifying the parenthesis example at
http://wiki.contextgarden.net/Command/setupdelimitedtext demonstrates
that when a style other than normal is specified, the left and right
settings are ignored  and style settings in deeper levels ignored as
well. (There may be other keys that are ignored as well, and others that
set this off.) I tried a number of combinations. The following is one
that shows the problem. Without the style settings, it works as
described in the wiki.


well, i can do a different check (in next beta) but you deal with 
questions about incompatible behaviour ...



\definedelimitedtext[parenthesis][location=text]
\setupdelimitedtext [parenthesis:1] [left={(}, right={)}]
\setupdelimitedtext [parenthesis:2] [style=slanted, left={[}, 
right={]}]

\setupdelimitedtext [parenthesis:3] [style=normal, left={\{},
right={\}}]
\starttext
\parenthesis{My outer layer \parenthesis{my inner layer
\parenthesis{my innermost layer}}}
\stoptext


i'll add symstyle/color:

\definedelimitedtext[parenthesis]   [location=text]
\setupdelimitedtext [parenthesis:1] [left={(}, right={)}]
\setupdelimitedtext [parenthesis:2] 
[symcolor=red,symstyle=boldslanted,style=slanted, left={[}, right={]}]
\setupdelimitedtext [parenthesis:3] 
[symcolor=blue,symstyle=bold,style=normal, left={\{}, right={\}}]


\starttext
\parenthesis{My outer layer \parenthesis{my inner layer 
\parenthesis{my innermost layer}}}

\stoptext


Hans,

I am not sure I understand the need for symstyle and symcolor. The issue 
is not that the symbols are not styled/colored, but that they do not 
appear at all when a non-normal style is specified. What I see with the 
example I posted is:


and I assume that Sander saw a similar issue.

Note that there are no square brackets present as defined for layer 2.

I realize that style=normal for level 3 should perhaps be style=\tf, 
since normal is redefined to slanted within the scope of layer 2. With 
that change to my example, I get


This still has the lack of square brackets, and now in addition lacks 
curly braces for level 3.


If your fix is meant to repair that, all is well. If not, could you 
explain why “it's deliberate and has always been the case in mkiv”?


--
Rik Kabel
___
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] authors in the toc

2014-10-03 Thread Rik Kabel

On 2014-10-03 10:32, Andrea Valle wrote:
Thanks, it’s a bit too complicated for me now, I was hoping for 
something like a before argument where to place the author param from 
the chapter.




Andrea,

If you can accept the author's name on a separate line in the toc and 
also a little less automation than the example that uses user structure 
variables, you might consider the \writebetweenlist command. In addition 
to the wiki entry (which is incomplete with respect to the parameters), 
see the recent email thread with the subject Chapter precis 
http://www.mail-archive.com/ntg-context%40ntg.nl/msg75670.html. The 
following may be a useful starting point:


   \starttext
   \completecontent
   \chapter{This is a chapter}
   \writebetweenlist[chapter][location=here]{\hskip4em\it Author Name}
   \input ward
   \section{A section}
   \section{Another section}
   \chapter{Another chapter}
   \stoptext


--
Rik
___
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] Generate Authorlist example fails, was Re: authors in the toc

2014-10-03 Thread Rik Kabel

On 2014-10-02 15:22, Wolfgang Schuster wrote:


Am 02.10.2014 um 19:42 schrieb Rik Kabel cont...@rik.users.panix.com 
mailto:cont...@rik.users.panix.com:



On 2014-10-02 05:18, Wolfgang Schuster wrote:
There is a example on the wiki. You have to set your own values with 
the second argument of the \startchapter etc. command, to display 
the entry in the roc you have to write your own layout where you 
access it with the \structurelistuservariable command.


http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content

Wolfgang

This example fails for me using the current (2014-09-27) standalone 
beta and with TL14. The failure is that the list of authors is 
presented as a grid without contents.


Changing any of the lines in the example that construct the table 
cells, such as


\bTD \structureuservariable{author} \eTD

to

\bTD xx \structureuservariable{author} \eTD

results in a table with the new text, but no user variable text, 
showing that the \structureuservariable commands are not returning 
any text in this example.


Has something relevant changed since the example was prepared 
(2010-11 or earlier)?


(A pointer to useful descriptions of \structureuservariable and 
\structurelistuservariable would also be welcome. In the wiki, the 
startsection command description describes the former, but I have 
come across no comprehensive description for either in the 
documentation.)


First you have to make a distinction between the values which are set 
with the first and second argument of \startchapter, \startsection 
etc.  While the first argument takes only certain keys, e.g. title, 
bookmark etc. you’re free to choose your own keys for the second 
argument because they are considered userdata.  The point of this 
userdata is to give users a way to specify information which are 
printed in the table of content or in the header, to access these 
values context provides two commands.  When you create a new layout 
for the table of contents you can use the \structurelistuservariable 
command which takes the name of the key with the information as 
argument and when you create a new header layout you can use the 
\structureuservariable command.



\define[3]\ChapterListCommand
  {\starttabulate
   \NC Number \NC #1 \NC\NR
   \NC Title  \NC #2 \NC\NR
   \NC Page   \NC #3 \NC\NR
   \TB[medium]
   \NC File   \NC \structurelistuservariable{file} \NC\NR
   \stoptabulate}

\setuplist[chapter][alternative=command,command=\ChapterListCommand]

\define[2]\ChapterHeadCommand
  {\startframed[align=flushleft,strut=no]
 \starttabulate[before=,after=]
 \NC Number \NC #1 \NC\NR
 \NC Title  \NC #2 \NC\NR
 \TB[medium]
 \NC File   \NC \structureuservariable{file} \NC\NR
 \stoptabulate
   \stopframed}

\setuphead[chapter][command=\ChapterHeadCommand]

\starttext

\completecontent

\startchapter[title=Knuth example][file=knuth.tex]
\input knuth
\stopchapter

\startchapter[title=Zapf example][file=zapf.tex]
\input zapf
\stopchapter

\stoptext

Wolfgang


Thank you, Wolfgang, for that explanation.

Can you suggest what might be wrong with the example at 
http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content?


The list of authors is created, so the user variable 'author' is set at 
for \doifsomething. When the index for the author list is set to a 
constant, only one row is generated, but when it is the user variable 
'name' the right number of rows is created, so 'name' is also set when 
it is referenced as the key in the author list sorting macro. Each line 
of the table is empty, suggesting that within the scope of the table the 
user variables are reset to nil. The same problem exists when 
\starttabulate is used instead of \bTABLE.


--
Rik

___
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] authors in the toc

2014-10-02 Thread Rik Kabel

On 2014-10-02 05:18, Wolfgang Schuster wrote:
There is a example on the wiki. You have to set your own values with 
the second argument of the \startchapter etc. command, to display the 
entry in the roc you have to write your own layout where you access it 
with the \structurelistuservariable command.


http://wiki.contextgarden.net/Generate_Authorlist_from_Head_Content

Wolfgang

This example fails for me using the current (2014-09-27) standalone beta 
and with TL14. The failure is that the list of authors is presented as a 
grid without contents.


Changing any of the lines in the example that construct the table cells, 
such as


   \bTD \structureuservariable{author} \eTD

to

   \bTD xx \structureuservariable{author} \eTD

results in a table with the new text, but no user variable text, showing 
that the \structureuservariable commands are not returning any text in 
this example.


Has something relevant changed since the example was prepared (2010-11 
or earlier)?


(A pointer to useful descriptions of \structureuservariable and 
\structurelistuservariable would also be welcome. In the wiki, the 
startsection command description describes the former, but I have come 
across no comprehensive description for either in the documentation.)


--
Rik Kabel



___
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] XML, XHTML, and HTML export issue with in URL

2014-08-28 Thread Rik Kabel
With the following example, the output xml writer fails to properly 
transform  to the html entity amp; in some urls; \hyphenatedurl works 
fine.


The generated xhtml and html files have this problem as well as more 
issues with the transformation, including what appears to be mistaken 
transformation of  and  to html entities and unbalanced link tags.


When a URL without  is used, the problems do not appear.

I used the default export-example.css file, and I assume that the lack 
of interaction in the result reflects the lack of coding for links in 
that file.


This was tested with the 2014-08-27 standalone.

   \setupbackend[export=xmltest.xml,xhtml=xmltest.xhtml,css=export-example.css]
   \setupinteraction[state=start]
   \useURL[avecAmpersand]
   [http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub]
  [][klik hier]
   \starttext
   \startsubject[title=Fails in xml]
   \startparagraph
  \tex{from}: \from[avecAmpersand]
   \stopparagraph
   \startparagraph
  \tex{goto[url]}: \goto{klik
   hier}[url(http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub)]
   \stopparagraph
   \stopsubject
   \startsubject[title=Okay in xml]
   \startparagraph
  \tex{url}: \url[avecAmpersand]
   \stopparagraph
   \startparagraph
  \tex{hyphenatedurl}:
   
\hyphenatedurl{http://www.mail-archive.com/search?l=ntg-context@ntg.nlq=Epub}
   \stopparagraph
   \stopsubject
   \stoptext

--
Rik Kabel
___
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] Startparagraph oddities

2014-08-28 Thread Rik Kabel
There appears to be an inconsistency in the implementation of 
\startparagraph. When it is used with one argument (or two by my reading 
of the source) it defines \stopparagraph with a terminal \endgraf, yet 
with no arguments this is not done. Strangely (to me) it also appears to 
insert a line-break before \startparagraph[]. The example below 
demonstrates these issues.


I would expect to have \endgraf inserted with each \stopparagraph 
regardless of the argument count.


There is also a wiki issue with overloading of the command name 
\startparagraph. The existing command entry points to the paragraphs 
mechanism for setting up parallel paragraphs in columns. There is also a 
\startParagraph command described for the t-pararef module. There is no 
mention of \startparagraph in the \startsection page, which might be an 
appropriate place. Perhaps some Wikipedia-style disambiguation mechanism 
is needed.


   \starttext
   \startparagraph
   One
   \stopparagraph
   \startparagraph
   Twee
   \stopparagraph
   \startparagraph
   Drie
   \stopparagraph
   \startparagraph[]
   One
   \stopparagraph
   \startparagraph
   Twee
   \stopparagraph
   \startparagraph
   Drie
   \stopparagraph
   \stoptext

--
Rik Kabel
___
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] \resetsetups

2014-08-14 Thread Rik Kabel

On 2014-08-14 00:26, Wolfgang Schuster wrote:


Am 13.08.2014 um 20:56 schrieb Rik Kabel cont...@rik.users.panix.com 
mailto:cont...@rik.users.panix.com:



Dear list,

In a number of notes (recent and in the list archive) I have seen 
\resetsetups, used (always) as in a block of code like this from 
Gerben Wierde:


\startsetups chapter:before
   \page[left]
   \noheaderandfooterlines
   \startalignment[left,nothyphenated]
\startnarrower[4*left]
\em \getbuffer[chapter:quote]
\stopnarrower
   \stopalignment
   \resetsetups[quote:text]
   \page[right]
   \noheaderandfooterlines
   \blank[force,2*big]
\stopsetups


What is the purpose of \resetsetups in this code? I see no different 
result without it, and all I can determine from list and document 
searches is that this is a vestigal command from x-fo processing.


With the \resetsetups command you can remove a previously created 
setups environment. As you can see from the following example 
“mysetups” doesn’t exist anymore after the \resetsetups command.


\startsetups[mysetups]
  Dummy text.
\stopsetups

\starttext

\doifsetupselse{mysetups}{YES}{NO}

\resetsetups[mysetups]

\doifsetupselse{mysetups}{YES}{NO}

\stoptext

Wolfgang


Thank you again, Wolfgang.

I notice that, while the _contents_ of the setup are removed, and using 
the reset setup introduces nothing into the text, there is no error or 
warning generated. (This is also the case, I learned, with an undefined 
buffer.) I can see that this can be very useful in a number of situations.


Can \resetsetups reset more than one setup in a single execution? When I 
try \resetsetups[setupA,setupB] it appears to reset neither. I only ask 
because of the plural name. It does not appear to be a burden to use 
multiple \resetsetups commands.


Are there equivalent commands to \resetsetups and \doifsetupelse for 
buffers? I could find nothing obvious.


The following example shows what I mean by the above statements. My 
examples are often clearer than my descriptions.


   \starttext

   \subject{test 1}

   \startsetups[mysetups]
  YES
   \stopsetups

   1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   \resetsetups[mysetups]

   2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   \startsetups[mysetups]
  yes
   \stopsetups

   3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   \subject{test 2}

   \startsetups[mysetups]
  YES
  \resetsetups[mysetups]
   \stopsetups

   1. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   2. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   \startsetups[mysetups]
  yes
  \resetsetups[mysetups]
   \stopsetups

   3. \doifsetupselse{mysetups}{\setup[mysetups]}{NO}

   \subject{test 3}

   \startsetups[mysetups]
  YES
   \stopsetups

   1. ¦\setup[mysetups]¦

  \resetsetups[mysetups]

   2. ¦\setup[mysetups]¦

   \startsetups[mysetups]
  yes
   \stopsetups

   3. ¦\setup[mysetups]¦

   \subject{test 4}

   \startsetups[mysetups]
  YES
  \resetsetups[mysetups]
   \stopsetups

   1. ¦\setup[mysetups]¦

   2. ¦\setup[mysetups]¦

   \startsetups[mysetups]
  yes
  \resetsetups[mysetups]
   \stopsetups

   3. ¦\setup[mysetups]¦

   \subject{test 5}

   1. ¦\setup[neverdefined]¦

   2.  ¦\getbuffer[neverdefined]¦

   \subject{test 6}

   \startsetups[mysetupstwo]
  , SIR!
   \stopsetups

   \startsetups[mysetups]
  YES
   \stopsetups

   1. ¦\setup[mysetups]\setup[mysetupstwo]¦

  \resetsetups[mysetups,mysetupstwo]

   2. ¦\setup[mysetups]\setup[mysetupstwo]¦

   \stoptext

--
Rik Kabel
___
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] \resetsetups

2014-08-14 Thread Rik Kabel

On 2014-08-14 15:10, Aditya Mahajan wrote:

On Thu, 14 Aug 2014, Rik wrote:

While I appreciate learning about these from the list, I must echo 
recent comments about the state of documentation. If these are user 
commands, as these appear to be, one should be able to find them in 
at least the advanced documents.


Please add the relavant information to the wiki, and then one will be 
able to find them in the advanced documents :-)


Aditya


When I understand a command enough to wikify it, or note an issue that 
might be problematic for somebody else, I have done just that. I do not 
know the syntax of these commands enough to do that now, and cannot be 
sure from the code just what it is.


Providing incomplete or inaccurate documentation does not benefit anyone.

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

2014-08-13 Thread Rik Kabel

Dear list,

In a number of notes (recent and in the list archive) I have seen 
\resetsetups, used (always) as in a block of code like this from Gerben 
Wierde:


   \startsetups chapter:before
  \page[left]
  \noheaderandfooterlines
  \startalignment[left,nothyphenated]
\startnarrower[4*left]
\em \getbuffer[chapter:quote]
\stopnarrower
  \stopalignment
  \resetsetups[quote:text]
  \page[right]
  \noheaderandfooterlines
  \blank[force,2*big]
   \stopsetups


What is the purpose of \resetsetups in this code? I see no different 
result without it, and all I can determine from list and document 
searches is that this is a vestigal command from x-fo processing.


--
Rik
___
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] Citation Sort Order

2014-08-11 Thread Rik Kabel

On 2014-08-11 01:30, Thangalin wrote:

Thank you, Rik.

I wanted to list all the bibliography entries (including unreferenced
citations) with referenced citations ordered chronologically. I
suppose that would require maintaining two separate bibliography
files...


If by chronologically, you mean by the order that citations appear in 
the document, then you might want something like:


   \setupbibtex[database=sources]
   \setuppublications[
  sorttype=cite,
   ]

   \starttext
  hello world\cite[kattamuri@debate]

  \startbackmatter
   \nocite[zbmath0homomorphic,peng04homomorphic,kattamuri@debate]
\nocite[delaune@coercion]
\nocite[kremer@verify,acquisti0homomorphic]
\placepublications[criterium=cite]
  \stopbackmatter
   \stoptext


This results in the explicitly cited works first, followed by the 
remaining nocited documents with cited works. You can manually create 
the nocite entries or generate them with a script.


From earlier comments on the list, it appears that with ConTeXt MKII 
one could use \nocite[*] instead of \nocite[all entries that appear in 
database], but that does not work in MKIV. Perhaps the new bibliography 
tools will provide it again.


--
Rik
___
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, indenting and font inside floats

2014-07-28 Thread Rik Kabel

On 2014-07-28 15:29, Joshua Krämer wrote:

Dear list,

I want to setup all my floats' contents to be middle-aligned, not
indented and typeset in a distinct font.  How can I do this?  The
attached example does not work.

Thank you and kind regards,
Joshua Krämer


\setupindenting [yes, \the\baselineskip]
\definefontfamily [figurefamily] [serif] [Latin Modern Sans]
\setupfloats [align=middle, style={\switchtobodyfont[figurefamily]},
indenting=no]

\starttext
\input knuth

\startplacefigure
Word
\stopplacefigure

\stoptext




   \setupexternalfigures[location={local,default}]
   \setupindenting[yes, \the\baselineskip]
   %\definefontfamily [figurefamily] [serif] [Latin Modern Sans]
   %\setupfloats [align=middle,
   style={\switchtobodyfont[figurefamily]}, indenting=no]
   \setupcaptions [style=ss]
   \setupframed[style=it]

   \starttext
   \input knuth

   \startplacefigure[title={Not a figure}]
   Word
   \stopplacefigure

   \startplacetable[title={A table}]
   \starttable[||]
   \NC Table\NC\NR
   \stoptable
   \stopplacetable

   \startplacefigure[title={A bovine figure}]
   \externalfigure[cow][width=5cm]
   \stopplacefigure

   \startplaceintermezzo[title={An intermezzo}]
   \startframedtext
   \input ward
   \stopframedtext
   \stopplaceintermezzo

   \stoptext

Captions are styled separately from the floats, hence \setupcaptions.

Word is not a figure. \startplacefigure does not make what follows a 
figure. When a real figure is set with \startplacefigure, it is centered 
by default.


You may be able to get away with style=ss instead of a new font 
definition if the sans is linked to the main serif font.


The contents of a float are styled according to the type of float.
___
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, indenting and font inside floats

2014-07-28 Thread Rik Kabel

On 2014-07-28 17:23, Rik Kabel wrote:

(much snipped)


The contents of a float are styled according to the type of float.

Sorry, that last statement should have been:

The contents of a float are styled according to the type of contents.

That is, if a table is floated (with placetable or startplacetable), you 
still use table-styling commands to style it.


--
Rik
___
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 make floats extend into the outer margin

2014-07-25 Thread Rik Kabel

On 2014-07-25 07:10, Hans Hagen wrote:

Am 24.07.2014 um 10:36 schrieb Wolfgang Schuster

schuster.wolfg...@gmail.com mailto:schuster.wolfg...@gmail.com:



\starttext

\startplacefigure
\framed[width=.8\textwidth,framecolor=red]{one}
\stopplacefigure

\setupfloat[figure][location=flushleft]

\startplacefigure
\framed[width=1.2\textwidth,framecolor=blue]{two}
\stopplacefigure

\stoptext


You can use the command key for \setupfloat to apply a macro to the
finished content of the float.

The purpose of this macro is to save the content and compare the width
to the width of the text are,
when the figure is wider then the available space use the \leftaligned
or \rightaligned commands
to let the content protrude to the outer margins.


\setuppagenumbering[alternative=doublesided]

\setuplayout[backspace=4cm,width=12cm]

\definemeasure[Widefigure][\textwidth+\rightmargindistance+\rightmarginwidth] 



\setupfloat[figure][command=\FigureCommand]

\define\FigureCommand
 {\dowithnextbox
{\signalrightpage
 \ifdim\nextboxwd\textwidth
\doifrightpageelse{\leftaligned{\flushnextbox}}{\rightaligned{\flushnextbox}}%
 \else
   \midaligned{\flushnextbox}%
 \fi}
\hbox}

\showframe

\starttext

\startplacefigure
\framed[width=.8\textwidth,framecolor=red]{Left margin}
\stopplacefigure

\page

\startplacefigure
\framed[width=\measure{Widefigure},framecolor=red]{Left margin}
\stopplacefigure

\input knuth

\page

\startplacefigure
\framed[width=\measure{Widefigure},framecolor=red]{Right margin}
\stopplacefigure

\stoptext

Wolfgang
___ 

With Wolfgang's solution, the captions remain centered on the page. With 
Hans's solution, the captions move with the center of the frame. I 
expect that, if captions are used and there are other figures that are 
not placed with this mechanism, Wolfgang's solution will result in a 
better looking page.


--
Rik
___
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] Leave out reference to page if on the same page?

2014-07-25 Thread Rik Kabel

On 2014-07-25 07:06, Hans Hagen wrote:

On 7/24/2014 2:03 PM, Otared Kavian wrote:

Hi,

Thanks for your attention, Wolfgang: indeed removing
\analyzecurrentreference
from your example allows mkiv to typeset correctly and obtain the 
expected result.


 

yet another sparsely documented feature ... in beta:

% tests/mkiv/pagestate-001.tex

\useMPlibrary[dum]

\setuppagenumbering
  [alternative=doublesided]

% new: \setupreferencing[doublesided=no]

% old: \somewhere{backward}{foreward}[label]
% new: 
\someplace{preceding}{backward}{current}{foreward}{following}[label]

% old: \atpage[#label]
% new: 
\doifcheckedpagestate{label}{preceding}{backward}{current}{foreward}{following}{otherwise}


\starttext

\dorecurse {20} {
\placefigure
  [here]
  [fig:#1]
  {}
  {\externalfigure[dummy]}
\dorecurse {20} {
##1: \atpage[fig:##1] /
\doifcheckedpagestate{fig:##1}
 {preceding}
 {backward}
 {current}
 {foreward}
 {following}
 {otherwise}
}
}

\stoptext

if okay, then it's something to wikify ... should 
\setupreferencing[doublesided=no] be default? (currently yes i.e. 
spread aware)


keep in mind that this kind of functionality once it kicks in (is 
used) can result in a few more runs to get thing right and that 
there's always the danger of oscillation as the text injected is 
dependent on the situation


Hans


This looks very promising. When I test it with today's beta, I see that 
current is set in some iterations, but never shows up in the final 
version of the page, so references on the same page always come out as 
backward or forward.


I would think that the default should match the default for 
\setuppagenumbering[alternative=], and perhaps be tied to that.


--
Rik Kabel

___
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] Three questions about descriptions

2014-07-25 Thread Rik Kabel

On 2014-07-25 14:56, Matthias Weber wrote:

Dear All,

I’d like to use a mechanism that allows me to create an itemized list with my 
own labels like one can
with descriptions:

\definedescription[outline][
 headstyle=bold,style=normal,alternative=hanging,margin=1cm,distance=-.8cm]

\starttext

\outline[Welcome] Tea

\outline[Introduction] Tufte or Knuth?

\outline[Snack] Chocolate Cake

\outline[Discussion] Knuth or Tufte?

\outline[Open End] Bear and wine

\stoptext

However, instead of the above I would like to

— have the result “packed”, i.e. without lines between the descriptions
— have a stopper (“:”) after the label
— have the text of the description begin after the stopper and not at a fixed 
indentation (distance=…)

How do I do that?

Thanks,

Matthias


The following works, but I suspect that there may be a better way to get 
the packing.


   \define[1]\outlinehead{#1:}
   \definedescription[outline]
   \setupdescription [outline]
  [headstyle=bold,
   style=normal,
   %  alternative=hanging,
   width=fit,
   distance=1ex,
   before={\blank[back]},
   headcommand=\outlinehead,
 ]

   \starttext

   \outline{Welcome} Tea

   \outline{Introduction} Tufte or Knuth? and more and more and more
   and more to see what hanging does.

   \outline{Snack} Chocolate Cake

   \outline{Discussion} Knuth or Tufte?

   \outline{Open End} Bear and wine

   \stoptext

Try it both with and without the hanging alternative.

And for me, beer is preferable to bear.
--
Rik
___
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] Leave out reference to page if on the same page?

2014-07-24 Thread Rik Kabel

On 2014-07-24 07:20, Otared Kavian wrote:

Hi Rik,

As a matter of fact the example given by Wolfgang works despite mkiv 
complaining about

\analyzecurrentreference
being unknown… Whent the typesetting stops because of this command, 
saying « run » or rather « r » continues the typesetting.


How do you know it works? You only show that it runs to completion at 
that point. But without knowing what \analyzecurrentreference should do, 
not knowing if, for instance, it adjusts for certain edge cases, you do 
not have a reliable result.


I didn’t send the example module of Marco Patzer since it doesn’t seem 
to work anymore with recent versions of mkiv.


Maybe Marco has a solution for his module?

Best regards: OK


As Wolfgang wrote, the version on Github, which is referenced in the 
link I provided, works just fine, aside from the issue I described earlier.


--
Rik

___
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] \startframed spurious whitespace

2014-07-23 Thread Rik Kabel

On 2014-07-23 02:20, Herbert Voss wrote:

Am 23.07.2014 03:20, schrieb Rik Kabel:

There appears to be a bug with \startframed. In the following example,
the instance with no optional argument sets correctly, while with the
use of an optional argument (even empty []) a whitespace is introduced
before the text.

 \starttext
 \startframed[]
 Why a space?
 \stopframed

TeX reads \startframed[] Why a space? \stopframed
A linebreak is replaced by a space and spaces at the beginning of
a line are ignored by default. Without the optional []
TeX reads \startframed Why a space? \stopframed
The first space is eaten by TeX while parsing the macro name.

  \startframed[]%   ignore the space
  Why a space?
  \stopframed

It is the same behaviour as for \startframed{} ...


Yes. TeX does read it that way. I have written LaTeX packages and know 
the issues. ConTeXt, on the other hand, makes an extra effort, at least 
with the start/stop commands, to do it differently. That is one of the 
primary benefits, to my mind, of using 
\starttexdefinition...\stoptexdefinition instead of \def.


Perhaps I am extending my expectation of that improved behavior to 
\startframed[], but it is not, I think, an unreasonable hope.

 \startframed
 This is ok.
 \stopframed
 \stoptext

This is also not correct, you should use:

  \startframed
  This is ok.%
  \stopframed
  \stoptext

Otherwise you'll get a space after the dot.


In a real document I would likely use \par or a blank line at that 
point, but I was trying to provide a DWE (demonstrative working 
example), if not a MWE, to show the issue with the leading space. 
Line-feed hiding with % does not belong in the content of the document 
unless one chooses to drop back to TeX instead of writing within the 
ConTeXt package.

Herbert


--
Rik
___
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] \startframed spurious whitespace

2014-07-22 Thread Rik Kabel
There appears to be a bug with \startframed. In the following example, 
the instance with no optional argument sets correctly, while with the 
use of an optional argument (even empty []) a whitespace is introduced 
before the text.


   \starttext
   \startframed[]
   Why a space?
   \stopframed

   \startframed
   This is ok.
   \stopframed
   \stoptext

--
Rik


___
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] Figure whitespace overflows page

2014-07-20 Thread Rik Kabel
On 2014-03-26 19:35, Rik Kabel wrote, originally with the subject 
Caption whitespace overflows page:
How can I get rid of the space at the top of the first line of text on 
page three in the following MWE. The \setupfloats[spaceafter=none] 
masks the problem rather than addresses the problem directly. Playing 
with the size of the figures (changing them to 3cm) shows that the  
caption text is not pushed to the second page, just some whitespace 
imputed to them. This happens with TL2013 and with the latest 
(20140325) standalone beta.


I may be able to get away with the figure overflowing into the 
footnote space by avoiding footnotes, but the space on the next page 
is just ugly.


\setuppapersize[A6]
\setupexternalfigures[location={local,default}]
\setupfloats[spaceafter=none]
\starttext
\input{knuth}
\placefigure[left]{Caption}
  {\startcombination[1*3]
{\externalfigure[cow.pdf][height=2cm]}{cow}
{\externalfigure[cow.pdf][height=2cm]}{cow}
{\externalfigure[cow.pdf][height=2cm]}{cow}
  \stopcombination}
\input{knuth}

\input{knuth}
\stoptext



Can anyone suggest a fix for this, or declare that there is nothing that 
can be done except to change the page content? It is still a problem.


The problem is not with caption space /per se/, but with the space taken 
for the figure as a whole. I would think that, once the page with the 
figure is finalized, additional reserved whitespace below it can be 
discarded.


I did notice that it was also raised without apparent resolution in 
March 2007 (http://www.mail-archive.com/ntg-context%40ntg.nl/msg21269.html).


--
Rik Kabel
___
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] ToC depth (and headers) per section block

2014-07-05 Thread Rik Kabel

On 2014-07-05 05:43, Hans Hagen wrote:

On 7/5/2014 5:52 AM, Rik Kabel wrote:

How can I specify different section depths for different parts in a
document in the TOC? That is, if the document structure is:

   Front Matter
   Body Matter
Part 1
  Chapter 1
   Section 1
  Chapter 2
   Section 1
   Section 2
Part 2
  Chapter 1
   Section 1
   Section 2
  Chapter 2
   Section 1
Appendices
  Chapter 1
   Section 1
  Chapter 2
   Section 1
Back Matter
  Notes
  Bibliography

How can I generate chapter and section entriess in the TOC for Part 1,
but chapter entries only (no section entries) for Part 2 and the
Appendices.

I currently do this by defining a new header equivalent to section and
using that for Part 2 and Appendix sections. Since it is not included in
the lists used by the contents combinedlist, it does not get set.

Is this the best way to do this?


\definehead[silentsection][section]

\starttext

\placelist[chapter,section]

\chapter{first}
\section{first}

\chapter{first}
\silentsection{first}

\stoptext

Yes, that is just what I do now, except that I use \completecontent and 
not \placelist[chapter,section], having excluded lower-level sectioning 
headers via \setupcombinedlist. I am asking if there is a way to take 
advantage of user-defined or system modes, or section blocks, to 
accomplish this without requiring explicit markup (silentsection in your 
example) in the text. I suspect that it is possible, particularly if I 
want the silentsections only in certain section blocks.


The document is set differently for print and screen, and minimizing the 
differences after \starttext seems to me to be generally advantageous.



If instead I want one depth for all body matter parts and a different
depth for the appendices, is there a solution that could be keyed on
system modes or on section blocks, thus moving all of the styling to the
preamble (to use a LaTeX term)? I currently do that to support different
header formats in the body matter and appendices, using the following
method, but I suspect that there may be a more effective way to do that
as well.

   \startsetups[Header]
 \startallmodes[print,*bodypart]
   {\color[PrintHeaderColor]{\PrintHeaderFont
{\llap{\getmarking[chapternumber]~}\getmarking[chapter]}}
 \stopallmodes
 \startallmodes[print,*appendix]
   \color[PrintHeaderColor]{\PrintHeaderFont
 {\getmarking[chapter]}}
 \stopallmodes
   \stopsetups
   \setupheadertexts   []
   \setupheadertexts [\setups{Header}][][][\setups{Header}]

Again, I prefer a method that can be implemented in the preamble. (MKIV
only.)


--
Rik Kabel

___
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] ToC depth (and headers) per section block

2014-07-04 Thread Rik Kabel
How can I specify different section depths for different parts in a 
document in the TOC? That is, if the document structure is:


  Front Matter
  Body Matter
   Part 1
 Chapter 1
  Section 1
 Chapter 2
  Section 1
  Section 2
   Part 2
 Chapter 1
  Section 1
  Section 2
 Chapter 2
  Section 1
   Appendices
 Chapter 1
  Section 1
 Chapter 2
  Section 1
   Back Matter
 Notes
 Bibliography

How can I generate chapter and section entriess in the TOC for Part 1, 
but chapter entries only (no section entries) for Part 2 and the Appendices.


I currently do this by defining a new header equivalent to section and 
using that for Part 2 and Appendix sections. Since it is not included in 
the lists used by the contents combinedlist, it does not get set.


Is this the best way to do this?

If instead I want one depth for all body matter parts and a different 
depth for the appendices, is there a solution that could be keyed on 
system modes or on section blocks, thus moving all of the styling to the 
preamble (to use a LaTeX term)? I currently do that to support different 
header formats in the body matter and appendices, using the following 
method, but I suspect that there may be a more effective way to do that 
as well.


  \startsetups[Header]
\startallmodes[print,*bodypart]
  {\color[PrintHeaderColor]{\PrintHeaderFont
{\llap{\getmarking[chapternumber]~}\getmarking[chapter]}}
\stopallmodes
\startallmodes[print,*appendix]
  \color[PrintHeaderColor]{\PrintHeaderFont
{\getmarking[chapter]}}
\stopallmodes
  \stopsetups
  \setupheadertexts   []
  \setupheadertexts [\setups{Header}][][][\setups{Header}]

Again, I prefer a method that can be implemented in the preamble. (MKIV 
only.)


--
Rik Kabel
___
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] context works, contextjit fails with Junicode

2014-07-01 Thread Rik Kabel

The jit engine complains

   lua errorerror on line 12 in file
   C:/Users/rik/Desktop/junicode_bold.tex:
   C:/ConTeXt/tex/texmf-context/tex/context/base/font-otp.lua:192:
   invalid value (nil) at index 1 in table for 'concat'

and produces an incorrect document (no bold or bold italic fonts used) 
for the following document, while the standard engine produces a correct 
document without complaint:


   \starttypescript [serif] [junicode]
  \definefontsynonym [Serif]   [file:junicode]
  \definefontsynonym [SerifItalic] [file:junicode-italic]
  \definefontsynonym [SerifBold] [file:junicode-bold]
  \definefontsynonym [SerifBoldItalic] [file:junicode-bolditalic]
   \stoptypescript
   \starttypescript [junicode]
\definetypeface [junicode] [rm] [serif] [junicode] [default]
   \stoptypescript
   \setupbodyfont[junicode]
   \starttext
   
\fontalternative{\it\fontalternative}{\bf\fontalternative}{\bi\fontalternative}
   \stoptext

I also note that the standard typescript for junicode is not useful. 
Beside mentioning goudysans (a cosmetic issue only, I think) the font 
file names do not reflect current file names for the font as available 
at http://junicode.sourceforge.net. If anybody has a typescript 
reflecting current ttf file naming, I would appreciate receiving a copy, 
either via the list or directly.


(The typescript in the above is stripped to a minimum, and not what I 
would use other than in such an example.)


--
Rik Kabel
___
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 works, contextjit fails with Junicode

2014-07-01 Thread Rik Kabel

On 2014-07-01 18:08, Hans Hagen wrote:

On 7/1/2014 11:52 PM, Rik Kabel wrote:

The jit engine complains

lua error  error on line 12 in file
C:/Users/rik/Desktop/junicode_bold.tex:
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otp.lua:192:
invalid value (nil) at index 1 in table for 'concat'


only luajittex?

are there more trace lines?


and produces an incorrect document (no bold or bold italic fonts used)
for the following document, while the standard engine produces a correct
document without complaint:

\starttypescript [serif] [junicode]
\definefontsynonym [Serif] [file:junicode]
\definefontsynonym [SerifItalic] [file:junicode-italic]
\definefontsynonym [SerifBold] [file:junicode-bold]
\definefontsynonym [SerifBoldItalic] [file:junicode-bolditalic]
\stoptypescript
\starttypescript [junicode]
\definetypeface [junicode] [rm] [serif] [junicode] [default]
\stoptypescript
\setupbodyfont[junicode]
\starttext
\fontalternative{\it\fontalternative}{\bf\fontalternative}{\bi\fontalternative}
\stoptext

I also note that the standard typescript for junicode is not useful.
Beside mentioning goudysans (a cosmetic issue only, I think) the font
file names do not reflect current file names for the font as available
at http://junicode.sourceforge.net. If anybody has a typescript
reflecting current ttf file naming, I would appreciate receiving a copy,
either via the list or directly.

(The typescript in the above is stripped to a minimum, and not what I
would use other than in such an example.)


what font is that?

Hans


As I said, the not-in-time engine has no problem with the file.

The font is referenced in the free fonts page of the wiki (I updated its 
outdated link earlier today). The same version of the font is included 
in the TL and standalone distributions. I have installed the ttf files 
in my Windows/fonts directory so that lesser programs can access them as 
well, and that is where they are found by ConTeXt.


Here is the full log of the jit run. When I unwrap the line between 
\starttext and \stoptext, the errors point to lines with bold fonts:


open source  1  1  
C:/ConTeXt/tex/texmf-context/tex/context/base/cont-yes.mkiv


ConTeXt ver: 2014.06.27 10:53 MKIV beta fmt: 2014.6.27 int: english/english

system  'cont-new.mkiv' loaded
open source  2  2  
C:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
close source  2  2  
C:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv
system  files  jobname 'junicode_bold', input './junicode_bold', 
result 'junicode_bold'

fonts  latin modern fonts are not preloaded
languages  language 'en' is active
open source  2  3  C:/Users/rik/Desktop/ContextBugs/Bugs I 
say/junicode_bold.tex

fonts  preloading modern-designsize (math)
fonts  typescripts  unknown library 'modern-designsize' or 'modern'
fonts  'fallback modern-designsize mm 12pt' is loaded
fonts  preloading modern-designsize (mono)
fonts  'fallback modern-designsize tt 12pt' is loaded
fonts  otf loading  loading 'c:/windows/fonts/junicode-bold.ttf', hash 
'junicode-bold'

fonts  otf loading  loading done
fonts  otf loading  file size: 421536
fonts  encoding  loading (extended) adobe glyph list
fonts  otf loading  fixing kernclass table of lookup 'pp_l_3_s'

lua error  error on line 19 in file 
C:/Users/rik/Desktop/ContextBugs/Bugs I say/junicode_bold.tex:


C:/ConTeXt/tex/texmf-context/tex/context/base/font-otp.lua:192: invalid 
value (nil) at index 1 in table for 'concat'

stack traceback:
[C]: in function 'concat'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otp.lua:192: in 
function 'pack_indexed'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otp.lua:375: in 
function 'enhancer'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otf.lua:302: in 
function 'enhance'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otf.lua:507: in 
function 'load'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otf.lua:2131: in 
function 'otftotfm'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-otf.lua:2176: in 
function C:/ConTeXt/tex/texmf-context/tex/context/base/font-otf.lua:2175
C:/ConTeXt/tex/texmf-context/tex/context/base/font-def.lua:313: in 
function 'loadfont'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-ctx.lua:478: in 
function 'loadfont'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-def.lua:415: in 
function 'read'
C:/ConTeXt/tex/texmf-context/tex/context/base/font-ctx.lua:1109: in 
function 'definefont_two'

[\directlua]:1: in main chunk

9 \definefontsynonym [Serif] [file:junicode]
10 \definefontsynonym [SerifItalic] [file:junicode-italic]
11 \definefontsynonym [SerifBold] [file:junicode-bold]
12 \definefontsynonym [SerifBoldItalic] [file:junicode-bolditalic]
13 \stoptypescript
14 \starttypescript [junicode]
15 \definetypeface [junicode] [rm] [serif] [junicode] [default]
16 \stoptypescript
17 \setupbodyfont[junicode]
18 \starttext
19  
\fontalternative{\it\fontalternative}{\bf\fontalternative}{\bi\fontalternative}

20 \stoptext
21


? q
OK, entering

[NTG-context] Protrusion with compound word hyphenation (||)

2014-07-01 Thread Rik Kabel
I notice that with compound words broken across lines protrusion does 
not get applied. This looks pretty rough when there are normal 
hyphenated words in the same paragraph.


WE (exaggerated, but demonstrates the point):

   \setuppapersize[monarch]
   \definefontfeature [default] [protrusion=quality]
   \setupalign[hanging]
   \setuptolerance[horizontal,strict]
   \setuphyphenmark   [sign=small]
   \showframe [text] [text]
   \starttext
   \dorecurse{21}{Multisyllabic||words||separated||by||hyphens. }
   \stoptext

Is this expected behavior? Can it be changed?
--
Rik Kabel
___
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] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Rik Kabel
Recently there have been reports of the first letter of a line of text 
being lost in the database and letter modules.


I tracked down what appears to be the same problem and developed a 
work-around.


The problem appears to be with the \grabbufferdata command. Something 
has changed in the way it works, and it now swallows the first token of 
the buffer that it grabs. It may also show up with other commands, but 
this is the only one I have found in my projects.


If you have code with this command, a workaround is to insert 
\ignorespaces after it. I have no idea why this helps. If you do not 
have the code (if it is in somebody else's module), then using a blank 
line or dummy argument or \relax after the command that calls the code 
with \grabbufferdata may help.


The following code shows the issues and these workarounds.

   % macros=mkvi

   \starttexdefinition unexpanded startNoIgnore
  \begingroup
  \dostartNoIgnore
   \stoptexdefinition
   \starttexdefinition dostartNoIgnore
  \grabbufferdata[Test][startNoIgnore][stopTest]
   \stoptexdefinition

   \starttexdefinition unexpanded startWithIgnore
  \begingroup
  \dostartWithIgnore
   \stoptexdefinition
   \starttexdefinition dostartWithIgnore
  \grabbufferdata[Test][startWithIgnore][stopTest]
  \ignorespaces
   \stoptexdefinition

   \starttexdefinition stopTest
  \getbufferdata[Test]
  \endgroup
   \stoptexdefinition

   \define\TestText
 {\qquad If you can read this the first token was not swallowed.}

   \starttext

   \subject{Test without \tex{ignorespaces}}

   First, the problem:

   \startNoIgnore\TestText\stopTest

   And the same with \type{{}}

   \startWithIgnore{}\TestText\stopTest

   Workaround with \tex{relax}

   \startNoIgnore\relax\TestText\stopTest

   Workaround with blank line

   \startNoIgnore

   \TestText\stopTest

   \subject{Test with \tex{ignorespaces}}

   This now works:

   \startWithIgnore\TestText\stopTest

   And the same with \type{{}}

   \startWithIgnore{}\TestText\stopTest

   And the same with \tex{relax}

   \startWithIgnore\relax\TestText\stopTest

   And the same with a blank line after the opening

   \startWithIgnore

   \TestText\stopTest
   \stoptext




--
Rik Kabel
___
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] First letter lost possible cause: \grabbfferdata

2014-06-25 Thread Rik Kabel

On 2014-06-25 15:51, Rik Kabel wrote:
Recently there have been reports of the first letter of a line of text 
being lost in the database and letter modules.


I tracked down what appears to be the same problem and developed a 
work-around.


The problem appears to be with the \grabbufferdata command. Something 
has changed in the way it works, and it now swallows the first token 
of the buffer that it grabs. It may also show up with other commands, 
but this is the only one I have found in my projects.


And as soon as I post, I see that Hans has found the problem in the 
buffering  code.


--
Rik Kabel
___
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] database module: the first letter is lost

2014-06-25 Thread Rik Kabel

On 2014-06-25 19:04, Hans Hagen wrote:

On 6/25/2014 11:13 PM, Wolfgang Schuster wrote:


Am 25.06.2014 um 21:44 schrieb Hans Hagen pra...@wxs.nl
mailto:pra...@wxs.nl:


On 6/25/2014 7:21 PM, Michael Green wrote:

This appears to be the same as the problem Peter Münster found with
the letter module

\usemodule[database]

\defineseparatedlist[MyTable]
[separator=tab,
before=\bTABLE,after=\eTABLE,
first=\bTR,last=\eTR,
left=\bTD,right=\eTD]

\starttext

The first letter of “Cell” is lost.

\startseparatedlist[MyTable]
Cell 1Cell 2
\stopseparatedlist

With an extra return, “Cell” is intact.

\startseparatedlist[MyTable]

Cell 1Cell 2
\stopseparatedlist


\stoptext


in buff-ini.mkiv change this:

\def\buff_start_indeed#1#2#3#4%
 {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}

probably needs some checking


Adding \obeylines to \grabbufferdatadirect would also work

\unexpanded\def\grabbufferdatadirect % name start stop
   {\begingroup % (6)
+  \obeylines
\buff_start_indeed\empty}

but I’m interested what’s the purpose of the fifth argument for
\buff_start_indeed.


that was wrong; the pickup macro has a fifth argument (\plusone here) 
but goes unnoticed when you add \obeylines in which case the first 
'obeyedline' ended up in #5


(i probably messed up when adding some feature but i would have to 
need to look at older code to see how/when)


does it make sense?

Hans


Adding \obeylines as Wolfgang indicated did not resolve the issue with 
my test case (shortened below), while removing #5 as Hans suggested does 
resolve it.


   % macros=mkvi
   \starttexdefinition unexpanded startTest
  \begingroup
  \dostartTest
   \stoptexdefinition
   \starttexdefinition dostartTest
  \grabbufferdata[Test][startTest][stopTest]
   \stoptexdefinition
   \starttexdefinition stopTest
  \getbufferdata[Test]
  \endgroup
   \stoptexdefinition
   \define\TestText
 {If you can read this the first token was not swallowed.}
   \starttext
   If another line does not follow this, there is a failure.

   \startTest\TestText\stopTest
   \stoptext

As I wrote before, I do not have a way to more extensively test the 
other effects of the change.


--
Rik Kabel
___
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] database module: the first letter is lost

2014-06-25 Thread Rik Kabel

On 2014-06-25 19:34, Wolfgang Schuster wrote:

Am 26.06.2014 um 01:19 schrieb Rik Kabel cont...@rik.users.panix.com:


Adding \obeylines as Wolfgang indicated did not resolve the issue with my test 
case (shortened below), while removing #5 as Hans suggested does resolve it.

There is a difference between

   \startFOO
   …
   \stopFOO

and

   \startFOO … \stopFOO

because context gobbles only content in the same line as \startFOO when you add 
\obeylines and in the first case there is nothing which can be removed.

Wolfgang

Thank you, Wolfgang, for the explanation.

When I use

   \startTest
   \TestText
   \stopTest

or

   \startTest
   \TestText\stopTest

it does indeed work with the obeylines fix. It fails on the one-line 
version and also on


   \startTest\TestText
   \stopTest

I have no problem using the multi-line versions. I only reduced it to a 
single line in preparing the MWE. I have, however, seen such one-line 
incantations in other examples on the list and possibly in the wiki. I 
do not recall who wrote them.


I will now leave this to the developers to handle as they see best.

--
Rik
___
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 in natural tables with nc= and alignmentcharacter

2014-06-24 Thread Rik Kabel

On 2014-06-24 08:03, Hans Hagen wrote:

On 6/23/2014 10:50 PM, Peter Münster wrote:

On Mon, Jun 23 2014, Peter Münster wrote:


No solution, just a smaller MWE:


Yet smaller, but I don't know, if it's still the same problem:

\starttext
\bTABLE
\bTR \bTD A x \eTD \bTD[nc=2] A \eTD \eTR
\eTABLE
\stoptext


after lots of experiments (adapting the width guesser) i decided to 
stick to a simple check and warning; the first column will be ok but 
the second one to wide (btw, one solution was to set maxwidth to a 
large value)


catching all possible errors in coding a table is undoable (plus 
unpredictable)


(xtables work ok btw)

Hans


Hans,

While xtable works fine for Peter's reduced MWE, it does not handle the 
problem first presented, which includes an alignment character for 
columns of mark-separated numbers. By my understanding of how xtable 
works, I suspect that it will not be able to handle this requirement.


In this case I can get by with explicitly setting column widths as 
needed to prevent the error. I have been using the following code to get 
the width of what appears to be the widest element in a column:


   %% This gets the width of simple things; from Hans on the mailing
   %%   list http://www.ntg.nl/pipermail/ntg-context/2007/024390.html
   %%   example usage: \SetWidthOf{\ColContent}\to\ColContentWidth\relax
   %%   or: \SetWidthOf{Column Content}\to\ContentWidth\relax
   \def\SetWidthOf#1\to#2%
 {\bgroup
  \setbox\scratchbox\hbox{#1}%
  \expanded{\egroup\def\noexpand#2{\the\wd\scratchbox}}}

Is TABLE with explicit column widths the best solution for now on tables 
that require number alignment, or do you recommend another table mechanism?


--
Rik
___
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 in natural tables with nc= and alignmentcharacter

2014-06-23 Thread Rik Kabel
When a wide-ish column precedes a character-aligned column and a column 
span is in place, the table is set improperly.


With the following example, the first two columns overlap.

When the first column is moved to the right side of the table there is 
no issue.


When the setup line is removed, there is no issue.

When the long entry in column is shortened, there is no issue.

When the column span is removed and another cell added to that row, 
there is no issue.


The problem occurs when the span is applied to the first two or the last 
two columns in the example.


TL14 handles this correctly. It fails with the 20140622 beta.

   \starttext
  \bTABLE
   \setupTABLE[c][3][alignmentcharacter={.},aligncharacter=yes]
\bTABLEbody
  \bTR
\bTC AAA\eTC
\bTC[nc=2] Location\eTC
  \eTR
  \bTR
\bTC AAA Longish entry\eTC
\bTC Figure\eTC
\bTC 1.12\eTC
  \eTR
  \bTR
\bTC AAA\eTC
\bTC Table\eTC
\bTC 10.8\eTC
  \eTR
\eTABLEbody
  \eTABLE
   \stoptext

--
Rik Kabel
___
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 in natural tables with nc= and alignmentcharacter

2014-06-23 Thread Rik Kabel

On 2014-06-23 15:03, Rik Kabel wrote:
When a wide-ish column precedes a character-aligned column and a 
column span is in place, the table is set improperly.


With the following example, the first two columns overlap.

When the first column is moved to the right side of the table there is 
no issue.


When the setup line is removed, there is no issue.

When the long entry in column is shortened, there is no issue.

When the column span is removed and another cell added to that row, 
there is no issue.


The problem occurs when the span is applied to the first two or the 
last two columns in the example.


TL14 handles this correctly. It fails with the 20140622 beta.

\starttext
  \bTABLE
\setupTABLE[c][3][alignmentcharacter={.},aligncharacter=yes]
\bTABLEbody
  \bTR
\bTC AAA\eTC
\bTC[nc=2] Location\eTC
  \eTR
  \bTR
\bTC AAA Longish entry\eTC
\bTC Figure\eTC
\bTC 1.12\eTC
  \eTR
  \bTR
\bTC AAA\eTC
\bTC Table\eTC
\bTC 10.8\eTC
  \eTR
\eTABLEbody
  \eTABLE
\stoptext

--
Rik Kabel

Small correction. The statement

   When the first column is moved to the right side of the table there
   is no issue.

is incorrect. The problem exists with the long entry in a column 
following the alignmentcharacter column as well.


--
Rik
___
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] Samples updates and bibtex entries

2014-06-06 Thread Rik Kabel

Hans,

The file samples.tex requests updated bibliography data for some of the 
samples. Since the file is a few years old, it is not clear if this 
information has already been provided.


If it is still needed, here are entries for three of the sources and a 
note on the source of another, along with corrections for a few typos.


The first bibtex entry was lifted from Google Boooks, the other two from 
the ACM Digital Library.


@book{dawkins2000unweaving,
  title={Unweaving the Rainbow: Science, Delusion and the Appetite 
for Wonder},

  author={Dawkins, R.},
  isbn={9780547347356},
  url={http://books.google.com/books?id=ZudTchiioUoC},
  year={2000},
  publisher={Houghton Mifflin Harcourt}
}
 @book{Hofstadter:1985:MTQ:537101,
  author = {Hofstadter, Douglas R.},
  title = {Metamagical Themas: Questing for the Essence of Mind and 
Pattern},

  year = {1985},
  isbn = {0465045405},
  publisher = {Basic Books, Inc.},
  address = {New York, NY, USA},
 }
@book{Tufte:1990:EI:78223,
 author = {Tufte, Edward},
 title = {Envisioning Information},
 year = {1990},
 isbn = {0-9613921-1-8},
 publisher = {Graphics Press},
 address = {Cheshire, CT, USA},
}

reich.tex is a list of the voice samples from Steve Reich's 1995 
composition /City Life/.


Corrections for dawkins.tex, douglas.tex, and knuth.tex:

In each set, the first line is taken from the current sample file and 
the second is a correction. The dawkins.tex and douglas.tex corrections 
are based on scanned images on Google Books, the knuth.tex correction is 
based on my personal copy of the book (first edition second printing).


dawkins.tex is from pages 145 and 146 of the book

   come down head. Everybody on the right had to will it to be
   come down heads. Everybody on the right had to will it to be

   to sit down. Then those who remained were divided into two,
   to sit down. Then those that remained were divided into two,

   I also note that all of the quotes in the Dawkins source are
   single-quotes, not double-quotes as in dawkins.tex, \quote{}, not
   \quotation{}. This is unusual for a book printed in the USA by an
   American publisher, so perhaps Dawkins wanted it that way.


douglas.tex is from page 260 of the book

   of his forthcoming books, from the typesetting and layout
   of his forthcoming books|=|from the typesetting and layout

   not become as well known or available.
   not become as well known or as available.

   Not only is the concept exiting and clearly well executed,
   Not only is the concept exciting and clearly well executed,

   There are a few other differences, but these are most likely due to
   publisher's style sheet and the lack of availability of logotypes
   for TeX and Metafont.

knuth.tex is from page 50 of the book

   from the chaff and separate the sheep from the goats.
   from the chaff, and separate the sheep from the goats.


--
Rik Kabel




___
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] Margin heading problem, was Re: sections

2014-06-05 Thread Rik Kabel

On 2014-06-02 19:16, Rik Kabel wrote:

On 2014-06-02 04:09, Hans Hagen wrote:

On 6/2/2014 3:44 AM, Rik Kabel wrote:

On 2014-06-01 12:52, Hans Hagen wrote:

On 6/1/2014 5:40 PM, Rik wrote:


Is this also the cause of problems I noted with heading placed into
the
margin, as in the example below?


no, unrelated, try this:

\setuphead
  [section]
  [after={\strut\blank[-2*line,samepage,disable]},
   command=\SectionCommand,
   distance=0pt]

\define[2]\SectionCommand{\inleft{XX}}


That was fine until it ran into \setupwhitespace with a non-zero value.
Fiddling with the after key \blank does not appear to help.

\define[2]\MarginHead{\inmargin{#1\\#2}}
\setuphead[section]
   [command=\MarginHead,
distance=0pt,
after={\strut\blank[-2*line,samepage,disable]}]
%% With no \setupwhitespace, or any \setupwhitespace setting that
%%   results in zero interparagraph whitespace, all is well.
%setupwhitespace  [none]%okay
%setupwhitespace  [fix]% okay
%% With non-zero interparagraph whitespace, the heading separates
%%   from the text
\setupwhitespace  [line]%bad
\starttext
\startchapter[title={Weisman}]
  \input weisman\par
  \input weisman
\startsection[title={Thuan}]
  \input thuan\par
  \input thuan
\stopsection
\stopchapter
\stoptext


you can always skip back whitespace or add 'nowhite'


Well, nowhite is a start, but the solution is still a way off.
Meanwhile, the following works for non-grid layouts with reasonable
values for \setupwhitespace, although perhaps somebody can come up with
a more eloquent way to write it:

\newdimen\SectionHeadSkip
\SectionHeadSkip\dimexpr-2\lineheight-\parskip\relax
\setuphead
   [section]
   [command=\SectionCommand,
distance=0pt,
after={\strut\blank[\the\SectionHeadSkip,samepage,disable,nowhite]},
   ]
  \define[2]\SectionCommand
{\inmargin{#1 – #2}}



A better formulation (better because it preserves any stretch that might 
defined by \setupwhitespace):


\setupwhitespace [big]
\newdimen\Parskip
\Parskip\dimexpr-\parskip\relax
\setuphead
  [section]
  [command=\SectionCommand,
   distance=0pt,
   after={\strut\blank[\the\Parskip,-2*line,
samepage,disable,nowhite]},
  ]
\define[2]\SectionCommand
  {\inmargin{#1 – #2}}

As with the previous, \Parskip has to be redefined if \setupwhitespace 
changes, so it is probably best left until after \starttext, when the 
body font is established.



When enabling grid layouts, the number of lines needs to be adjusted.


No, it is not stable on grid layouts. Sections that have a figure placed 
as the first thing will be a line off.




Floats that appear as the first thing after a heading may present
problems, especially with larger values for \setupwhitespace. (The
default, with no location= specified, is pretty good, but when
location={left,force} or such, there is often an unwanted offset from
the header. and page breaks still appear between the heading and figure
at times, despite the samepage setting for \blank.)

So, this is quite fragile. It requires careful checking of every
heading, and manual tuning when one breaks. Not a desirable solution,
but at least it is possible.


Still fragile.

--
Rik Kabel

___
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] Keyword order problem

2014-06-03 Thread Rik Kabel
Keyword order appears to matter for the \blank command. The following 
example shows all orderings for the set  {dimension, nowhite, samepage}, 
some of which work and some of which do not. It also shows two orderings 
of {dimension, nowhite, samepage, disable}; one works and the other does 
not. This happens with TL13 as well as the 2014-06-01 beta.


I can find no discussion of keyword ordering in the wiki, on the mailing 
list, or in the manuals.


Is this intentional, and if so, with what other commands are keywords 
similarly constrained? Whether or not this is intentional, can a 
developer please provide a suggested ordering to use until this is 
better documented or corrected? The order that keywords are presented in 
the wiki and in the reference manual are among those that fail.


   \starttext
   \subject{Without disable}

   12pt,samepage,nowhite\blank[12pt,samepage,nowhite]
   works

   12pt,nowhite,samepage\blank[12pt,nowhite,samepage]
   fails

   samepage,12pt,nowhite\blank[samepage,12pt,nowhite]
   fails

   samepage,nowhite,12pt\blank[samepage,nowhite,12pt]
   works

   nowhite,12pt,samepage\blank[nowhite,12pt,samepage]
   works

   nowhite,samepage,12pt\blank[nowhite,samepage,12pt]
   works

   \subject{With disable}

   12pt,samepage,nowhite,disable\blank[12pt,samepage,nowhite,disable]
   works

   samepage,12pt,nowhite,disable\blank[samepage,12pt,nowhite,disable]
   fails

   \stoptext

--
Rik Kabel
___
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] Margin heading problem, was Re: sections

2014-06-02 Thread Rik Kabel

On 2014-06-02 04:09, Hans Hagen wrote:

On 6/2/2014 3:44 AM, Rik Kabel wrote:

On 2014-06-01 12:52, Hans Hagen wrote:

On 6/1/2014 5:40 PM, Rik wrote:

Is this also the cause of problems I noted with heading placed into 
the

margin, as in the example below?


no, unrelated, try this:

\setuphead
  [section]
  [after={\strut\blank[-2*line,samepage,disable]},
   command=\SectionCommand,
   distance=0pt]

\define[2]\SectionCommand{\inleft{XX}}


That was fine until it ran into \setupwhitespace with a non-zero value.
Fiddling with the after key \blank does not appear to help.

\define[2]\MarginHead{\inmargin{#1\\#2}}
\setuphead[section]
   [command=\MarginHead,
distance=0pt,
after={\strut\blank[-2*line,samepage,disable]}]
%% With no \setupwhitespace, or any \setupwhitespace setting that
%%   results in zero interparagraph whitespace, all is well.
%setupwhitespace  [none]%okay
%setupwhitespace  [fix]% okay
%% With non-zero interparagraph whitespace, the heading separates
%%   from the text
\setupwhitespace  [line]%bad
\starttext
\startchapter[title={Weisman}]
  \input weisman\par
  \input weisman
\startsection[title={Thuan}]
  \input thuan\par
  \input thuan
\stopsection
\stopchapter
\stoptext


you can always skip back whitespace or add 'nowhite'


Well, nowhite is a start, but the solution is still a way off. 
Meanwhile, the following works for non-grid layouts with reasonable 
values for \setupwhitespace, although perhaps somebody can come up with 
a more eloquent way to write it:


   \newdimen\SectionHeadSkip
   \SectionHeadSkip\dimexpr-2\lineheight-\parskip\relax
   \setuphead
  [section]
  [command=\SectionCommand,
   distance=0pt,
   after={\strut\blank[\the\SectionHeadSkip,samepage,disable,nowhite]},
  ]
 \define[2]\SectionCommand
   {\inmargin{#1 -- #2}}

When enabling grid layouts, the number of lines needs to be adjusted.

Floats that appear as the first thing after a heading may present 
problems, especially with larger values for \setupwhitespace. (The 
default, with no location= specified, is pretty good, but when 
location={left,force} or such, there is often an unwanted offset from 
the header. and page breaks still appear between the heading and figure 
at times, despite the samepage setting for \blank.)


So, this is quite fragile. It requires careful checking of every 
heading, and manual tuning when one breaks. Not a desirable solution, 
but at least it is possible.


--
Rik Kabel
___
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] Margin heading problem, was Re: sections

2014-06-01 Thread Rik Kabel

On 2014-06-01 12:52, Hans Hagen wrote:

On 6/1/2014 5:40 PM, Rik wrote:


Is this also the cause of problems I noted with heading placed into the
margin, as in the example below?


no, unrelated, try this:

\setuphead
  [section]
  [after={\strut\blank[-2*line,samepage,disable]},
   command=\SectionCommand,
   distance=0pt]

\define[2]\SectionCommand{\inleft{XX}}


That was fine until it ran into \setupwhitespace with a non-zero value. 
Fiddling with the after key \blank does not appear to help.


   \define[2]\MarginHead{\inmargin{#1\\#2}}
   \setuphead[section]
  [command=\MarginHead,
   distance=0pt,
   after={\strut\blank[-2*line,samepage,disable]}]
   %% With no \setupwhitespace, or any \setupwhitespace setting that
   %%   results in zero interparagraph whitespace, all is well.
   %setupwhitespace  [none]%okay
   %setupwhitespace  [fix]% okay
   %% With non-zero interparagraph whitespace, the heading separates
   %%   from the text
   \setupwhitespace  [line]%bad
   \starttext
   \startchapter[title={Weisman}]
 \input weisman\par
 \input weisman
   \startsection[title={Thuan}]
 \input thuan\par
 \input thuan
   \stopsection
   \stopchapter
   \stoptext

--
Rik Kabel
___
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] Character and word spacing

2014-05-29 Thread Rik Kabel
I am setting some text from Geoffrey Dowding's /Finer Points in the 
Spacing and Arrangement of Type/. I am trying to set it using his 
recommendations. For those not familiar with his book, the key point is 
that he promotes extremely tight spacing to achieve a uniform density 
across the page in the belief that this leads to a pleasing presentation 
and improved readability.


Among his recommendations is that an opening single quote together with 
the space preceding it should take up no more space than a normal word 
space, and similarly following a closing single quote; that the space 
after some punctuation be minimized (some of his commas appear to have 
perhaps just a hairspace, following them); that the space between 
punctuation and letters be adjusted according to the shape of the 
letter; and that 'and' be replaced by '' as necessary to improve word 
spacing. While this last is probably beyond the scope of ConTeXt, I am 
hoping that the first few might be managed through 
\definecharacterspacing, \setupcharacterspacing, and \setcharacterspacing.


Alas, I have found no documentation on this set of commands, and what I 
see in the source is opaque.


If you have pointers to the details of these commands, or other 
suggestions for such typographic exercises, please let me know.


--
Rik Kabel
___
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 \framed align and orientation on landscape pages

2014-05-25 Thread Rik Kabel

On 2014-05-25 00:12, Aditya Mahajan wrote:



On May 24, 2014, at 1:12 PM, Rik Kabel cont...@rik.users.panix.com 
mailto:cont...@rik.users.panix.com wrote:



On 2014-05-24 06:26, Hans Hagen wrote:

On 5/24/2014 4:11 AM, Rik Kabel wrote:

For the /\framed/ command, any value for the key /align /other than a
null value pushes the frame beyond the bottom margin on a landscape 
page

for many values of /orientation/. The following MWE demonstrates this:

\setuppapersize [A4,landscape]
\starttext
\framed[orientation=90,align=no]{\externalfigure[dummy]}
\stoptext

It also seems that the default value of /align/// is not /no/ as the
wiki suggests, since there is a very different result when no align 
key
is provided and when it is provided as above with /no/, if by a 
default

value one means that, when a given key is not explicitly provided,
processing will occur as if it had been provided with that particular
value.


\setuppapersize [A4,landscape]

\starttext

\framed[orientation=90,width=\textheight,align=no]{\externalfigure[dummy]} 


\stoptext

Thank you, Hans. That pointed me in the right direction, although it 
is not the solution in my case.


The problem was with align=no. It does not, as I surmised, lead to 
the same result as having no align key at all. The following shows 
the differences clearly. What I am after is the fifth page. I would 
think that the wiki is incorrect in stating that the default value 
for the align key is no, but I do not know what is the proper 
description of the default.


\setuppapersize [A5,landscape][A4]
\definebodyfontenvironment [default][d=6]
\showframe
\starttext
\framed[align=no]{\tfd 1}
\page
\framed[]{\tfd 2}
\page
\framed[orientation=90,align=no,width=\textheight]{\tfd 3}
\page
\framed[orientation=90,align=no]{\tfd 4}
\page
\framed[orientation=90]{\tfd 5}
\stoptext




Without any align key, \framed is a \hbox; with align it is a \vbox. 
That might explain the difference that you see. Try adding 
\dontleavehmode in front of \framed


Aditya


Alas, Aditya, \dontleavehmode does not appear to make a difference.

I think that we might expect frames 1 and 4 above to produce similar 
results, as do frames 2 and 5. They do not, and I am trying to 
understand why that is.


The fact that it is landscape just exacerbates the problem, pushing some 
of the text off the page. Remove that and the differences are still 
there; the text is still on the page although not where I expect it. 
Hans's resetting of the width does make the landscape result the same as 
the portrait result, with the frame pushed just to the lower edge of the 
text area, but it does not address the different treatment with and 
without align.


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

<    1   2   3   4   5   6   >