##### 43.2.3.5 Constructing file names from multiple paragraph formats

Suppose you split files on both Heading1 and Heading2 paragraph formats, and you want each Heading2 split-file name to be prefixed by the content of the preceding Heading1 paragraph. You can use the TextStore property to capture the content of each succeeding Heading1 paragraph, and make that content available to all Heading2 split files up to the next Heading1 paragraph:

    [HtmlStyles]
    ChapterTitle = Split Title FileName
    Heading1 = Split Title FileName TextStore
    Heading2 = Split Title Filename

    [StyleFilePrefix]
    Heading2 = <$($$Heading1 replace " " with "_")>_

The TextStore property uses the format name by default for the name of the variable it creates (see §37.3.5.1 Capturing paragraph content with the TextStore property), so you can simply specify $$Heading1 in the prefix value. You can use a macro expression to replace any spaces in Heading1 content; see §37.6.5 Specifying substrings in expressions.

Previous Topic: 43.2.3.4 Specifying a file-name prefix or suffix

Next Topic: 43.2.3.6 Preventing duplicate file names based on paragraph formats

Parent Topic: 43.2.3 Using paragraph formats to name output files

Sibling Topics:

43.2.3.1 Constructing file names based on paragraph content

43.2.3.2 Basing output file names on existing paragraph formats

43.2.3.3 Creating special paragraph formats to name output files

43.2.3.4 Specifying a file-name prefix or suffix

43.2.3.6 Preventing duplicate file names based on paragraph formats