#### 37.9.2 Invoking macros at predetermined points in output

You can specify macros to be invoked at several predetermined points in HTML or RTF output, by assigning the macros to keywords. Locations for macro insertion depend on the type of output:

HTML macro insertion points

RTF macro insertion points for Word

RTF macro insertion points for WinHelp

HTML macro insertion points

To insert macros in HTML output:

    [Inserts]
    ; location = macro to insert, can call another macro
    ; TopicBreak is placed between topics when files are not split
    ; Entities is placed before the head element
    ; Head is placed after the title element within the head element
    ; Frames is placed between the head and body (for Framesets)
    ; Top is placed at the beginning of the body element
    ; Bottom is placed just before the ending of the body
    ; End is placed after the ending of the body (to close noframes)

For split and extract files, you can use variants of the [Inserts] keywords to restrict the types of files to which an inserted macro should apply; see §27.6.2 Assigning code to [Inserts] keywords for splits and extracts.

For example:

    [Inserts]
    Top=<$EscapeFrameset>

    [EscapeFrameset]
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    if (self.top.frames.length != 0)
        self.top.location=self.location;
    // End -->
    </SCRIPT>
    <a target="_top"></a>

RTF macro insertion points for Word

To insert macros (or other content) in RTF output for Word:

    [Inserts]
    ; location = content to insert, which may be a DITA2Go macro
    ; Top, Bottom
    ; Header, Footer
    ; FirstHeader, FirstFooter
    ; LeftHeader, LeftFooter
    ; RightHeader, RightFooter

RTF macro insertion points for WinHelp

To insert macros (or other content) in RTF output for WinHelp:

    [Inserts]
    ; location = content to insert, which may be a macro
    ; TopicStart, TopicEnd
    ; SlideStart, SlideEnd

Previous Topic: 37.9.1 Understanding where to use macros and macro variables

Next Topic: 37.9.3 Surrounding or replacing text with code or macros

Parent Topic: 37.9 Deploying macros and macro variables

Sibling Topics:

37.9.1 Understanding where to use macros and macro variables

37.9.3 Surrounding or replacing text with code or macros

37.9.4 Assigning macros to graphics or tables for HTML

37.9.5 Using HTML Macro PI markers to invoke macros

37.9.6 Implementing drop-down text with macros

Table of Contents • Index