Please enable JavaScript to view this site.

 

str = FormatParagraph(sTextIn, sParagraphTags)

 

This macro function return sTextIn with markers that identify it as text whose paragraph will be formatted according to the xtags string sParagraphXtags, at a later stage, during diary generation.

 

As xtags are not supported by InDesign, this function is only supported when using QuarkXPress.

 

To apply paragraph formatting when using either InDesign or QuarkXPress, refer to the topic on native paragraph formatting.

 

sTextIn

This can be any text, even text that is the result of a previous call to the function FormatText. That is to say, formatting of both text and paragraphs can be nested.

sParagraphTags

This is a string of Xpress Tags formatting which is used internally by QuarkXPress to describe most of a textbox's contents.

 

Usually, if using XPress Tags, the easiest way to obtain such a string is to create the desired result in QuarkXPress, and then to export that result to an xtg file, which can then be cannibalized for the parts that you need, as described here and here.

 

The xtags contained in sParagraphXtags can also contain text formatting, but usually if you only need to format text, and not paragraphs, then using the function FormatText is easier.

 

Alternatively, if you wish to write your xtags string yourself, an excellent reference on the Xpress Tags descriptor language can be downloaded from www.emsoftware.com, and also the Guide to XPress Tags 2019, released in February 2020, which is available as a PDF download.

result

The text result of this function will be plain text with markers that identify it for further processing, later in the diary generation.

 

Consider the macro code below, which applies a rule above to the paragraph containing sResult.

sResult = FormatParagraph('©2019''<*ra(8.504,0,K,10,100,0,0,-2.835)>')

The value of sResult after the above call to FormatParagraph would be:

'**RICH1**©2019**TEXT1**'

At the same time a command is saved for later processing, to replace the string '**RICH1**©2019**TEXT1**' with '©2019' while applying the rule above formatting specified above.

 

If, at one point, later in the macro, you need to get the plain text, without the markers, you can use the PeekTokenValue function.

 

See also: FormatText, native paragraph formatting, native textbox formatting.

 


Topic 178135, last updated on 16-Sep-2024