Re: [NTG-context] align natural tables left and right

2016-12-29 Thread Rik Kabel

On 2016-12-29 11:31, MF wrote:

Hello list,
please take a look at this:

\setupbackgrounds[text][frame=on]

\starttext

Preceding text.

\startplacetable[location={none,fit,force,here,middle}]
\bTABLE
   \bTR
  \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
   \eTR
   \bTR
  \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
   \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,left}]
\bTABLE
   \bTR
  \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
   \eTR
   \bTR
  \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
   \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,right}]
\bTABLE
   \bTR
  \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
   \eTR
   \bTR
  \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
   \eTR
\eTABLE
\stopplacetable

Following text.

\stoptext

It's the same table repeated on three pages, with some preceding text
and some following text.
Only the "location" option of \startplacetable is modified across
pages: "middle" in page 1, "left" in page 2, "right" in page 3.

When I use location=middle (page 1), the table is centered and the
"Following text" goes after (under) the table. This is what I want to
achieve: the following text should be under the table.

Using location=left or location=right, the "Following text" is not
placed under the table. How can I achieve that?

Thanks in advance,
Massi

Consider your third example, slightly modified:

   \startplacetable[location={none,fit,force,here,right}]
   \bTABLE
  \bTR
 \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
 \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
   \eTABLE
   \stopplacetable

   Following text.

   Following text.

   Following text.

   Following text.

And this example, with a frame around the table:

   \startframed[frame=off,align=right]
   \startplacetable[location={none,fit,force,here}]
   \bTABLE
  \bTR
 \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
 \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
   \eTABLE
   \stopplacetable
   \stopframed

   Following text.

   Following text.

   Following text.

   Following text.


The float location left (right) allows flowing text around the float. 
You do not want that, so do not use it.


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

[NTG-context] align natural tables left and right

2016-12-29 Thread MF
Hello list,
please take a look at this:

\setupbackgrounds[text][frame=on]

\starttext

Preceding text.

\startplacetable[location={none,fit,force,here,middle}]
\bTABLE
  \bTR
 \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
 \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,left}]
\bTABLE
  \bTR
 \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
 \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\page

Preceding text.

\startplacetable[location={none,fit,force,here,right}]
\bTABLE
  \bTR
 \bTD $a_{11}$ \eTD \bTD $a_{12}$ \eTD
  \eTR
  \bTR
 \bTD $a_{21}$ \eTD \bTD $a_{22}$ \eTD
  \eTR
\eTABLE
\stopplacetable

Following text.

\stoptext

It's the same table repeated on three pages, with some preceding text
and some following text.
Only the "location" option of \startplacetable is modified across
pages: "middle" in page 1, "left" in page 2, "right" in page 3.

When I use location=middle (page 1), the table is centered and the
"Following text" goes after (under) the table. This is what I want to
achieve: the following text should be under the table.

Using location=left or location=right, the "Following text" is not
placed under the table. How can I achieve that?

Thanks in advance,
Massi
___
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] columnsetspan extra line

2016-12-29 Thread Mikael P. Sundqvist
On Thu, Dec 29, 2016 at 1:43 PM, Hans Hagen  wrote:
> On 12/29/2016 1:10 PM, Mikael P. Sundqvist wrote:
>
>> 3) Is there a simple way to define the height of the frame (that is
>> now set to 0.3\textheight) to be a certain number of lines?
>
>
> 5\lineheight
>
>
> -
>   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
> ___

Thanks, that worked indeed (I had to skip the style of the chapter,
and put the \definedfont and \setupinterlinespace inside the macro).

For 2) I noted that a grid=no as option to \startframedtext results in
the frame starting from the top. Maybe there is a cleaner solution?
grid=?

1) was actually my main concern. Any idea?

/Mikael
___
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] columnsetspan extra line

2016-12-29 Thread Hans Hagen

On 12/29/2016 1:10 PM, Mikael P. Sundqvist wrote:


3) Is there a simple way to define the height of the frame (that is
now set to 0.3\textheight) to be a certain number of lines?


5\lineheight


-
  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] columnsetspan extra line

2016-12-29 Thread Mikael P. Sundqvist
Dear all,

I'm struggling with the column environments these days. The code below
runs fine, but there are some problems with the result.

1) There is an extra blank line at the top of the left column. I can
get rid of it with a \vskip-\baselineksip (commented out in the
example) but that feels like a hack. Does anyone see why it is there
from the beginning?

2) Why is the frame something like 3 lines down from the top of the
page? Can I force it to be on top?

3) Is there a simple way to define the height of the frame (that is
now set to 0.3\textheight) to be a certain number of lines?

%%% Start of example
\usemodule[newcolumnsets]

\setuplayout[
grid=yes,
]

\showgrid

\definecolumnset[example][n=2]
\definecolumnsetspan[intro][n=2,after=,before=,]


\define[1]\mychapnum{%
\startuseMPgraphic{chapnum}
label(btex {\bf #1} etex scaled 12,
(0.5*OverlayWidth,0.5*OverlayHeight)) withcolor darkred;
setbounds currentpicture to unitsquare xyscaled (OverlayWidth,OverlayHeight);
\stopuseMPgraphic
}
\defineoverlay[chapnum][\useMPgraphic{chapnum}]

\define[1]\mychaptext{%
\startcolumnsetspan[intro]
\startframedtext[align={middle,lohi},background=chapnum,frame=on,framecolor=darkyellow,rulethickness=2pt,width=\makeupwidth,height=0.3\textheight,after=,before=]
\setupinterlinespace[line=60pt] #1
\stopframedtext
\stopcolumnsetspan
}


\setuphead[chapter][
style={\definedfont[Serif at 48pt]},
numbercommand=\mychapnum,
textcommand=\mychaptext,
after=,
before=,
page=no,
]


\starttext

\startcolumnset[example]
\chapter{A chapter}

%\vskip-\baselineskip
\dorecurse{2}{\input knuth \par}
\stopcolumnset


\stoptext
%%% end of example


ctx-listexample21.pdf
Description: Adobe PDF document
___
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] integral symbol

2016-12-29 Thread Hans Hagen

On 12/29/2016 12:12 PM, Fabrice Couvreur wrote:

Hi Hans,
Thanks for your solution. I created a macro, is it "robust" ?
Fabrice

\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]


\unexpanded

\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}

\starttext
 \integ{4}{1}{g(x)}
\stoptext


2016-12-28 18:40 GMT+01:00 Hans Hagen >:

On 12/28/2016 6:14 PM, Alan Braslau wrote:

Hi Hans, Hi list,

This is similar to what we have discussed earlier on this list and
elsewhere regarding \over vs. \frac. (I agree with Knuth that {a
\over
b} is *much* more readable in running source code than
\frac{a}{b} but
have resigned myself to use \frac{}{}, as this can be made better
behaved and gives a much better result.)

Other traditional TeX constructs like \int^a_b have their charm (and
need to remain supported, just like is \over), but I support
introducing and encouraging the use of new constructs like your
example
below. An alternative syntax (that could co-exist) would be
admitting
$\left\int ... \right.$, but I do not know what limitations
there might
be with both the (luatex) engine and with ConTeXt.


the tricky part there is that int has super and subscripts while
left / right are different animals ... i looked into this (in the
engine) and decided to delay implementing that (i might do it some
day but it's sort of tricky to keep compatibility)

also, ints are upright (extensible or stepwise sizes) or slanted
(stepwise sizes) so even if we support something there are some
limitations due to lack of font support (could be dealt with in due
time)

The problem with extensions, like always, in straying from
traditional
TeX is interchangeability of code, or, more importantly, in the
learning curve obstacles that this introduces to traditional TeX
(and
LaTeX) thinking. I know that at some level we do not care, for
we often
make (good) design choices that improve the syntax of ConTeXt.

Perhaps we can use this thread to discuss other cases (like
\sum, ...)
that present difficulties and then decide on good solutions.


sure ...

Hans

-
  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] integral symbol

2016-12-29 Thread Fabrice Couvreur
Hi Hans,
Thanks for your solution. I created a macro, is it "robust" ?
Fabrice

\setupmathextensible[integral][rightoffset=-3mu,exact=yes,factor=2]
\def\integ#1#2#3{\math{\autointegral{#1}{#2}{#3}\diff x}}

\starttext
 \integ{4}{1}{g(x)}
\stoptext


2016-12-28 18:40 GMT+01:00 Hans Hagen :

> On 12/28/2016 6:14 PM, Alan Braslau wrote:
>
>> Hi Hans, Hi list,
>>
>> This is similar to what we have discussed earlier on this list and
>> elsewhere regarding \over vs. \frac. (I agree with Knuth that {a \over
>> b} is *much* more readable in running source code than \frac{a}{b} but
>> have resigned myself to use \frac{}{}, as this can be made better
>> behaved and gives a much better result.)
>>
>> Other traditional TeX constructs like \int^a_b have their charm (and
>> need to remain supported, just like is \over), but I support
>> introducing and encouraging the use of new constructs like your example
>> below. An alternative syntax (that could co-exist) would be admitting
>> $\left\int ... \right.$, but I do not know what limitations there might
>> be with both the (luatex) engine and with ConTeXt.
>>
>
> the tricky part there is that int has super and subscripts while left /
> right are different animals ... i looked into this (in the engine) and
> decided to delay implementing that (i might do it some day but it's sort of
> tricky to keep compatibility)
>
> also, ints are upright (extensible or stepwise sizes) or slanted (stepwise
> sizes) so even if we support something there are some limitations due to
> lack of font support (could be dealt with in due time)
>
> The problem with extensions, like always, in straying from traditional
>> TeX is interchangeability of code, or, more importantly, in the
>> learning curve obstacles that this introduces to traditional TeX (and
>> LaTeX) thinking. I know that at some level we do not care, for we often
>> make (good) design choices that improve the syntax of ConTeXt.
>>
>> Perhaps we can use this thread to discuss other cases (like \sum, ...)
>> that present difficulties and then decide on good solutions.
>>
>
> sure ...
>
> Hans
>
> -
>   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/list
> info/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
___