Develop Correct Line Spacing for IF Instructions

From HotDocs Wiki

Jump to: navigation, search

When you include IF instructions in your text templates, you must be consistent in the number of hard returns and spaces before and after the IF instructions. For example, if you have three paragraphs, each conditioned separately using IF instructions, consistent spacing will ensure that you will always have the same spacing between each paragraph, no matter how many of the paragraphs are included in the assembled document.

When you use IF instructions to merge paragraphs into a document, HotDocs inserts one hard return after the IF instruction, and another hard return after the END IF instruction.

Consider the following paragraph:

Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation or any nation so conceived and so dedicated can long endure. We are met on a great battlefield of that war.¶

If you select the middle sentence and insert an IF instruction to make that sentence conditional, the paragraph looks like this:

Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. «IF Second Sentence» ¶
Now we are engaged in a great civil war, testing whether that nation or any nation so conceived and so dedicated can long endure. «END IF» ¶
We are met on a great battlefield of that war.¶

The two hard returns were inserted by HotDocs.

When you assemble a document, HotDocs removes the hard returns it inserted. For example, if you assemble this paragraph and choose to include the middle sentence, the resulting document looks like this:

Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. Now we are engaged in a great civil war, testing whether that nation or any nation so conceived and so dedicated can long endure. We are met on a great battlefield of that war.¶

If you assemble the paragraph and choose not to include the middle sentence, the resulting document looks like this:

Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal. We are met on a great battlefield of that war.¶

HotDocs works the same when you make paragraphs, instead of sentences within a paragraph, conditional.

Consider the following three paragraphs with two hard returns separating each one:

‘Twas the night before Christmas, and all through the house, not a creature was stirring, not even a mouse¶

The stockings were hung on the chimney with care in hopes that Saint Nicholas soon would be there¶

The children were nestled all snug in their beds, while visions of sugar plums danced in their heads¶

If you made the second paragraph conditional, HotDocs would insert two additional hard returns: one after the IF statement and one after the END IF statement.

‘Twas the night before Christmas, and all through the house, not a creature was stirring, not even a mouse¶

«IF Stockings» ¶
The stockings were hung on the chimney with care in hopes that Saint Nicholas soon would be there¶

«END IF»¶
The children were nestled all snug in their beds, while visions of sugar plums danced in their heads¶

When HotDocs assembles a document, it removes the two hard returns it inserted and leaves in the other three. The hard return at the end of the second paragraph and the hard return just following that paragraph are conditional and will be merged into the document only when the second paragraph is included. This will keep the line spacing between paragraphs consistent, regardless of whether the second paragraph is merged.