Page 1 of 1

How to use style templates when creating document

Posted: Thu Jul 06, 2017 9:33 pm
by wsigmund
The advice in the help file is to use style templates rather than text styles and para styles. I need some help with this when generating a document in code. The demo style templates project loads styles from a document or changes the styles at runtime so is not any help. Is there any simple code example to show how you can set up text and para formats (don't want to use the word 'style' here) for a simple text document with a header using style templates? And how the style template relates to parastyle and textstyle?

Or do style templates only apply to editing a document?

Thanks.

William

Re: How to use style templates when creating document

Posted: Sat Jul 08, 2017 9:53 pm
by Sergey Tkachenko
StyleTemplates do not replace TextStyles and ParaStyles, they are applied on top of them.
Document still refers to items in TextStyles and ParaStyles, but items in TextStyles and ParaStyles can be linked to StyleTemplates.

StyleTemplates do not affect document appearance directly, they are rather provide a mechanism for convenient modification of TextStyles and ParaStyles. Similarly, MS Word's styles do not affect document appearance directly, but they allow changing text and paragraph attributes.
See http://www.trichview.com/help/styles_an ... lates.html

I'll create an example tomorrow.

Re: How to use style templates when creating document

Posted: Sun Jul 09, 2017 3:20 pm
by Sergey Tkachenko

Re: How to use style templates when creating document

Posted: Mon Jul 10, 2017 11:13 am
by wsigmund
Thank you Sergey.

Re: How to use style templates when creating document

Posted: Wed Jun 15, 2022 10:02 am
by edwinyzh
Sergey Tkachenko wrote: Sat Jul 08, 2017 9:53 pm StyleTemplates do not replace TextStyles and ParaStyles, they are applied on top of them.
Document still refers to items in TextStyles and ParaStyles, but items in TextStyles and ParaStyles can be linked to StyleTemplates.

StyleTemplates do not affect document appearance directly, they are rather provide a mechanism for convenient modification of TextStyles and ParaStyles. Similarly, MS Word's styles do not affect document appearance directly, but they allow changing text and paragraph attributes.
See http://www.trichview.com/help/styles_an ... lates.html
This, the best description of the purpose of style templates!