Re: [NTG-context] Bug in wrapped placefigure

2018-03-29 Thread Hans Hagen

On 3/29/2018 11:17 PM, Henri Menke wrote:

On Thu, 2018-03-29 at 13:20 +0200, Hans Hagen wrote:

On 3/29/2018 12:50 PM, Henri Menke wrote:


Dear devs,

When a figure is wrapped in a paragraph and that paragraph is the first
in a section, ConTeXt adds spurious vertical space above the text
(eyeballing it, I'd say it is \topskip).  Find MWE with workaround below.

Found at https://tex.stackexchange.com/questions/423817

Cheers, Henri

---

\setupwhitespace[big]

\starttext

\startsection[title=section]

    \startmode[fix]
  % Set default whitespace
  \setupwhitespace[none]
    \stopmode

    \startplacefigure
  [location={right},
    title={just a dummy figure}]
  \externalfigure[dummy][width=.5\textwidth]
    \stopplacefigure

    \input lorem

    \startmode[fix]
  % Restore whitespace
  \setupwhitespace[big]
    \stopmode

    \input lorem

\stopsection

\stoptext

can you test with

\def\page_sides_wrapup
    {% we need to do this aftergroup
 \aftergroup\par
 \aftergroup\ignoreparskip
 \aftergroup\ignorespaces
 }


Interesting.  This fixes it in beta but not in TL17.


side floats are redone recently ... so partly incompatible code with TL17


BTW: What snapshot is going to be in TL18?


i might push a current





-
    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
__
_

___
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 in wrapped placefigure

2018-03-29 Thread luigi scarso
On Thu, Mar 29, 2018 at 11:17 PM, Henri Menke  wrote:
> BTW: What snapshot is going to be in TL18?

current (ie tags/1.07.0) with luatex lua 5.2.4


-- 
luigi
___
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 in wrapped placefigure

2018-03-29 Thread Henri Menke
On Thu, 2018-03-29 at 13:20 +0200, Hans Hagen wrote:
> On 3/29/2018 12:50 PM, Henri Menke wrote:
> > 
> > Dear devs,
> > 
> > When a figure is wrapped in a paragraph and that paragraph is the first
> > in a section, ConTeXt adds spurious vertical space above the text
> > (eyeballing it, I'd say it is \topskip).  Find MWE with workaround below.
> > 
> > Found at https://tex.stackexchange.com/questions/423817
> > 
> > Cheers, Henri
> > 
> > ---
> > 
> > \setupwhitespace[big]
> > 
> > \starttext
> > 
> > \startsection[title=section]
> > 
> >    \startmode[fix]
> >  % Set default whitespace
> >  \setupwhitespace[none]
> >    \stopmode
> > 
> >    \startplacefigure
> >  [location={right},
> >    title={just a dummy figure}]
> >  \externalfigure[dummy][width=.5\textwidth]
> >    \stopplacefigure
> > 
> >    \input lorem
> > 
> >    \startmode[fix]
> >  % Restore whitespace
> >  \setupwhitespace[big]
> >    \stopmode
> > 
> >    \input lorem
> > 
> > \stopsection
> > 
> > \stoptext
> can you test with
> 
> \def\page_sides_wrapup
>    {% we need to do this aftergroup
> \aftergroup\par
> \aftergroup\ignoreparskip
> \aftergroup\ignorespaces
> }

Interesting.  This fixes it in beta but not in TL17.

BTW: What snapshot is going to be in TL18?

> 
> 
> 
> -
>    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
> __
> _
___
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] Circled text in metapost

2018-03-29 Thread Gerhard Kugler
On Thu, Mar 29, 2018 at 07:11:50AM -0600, Alan Braslau wrote:
> On Thu, 29 Mar 2018 12:43:56 +0200
> Gerhard Kugler  wrote:
> 
> > One misunderstanding made by my post: I want to write the text curved
> > as a (half-)circle.
> 
> Take a look at the Metafun manual.
> 

In the manual is an example on page 233 with the following content:

-

\def\rotatetokens#1#2#3#4% delta extra radius tokens
{\vbox\bgroup
\MPtoks\emptytoks
\resetMPdrawing
\startMPdrawing
picture pic[] ;
numeric wid, len[], rot ;
numeric delta, extra, radius, n, r ;
len[0] := n := 0 ;
delta := #1 ; extra := #2 ; radius := #3 ;
\stopMPdrawing
\handletokens#4\with\processrotationtoken
\startMPdrawing
r := len[n]/Pi ;
for i=1 upto n :
wid := abs(xpart lrcorner pic[i] -
xpart llcorner pic[i]) ;
rot := extra + delta -
((len[i]-.5wid)/len[n]) * (180+2delta) ;
draw pic[i]
rotatedaround (origin,-270) shifted (-r-radius,
ypart -.5[ulcorner pic[i], llcorner pic[i]])
rotatedaround (origin,rot) ;
endfor ;
\stopMPdrawing
\MPdrawingdonetrue
\getMPdrawing
\resetMPdrawing
\egroup}

\startcombination[3*1]
{\rotatetokens {0} {0}{0}{Does it work ok?}} {A}
{\rotatetokens{20} {0}{0}{Does it work ok?}} {B}
{\rotatetokens{20}{30}{0}{Does it work ok?}} {C}
\stopcombination

-

But I cannot see what part calls what parts and how they can be
embedded.

Gerhard


-- 
Gerhard Kugler
Bensheim
___
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] Circled text in metapost

2018-03-29 Thread Alan Braslau
On Thu, 29 Mar 2018 12:43:56 +0200
Gerhard Kugler  wrote:

> One misunderstanding made by my post: I want to write the text curved
> as a (half-)circle.

Take a look at the Metafun manual.

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

Re: [NTG-context] Bug in wrapped placefigure

2018-03-29 Thread Hans Hagen

On 3/29/2018 12:50 PM, Henri Menke wrote:

Dear devs,

When a figure is wrapped in a paragraph and that paragraph is the first
in a section, ConTeXt adds spurious vertical space above the text
(eyeballing it, I'd say it is \topskip).  Find MWE with workaround below.

Found at https://tex.stackexchange.com/questions/423817

Cheers, Henri

---

\setupwhitespace[big]

\starttext

\startsection[title=section]

   \startmode[fix]
 % Set default whitespace
 \setupwhitespace[none]
   \stopmode

   \startplacefigure
 [location={right},
   title={just a dummy figure}]
 \externalfigure[dummy][width=.5\textwidth]
   \stopplacefigure

   \input lorem

   \startmode[fix]
 % Restore whitespace
 \setupwhitespace[big]
   \stopmode

   \input lorem

\stopsection

\stoptext

can you test with

\def\page_sides_wrapup
  {% we need to do this aftergroup
   \aftergroup\par
   \aftergroup\ignoreparskip
   \aftergroup\ignorespaces
   }



-
  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] Bug in wrapped placefigure

2018-03-29 Thread Henri Menke
Dear devs,

When a figure is wrapped in a paragraph and that paragraph is the first
in a section, ConTeXt adds spurious vertical space above the text
(eyeballing it, I'd say it is \topskip).  Find MWE with workaround below.

Found at https://tex.stackexchange.com/questions/423817

Cheers, Henri

---

\setupwhitespace[big]

\starttext

\startsection[title=section]

  \startmode[fix]
% Set default whitespace
\setupwhitespace[none]
  \stopmode

  \startplacefigure
[location={right},
  title={just a dummy figure}]
\externalfigure[dummy][width=.5\textwidth]
  \stopplacefigure

  \input lorem

  \startmode[fix]
% Restore whitespace
\setupwhitespace[big]
  \stopmode

  \input lorem

\stopsection

\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] Circled text in metapost

2018-03-29 Thread Gerhard Kugler
Thank you very much for these examples. The most important hints are
given now. Perhaps I am able to apply them.

One misunderstanding made by my post: I want to write the text curved
as a (half-)circle.

Gerhard

-- 
Gerhard Kugler
Bensheim
___
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] Circled text in metapost

2018-03-29 Thread Hans Hagen

On 3/29/2018 11:52 AM, Henri Menke wrote:

On 03/29/2018 10:28 PM, Gerhard Kugler wrote:

Hi,

in documentations I can find various examples of circled text. But
copying them I had no success till now.

I want to place text in half circles of various radiuses. Is there
anywhere a simple example?


The Metafun experts would probably tear this apart...
 
\startuniqueMPgraphic{half circle}

   path p, q ;
   p := fullcircle scaled OverlayWidth;
   q := (p cutafter (point .5 along p)) shifted (0,-.5BodyFontSize) ;
   fill q -- cycle withcolor lightgray ;
   draw q withpen pencircle scaled 2pt withcolor darkred ;
   setbounds currentpicture to boundingbox p ;
\stopuniqueMPgraphic

\defineoverlay[half circle][\uniqueMPgraphic{half circle}]

\starttext

\framed[background=half circle,frame=off]{Text width half circle.}

\stoptext


Well, if you really want a tear down ...

\startuniqueMPgraphic{half circle}
path p ; p := halfcircle scaled OverlayWidth shifted center 
OverlayBox ;

path q ; q := p shifted (0,-StrutDepth)  ;
draw image (
fill q -- cycle withcolor OverlayColor ;
draw q  withcolor OverlayLineColor ;
) withpen pencircle scaled 2pt ;
setbounds currentpicture to boundingbox OverlayBox ;
\stopuniqueMPgraphic

\defineoverlay[half circle][\uniqueMPgraphic{half circle}]

\starttext

\framed
  [background=half circle,
   frame=off,
   framecolor=red,
   backgroundcolor=lightgray]
  {Text width half circle.}

\framed
  [background=half circle,
   frame=off,
   framecolor=red,
   backgroundcolor=lightgray]
  {Text width half circle and more.}

\stoptext




My greatest problems seem to be in the embedding code.

Gerhard




___
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] Combine overlapping margin notes with separator

2018-03-29 Thread Henri Menke
On 03/29/2018 09:59 PM, Hans Hagen wrote:
> On 3/29/2018 6:34 AM, Henri Menke wrote:
>> Bump!
> 
> thers is currently no mechanism to collect entries (one can stack them
> but no auto-separator)

What about horizontal stacking?  (If it is already available, it is not
clearly documented)

> 
>> On Mon, 2018-03-19 at 01:39 -0700, Benjamin Epstein wrote:
>>> Hello!
>>>
>>> I am typesetting a text with line numbers in the margin and am
>>> interested in
>>> combining them if two should end up on the same line, dividing them
>>> with a
>>> comma or something like that.  With the code below, the first line of
>>> the
>>> output contains an overlapping "1" and "2" in the margin.  I would
>>> like the
>>> "1" and "2" not to be overlapping, nor to be stacked like
>>> \setupmargindata[stack=yes] would get me, but rather to automatically
>>> combine
>>> those that would overlap to get something like "1,2".
>>>
>>> Current output: https://i.imgur.com/RaTQ1ZO.png
>>> Desired output: https://i.imgur.com/oWKigTX.png
>>>
>>> Is there a reliable way to implement this?  Any help would be
>>> appreciated!
>>>
>>> ***
>>>
>>> \starttext
>>>
>>> \inmargin{1}Now we are engaged in a great civil war.
>>> \inmargin{2}We are testing whether that nation or any nation so
>>> conceived
>>> and so dedicated, can long endure.
>>> \inmargin{3}We are met on a great battle-field of that war.
>>>
>>> \stoptext
>>>
>>> ***
>>>
>>> Thank you,
>>> Benjamin
>>> __
>>>
>>> _
>>> If your question is of interest to others as well, please add an
>>> entry to the
>>> Wiki!
>>>
>>> maillist : ntg-context@ntg.nl /
>>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>>> wiki : http://contextgarden.net
>>> __
>>>
>>> _
>> ___
>>
>> If your question is of interest to others as well, please add an entry
>> to the Wiki!
>>
>> maillist : ntg-context@ntg.nl /
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
>>
>>
> 
> 

___
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] Circled text in metapost

2018-03-29 Thread Henri Menke
On 03/29/2018 10:28 PM, Gerhard Kugler wrote:
> Hi,
> 
> in documentations I can find various examples of circled text. But
> copying them I had no success till now.
> 
> I want to place text in half circles of various radiuses. Is there
> anywhere a simple example?

The Metafun experts would probably tear this apart...


\startuniqueMPgraphic{half circle}
  path p, q ;
  p := fullcircle scaled OverlayWidth;
  q := (p cutafter (point .5 along p)) shifted (0,-.5BodyFontSize) ;
  fill q -- cycle withcolor lightgray ;
  draw q withpen pencircle scaled 2pt withcolor darkred ;
  setbounds currentpicture to boundingbox p ;
\stopuniqueMPgraphic

\defineoverlay[half circle][\uniqueMPgraphic{half circle}]

\starttext

\framed[background=half circle,frame=off]{Text width half circle.}

\stoptext


> 
> My greatest problems seem to be in the embedding code.
> 
> Gerhard
> 
> 

___
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] Circled text in metapost

2018-03-29 Thread Gerhard Kugler
Hi,

in documentations I can find various examples of circled text. But
copying them I had no success till now.

I want to place text in half circles of various radiuses. Is there
anywhere a simple example?

My greatest problems seem to be in the embedding code.

Gerhard


-- 
Gerhard Kugler
Bensheim
___
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] Combine overlapping margin notes with separator

2018-03-29 Thread Hans Hagen

On 3/29/2018 6:34 AM, Henri Menke wrote:

Bump!


thers is currently no mechanism to collect entries (one can stack them 
but no auto-separator)



On Mon, 2018-03-19 at 01:39 -0700, Benjamin Epstein wrote:

Hello!

I am typesetting a text with line numbers in the margin and am interested in
combining them if two should end up on the same line, dividing them with a
comma or something like that.  With the code below, the first line of the
output contains an overlapping "1" and "2" in the margin.  I would like the
"1" and "2" not to be overlapping, nor to be stacked like
\setupmargindata[stack=yes] would get me, but rather to automatically combine
those that would overlap to get something like "1,2".

Current output: https://i.imgur.com/RaTQ1ZO.png
Desired output: https://i.imgur.com/oWKigTX.png

Is there a reliable way to implement this?  Any help would be appreciated!

***

\starttext

\inmargin{1}Now we are engaged in a great civil war.
\inmargin{2}We are testing whether that nation or any nation so conceived
and so dedicated, can long endure.
\inmargin{3}We are met on a great battle-field of that war.

\stoptext

***

Thank you,
Benjamin
__
_
If your question is of interest to others as well, please add an entry to the
Wiki!

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

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

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




--

-
  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
___