Even if you are not publishing versions of your project with different content you will still need slight variations in your output for different output formats. For example, some topics may not be appropriate in both CHM and PDF output, and some references in the text might need to be phrased differently in each format.
In addition to small variations in content and included topics for different output formats, you will sometimes want to produce versions of your project with larger differences. For example, different topics, topics in different order in the TOC and so on. In addition to this you might also want to generate these versions with a different "look and feel" or corporate branding. If you want to publish different versions of the project in the same output format, for example different versions of the same CHM, you need to define your own output conditions.
You create versions with varying content by tagging content in your topic for inclusion or exclusion using what we refer to as "build options". You can do this both for output format (e.g. include in PDF, exclude in CHM) and for options that you define (e.g. include in DEMO BUILD, exclude for CLIENT JONES).
Tagging content for different output formats is easy, you just need to select the name of the output format, which is predefined. To create different versions of your project in the same format you need to define your own "build options". Once you have defined them, you can use them in exactly the same way as the format tags.
Defining custom build tags:
1.In the Project Explorer go to Configuration > Common Properties > Custom Builds.
2.Use Add and Delete to add and delete include options. When you define a new include option you must enter a "Build ID". This is the actual include option tag and it cannot be changed later. Use short names for the options, like BUILDA, CLIENT2, DEMO and so on.
3.Click in the Display Text column to edit the descriptive texts for your include options. These are just informative and do not have any effect on the functioning of the conditions. Keep them relatively short because they must be displayed in selection lists in dialogs, which are generally quite narrow.
All the definitions you enter here are automatically displayed in all locations where include options are used.
You tag variant content in topics for exclusion or inclusion with the Conditional Text tool in Write > Insert Object.
For example, you might want to include an active hyperlink in the version designed for CHM but a simple chapter reference in a PDF designed for printing. The tagged text in a topic would look like this:
In the example above, the "installation instructions" link will be included in the CHM version and the "chapter 1" text in the PDF version. You can use your own build tags (see above) in exactly the same way. Then you can include content by activating the tags when you publish and exclude it by deactivating them.
You apply your own user-defined tags like DEM'O and CLIENTA in exactly the same way. They are also displayed in the Conditional Text tool.
Applying the build conditions:
1.Select the text or other content (images, multiple paragraphs etc.) you want to include in a specific output format.
2.Select the Conditional Text tool with Write > Insert Object >
3.Select If or If Not and the format you want to include the content in, then click on OK to apply the tags.
Publishing your project:
When you publish your project the build tags you define are automatically displayed in the Publish dialog, in the Include Options: box. To activate a build tag select its check box, then the content marked with those tags will be included. The format tags (PDF, CHM etc.) are selected automatically, depending on the output format you choose.
See Conditions and Customized Output for full details on using these features.
Just as you apply build options to content in topics with the Conditional Text tool, you can apply the same build options to every item you can include in the TOC. This includes topics, chapters and entire project modules inserted in modular projects.
Applying the build conditions:
1.In the Project Explorer, select the topic, chapter or module you want to include only in one or more output formats or builds.
2.Select Change > Include in Builds in Project > Manage Topics. This displays a list of available build conditions that you can apply to the topic. This menu is also available with a right-click on the item in the TOC.
3.Activate the check boxes for all the formats where you want to include the selected topic, chapter or module. It will be included in formats you activate in this list. It will be excluded from all ones that are not activated.
Sometimes just including and excluding individual topics is not enough for an alternative version. You need a completely different TOC structure. That is possible with includes, but very difficult to manage. Instead, you can insert an additional TOC with a different selection of entries organized in a different way. The entries in your additional TOC can point to the same topic files as those in your main TOC. In addition to this, the alternative TOC can also have unique topics of its own that are not used in the main TOC at all.
When you publish your project you can then choose which TOC you want to use. See Multiple TOCs for detailed instructions explaining how to use this powerful feature.
When you publish your project both the format-based build options and your user-defined build options are displayed in the Publish dialog, in the Include Options: box. To activate a build tag select its check box. Then the content marked with those tags will be included. The format tags (PDF, CHM etc.) are selected automatically, depending on the output format you choose:
If you have defined more than one TOC in your project you can also select the TOC you want to use in the Select Table of Contents section: