Jump to content
You must now use your email address to sign in [click for more info] ×

Recommended Posts

I need to lay out a book of poetry.  Sometimes the left aligned lines (paragraphs in fact) are too long to fit the page and the customer wants the 'overflow' line to be right aligned.  I've been looking to set a style for this. The option of Justify Last Line Right works if there is a first line (although it can look messy with big gaps) but if all the text fits on the line it is also the last line and so becomes right justified.

Is there some way out of this?  I.e. left aligned for the first line but right aligned for the second?

 

Link to comment
Share on other sites

1 hour ago, SteveKimpton said:

Is there some way out of this?  I.e. left aligned for the first line but right aligned for the second?

I don't see any way of allowing that.

I think it's more usual to see the overflow lines significantly indented, rather than right-aligned, and you can easily do that with the Left-indent and First-line-indent settings.

Perhaps if you pointed out to the customer that with right-aligned overflow lines they're going to have uneven indenting, which the reader may find distracting or harder to read, they'd be willing to consider a simple static amount of indent for them.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

1 hour ago, SteveKimpton said:

trick

Why do you need a "trick"? – If the poem shall be typeset line by line then it will have break characters anyway and thus can stay with line or paragraph breaks. If it may just flow you don't need special characters in every line. However, in both cases you need to intervene for some specific last lines selectively. For those you could create a separate style (… which optionally has no Space before and the 'main' style as Next Style defined).

1065987043_poetrylastlinerightalign.jpg.801ced9ebb74ec3a47ab4aff44e7cbec.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Or use a line break followed by a right indent tab, if you want to keep your paragraphs intact.

Macbook Pro mid 2015, 16 GB, double barrel: MacOS Mojave + Affinity 1 (+ Adobe’s CS6)/ MacOS Monterey + Affinity 2

Link to comment
Share on other sites

15 minutes ago, RM f/g said:

Or use a line break followed by a right indent tab, if you want to keep your paragraphs intact.

To achieve a left aligned paragraph while every line may have a different number of characters? Wouldn't this require such indents to be set quite flexible and different for each of the lines, depending on their lengths?

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

To clarify:

The original text was produced in MSWord with all paragraphs left aligned.  Each line of the poem was actually a paragraph with verses separated by blank lines (i.e empty paragraphs).  There were no overflows because the author had her pages set to A4.

I  hoped to find a style that would allow me to copy and paste the original text to get the effect requested by the author as illlustrated by lacerto above without the need to edit the text with additional breaks, tabs or anything else.   I used the word 'tricks' to refer to this unfortunate but apparently necessary editing.

Link to comment
Share on other sites

Thanks for clarifying. As I understand, since left aligned text has no style option like "last line right aligned" you need to get additional break characters, placed at specific spots within lines which exceed a certain lengths. And you don't want to add them manually.

I am no script coder at all but wonder if that can be achieved via GREP in the Find & Replace panel. For instance with a query that checks whether a line has more than a max. number of characters per line and if, then adds a break after this number of characters. Maybe @walt.farrell or @Old Bruce will pop-in and shed more light on this or another way to solve your task via GREP.

In a next query F&R GREP could auto-assign a text style "right aligned" (which you would have setup before of course) for exclusively those lines that are followed by a double paragraph break ¶¶.

By the way: The F&R panel is also very helpful if you want to avoid the empty lines of the word.doc but would rather define the paragraph style with a space after (or before) and thus have more flexibility with the leading in your layout. For this you don't need GREP but just replace the paragraph breaks with line breaks ¬ . But you would want to exclude the empty lines in this replacements. Therefore you would first replace all double paragraph breaks ¶¶ with any xy-character that is not used in the text (and "save" these text spots this way), then replace all single paragraph breaks by line breaks + then re-replace the temporary xy-character with its initial paragraph break. It may sound complex in this description but it is easy to do in the F&R panel.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Thanks Thomoso,

I expect such script coding would be possible but remember it's not the number of characters that matters but the physical space available.  Lines with lots of 'w's take more space that those with lots of 'i's.  In any case, I'm sure it's beyond me so I'll stick with the manual tweaks!

 

Link to comment
Share on other sites

That is right but the number of characters could be used as an average size and include a "safe space" in its definition (GREP can't check the physical width). Nonetheless, the script would be more complex for the additional paragraph breaks: they should not get added at any spot of the line but between words only.

However, it might take more time to setup the GREP expressions correctly than doing the breaks manually.

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

36 minutes ago, thomaso said:

That is right but the number of characters could be used as an average size and include a "safe space" in its definition (GREP can't check the physical width). Nonetheless, the script would be more complex for the additional paragraph breaks: they should not get added at any spot of the line but between words only.

However, it might take more time to setup the GREP expressions correctly than doing the breaks manually.

The grep is easy enough:

.{85,92}\K\h

That will find any spaces between 85 and 92 characters. In the Replace, one can configure a Line Break plus a Right-Aligned Tab to, well, add a line break and make the following line right-aligned.

What number of space characters to use in the expression depends on the font, font size, frame width, average word lengths. etc. Those numbers used may/will take the most time to configure...but the regular expression part is easy.

untitled.afpub

Link to comment
Share on other sites

36 minutes ago, MikeW said:

The grep is easy enough:

.{85,92}\K\h

That will find any spaces between 85 and 92 characters. In the Replace, one can configure a Line Break plus a Right-Aligned Tab

Thanks, Mike, unfortunately my GREP skills are too limited to make even this work. I don't get any result with your sample document (should it have any F&R field entry included in the file that you attached it?).

1218534474_grepfindspaceswithinx.jpg.ec2e7ebc62a8c268c2650c43b7f0c69f.jpg

Additionally I don't know which of the GREP options would be useful or required here, I tried various of the 8 available combinations.

625322014_grepoptions.jpg.f094b79a87f9191cc78af87491469c59.jpg

Also this test site doesn't find any, – not sure if it covers the library used by Affinity. (… whereas its explanations are helpful, @SteveKimpton, in case you want to try)

https://regex101.com/r/GCyp0H/1

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Try enabling regular expression, and maybe unchecking local aware. 

The expression, if not included, is in my post.

As far as the replace, use the dropdown and select line break and right alignment tab.

Link to comment
Share on other sites

On 4/2/2023 at 10:57 AM, SteveKimpton said:

I need to lay out a book of poetry.  Sometimes the left aligned lines (paragraphs in fact) are too long to fit the page and the customer wants the 'overflow' line to be right aligned

I just want to jump in here and say that perhaps the poet/client would be happier with a hanging indent instead of Right aligned. I used MikeW's Ode to GREP to illustrate it.

148300389_ScreenShot2023-04-05at11_42_51AM.png.0bc30dc38fde533c5e1768ea137e85eb.png

Mac Pro (Late 2013) Mac OS 12.7.4 
Affinity Designer 2.4.1 | Affinity Photo 2.4.1 | Affinity Publisher 2.4.1 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

15 minutes ago, Old Bruce said:

I just want to jump in here and say that perhaps the poet/client would be happier with a hanging indent instead of Right aligned.

Suggested in the 2nd post in the topic. But thanks for including a visual example.

Simple hanging indents are much more common for this situation in poetry, in my experience, and gives a better reading experience in my opinion.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

21 hours ago, MikeW said:

Try enabling regular expression, and maybe unchecking local aware. 

The expression, if not included, is in my post.

Any idea why I don't get findings?

EDIT: (video removed) I had a space character copied from the end of the expression. That prevented my GREP search from working.

 

Edited by thomaso

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

13 minutes ago, thomaso said:

Any idea why I don't get findings?

Works fine for me in 1.10.6 and 2.1.0.1736, so I've no idea why it fails for you unless it's a V1 issue on macOS.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro, version 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro, version 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
iPad:  iPad Pro M1, 12.9": iPadOS 17.4.1, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.4.1

Link to comment
Share on other sites

@MikeW, @walt.farrell, Sorry, I had a space character copied from the forums post which prevented my grep search from working.

@SteveKimpton, depending on the number of affected lines in your entire layout the F&R GREP trick indeed can be worth a try, – regardless of your align & indent decision in "Replace". It also can work with just 1 number of characters, instead of a range.

 

598264348_greplinelengthsetting.jpg.bf4719ad46aa9f320296bb7673adea50.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.