Closing Quotation Marks

Everything related to our flagship word processor.
Post Reply
User avatar
useeger
Posts: 89
Joined: 2004-06-28 00:03:01
Location: Germany

Closing Quotation Marks

Post by useeger »

There is an annoying bug in Apple's text engine: sometimes a closing quotation mark stands alone at the beginning of a new line instead at the end of the preceding line. This problem occurs in German texts, perhaps also in other languages.

Martin suggested at <viewtopic.php?p=31085#p31085> a solution for that problem: a zero-width space or a zero-width non-joiner character, placed after the closing quotation mark. That indeed helps in most cases. But there are some rare cases, where it does not help, see snapshot below (after every closing quotation mark is a zero-width space inserted).

How can I bring the closing quotation mark to the preceding line or the last word of the preceding line in the next line? The text is aligned justified, therefore a soft return before the last word is no solution.

The next problem is: How can I find in the book all occurences of closing quotation marks at the beginning of a new line. In the Find-window a position at the beginning of a line is not available.

Thanks for help!
Ulrich
Attachments
Snap.png
Snap.png (55.75 KiB) Viewed 1299 times
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Closing Quotation Marks

Post by adryan »

G'day, Ulrich et al

You attached a PNG file rather than a text file. I opened it in Preview and was then able to extract the text and paste it into an NWP document. There appears to be a paragraph return immediately preceding the closing quotation mark following "mein Kind?". This would explain why the closing quotation mark was not "stuck" to the preceding text in this instance.

I'm not sure whether you saw my post on that Forum page you referenced. There I suggested using a special Macro to place the German quotation marks around a selection. It works for me.

As for fixing all the instances at the beginning of lines, this could probably be done with a Macro that recognized beginnings of lines, if that's possible. A bit beyond me, I'm afraid.

What I would suggest instead is that you search for all the quoted strings, regardless of where in a line the quotation marks occur. Replace the quotation marks together with any attached zero-width spaces with some dummy strings; eg, XXXGuten Tag!YYY. Find all strings delimited by the dummy text. Apply my Macro to the selected result. Finally, delete all the dummy strings.

I hope this helps.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
User avatar
useeger
Posts: 89
Joined: 2004-06-28 00:03:01
Location: Germany

Re: Closing Quotation Marks

Post by useeger »

Hello Adrian,

I am sorry, I didn't see your reply before, I only now read it.

I tried your macro, it didn't change anything. The rest of your post is not clear for me, perhaps my English is too bad. Anyway the point is that adding a zero-width space or a zero-width non-joiner character solves the problem often but not in any case.

Enclosed I add a text snippet with a wrong closing quote. You need the Font Charis SIL to view it. Then you can see, that there is no return before the wrong closing quote. Do you really think, I am so stupid? Or did I understand something wrong?

regards,
Ulrich
Attachments
quotes.rtf
(7.01 KiB) Downloaded 97 times
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Closing Quotation Marks

Post by martin »

Hi Ulrich,

The other forum topic that you referenced actually talks about the opposite problem, where a final word and its following closing quote mark wrap too early, but all together. Your situation is not like this. Your problem is that the close quote mark wraps on its own and leaves the final word on the prior line by itself.

The solution you are looking for is the zero-width joiner character (not the non-joiner character). You will want to insert the joiner between the final word and the quote mark, in the exact place where the unwanted wrapping occurs.

I'll file a bug that Nisus Writer should help you with this automatically.
User avatar
useeger
Posts: 89
Joined: 2004-06-28 00:03:01
Location: Germany

Re: Closing Quotation Marks

Post by useeger »

Yes, that's it.

Thank you very much, Martin!

Remains the problem how to find the lines which start with a closing quotation mark.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Closing Quotation Marks

Post by phspaelti »

Hello Ulrich,
Here is a macro you can try that should insert joiners in front of such quotes. Note that the macro is hard-coded to work for codepoint \x{201C} which is the closing quote used in your sample. If your document includes other close quote characters it will need to be adjusted.
Attachments
Fix Quotes at Beginning of Line.nwm
(6.12 KiB) Downloaded 96 times
philip
User avatar
useeger
Posts: 89
Joined: 2004-06-28 00:03:01
Location: Germany

Re: Closing Quotation Marks

Post by useeger »

Your macro does exactly what I want, thank you very much, Philip!

Interesting was that your macro found 10 occurences. Afterwards I tried it once more with the original document but deleted all zero-width spaces before. Then your macro found 45 occurences. That means that 35 occurences where repaired by a zero-width space after the closing quotation mark and the remaining 10 occurences were repaired by a zero-width joiner before the closing quotation mark.

It is good to use both methods, because it was necessary to review all changes that your macro did. Often a soft hyphen helps to make the line wrap better looking. German hyphenation is still not very clever.

Thanks a lot and all the best,
Ulrich
Post Reply