Change font & Size

Get help using and writing Nisus Writer Pro macros.
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Change font & Size

Post by Tacitus »

I use Scrivener as my writing tool for long form projects and then transfer to Nisus. When typing dates Scriv uses ordinals EG 20th/ 23rd etc. The 'th' and 'rd' are put in 8pt superscript, and in Nisus this translates the same although sometimes with a baseline the same as the body type. In Nisus this becomes:
Screenshot 2022-04-10 at 10.13.33.png
Screenshot 2022-04-10 at 10.13.33.png (31.66 KiB) Viewed 4514 times
TBH I'm not sure how books treat date ordinals. Those I've looked at appear to my eyes to use superscript but possibly with a slightly smaller type to that of the main body text, so any advice appreciated. To me 8pt looks rather too small.

Is it possible to devise a macro which looks in the body text for any 8pt text (plain or superscript) and alters this to (say) 12pt superscript, perhaps with a baseline of -1, although I'm happy to take advice from any typography experts on here. I did think the latter part could be achieved with a character style, but this style would be plain text and the problem appears in both italic and normal text. Ideally the macro would take account of the surrounding text - plain or italic - and adjust accordingly.

Footnotes are generally 9 or 10pt text so the only place 8pt appears is in the body with those characters which transferred from Scrivener.

I suspect this may be more trouble than it's worth. I'm not a purist regarding typography and if neccessary could turn off the ordinals for dates in Scrivener, but it would be nice to retain them in the final Nisus output.
History is a nightmare from which I am trying to escape.
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Change font & Size

Post by adryan »

G'day, Tacitus et al

First, typography is one of the (few) things in which I claim no expertise, but the following comments may be useful.

I think treatment of ordinals comes under the heading of "house rules", by which I mean that each publisher will have its own preference for a particular project. Many publications treat ordinal suffixes as ordinary (non-superscripted) text; others treat them as superscripts. In the end, it's whatever is most pleasing to the eye that's important. Often the default appearance of superscripts in a font may not be the best choice for a given situation. I often find superscripts far too small for my taste.

If you are thinking of creating your own superscript appearance (via alteration of size and baseline), I would suggest using a relative size (eg, –1 pt, say), rather than an absolute size (such as 8 pt). (In a simple Macro you can use the Decrease command as many times as necessary to achieve this.) This might work better in more situations (different fonts, different uses in the document). Experiment also with different baseline heights until you arrive at a nice-looking combination.

Rather than search a document for text having a particular size or baseline height, I would suggest you search it for ordinals however they are displayed. Remember that, among other possibilities, you need to search for both "1st" and "1th" because the latter is needed to capture "11th". You can then alter their formatting as you wish, retaining whatever aspects you want retained (italics, bold, color, etc).

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Thanks for the tip re 11th etc - one thing I didn't think of.

The problem with searching for ordinals in general is there are a lot of footnotes so the citation markers are in superscript albeit a different size. Hence my thinking of searching for 8pt text since these particular ordinals will only appear as 8pt within the body text.

I looked at creating a character style based on the existing 8pt super, but I can't see how I can persuade all instances of 8pt super to adopt that style. I could do it manually using Powerfind to locate the next occurence of a number, but a macro to find and apply the style globally would be better. Right now I'm in the early stages so manually is not too tedious, but the final doc will run to around 60/80k words....

Once I have an applied character style, I can play with things like size/baseline etc within the style formatting and have it apply throughout the doc.
History is a nightmare from which I am trying to escape.
adryan
Posts: 561
Joined: 2014-02-08 12:57:03
Location: Australia

Re: Change font & Size

Post by adryan »

G'day, Tacitus et al

I would have thought that citation markers might be superscripted but they wouldn't be ordinals. Searching specifically for ordinals avoids the need to worry about what sort of text is displayed as 8 pt.

You certainly don't want (or need) to find each ordinal in succession and replace the Style associated with it with a different one. You find all the ordinals at once, then apply the new Style to the whole lot in one hit.

Cheers,
Adrian
MacBook Pro (M1 Pro, 2021)
macOS Ventura
Nisus Writer user since 1996
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

I think I'm doing it slightly differently in that I'm not searching specifically for ordinals, but using PowerFind and 'match' with 'formatting sensitive turned on. I then apply the 'new' style. Doing it this way means I have to match both 'th' and 'nd' using two operations but in practice that's OK. Once done I can play with the style and it should propagate through the whole doc.

TBH in all the years I've used Nisus I don't recall every having used PowerFind, so I've learnt something new. :D

Just noticed you've been using Nisus since '96. I came on board in '98 with Nisus 5.1.3 when the old Dartmouth list was still going strong. Apart from a (very) brief excursion to Mellel when OSX was in its infancy, I've remained with Nisus ever since.

That's it. Thanks for the help.
History is a nightmare from which I am trying to escape.
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Change font & Size

Post by phspaelti »

Tacitus wrote: 2022-04-10 06:02:08 Doing it this way means I have to match both 'th' and 'nd' using two operations but in practice that's OK. Once done I can play with the style and it should propagate through the whole doc.
You don't have to use two operations you can do it all in one. The search will be for (spelled out):
Screen Shot 2022-04-11 at 0.38.28.png
Screen Shot 2022-04-11 at 0.38.28.png (118.41 KiB) Viewed 4496 times
I would also recommend doing a Find All and then applying the style directly or otherwise via a character style, rather than using a style sensitive replacement.
philip
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Hi Tacitus,

Like you I use Scrivener for long-form writing etc. and compile to open in RTF. Not only do I too find any superscripts too small, but I also dislike the fact that Scrivener basically raises the baseline to create a superscript, rather than also changing the font size, so it creates ugly unwanted extra space between lines. So in Scrivener itself, I don't use superscripting at all.

So here's where Philip's suggestion comes in.
  • I took his Find statement, converted it to Powerfind Pro, checked that it found all instances in a small test file and then macroized it.
  • I then created a character style that I called "Super". As my test file was in 12pt Times New Roman, I set "Super" to 9pt with baseline raised 3pts.
  • Having checked that that did what I wanted, I added the command to the macro, and checked again.
Here's the macro:
find_all_ordinals.nwm
(5.39 KiB) Downloaded 226 times
To use it, all you need to do is first make a character style called "Super", a couple of points smaller than the normal text you use and with the baseline raised by the same number of points. Here's my sample text — and yes it did start life in my Scrivener test-bed project! — which has my "Super" style included.
superscript.rtf
(5.67 KiB) Downloaded 228 times
HTH

Mark
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Thanks Phillip and Mark - I've only just picked up on your posts.

I'm away from base doing some research at present, but once I've got that sorted I'll check your suggestions
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

After I posted that, it struck me that if you have superscripts set in your Scrivener project, when you compile to RTF, the macro as given wont remove the superscript setting, which you will need done. I'll give that more thought … or perhaps Philip will if he has time, even though this macro is way below his pay-grade! 😁

Mark
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Thanks Phillip and Mark, those suggestions and the macro work a treat and were a big help. As you say Mark, the macro doesn't remove superscript, but I can live with that. I do however have another problem, this time with the footnotes.

The compiled RTF from Scriv uses its own footnote style and carries this over. I can't see a way of applying the footnote style hardwired into Nisus which includes both the font, paragraph and importantly the footnote *number* character marker. Both sets of attributes are part of the same footnote style If I copy and past the Scriv compiled text into my default Nisus new file, even if I tell it to use the styles in the new doc (when pasting, use existing styles = those in my default new doc) they remain as per Scriv. The body text styles are applied but not the footnote space.

If I create a new footnote paragraph style that will take care of the font, line spacing etc but not the footnote number character.

I can't export the footnote style since it appears to be hardwired into Nisus and operates independently of other styles, presumably only applying to the footnote space.

Anyone any ideas for getting round this, so tht I can apply footnote style including the number character to the imported/pasted footnote text?
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Hello,

The thing is, in Scrivener footnotes/endnotes are "No Style". When compiled to RTF and opened in NWP, if you put your cursor in a footnote and look at the Formatting inspector, you will see it is assigned "Normal" paragraph style together with "Footnote" and "Superscript" (You need to Cmd-A to select the entire footnote to see the latter). This means that they do not fit the style as defined in the style sheet — in my case a hanging indent of 0.25 inches, with the "Note Reference" not superscripted and followed by a tab.
Screenshot 2022-04-16 at 23.18.14.png
Screenshot 2022-04-16 at 23.18.14.png (112.98 KiB) Viewed 4374 times
Fortunately, it is easy to resolve … with your cursor in a footnote:
  • Cmd-A to select all that footnote;
  • Cmd-A again to select all footnotes;
  • Right-click on "Style Normal" and from the dropdown choose "Remove Selected Formatting";
  • If you don’t want the Note Reference superscripted, right click on "Superscript" and choose "Remove selected Formatting".
And that's it. All your footnotes should now conform to your settings in the style sheet. Some macro-wizard might be able to produce a macro to do that, but it's a minimal amount of effort needed to sort out all your footnotes at one go.

:D

Mark

PS If you edit your Scrivener Compile format, you can choose "Use Period and space style instead of superscript in markers" but I don't bother as its easier to remove the superscript than replace period+space with Tab. I also leave "Indent footnotes and endnotes to match text" unselected, so I don't know what effect it has.
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Hi Mark:

For some reason that fails to work. If I compile a Scriv project, open it, select all body text and then paste that into a new Nisus File which uses all my own styles, it will adopt the body styles but not those in the footnotes. For some reason the footnote number is as specified in the character style within the footnote style format in the new file, but not the paragraph spacing.

If I then create a new style "Footnotes" with my desired spacing - exactly the same as in the 'hardwired" footnotes, 9pt text, 11pt spacing, 1pt after -and apply that to all footnotes, I get the desired result; paragraph spacing is as required. Oddly, if I need more space between footnote number and text, useful if footnotes run into 3 figures, I can put this in the hardwired footnote style and that will apply throughout.

Thanks to your advice I do have workrounds which are relatively straightforward. Not previously paid much attention to the format inspector, but I can see its uses. Since you deal in Chinese script, I'm guessing you need to get under the hood rather more than me. In the past half a dozen standard templates and that's been it, but using Scriv has pushed me into getting into the nuts and bolts.
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Hi Tacitus,

Just quickly as I've got to go out for a while…

My immediate reaction to your post was "Why is he opening copying the compiled RTF file in NWP and copying all the text in into a new NWP document?" But then I realised you were doing it to put the text into an existing template.

Actually, for the combination of Scrivener + NWP that's going at it the wrong way round; you need to be importing your styles into the compiled RTF. That’s what I do. I have a style collection set up in my Style Library, which I call "Standard.rtf" which has all the styles in Nisus New File, and styles with the same names in Scrivener. I then have a macro — almost entirely created by the ever-generous Martin! — which I run, which asks me to choose which style collection to import and then applies those styles to the text.

The macro has code that does things I need, like selecting all text in Chinese and language-marking it, so later when I have time, I'll take a look at it all and set up a macro, style sheet and sample text for you to try.

Incidentally, I have the "Note Reference in Document" also set to non-superscripted, but font minus 2 pts raised 2 pts.

At a quick look, it won't take too long to put it all together.

Mark
User avatar
xiamenese
Posts: 543
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Here you are, try this!
Tacitus.zip
(81.24 KiB) Downloaded 225 times
When you unzip it, you'll find five files: Tacitus-macro.nwm, Tacitus-styles.rtf, Tacitus-test.rtf, Tacitus.scrformat and Tacitus-test.scriv.

First off you need to import the macro into your NWP macros folder and move/copy Tacitus-styles.rtf into your NWP style library (for instance, mine is /iCloud/Nisus Documents/Style Library). When you've done that you can try it out immediately on the Tacitus-test file. I compiled that from the scriv project, using the Tacitus.scrformat compile format. If you want to start from the beginning, you need to import the .scrformat into Scrivener (or, with Scrivener closed you can just move or copy it into your /Username/Library/Application Support/Scrivener/Compile Formats, if you're happy to do that).

The macro ( if you want to look at it, it's all commented to explain each step) does the following in sequence:
  • it puts up a dialog asking you to choose which style collection to use and then applies the styles to the document (the code for this is actually most of the macro);
  • It then removes any stray blank lines (I presume you would want that to happen, but if you don't, its easy to stop that bit from happening);
  • It then finds all the ordinals in the text, removes the superscript (I put that in as you have them superscripted in Scrivener) and applies the "Super" character style;
  • Finally, it removes the superscript from the footnote markers in the text (my stylesheet sets them to TNR 9pt baseline raised 3pts like the ordinals).
So when you've run the macro, all that should be left is to select all of the footnotes, and remove the imposed "Normal" style and the superscript if like me you don't want the markers superscripted.

To make your own style collection, since you say you are currently copying into a new NWP document, the easiest way is to open a new blank NWP document and without entering any text save it with a suitable name … like "standard.rtf" or whatever suits you … in your style library. That's what I did for Tacitus-styles.rtf, only I removed styles like "Chinese" and modified the styles to TNR rather than my default Adobe Garamond Pro before saving it.

On the Scrivener side, your style names will need to match the style names you use in NWP, except that "Normal" is "No Style" in Scriv. You will see I have a style "No indent", which I use to follow headings and block quotes, the reason being that for my own purposes I use AGP, but when I need to send texts to my Chinese collaborators, I simply change the "Normal" font to TNR. Without the "No indent" style, paragraphs following headings and block quotes would gain an unwanted indent.

Let me know how you get on.

:)

Mark
Tacitus
Posts: 122
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Hi Mark:

That's very generous of you to produce all of this. At a quick glance I think what you're doing is what I'm trying to do, except that your way works and mine doesn't.....

I'll give those a try and let you know what happens. BTW I like your variation on Lorem Ipsum :D
History is a nightmare from which I am trying to escape.
Post Reply