ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda)
@ 2005-03-19 19:42 Gerben Wierda
  2005-03-19 22:22 ` Henning Hraban Ramm
  2005-03-21  2:13 ` h h extern
  0 siblings, 2 replies; 4+ messages in thread
From: Gerben Wierda @ 2005-03-19 19:42 UTC (permalink / raw)


I forgot one part at the end. Here it is again.

I've got this in my environment file:

\def\ClearChapterQuote{\def\ChapterQuote{}}
\ClearChapterQuote
\def\ChQuoteFormat#1{\starttext%
         \startalignment[left]%
         \startnarrower[4*left] \noindent{\hyphenpenalty 10000\em #1}%
         \stopnarrower\stopalignment\stoptext\blank}
\setuphead[chapter]
         [page=left,
         before={\ChQuoteFormat{\ChapterQuote}\noheaderandfooterlines%
                 \page[right]\blank[2*big]},
         after={\ClearChapterQuote\blank[3*big]}%
                 \noheaderandfooterlines]

I've got two problems with this setup:

First, even with the \hyphenpenalty I get this line breaking:

For what can a man accomplish that has not been done
a million times before? What can he say that he will not
find in Lao-Tse or the Bhagavad-gita or the Prophet Isa-
iah?
John Steinbeck — Sweet Thursday

(Interestingly, when I copy/paste this from Apple's Preview.app I get

For what can a man accomplish that has not been done a million times  
before? What can he say that he will not find in Lao-Tse or the  
Bhagavad-gita or the Prophet Isaiah? John Steinbeck — Sweet Thursday)

no -, no line break, etc. Anyway: this line breaking is really ugly. I  
can fix this by hand, but I'd rather have this working automatically.

My second problem is that I get two empty numbered pages between  
chapters. As in
page 13: last text of chapter 1
page 14: empty page with page number
page 15: empty page with page number
page 16: page with quote and no page number
page 17: first page of chapter 2 no page number

I'd like to get rid of pages 14 and 15. I think I need to only do a  
page=left when I am on a right page at that time (page=even has the  
same result)

I even tried:

\setuphead[chapter]
         [page=disable,
          
before={\page[even]\ChQuoteFormat{\ChapterQuote}\noheaderandfooterlines%
                 \page[right]\blank[2*big]},
         after={\ClearChapterQuote\blank[3*big]}%
                 \noheaderandfooterlines]

Thanks,

G

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

* Re: Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda)
  2005-03-19 19:42 Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda) Gerben Wierda
@ 2005-03-19 22:22 ` Henning Hraban Ramm
  2005-03-19 23:27   ` Gerben Wierda
  2005-03-21  2:13 ` h h extern
  1 sibling, 1 reply; 4+ messages in thread
From: Henning Hraban Ramm @ 2005-03-19 22:22 UTC (permalink / raw)


Am 19.03.2005 um 20:42 schrieb Gerben Wierda:

> \def\ClearChapterQuote{\def\ChapterQuote{}}
> \ClearChapterQuote
> \def\ChQuoteFormat#1{\starttext%
>         \startalignment[left]%
>         \startnarrower[4*left] \noindent{\hyphenpenalty 10000\em #1}%
>         \stopnarrower\stopalignment\stoptext\blank}
> \setuphead[chapter]
>         [page=left,
>         before={\ChQuoteFormat{\ChapterQuote}\noheaderandfooterlines%
>                 \page[right]\blank[2*big]},
>         after={\ClearChapterQuote\blank[3*big]}%
>                 \noheaderandfooterlines]
>
> First, even with the \hyphenpenalty I get this line breaking:

Perhaps try \nohyphens instead of the penalty.

(Source: http://source.contextgarden.net/core-spa.tex?search=nohyphens)


Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net

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

* Re: Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda)
  2005-03-19 22:22 ` Henning Hraban Ramm
@ 2005-03-19 23:27   ` Gerben Wierda
  0 siblings, 0 replies; 4+ messages in thread
From: Gerben Wierda @ 2005-03-19 23:27 UTC (permalink / raw)


On 19 Mar 2005, at 23:22, Henning Hraban Ramm wrote:

> Am 19.03.2005 um 20:42 schrieb Gerben Wierda:
>
>> \def\ClearChapterQuote{\def\ChapterQuote{}}
>> \ClearChapterQuote
>> \def\ChQuoteFormat#1{\starttext%
>>         \startalignment[left]%
>>         \startnarrower[4*left] \noindent{\hyphenpenalty 10000\em #1}%
>>         \stopnarrower\stopalignment\stoptext\blank}
>> \setuphead[chapter]
>>         [page=left,
>>         before={\ChQuoteFormat{\ChapterQuote}\noheaderandfooterlines%
>>                 \page[right]\blank[2*big]},
>>         after={\ClearChapterQuote\blank[3*big]}%
>>                 \noheaderandfooterlines]
>>
>> First, even with the \hyphenpenalty I get this line breaking:
>
> Perhaps try \nohyphens instead of the penalty.

Doesn't work.

G

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

* Re: Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda)
  2005-03-19 19:42 Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda) Gerben Wierda
  2005-03-19 22:22 ` Henning Hraban Ramm
@ 2005-03-21  2:13 ` h h extern
  1 sibling, 0 replies; 4+ messages in thread
From: h h extern @ 2005-03-21  2:13 UTC (permalink / raw)


Gerben Wierda wrote:
> I forgot one part at the end. Here it is again.
> 
> I've got this in my environment file:
> 
> \def\ClearChapterQuote{\def\ChapterQuote{}}
> \ClearChapterQuote
> \def\ChQuoteFormat#1{\starttext%

                        ^^^^^^^^^^ no

>         \startalignment[left]%
>         \startnarrower[4*left] \noindent{\hyphenpenalty 10000\em #1}%
                                            ^^^^^^^^^^^^^^^^^^^^ see below
>         \stopnarrower\stopalignment\stoptext\blank}

                                       ^^^^^^^^ no

> \setuphead[chapter]
>         [page=left,
>         before={\ChQuoteFormat{\ChapterQuote}\noheaderandfooterlines%
>                 \page[right]\blank[2*big]},
                               ^^^^^^ space at top is discarded, use [force,2*big]
>         after={\ClearChapterQuote\blank[3*big]}%
>                 \noheaderandfooterlines]
> 
> I've got two problems with this setup:

a bit more readable (less code in key/val)

\setuphead
   [chapter]
   [page=,
    before=\setups{chapter:before},
    after=\setups{chapter:after}]

\startsetups chapter:before

     \page[left]

     \noheaderandfooterlines

     \startalignment[left,nothyphenated]
         \startnarrower[4*left]
             \noindent \em \setups[chapter:quote]
         \stopnarrower
     \stopalignment

     \resetsetups[quote:text]

     \page[right]

     \noheaderandfooterlines

     \blank[force,2*big]

\stopsetups

\startsetups [chapter:after]

     \blank[3*big]

\stopsetups

\setupheadertexts[header]
\setupfootertexts[footer]
\starttext

\startsetups [chapter:quote]

For what can a man accomplish that has not been done
a million times before? What can he say that he will not
find in Lao-Tse or the Bhagavadgita or the Prophet Isaiah?

\stopsetups

\chapter{TEST}

\stoptext

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

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

end of thread, other threads:[~2005-03-21  2:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-19 19:42 Repost: Two problems with my chapter quote setup (Modified by Gerben Wierda) Gerben Wierda
2005-03-19 22:22 ` Henning Hraban Ramm
2005-03-19 23:27   ` Gerben Wierda
2005-03-21  2:13 ` h h extern

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).