Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Rik Kabel

On 2018-01-12 17:46, Hans Hagen wrote:

On 1/12/2018 10:31 PM, Rik Kabel wrote:


maybe putting a \dontleavehmode in front helps


Indeed. Thank you. Adding it to the before key of \defineenumeration 
appears to have no unwanted side effects. Can you think of a reason 
not to do that?
something tex ... one starts a group at the start of a paragraph while 
not yet in par/hmode .. \dontleavehmode forces hmode (a paragraph)
Understood. I was just wondering if there is a downside to using it 
everwhere one places an enumeration by putting it into the before key.


--
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Hans Hagen

On 1/12/2018 10:31 PM, Rik Kabel wrote:


maybe putting a \dontleavehmode in front helps


Indeed. Thank you. Adding it to the before key of \defineenumeration 
appears to have no unwanted side effects. Can you think of a reason not 
to do that?
something tex ... one starts a group at the start of a paragraph while 
not yet in par/hmode .. \dontleavehmode forces hmode (a paragraph)


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

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

[NTG-context] Firstline problem with smallcaps

2018-01-12 Thread Rik Kabel
When \setfirstline is used to set the first line of a paragraph in a 
small-cap style, the line is mis-set. This does not occur with every 
font and input, but occurs with most fonts and many inputs. The problem 
does not seem to be awakened by other styles (emboldened, italicized).


   \definefirstline[SC][alternative=line,style=\setfontfeature{smallcaps}]%
   or =\sc
   \definefirstline[BD][alternative=line,style=bold]
   \definefirstline[IT][alternative=line,style=italic]
   \setupbodyfont[termes,11pt]% requires font with small caps
   \starttext
  \setfirstline[SC]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[BD]
  \startparagraph
    \input montgomery
  \stopparagraph
  \setfirstline[IT]
  \startparagraph
    \input montgomery
  \stopparagraph
   \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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Rik Kabel

On 2018-01-12 15:50, Hans Hagen wrote:

On 1/12/2018 8:24 PM, Rik Kabel wrote:

On 2018-01-12 13:27, Hans Hagen wrote:

On 1/12/2018 6:58 PM, Rik Kabel wrote:

Bump.

On 2015-08-11 14:45, Rik Kabel wrote:
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.


use

\ID ... \par

as it has to know where it ends which is a paragraph end

or use

\startID ... \stopID



    \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

Thank you Hans.

With \defineenumeration, adding an explicit \par for the footnote 
allows the index to print in the margin, and it works as well with 
multi-paragraph footnotes using \epar and \bpar.


However, this does not address the failure to indent when the ID 
starts a paragraph.


maybe putting a \dontleavehmode in front helps


Indeed. Thank you. Adding it to the before key of \defineenumeration 
appears to have no unwanted side effects. Can you think of a reason not 
to do that?


--
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Hans Hagen

On 1/12/2018 8:24 PM, Rik Kabel wrote:

On 2018-01-12 13:27, Hans Hagen wrote:

On 1/12/2018 6:58 PM, Rik Kabel wrote:

Bump.

On 2015-08-11 14:45, Rik Kabel wrote:
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.


use

\ID ... \par

as it has to know where it ends which is a paragraph end

or use

\startID ... \stopID



    \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

Thank you Hans.

With \defineenumeration, adding an explicit \par for the footnote allows 
the index to print in the margin, and it works as well with 
multi-paragraph footnotes using \epar and \bpar.


However, this does not address the failure to indent when the ID starts 
a paragraph.


maybe putting a \dontleavehmode in front helps

This does nothing to address the issues with \definelabel, but 
\defineenumeration, together with "don't do that" for paragraph starts, 
may now suffice.





--

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

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

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Rik Kabel

On 2018-01-12 13:27, Hans Hagen wrote:

On 1/12/2018 6:58 PM, Rik Kabel wrote:

Bump.

On 2015-08-11 14:45, Rik Kabel wrote:
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.


use

\ID ... \par

as it has to know where it ends which is a paragraph end

or use

\startID ... \stopID



    \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

Thank you Hans.

With \defineenumeration, adding an explicit \par for the footnote allows 
the index to print in the margin, and it works as well with 
multi-paragraph footnotes using \epar and \bpar.


However, this does not address the failure to indent when the ID starts 
a paragraph.


This does nothing to address the issues with \definelabel, but 
\defineenumeration, together with "don't do that" for paragraph starts, 
may now suffice.


--
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Hans Hagen

On 1/12/2018 6:58 PM, Rik Kabel wrote:

Bump.

On 2015-08-11 14:45, Rik Kabel wrote:
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.


use

\ID ... \par

as it has to know where it ends which is a paragraph end

or use

\startID ... \stopID



\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

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

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

Re: [NTG-context] Bug: Paragraph formatting on new page after placefigure

2018-01-12 Thread Hans Hagen

On 1/12/2018 6:44 PM, Rik Kabel wrote:

Bump.

This has come up a few times, but never resolved.

Is there the possibility of an option for placefigure to discard 
remaining depth at a page break?


it's more a aside effect of operating at the edge of the page (i'm 
reluctant to change this mechanism as at soem point we should stick to 
what we have ... it already changed a few times)


just move up the figure a bit:

\placefigure
  [right,high][]{caption}
  {\externalfigure[nop][width=0.5\textwidth,height=19cm]}

or limit the height


--
Rik

On 2015-08-25 10:14, Rik Kabel wrote:

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 
) and 
by me in March 2014 (Caption whitespace overflows page 
) 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___




--

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

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

Re: [NTG-context] referencing the customized enumeration with framed title

2018-01-12 Thread Hans Hagen

On 1/12/2018 5:22 PM, Jeong Dal wrote:


Dear Hans,

Thank you for the quick answer.
Repalcing “p:=textext.rt();” and commenting out “headcommand=gobbleone…”  with 
your suggestion, the references are working.
However, there is a side effect.
“Theorem 1.1” appears twice, one in the frame which I expected and one at the 
beginning of the framed text which I don’t want.

One more thing, is there no way to show the number of  the Definition?

you can download a beta and try

\defineenumeration[Theorem]
  [alternative=empty,
   before=\startMyText,
   after=\stopMyText]

\defineframed
  [MyFramed]
  [frame=off,
   loffset=1ex,
   roffset=1ex,
   foregroundstyle=\ssbf]

\startuseMPgraphic{MyFrame}
picture p ; numeric o ; path a, b ; pair c ;
 %  p := textext.rt("\MyFramed{\currentconstructiontext}") ;
p := 
textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ;
 %  p := 
textext.rt("\MyFramed{\wrappedconstruction{\currentconstructiontext}}") ;

 %  p := textext.rt("\MyFramed{\wrappedcurrentconstruction}") ;
o := BodyFontSize ;
a := OverlayBox ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic

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

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   offset=\bodyfontsize,
   width=\textwidth]

\starttext

\startTheorem[lem]
bla bla
\stopTheorem

Bla bla \in {Lemma} [lem] bla bla.

\stoptext


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

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

Re: [NTG-context] Problem with definelabel and footnotes

2018-01-12 Thread Rik Kabel

Bump.

On 2015-07-27 22:08, Rik Kabel wrote:
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Label problems with \definelabel and \defineenumeration, in and out of footnotes

2018-01-12 Thread Rik Kabel

Bump.

On 2015-08-11 14:45, Rik Kabel wrote:
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Bug: Paragraph formatting on new page after placefigure

2018-01-12 Thread Rik Kabel

Bump.

This has come up a few times, but never resolved.

Is there the possibility of an option for placefigure to discard 
remaining depth at a page break?


--
Rik

On 2015-08-25 10:14, Rik Kabel wrote:

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 
) and 
by me in March 2014 (Caption whitespace overflows page 
) 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] referencing the customized enumeration with framed title

2018-01-12 Thread Jeong Dal

Dear Hans,

Thank you for the quick answer.
Repalcing “p:=textext.rt();” and commenting out “headcommand=gobbleone…”  with 
your suggestion, the references are working.
However, there is a side effect.
“Theorem 1.1” appears twice, one in the frame which I expected and one at the 
beginning of the framed text which I don’t want.

One more thing, is there no way to show the number of  the Definition?

Thanks again.

Best regards,

Dalyoung

%%

\setupcolors[state=start]
\definecolor[dGreen] [r=0,g=.375,b=.0]
%%% define the background of Theorems:
\defineframed
  [FunnyFramed]
  [frame=off,
   loffset=1ex,
   roffset=1ex,
   foregroundstyle=\ssbf]

\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
%p := textext.rt(“\FunnyFramed{\enumerationparameter{text} 
\convertedcounter[Theorem]}”) ;
p := textext.rt("\FunnyFramed{\currentconstructiontext}") ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic 

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}] 

\defineframedtext
  [FunnyText]
  [frame=off,
   background=FunnyFrame,
   before={\blank[line,halfline]},
   after={\blank[line]},
   offset=\bodyfontsize,
   width=\textwidth]

\defineenumeration[Theorem]
  [title=no,
  text={\translate[en=Theorem, kr=정리]},
   prefix=yes,
   prefixsegments=chapter,
   way=bychapter,
   alternative=command,
%% headcommand=\gobbleoneargument,
   before=\startFunnyText,  
   after=\stopFunnyText]

 Definition style
\definenumber[DefNumber][way=bychapter,sectionumber=yes]
\setuptextrules[rulecolor=dBlue]

\define\DefCommand{\incrementnumber[DefNumber]
\textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]}
}   
\defineenumeration[Definition]
[width=fit,
alternative=serried,
text={}, 
number=no,
before={\DefCommand}, 
after=\vskip3pt\hrule\blank] 

%%% Examples with or without solutions
\defineenumeration[Exam]
   [text={\white\translate[en=Example, kr=예제]},
   numbercommand={\inframed[corner=round, 
framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, 
background=color,backgroundcolor=dGreen]},
%title=no,
alternataive=hanging,
prefix=yes,
prefixsegments=chapter,
way=bychapter,
before={\blank[big]},
after=\blank]

 
\starttext

\chapter{Spaces}

\section{Space 1}

\startDefinition[def:first]
Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let 
$\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin 
G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal 
T} )$ is called {\bf Fort's space}.
\stopDefinition

\startTheorem[lem:first]
Fort's space is a compact and Hausdorff topological space.\par
\stopTheorem

\startTheorem[thm:second]
Fort's space is a compact and Hausdorff topological space.
\stopTheorem

\startExam[Ex:first]
Example Example Example Example Example Example Example Example Example 
Example Example Example Example Example Example Example Example Example 
Example Example Example Example Example Example Example Example Example 
\stopExam

In this example, we defined \in{Definition}[def:first]. After that, we proved 
\in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], 
we saw an example of it.

\stoptext



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Re: [NTG-context] referencing the customized enumeration with framed title

2018-01-12 Thread Hans Hagen

On 1/12/2018 3:54 AM, Jeong Dal wrote:

Hi,

Some time ago, I am able to use following code(the framed title for Theorems 
and etc.)
Thank Wolfgang and Otared again.

Since it uses the customized style of numbering, there is a problem to 
reference them.
As in the following code, \in{Definition}[] shows no number and \in{Theorem}[] 
shows ?? instead of numbers while \in{Exam}[] shows correctly.

Is there a way to show the numbers correctly?

% in cont-new.mkiv:

\unprotect

\defineconstructionalternative
  [\v!empty]
  [\c!renderingsetup=\??constructionrenderings:\v!empty]

\startsetups[\??constructionrenderings:\v!empty]
\noindent
\useconstructionstyleandcolor\c!style\c!color
\ignorespaces
\stopsetups

\protect

% till here

\defineenumeration[Theorem]
  [alternative=empty,
   before=\startMyText,
   after=\stopMyText]

\defineframed
  [MyFramed]
  [frame=off,
   loffset=1ex,
   roffset=1ex,
   foregroundstyle=\ssbf]

\startuseMPgraphic{MyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt("\MyFramed{\currentconstructiontext}") ;
 %  p := 
textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ;
 %  p := 
textext.rt("\MyFramed{\wrappedconstruction{\currentconstructiontext}}") ;

 %  p := textext.rt("\MyFramed{\wrappedcurrentconstruction}") ;
o := BodyFontSize ;
a := OverlayBox ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
b := a superellipsed .95 ;
draw b ;
b := (boundingbox p) superellipsed .95 ;
fill b withcolor .85white ;
draw b ;
draw p withcolor black ;
setbounds currentpicture to a ;
\stopuseMPgraphic

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

\defineframedtext
  [MyText]
  [frame=off,
   background=MyFrame,
   offset=\bodyfontsize,
   width=\textwidth]

\starttext

\startTheorem[lem]
bla bla
\stopTheorem

Bla bla \in {Lemma} [lem] bla bla.

\stoptext



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

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

Re: [NTG-context] referencing the customized enumeration with framed title

2018-01-12 Thread Hans Hagen

On 1/12/2018 3:54 AM, Jeong Dal wrote:

Hi,

Some time ago, I am able to use following code(the framed title for Theorems 
and etc.)
Thank Wolfgang and Otared again.

Since it uses the customized style of numbering, there is a problem to 
reference them.
As in the following code, \in{Definition}[] shows no number and \in{Theorem}[] 
shows ?? instead of numbers while \in{Exam}[] shows correctly.

Is there a way to show the numbers correctly?

Thank you for reading.

Best regards,

Dalyoung

%%%
\setupcolors[state=start]
\definecolor[dGreen] [r=0,g=.375,b=.0]
%%% define the background of Theorems:
\defineframed
   [FunnyFramed]
   [frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]

\startuseMPgraphic{FunnyFrame}
 picture p ; numeric o ; path a, b ; pair c ;
 p := textext.rt("\FunnyFramed{\enumerationparameter{text} 
\convertedcounter[Theorem]}") ;


p := textext.rt("\FunnyFramed{\currentconstructiontext}") ;

in a next version:
% p := 
textext.rt("\wrappedconstruction{\FunnyFramed{\currentconstructiontext}}") ;
% p := 
textext.rt("\FunnyFramed{\wrappedconstruction{\currentconstructiontext}}") ;

% p := textext.rt("\FunnyFramed{\wrappedcurrentconstruction}") ;



 o := BodyFontSize ;
 a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
 p := p shifted (2o,OverlayHeight-ypart center p) ;
 drawoptions (withpen pencircle scaled 1pt withcolor .625red) ;
 b := a superellipsed .95 ;
 draw b ;
 b := (boundingbox p) superellipsed .95 ;
 fill b withcolor .85white ;
 draw b ;
 draw p withcolor black ;
 setbounds currentpicture to a ;
\stopuseMPgraphic

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]

\defineframedtext
   [FunnyText]
   [frame=off,
background=FunnyFrame,
before={\blank[line,halfline]},
%before={\blank[line]},
 after={\blank[line]},
offset=\bodyfontsize,
width=\textwidth]

\defineenumeration[Theorem]
   [title=yes,
   text={\translate[en=Theorem, kr=정리]},
prefix=yes,
prefixsegments=chapter,
way=bychapter,
alternative=command,
headcommand=\gobbleoneargument,


Don't do this ^^


before=\startFunnyText,
after=\stopFunnyText]

 Definition style
\definenumber[DefNumber][way=bychapter,sectionumber=yes]
\setuptextrules[rulecolor=dBlue]

\define\DefCommand{\incrementnumber[DefNumber]
\textrule[top]{\translate[en=Definition, kr=정 의] \getnumber[DefNumber]}
}   
\defineenumeration[Definition]
[alternative=hanging,
width=fit,
alternative=serried,
text={},
number=no,
before={\DefCommand},
after=\vskip3pt\hrule\blank]

%%% Examples with or without solutions
\defineenumeration[Exam]
[text={\white\translate[en=Example, kr=예제]},
numbercommand={\inframed[corner=round, 
framecolor=dYellow,toffset=-1pt,boffset=-1pt, loffset=1ex,roffset=1ex, 
background=color,backgroundcolor=dGreen]},%height=1.3em,
%title=no,
 prefix=yes,
 prefixsegments=chapter,
 way=bychapter,
 before={\blank[big]},
 after=\blank]

\starttext

\chapter{Spaces}
 
\section{Space 1}


\startDefinition[def:first]
Let $X$ be a uncountable set. Let $\infty$ is a fixed point of $X$. Let 
$\mathcal T$ be the family of subsets $G$ such that either (i) $\infty \notin 
G$ or (ii) $\infty \in G \text{ and } G^c$ is finite. The space $(X, {\mathcal 
T} )$ is called {\bf Fort's space}.
\stopDefinition

\startTheorem[lem:first]
 Fort's space is a compact and Hausdorff topological space.\par
\stopTheorem

\startTheorem[thm:second]
 Fort's space is a compact and Hausdorff topological space.
\stopTheorem

\startExam[Ex:first]
Example Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example Example
Example Example Example Example Example Example Example Example Example
\stopExam

In this example, we defined \in{Definition}[def:first]. After that, we proved 
\in{Lemma}[lem:first] and \in{정리}[thm:second]. Finally, \in{Example}[Ex:first], 
we saw an example of it.

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-