SteveKimpton Posted April 2, 2023 Posted April 2, 2023 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? Quote
walt.farrell Posted April 2, 2023 Posted April 2, 2023 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. MikeTO 1 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
lacerto Posted April 3, 2023 Posted April 3, 2023 I am not sure if I got what you are after but wouldn't Justify Right create something like that, and just using the tab character in situations where you want a shorter line to be left aligned? If you do not want to have fully justified lines, you would end each line with a tab character, except the last one. Old Bruce and walt.farrell 2 Quote
SteveKimpton Posted April 4, 2023 Author Posted April 4, 2023 That's a sufficiently good trick, especially when used with the 'tighten' function, to get what I need. Thank you. lacerto 1 Quote
thomaso Posted April 4, 2023 Posted April 4, 2023 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). Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
RM f/g Posted April 4, 2023 Posted April 4, 2023 Or use a line break followed by a right indent tab, if you want to keep your paragraphs intact. Quote Macbook Pro mid 2015, 16 GB, double barrel: MacOS Mojave + Affinity 1 (+ Adobe’s CS6)/ MacOS Monterey + Affinity 2
thomaso Posted April 4, 2023 Posted April 4, 2023 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? Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
SteveKimpton Posted April 5, 2023 Author Posted April 5, 2023 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. Quote
thomaso Posted April 5, 2023 Posted April 5, 2023 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. Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
SteveKimpton Posted April 5, 2023 Author Posted April 5, 2023 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! Quote
thomaso Posted April 5, 2023 Posted April 5, 2023 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. Old Bruce 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
MikeW Posted April 5, 2023 Posted April 5, 2023 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 Quote
thomaso Posted April 5, 2023 Posted April 5, 2023 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?). Additionally I don't know which of the GREP options would be useful or required here, I tried various of the 8 available combinations. 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 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
MikeW Posted April 5, 2023 Posted April 5, 2023 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. Quote
Old Bruce Posted April 5, 2023 Posted April 5, 2023 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. Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
walt.farrell Posted April 5, 2023 Posted April 5, 2023 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. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
thomaso Posted April 5, 2023 Posted April 5, 2023 (edited) 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 April 6, 2023 by thomaso Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
walt.farrell Posted April 5, 2023 Posted April 5, 2023 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. thomaso and MikeW 2 Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
thomaso Posted April 6, 2023 Posted April 6, 2023 @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. grep line length.m4v walt.farrell 1 Quote macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1
SteveKimpton Posted April 7, 2023 Author Posted April 7, 2023 Thanks for all the effort everyone. I'm afraid I checkened out and did it manually because the number of instances didn't justify the time - the and likelyhood of edge cases that we haven't thought about. Quote
Recommended Posts
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.