Underlying Style Support for Custom Styles and Macros

July 11, 2020

Onetastic Custom Styles provides an easy way to quickly format your text with your choice of font, color, size and other formatting. However until now it didn't set the underlying style for the paragraph to one of the built-in styles supported by OneNote. For instance you can use Onetastic's custom Heading 1 style to format a paragraph but it would still use OneNote's built-in Normal style. With the latest update, Custom Styles can now also set the underlying style of the paragraph to one of the built-in styles. If you use Heading 1 custom style, it will use its unique formatting but will also mark the paragraph with the built-in Heading 1 style from OneNote.

This has the benefit of using macros like TOC in Current Page on pages where you used custom styles. Such macros check underlying style of paragraphs to find headings and wouldn't previously work with headings formatted using Custom Styles. You can see how this now works in the below video.

Video

Macros can now change paragraph style

Paragraph objects in macros had a read-only style property. With this update this property is now read/write so you can change the style of a paragraph to one of the built-in styles. Following is a list of accepted values: p, h1, h2, h3, h4, h5, h6, PageTitle, cite, blockquote, code. A sample macro demonstrating this is available here: Sample - Insert Styled Paragraph.

Comments

Name
Comment
DGDunning - 2021-05-04
Spot on! Thanks Omer.
Omer Atay - 2021-04-23
DGDunning: All parts of a style, including the underlying style is optional. You can uncheck the underlying style while creating a custom style.
DGDunning - 2021-04-23
Can the change to the underlying paragraph style be made optional?
I use the custom code style, (and a variation of it), to change text in the middle of a sentence. Now the rest of the paragraph changes to the built-in code style too.
I appreciate the benefits for the heading styles, but the in-line style changes are really useful too. And more than the built-in code style can manage.
Thanks.

Other Posts

Show all posts