Change font & Size

Get help using and writing Nisus Writer Pro macros.
User avatar
xiamenese
Posts: 513
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Tacitus wrote: 2022-04-18 09:41:41 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.....

Thank you for that and for encouraging me to think about my own macro collection. I have received so much generous help from Martin over the years that I am more than happy to give others any help I can, both with NWP and with Scrivener (though I am less active on that forum than I used to be while still checking it very regularly).

Looking at my personal macros and workflow has made me realise I can prune a lot of unnecessary code. The main macro was first created while Scrivener was pre version 3 and only had presets rather than styles. I realised I could use non-humanly-perceptible colour differences to mark blocks of text and could do a search and replace in NWP for text in those colours and replace them with the same text but marked with the appropriate style… for instance, "Normal" was #FFFFFF (black), Heading 1 was #FFFFFE which was undetectable to me but a different colour to the computer. So my personal macro still has all the necessary code, which is now totally redundant.

I am now experimenting even further and compiling to .MD which I get to open automatically in NWP and, again with great help from Martin, have a macro which turns it into RTF. I can then apply my standard style collection. This means I can write in Scrivener using binder hierarchy to allocate heading levels, simplifying the compile format considerably. That said, lists are still a problem as each list gets its own list style, rather than just applying the usual NWP list styles and levels… my first attempt resulted in 54 separate list styles! However lists are not actually part of my usual texts.😄
Tacitus wrote: 2022-04-18 09:41:41 I'll give those a try and let you know what happens. BTW I like your variation on Lorem Ipsum :D
I look forward to hearing how you get on. As for the Lorem Ipsum variation, I took a chunk of text from one of my projects did a fair number of search and replace all firstly of different single letters, and then a fair number of search and replace all of two letter combinations. I can't even remember what the original text was or what or how many operations I did. But yes, it makes a change from Lorem Ipsum. 😄

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

Re: Change font & Size

Post by Tacitus »

Been having a play with all the material you sent and most of it works as expected. Importing the styles is a more elegant way of doing the formatting and the styles match up with the Scriv styles of the same name, although the formatting is slightly different.

The one place where it goes south is again the footnote area. No matter what i do to the footnote styles both paragraph and number character styles refuse to alter. Easy enough to alter the paragraph line spacing etc via a new paragraph style, but the footnote number character refuses to be anything but 9pt super with a -2pt baseline. Despite changing it several times it refuses to apply to what's in the footnote area. Footnote number in the body text is fine and amenable to change.

I've tried various methods: copy/paste, Import styles from a style sheet etc but nothing appears to be able to modify the number character in the footnote area. Something somewhere is overiding it but I've no idea what or where it came from.
History is a nightmare from which I am trying to escape.
User avatar
martin
Official Nisus Person
Posts: 5118
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Change font & Size

Post by martin »

Tacitus wrote: 2022-04-19 10:07:02The one place where it goes south is again the footnote area. No matter what i do to the footnote styles both paragraph and number character styles refuse to alter. Easy enough to alter the paragraph line spacing etc via a new paragraph style, but the footnote number character refuses to be anything but 9pt super with a -2pt baseline. Despite changing it several times it refuses to apply to what's in the footnote area. Footnote number in the body text is fine and amenable to change.

I've tried various methods: copy/paste, Import styles from a style sheet etc but nothing appears to be able to modify the number character in the footnote area. Something somewhere is overiding it but I've no idea what or where it came from.
I haven't been following this thread closely but there may be two kinds of overrides present in the footnotes area:

1. Custom note references can override your document's style to change the text characters used to show your note references, e.g. "4" vs "iv". To check this you can right-click any footnote reference and look for the presence of the command Remove Custom Note Reference.

2. Manual formatting can override the formatting enforced by your document styles. To check this you can select any note reference and use the menu Format > Remove Formatting Except Styles.
Tacitus
Posts: 117
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Hi Martin:

Thank you for joining in.
right-click any footnote reference and look for the presence of the command Remove Custom Note Reference.
Doing this with the footnote reference character in the footnote area produces:”Set Custom Note Reference” This is within the Scriv generated rtf file - at this stage I’ve not imported any styles.
use the menu Format > Remove Formatting Except Styles
Unfortunately doing this removes all formatting in the footnote area. If you’re using defined footnote styles such as in my case MHRA, then italicisation is a must. Stripping out all formatting is impractical.

My workflow has generally been to copy/paste the Scrivener generated output into a Nisus template where it will pick up the styles in that template. This has generally worked although the footnote area has always been a problem.

So, with reference to Mark's suggestions.... I now import a style sheet via Mark’s macro above which also takes care of the Scriv ordinals. I replace the existing Scriv generated styles with the new style sheet which includes my preferred footnoting styles. All style names are picked up save for the footnote area styles both paragraph style and fn number character.

Next, in the footnote area; cmnd-A twice to select all footnotes. I then use the text palette to modify the characters to what I want for the number (note reference) character, which is showing as 9pt super, baseline -2 Basically increase the size to 11 pt since the baseline is showing as -2 (presumably derived from Scriv) which is what I want. This also increases the size of all the footnote text to 11 point. I then apply a paragraph style which mirrors what I’ve already set in the footnote style: In this case, 9pt with 10pt spacing, 1pt after. This sets the paragraph but does not affect the numbering character.

A clunky way of doing it but so far it appears to work. The odd thing is that if I then manipulate the “note reference within note” character in the style sheet it propagates through as it should, so for some reason it is now accepted as “note reference within note”
I simply cannot get Scriv generated rtf to accept the footnote style (including note number character) as defined in the style sheet.

The workround could likely be automated via a macro, but what is needed is something to force all text in the footnote area to accept the defined footnote style in its entirety, including the “note reference within note” character.
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 513
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Tacitus, just a suggestion …

Can you let me have your compile .scrformat and your style collection .rtf, so that I can try your workflow to see if I can work out what's going on with your footnotes? Also, what the footnotes must conform to as defined by MHRA.

Mind you, thinking through all this, do the MHRA guidelines also define what superscripts must conform to?

:)

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

Re: Change font & Size

Post by xiamenese »

Hi Martin,

I'm glad you've chimed in. All this has made me wonder …

In creating the "Super" style (see my samples for Tacitus), one can use the menu entries:
Format → Size → Decrease by…
Format → Baseline → Raise Baseline by…
but then, using 2pts difference, the stylesheet reads "Font Size: 10pts" and "Baseline +2pts".

The "Font Size: 10pts" seems to be taken from the font size used in "Normal" even though the style sheet has "Based on: None". However, if one changes "Normal" to 11pts, the "Super" character style remains at 10 pts, rather than reducing to 9 pts.

Would it be at all possible to define a character style, not as an exact number of points, but as 'Font Size: -2pts Baseline +2pts". It doesn't seem possible at the moment, so can I make that a request for an enhancement … if it is possible within RTF?

:)

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

Re: Change font & Size

Post by Tacitus »

Hi Mark:

At present I'm using the default compile format. I should have said "loosely based on MHRA". Since this is a genealogical project which is not intended for peer review, there are few standard formats although many use those suggested by Elizabeth Shown Mills*.

It's those other projects for which the footnote styles are rigidly controlled which become a concern. I should add that at present the method outlined above appears to be working. Clunky but it does seem to work.

I've attached the Nisus Style sheet.
Basic Styles.rtf.zip
(3.68 KiB) Downloaded 86 times
Elizabeth Shown Mills, Evidence: Citation and Analysis for the Family Historian. (Baltimore, Maryland: Genealogical Publishing Company, 1997).
History is a nightmare from which I am trying to escape.
Tacitus
Posts: 117
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

For information here is a link to a section of the Scriv text. The project is in an early stage so don't worry about the content. I've got a bit sidetracked with the ordinals and now the footnoting problem. Nevertheless I'm learning a lot despite having used Nisus for many years.

I've not imported stylesheets and apart from blanking some names it's as per the Scriv compile. In this case there are few styles since it's mostly normal text and block quote. Nonetheless after importing the styles it should replace the footnote section.

{Edited to show correct link]

https://ln5.sync.com/dl/83c4602b0/8w5kw ... v-2ueif2d8
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 513
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Thanks Tacitus,

I've downloaded those and will look into it all later.

:)

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

Re: Change font & Size

Post by xiamenese »

We've had a visitor staying with us over the weekend, which means I've only just got round to looking closely at what you sent me. Here's what I found in your style sheet:
  • You had created a "Footnotes" style though there is the built-in "Footnote" style. I think that was causing you confusion.
  • In the footnotes, the font was set to Georgia 9pt with the marker set to superscripted 11pt Georgia with the baseline lowered. This too was making it difficult to sort out … essentially why Martin's solution didn't work.
So I have modified the style sheet as follows:
  • I have removed the "Footnotes" style and made sure the built-in "Footnote" style is set to Georgia 9pt.
  • I set the marker to 7pts with baseline raised 2pts.
  • I have also removed the "Remove superscript" line in the ordinals part of the macro, as I found it isn't actually necessary.
  • I have not modified the footnote marker in the text (but see below).
I have saved the style sheet as "Basic Styles-2", which I attach.
Basic Styles 2.rtf.zip
(4.53 KiB) Downloaded 79 times
Tacitus-macro.nwm.zip
(2.72 KiB) Downloaded 81 times
So now if you unzip it and the revised macro, and move them into your Style Library and macro collection respectively, then run the macro on the file you sent me. When you've done that, with your cursor in the footnote area, Cmd-A, Cmd-A, as I said and look at the Formatting examiner. It will look like this:
Screenshot 2022-04-25 at 17.15.43.png
Screenshot 2022-04-25 at 17.15.43.png (122.99 KiB) Viewed 1388 times
Right click on "Normal" at point 1 and choose "Remove selected Formatting". Then go down to the second part "Displayed Formatting" and right click at point 2. This time choose, "Remove Formatting Except Styles". You will see that it will then show you that the markers are 7pt Georgia, baseline raised 2 pts, which is what I think you were aiming at.

As I said, I haven't changed anything with the footnote markers in the text, though may I point out that at the moment they are in Georgia, while the text itself is in Helvetica. Furthermore, your "Super" style for ordinals is 8pt Helvetica baseline raised 3 pts (as the main text is 12pt Helvetica, I personally would either use 9pt raised 3, or 8pt raised 4). But of course, all of this is your call. But do let me know if I can help further.

Cheers,

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

Re: Change font & Size

Post by Tacitus »

Hi Mark:

The reason for the additional footnotes paragraph style is because the imported text from Scriv wasn't picking up the footnote style. If I used *my* footnotes style together with the clunky workround outlined above I got the desire result. No idea why it worked but that's computers for you. The real weird thing is that the supplied 'hardwired' footnote and footnote number character then work and I can modify them and have it apply throughout. It's as if the clunky workround removes a block somewhere.

Reason for the Helvetica text is that I always use that for drafts. I do a global apply Times/Georgia/whatever when I check the final script.

I'll download and try the solutions you posted.

Thanks again for the help.
History is a nightmare from which I am trying to escape.
Tacitus
Posts: 117
Joined: 2004-02-12 00:11:45
Location: UK

Re: Change font & Size

Post by Tacitus »

Thanks for all this Mark. After a couple of false starts it now works perfectly!

I wish I knew more about the macro language, although if I really started using PowerFind/Pro, that would probably give me some baby steps into it. At one time I believe Take Control Books were going to do one on Nisus Macros, but that never materialised.
History is a nightmare from which I am trying to escape.
User avatar
xiamenese
Posts: 513
Joined: 2006-12-08 00:46:44
Location: London or Exeter, UK

Re: Change font & Size

Post by xiamenese »

Tacitus wrote: 2022-04-26 09:43:10 Thanks for all this Mark. After a couple of false starts it now works perfectly!

I wish I knew more about the macro language, although if I really started using PowerFind/Pro, that would probably give me some baby steps into it. At one time I believe Take Control Books were going to do one on Nisus Macros, but that never materialised.
That's great. I'm glad you've now got it working.

I too am pretty much at sea with the macro language … I'm not a programmer, though had computers existed when I was young and if my maths teachers had been more inspiring, I would have been. When the Sinclairs became available, I had a very full teaching job and a baby/infant at home, and lacked the necessary time, energy and money.

But Martin has really helped, and I do use PowerFind/Pro which is a good way into creating simple macros.

:)

Mark
Post Reply