ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* columnsetspan extra line
@ 2016-12-29 12:10 Mikael P. Sundqvist
  2016-12-29 12:43 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: Mikael P. Sundqvist @ 2016-12-29 12:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

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

[-- Attachment #2: ctx-listexample21.pdf --]
[-- Type: application/pdf, Size: 28783 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: columnsetspan extra line
  2016-12-29 12:10 columnsetspan extra line Mikael P. Sundqvist
@ 2016-12-29 12:43 ` Hans Hagen
  2016-12-29 12:53   ` Mikael P. Sundqvist
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2016-12-29 12:43 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: columnsetspan extra line
  2016-12-29 12:43 ` Hans Hagen
@ 2016-12-29 12:53   ` Mikael P. Sundqvist
  0 siblings, 0 replies; 3+ messages in thread
From: Mikael P. Sundqvist @ 2016-12-29 12:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, Dec 29, 2016 at 1:43 PM, Hans Hagen <pragma@wxs.nl> 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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-29 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-29 12:10 columnsetspan extra line Mikael P. Sundqvist
2016-12-29 12:43 ` Hans Hagen
2016-12-29 12:53   ` Mikael P. Sundqvist

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).