ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Martin Bruchanov <bruxy@regnet.cz>
To: ntg-context@ntg.nl
Subject: Two columns type problem
Date: Mon, 13 Feb 2012 14:17:05 +0100	[thread overview]
Message-ID: <20120213131705.GA10561@regnet.cz> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 4666 bytes --]

Hello,

I'm using:  current version: 2012.02.08 21:58
but this problem happens in more versions.

See example document:

http://bruxy.regnet.cz/tmp/twocols_fight.pdf
http://bruxy.regnet.cz/tmp/twocols_fight.ctex

After 4th chapter, there is unwanted blank page. The blank 
page appears every time, when the chapter is on the
top of page.

I want to prepare two columns layout, but chapters
should be overlaid over two cols. I played also with
\definecolumns and columnset environment, but columns
were not balanced and doesn't work as I expected.

The source code:

8<---- 8<---- 8<---- 8<---- 8<---- 8<---- 8<---- 8<----
\mainlanguage[cz]
\language[cz] 
\enableregime[utf] % latin2
\pdfminorversion=4 % verze pdf
\setupbodyfont[9pt]  %
\setuppapersize[A4, portrait][A4, portrait] % A3, A4, A5, A6;
landscape

\setuplayout[
width=175mm,
height=285mm, %285mm
        topspace=5mm,
        header=5mm,
		headerdistance=10mm,
        footer=11mm, %10mm
        bottomspace=5mm,
        bottom=0mm,
]

% Pouziti barev
\setupcolors[state=start]
\setupcolor[rgb]

\setupinterlinespace[medium]

\setupwhitespace[medium]
\setuptabulate[header=repeat]

\setupbodyfontenvironment[default][em=italic]

\startuseMPgraphic{PageDeco} 
	size := 8mm;
	pickup pencircle scaled 0.5mm;

	draw fullcircle scaled size; % shifted (0,-25mm);
	label(textext("\pagenumber"), (0,0)); %shifted (0,-25mm);

	krizy := -size/2 - size/4;
	
	draw (0, -size/2)--(0, -size);

	draw (0,krizy)--(-size/4,krizy);
	draw (0,krizy)--(size/4,krizy);
\stopuseMPgraphic

\defineoverlay[PageDeco][\uniqueMPgraphic{PageDeco}]

\def\Page#1{
	\framed[background={PageDeco},
		align=center, 
		frame=off]
		{~}%\vbox{\bf\rm\switchtobodyfont[48pt]
\color[ChapterNumber]{#1}}}
	}

\setuppagenumbering[%
	alternative=doublesided,
	location={footer, center}, % header, middle, inleft,
inmargin
	command=\Page,
]

\setupinteraction[state=start,color=black] % klikaci dokument
\setupurl[style=type,color=black]

\setupcombinedlist[content][level=1,alternative=c] 
\setuplist[chapter][width=10mm,style=bold]

\setupwhitespace[none] 

% velikost odsazeni
\setupindenting[small,next]  % none, small, medium, bix, next,
first, [rozmer]
\indenting[yes]

% Nastaveni hlavicky
\setupheader[style=\tfx\sc]

\startuseMPgraphic{NumberDeco} 
	size := 1.5cm;
	pickup pencircle scaled 2mm;
	draw fullcircle scaled size; % shifted (0,-25mm);
	label(textext("\bf\ss\switchtobodyfont[28pt]
\namedheadnumber{chapter}"), (0mm,0mm)); %shifted (0,-25mm);

	z0 = (size/2 * cos(45), size/2 * sin(45));
	z1 = (size/2 * cos(45), size/2 * sin(45)) + (size/2,
size/2);

	linecap := butt;

	draw z0--z1;
	linecap := squared;
	draw z1--z1+(-size/2,0);
	draw z1--z1+(0,-size/2);

\stopuseMPgraphic

\defineoverlay[NumberDeco][\uniqueMPgraphic{NumberDeco}]


\def\MyChapter#1#2{ %2 -- text, 1 -- cislo
	\framedtext[width=\overlaywidth,
        offset=10pt,
        strut=no,
        frame=off,
%		bottomframe=on,
        align=right]{%
           \vbox{#2}\vbox{#1}
        }
}

\def\Cislovani#1{
	\framed[background={NumberDeco},
		width=3cm,
		offset=5mm,
		align=center, 
		frame=off]
		{~}%\vbox{\bf\rm\switchtobodyfont[48pt]
\color[ChapterNumber]{#1}}}
	}

\setuphead[chapter][
	numbercommand=\Cislovani,
	style={\bf\switchtobodyfont[28pt]\ss},
	before={\blank[0.5cm]},
	after={\blank[0.5cm]},
	page=no,
]

\def\uv#1{\quotation{#1}}

\setupcaption[location=none]

%\definecolumnset[two][n=2] 

\def\bdvoj{
        \startcolumns[n=2]
%\startcolumnset[two]
}
        
\def\edvoj{
        \stopcolumns
%\stopcolumnset
}

\starttext
\setuppagenumber[state=stop]

\startfrontmatter

\blank[5cm,force]

\startalignment[middle]
{\switchtobodyfont[32pt] Two cols fight}
\stopalignment

\stopfrontmatter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\startbodymatter
\setuppagenumber[state=start,number=5]
\setupbackgrounds[header][text][frame=off,bottomframe=on]

\setupheadertexts[{My two col book}][chapter]

\title{Obsah}
\placelist[chapter][alternative=c,interaction=no]

\page

\dorecurse{10}
{
	\chapter{Pokus}
	
	\bdvoj
	\input knuth
	\input knuth
	\edvoj
}

\stopbodymatter
\stoptext

8<---- 8<---- 8<---- 8<---- 8<---- 8<---- 8<---- 8<----

Thanks for help...

-- 
Martin Bruchanov

Skype     :  bruxytronics
WWW       :  http://bruxy.regnet.cz/
GPG-Key   :  http://bruxy.regnet.cz/bruxy-gpg.key (0x8107ED53)
Linked-In :  http://www.linkedin.com/in/bruxy
Google+   :  http://gplus.to/BruXy

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

                 reply	other threads:[~2012-02-13 13:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120213131705.GA10561@regnet.cz \
    --to=bruxy@regnet.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).