force text block to bottom of page

Everything related to our flagship word processor.
Post Reply
MyronGochnauer
Posts: 8
Joined: 2009-08-12 02:59:46

force text block to bottom of page

Post by MyronGochnauer »

Is there any way to force a selected block of text to appear at the bottom of the page?

Image a letter that ends half was down the page, but you want to put a three line message down at the bottom margin. You might want to say, for example:

Included:
2015 return
2014 Objection

Short of using carriage returns, or putting it in a new footer, is what can be done? Is there anything like a "vertical tab" that you could use in the way right-tabs are used to keep pages numbers and similar things at the right margin?
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: force text block to bottom of page

Post by martin »

Unless I misunderstand, it seems to me that it would be easiest to place such text into the page footer. Is there a reason you don't want to use the footer area? If not, you could consider using a floating text box, to move the final bit of text anywhere you like.
MyronGochnauer
Posts: 8
Joined: 2009-08-12 02:59:46

Re: force text block to bottom of page

Post by MyronGochnauer »

Yes, I could use the footer, but it would need to be limited to that one page only, and more importantly, it seems just plain inelegant! Using carriage returns gets the job done, too, but seems similarly poorly designed for the purpose.

The text box might be the best solution available. I rarely use them, so i'll need to check.

I still think there is use for what some programs would call an "elastic space" (one that "pushes" against the text on both sides to space the two sides out maximally), although vertically rather than horizontally. I think that is what the LaTeX \vfill formatting command does. (vfill = vertical-fill)
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: force text block to bottom of page

Post by adryan »

G’day, Myron et al

This is an interesting problem which I suspect might be better dealt with by desktop publishing software.

The sort of Nisus Writer solution that best suits you depends a lot on your particular requirements and how often the situation is likely to arise in your work.

I personally find text boxes awkward for anything but the simplest scenario. Scuttling the text to a footer will prove problematic if the page also contains footnotes; it will also prevent the use of footnotes pertaining to the sunken text itself.

A general solution should permit alterations to both blocks of text (top of page and bottom of page) and yet still give the required result. Alterations to text earlier in the manuscript might affect this special page if it is not quarantined by a preceding page break. Correct placement of the bottom block of text will also be affected by happenings in the footnotes and footer areas.

All things considered, if I needed to do this often, I would write a macro to do it for me. Regrettably, I do not have time to do this right now, but my general approach would be as follows:–

(1) Create a “Sink Me” paragraph style that would be applied to the relevant paragraphs.
(2) When desired, invoke a “Scuttle Them” macro which:–
(a) finds all sets of paragraphs with the “Sink Me” paragraph style
(b) for each such set, causes it to be separated from previous (non-Return) text by a single paragraph return
(c) iteratively either adds paragraph returns or (more elegantly) increases Line Spacing After until the number of pages in the document is incremented by 1, then backs up one iteration to preserve the previous page count.

I would make sure I invoked the macro when the manuscript was complete, before checking Table of Contents and Index for correct page numbers.

I hope this helps.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
MyronGochnauer
Posts: 8
Joined: 2009-08-12 02:59:46

Re: force text block to bottom of page

Post by MyronGochnauer »

I like the adjectival phrase "Sink Me"! It pretty well captures the idea.

The suggested macro is ingenious, but may not be simple enough in use to replace simple carriage returns added/deleted as a final step.

When hard copy memos are used it is common to place a "CC: " (Carbon Copy) line at the bottom of the page. That's just a quick but necessary one-off.
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: force text block to bottom of page

Post by adryan »

G’day, Myron et al

The macro would be easy to use in practice: it’s the design and construction that require the hard work!

A couple of quick observations: Kino’s “Select By Style” macro (in the Find folder of the Macros folder) could be raided for relevant code if necessary, and the page in the manuscript would need to be delimited both before and after by page breaks. The macro could insert these page breaks if they are not present already.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: force text block to bottom of page

Post by phspaelti »

adryan wrote:Kino’s “Select By Style” macro (in the Find folder of the Macros folder) could be raided for relevant code if necessary…
Kino's macro is fine, but this would be total overkill for such a simple task. (That macro was written in the old days, when there was no easy way to do this.) The code to find text in a given style is:

Code: Select all

$doc = Document.active
Find $doc.styleWithName("Sink Me")
Alternately, if you want the text selections for further processing:

Code: Select all

$doc = Document.active
$sels = $doc.text.find $doc.styleWithName("Sink Me")
philip
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: force text block to bottom of page

Post by phspaelti »

So here is a macro that implements the basic idea proposed by adryan:
Attachments
Scuttle Paragraphs.nwm
(5.27 KiB) Downloaded 418 times
philip
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: force text block to bottom of page

Post by adryan »

G’day, Philip et al

Very neat, Philip. When I have time, I’ll study your macro in more detail, but a cursory examination shows it contains some very useful commands I haven’t had occasion to use before.

I didn’t mean to imply the necessity to use much of Kino’s macro — just that bits of it might be useful in the current context. (As I’d said, I haven’t had time to delve into the problem properly: I was merely trying to indicate a path for anyone interested.) I had started having doubts as to whether a preceding page break might be required, but in the end you have dispensed with both of them — much more elegant!

However, the macro does not quite fit the brief just yet, I’m afraid. We don’t want a spacingIncrement before every paragraph of the style “Sink Me” — only before the first paragraph in every block of contiguous such paragraphs. (See Myron’s original posting: a block to be scuttled may contain multiple paragraphs.)

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: force text block to bottom of page

Post by phspaelti »

adryan wrote:However, the macro does not quite fit the brief just yet, I’m afraid. We don’t want a spacingIncrement before every paragraph of the style “Sink Me” — only before the first paragraph in every block of contiguous such paragraphs. (See Myron’s original posting: a block to be scuttled may contain multiple paragraphs.)
Ah! You noticed that :wink: Fixed.
Attachments
Scuttle Paragraphs.nwm
(5.33 KiB) Downloaded 438 times
philip
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: force text block to bottom of page

Post by adryan »

G’day, Philip et al

We are there! Great work, Philip. Is it not a joy to see this in action?

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: force text block to bottom of page

Post by martin »

Nice macro, thanks Philip! I just tested it and have one potential change: the macro should zero the paragraph spacing for these Sink Me paragraphs before doing anything. I ran into a situation where the macro never finished running because the initial spacing from my last macro run already pushed the paragraph to the next page.
Attachments
Sink Paragraphs.nwm
(5.24 KiB) Downloaded 422 times
Post Reply