ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to: get TeX to warn me when it breaks a chunk of text overpages.
@ 2002-03-08 10:57 Daniel Pittman
  2002-03-08 12:41 ` How to: get TeX to warn me when it breaks a chunk of text over pages Johannes Hüsing
  2002-03-08 14:04 ` John Culleton
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Pittman @ 2002-03-08 10:57 UTC (permalink / raw)


As part of writing the recipe book that I am working on I want to
achieve something a bit non-standard in terms of TeX page breaking.

Because the book is intended to be sitting on the bench and read while I
am in the middle of cooking, breaking a recipe over a page boundary is a
/very/ undesirable thing to do.

I would rather have (and have to fill) whitespace on the page than a
page break in the middle of a recipe.

Now, I don't think that I can get TeX to do much of the work of ordering
recipes for me to automatically fill the space optimally, at least not
if I want to be able to have recipes that are longer than a single page.

I tried placing each recipe in a float which solved the page break issue
tolerably but cut of recipes that extended longer than a single page --
without a warning or error. :/

I don't mind having to go through and manually paginate in places and to
reorder recipes to achieve the layout that I want. Having TeX do some or
all of this would be nice but...

What would be great would be to be able to discourage page breaking
within the recipe and to have TeX warn me when it does break within the
bounds of the recipe.

I don't know how on-topic this is for the list but I hope that someone
can help me.

Thanks,
        Daniel

-- 
[It's said that hallucinogenic drugs give insight] 
But just what kind of insight are we talking about here? Are we talking about
the Second Law of Thermodynamics? Or are we talking about "Oh wow, like, I
finally realized that, deep down inside, I'm me."?
        -- P.J. O'Rourke


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

* Re: How to: get TeX to warn me when it breaks a chunk of text over pages.
  2002-03-08 10:57 How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
@ 2002-03-08 12:41 ` Johannes Hüsing
  2002-03-08 14:04 ` John Culleton
  1 sibling, 0 replies; 6+ messages in thread
From: Johannes Hüsing @ 2002-03-08 12:41 UTC (permalink / raw)


On Fri, Mar 08, 2002 at 09:57:19PM +1100, Daniel Pittman wrote:
> As part of writing the recipe book that I am working on I want to
> achieve something a bit non-standard in terms of TeX page breaking.
> 

Not that it's non-standard ... within TeX you can set the \penalty in 
vertical mode to a large negative value between two recipes.

[...]
> 
> I would rather have (and have to fill) whitespace on the page than a
> page break in the middle of a recipe.
> 

In ConTeXt encouraging pagebreks is done with

\page[bigpreference] 

and it is better to encourage pagebreaks than to discourage them elsewhere. 

To my mind the bigpreference is sometimes not big enough. I once typeset 
a final exam with multiple choice questions. I did not manage to suppress
all page breaks within questions.

Greetings

Johannes
-- 
Johannes Hüsing   There is something fascinating about science. One gets
hannes@ruhrau.de  such wholesale returns of conjecture from such a 
                  trifling investment of fact.                Mark Twain


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

* Re: How to: get TeX to warn me when it breaks a chunk of text over pages.
  2002-03-08 10:57 How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
  2002-03-08 12:41 ` How to: get TeX to warn me when it breaks a chunk of text over pages Johannes Hüsing
@ 2002-03-08 14:04 ` John Culleton
  2002-03-08 22:23   ` How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
  1 sibling, 1 reply; 6+ messages in thread
From: John Culleton @ 2002-03-08 14:04 UTC (permalink / raw)


On Friday 08 March 2002 05:57, Daniel Pittman wrote:
> As part of writing the recipe book that I am working on I want
> to achieve something a bit non-standard in terms of TeX page
> breaking.
>
> Because the book is intended to be sitting on the bench and
> read while I am in the middle of cooking, breaking a recipe
> over a page boundary is a /very/ undesirable thing to do.
>
> I would rather have (and have to fill) whitespace on the page
> than a page break in the middle of a recipe.
>
>
> Now, I don't think that I can get TeX to do much of the work
> of ordering recipes for me to automatically fill the space
> optimally, at least not if I want to be able to have recipes
> that are longer than a single page.
>
> I tried placing each recipe in a float which solved the page
> break issue tolerably but cut of recipes that extended longer
> than a single page -- without a warning or error. :/
>
>
> I don't mind having to go through and manually paginate in
> places and to reorder recipes to achieve the layout that I
> want. Having TeX do some or all of this would be nice but...
>
>
> What would be great would be to be able to discourage page
> breaking within the recipe and to have TeX warn me when it
> does break within the bounds of the recipe.
>
>
> I don't know how on-topic this is for the list but I hope that
> someone can help me.
>
> Thanks,
>         Daniel

The traditional way of handling this is the \filbreak command. It
says in effect ``break the page here unless there is room for 
the next chunk of text followed by a \filbreak command.'' See
the TeXBook page 111. Thst fits your recipe situation perfectly.

Now I don't know what the interaction is between \filbreak and
Context. You may have to retreat to pdftex, but probably not. 

This will work more reliably than floats. 

John Culleton


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

* Re: How to: get TeX to warn me when it breaks a chunk of text overpages.
  2002-03-08 14:04 ` John Culleton
@ 2002-03-08 22:23   ` Daniel Pittman
  2002-03-10  0:51     ` How to: get TeX to warn me when it breaks a chunk of text over pages Bruce Horrocks
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Pittman @ 2002-03-08 22:23 UTC (permalink / raw)


On Fri, 8 Mar 2002, John Culleton wrote:
> On Friday 08 March 2002 05:57, Daniel Pittman wrote:

[...]

>> I would rather have (and have to fill) whitespace on the page
>> than a page break in the middle of a recipe.

[...]

>> What would be great would be to be able to discourage page
>> breaking within the recipe and to have TeX warn me when it
>> does break within the bounds of the recipe.

[...]

> The traditional way of handling this is the \filbreak command. It
> says in effect ``break the page here unless there is room for 
> the next chunk of text followed by a \filbreak command.'' See
> the TeXBook page 111. Thst fits your recipe situation perfectly.

The \filbreak command achieves the first part of what I want very
nicely. It places whitespace to maximize the degree to which a recipe
will remain on a single page but does not prevent page breaking.

This is great -- thanks for that. :)

I still don't get a warning if a recipe is longer than a single page,
though, which is a shame. It's not an insoluble problem, just an
annoyance. I wish that TeX would tell me when I had work to do on the
layout. ;)

I don't have the TeXbook[1] yet. Is the recipe on p.111 more than just
the use of the \filbreak operation? If so, would you summarize it for me
please?

Thanks, though. This is /so/ much of an improvement.
        Daniel

Footnotes: 
[1]  Which annoys me, but I can't afford it for a little while since I
     became suddenly out of work. :(

-- 
We close our eyes and look in opposite direction.
We ignore the threats and hope they'll go away.
We refuse to pay attention to the dangers we create
in the name of our fathers we kill our children.
        -- Covenant, _Theremin_


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

* Re: How to: get TeX to warn me when it breaks a chunk of text over pages.
  2002-03-08 22:23   ` How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
@ 2002-03-10  0:51     ` Bruce Horrocks
  2002-03-10  2:18       ` How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
  0 siblings, 1 reply; 6+ messages in thread
From: Bruce Horrocks @ 2002-03-10  0:51 UTC (permalink / raw)


In message <87ofhy1yxa.fsf@inanna.rimspace.net>,
on Sat, 9 Mar 2002 at 09:23:45, Daniel Pittman wrote:

>I still don't get a warning if a recipe is longer than a single page, 
>though, which is a shame. It's not an insoluble problem, just an 
>annoyance. I wish that TeX would tell me when I had work to do on the 
>layout. ;)

Can you not have a \startofrecipe command that simply stores the current 
page number (\pageno) and an \endofrecipe command that compares the 
previous stored value with the current page number. If they are 
different then a new page must have occurred and you can have the macro 
write a warning message and the page number to the log file so that you 
know where to go and look?

Regards,

-- 
Bruce Horrocks
Hampshire
England
bh@granby.demon.co.uk


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

* Re: How to: get TeX to warn me when it breaks a chunk of text overpages.
  2002-03-10  0:51     ` How to: get TeX to warn me when it breaks a chunk of text over pages Bruce Horrocks
@ 2002-03-10  2:18       ` Daniel Pittman
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Pittman @ 2002-03-10  2:18 UTC (permalink / raw)


On Sun, 10 Mar 2002, Bruce Horrocks wrote:
> In message <87ofhy1yxa.fsf@inanna.rimspace.net>,
> on Sat, 9 Mar 2002 at 09:23:45, Daniel Pittman wrote:
> 
>> I still don't get a warning if a recipe is longer than a single page,
>> though, which is a shame. It's not an insoluble problem, just an
>> annoyance. I wish that TeX would tell me when I had work to do on the
>> layout. ;)
> 
> Can you not have a \startofrecipe command that simply stores the
> current page number (\pageno) and an \endofrecipe command that
> compares the previous stored value with the current page number. If
> they are different then a new page must have occurred and you can have
> the macro write a warning message and the page number to the log file
> so that you know where to go and look?

Thank you very much. /That/ will work perfectly. Yay!

        Daniel

-- 
Solum certum nihil esse certi.
the only certainty is that nothing is certain
        -- Pliny the Elder, _Historia Naturalis_


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

end of thread, other threads:[~2002-03-10  2:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-08 10:57 How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
2002-03-08 12:41 ` How to: get TeX to warn me when it breaks a chunk of text over pages Johannes Hüsing
2002-03-08 14:04 ` John Culleton
2002-03-08 22:23   ` How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman
2002-03-10  0:51     ` How to: get TeX to warn me when it breaks a chunk of text over pages Bruce Horrocks
2002-03-10  2:18       ` How to: get TeX to warn me when it breaks a chunk of text overpages Daniel Pittman

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