Expand glossary in current font and size

Everything related to our flagship word processor.
Post Reply
lyndondrake
Posts: 20
Joined: 2016-10-23 23:53:01

Expand glossary in current font and size

Post by lyndondrake »

Hi,

Is there any way to do an Expand Glossary command to just insert the Unicode characters, i.e. without changing the font or font size?

Cheers,
Lyndon
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Expand glossary in current font and size

Post by phspaelti »

My understanding of how Glossaries work is that if you remove all attribute and style information from the glossary entry that it will take on attributes and styles as appropriate at the insertion point. That is what I found from a quick test of the feature.
philip
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Expand glossary in current font and size

Post by martin »

Philip is correct: if your glossary entry is lacking in a particular attribute (eg: font size) then the expansion will assume the ambient formatting for that attribute.

When creating such a glossary entry with no formatting, make sure the Normal paragraph style doesn't remain applied. That style tends to bring along a lot of formatting, like a font face and size. Here's one way to do it:

1. Add your glossary entry in your glossary file.
2. Select the entire glossary entry paragraph.
3. Use the menu Format > Remove Attributes and Styles.
4. Use the menu Format > Paragraph Style > Remove Paragraph Styles.

Alternatively, you can also use QuickFix for this purpose. QuickFix entries are always free of formatting, and thus will always assume the ambient formatting when triggered. However, be aware that QuickFix entries are defined on a per-language basis.
lyndondrake
Posts: 20
Joined: 2016-10-23 23:53:01

Re: Expand glossary in current font and size

Post by lyndondrake »

Thanks for both answers, very helpful.

QuickFix is probably the way I should do this. The difficulty is that I'm working with a very large number of cuneiform signs. Is there a way to bulk input QuickFix items? Or does it have to be one by one?
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Expand glossary in current font and size

Post by phspaelti »

Hi Lyndon,
On the contrary. I would recommend that you use the glossary for this. Assuming you have a file where each abbreviation is paired with its cuneiform counterpart (separated by a tab, for example), you can just insert glossary separators between the entries (perhaps with Find/Replace, otherwise with a macro), and then save the whole thing as glossary. Removing the styles, as Martin explained, can also be done in one go on the entire file.

One further advantage of the glossary method is that you could apply a special character style to your cuneiform. This style wouldn't need to have any attributes, so the the cuneiform would still take the attributes (size, color, font, weight) from the environment. This style would allow you to quickly select the cuneiform in your document, and you could control such things as language, font, highlight, etc. for these characters easily—by changing the style—at any time.

Finally such a glossary can easily be turned on and off at any time. Just open the preferences and click it on/off.
philip
lyndondrake
Posts: 20
Joined: 2016-10-23 23:53:01

Re: Expand glossary in current font and size

Post by lyndondrake »

Hi Phillip,

Thank you, that's extremely helpful, especially the idea of a style with no attributes. Am I right in thinking that if I have a style with the same name in my document, the expanded glossary items will take on my document style's attributes? Or would I have to wait until I have inserted at least one glossary item, and then modify the resulting new style's attributes?

Cheers,
Lyndon
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Expand glossary in current font and size

Post by phspaelti »

Hello Lyndon,
the answer to your question is of course: try it and see.

I'll admit that I hadn't considered your scenario specifically when I made the suggestion. But I am happy to report that things work exactly as one would have hoped. If your glossary entries are marked with a character style "Cuneiform" with no attributes, and you expand them into a document where a/the character style "Cuneiform" is already present and set to have certain attributes (font, size, etc.) then the newly expanded glossaries will immediately take on those attributes. If you have several files with different attribute settings for "Cuneiform", the glossary entries will always take on the attributes appropriate for that file.

If you try to copy such expanded text to another file where "Cuneiform" has different settings, you will of course get a style conflict dialog. But that should be obvious.

PS: AFAIK Nisus just uses the spelling of the style name (+ style type) to determine that two styles are "the same".
philip
credneb
Posts: 187
Joined: 2007-03-28 07:30:34

Re: Expand glossary in current font and size

Post by credneb »

[quote]Assuming you have a file where each abbreviation is paired with its cuneiform counterpart (separated by a tab, for example), you can just insert glossary separators between the entries (perhaps with Find/Replace, otherwise with a macro), and then save the whole thing as glossary.[/quote]

Because the only place where you can insert Glossary Breaks is within a glossary file, to do this you will have to:

1. first create a new glossary file
2. then paste your tabbed text list into the glossary file; this should be in the form abbrev<tab>cuneiform expansion<return>
3. select the Return at the end of any one line, and manually Insert:Glossary Entry Break in its place
4. select and copy the GB character
5. in the Find/Replace dialog, put a <return> in the Find field and paste the GB character into the Replace field
6. Replace All

You can now select all and globally remove attributes and styles as Martin described so the cuneiforms take the ambient styling.

The GB character is U+000C, which is the same as page breaks and section breaks. Nisus will retain the GB attributes when you copy/paste it. Unless something has changed, there does not seem to be a PowerFind or PFPro expression that inserts the GB attributes -- other than to insert a GB with the Insert:Glossary Entry Break menu command, which again only works inside a glossary file. For a one-time operation, the above may be simpler.

Cliff
User avatar
phspaelti
Posts: 1313
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Expand glossary in current font and size

Post by phspaelti »

Cliff, if you are editing the glossary file, you can just choose "Glossary Entry Break" from the Insert menu and put it into the replace box. "Replace attributes" will be checked automatically and the resulting replacement will insert valid glossary entry breaks.

A macro to do the same is also simple enough:

Code: Select all

While Find "\n"
Insert:Glossary Entry Break
End
philip
Post Reply