In Word the only way
to have conditional text is with the “if” field.
The equivalent in Writer is the field “Conditional text”.
insert a conditional field in Writer: Insert
> Fields > Other > Functions > Conditional text or
> Functions >
is also a field “Hidden text” that hides the text when the
condition is true.
with the relevant fields for conditional text, both in Word and in
Writer, means that only small amounts of text can be conditional.
However, there are times when having whole paragraphs or sections of
text be conditionally hidden is very convenient. Some examples:
test so that the same document can be used for the test itself and
for the model answers.
documents where the same document with variations can be used for
similar models of equipment.
provides a field for conditionally hiding paragraphs and the ability
to conditionally hide sections. Here is
an example to show how this could be done:
that hidden text is viewable: Tools
> Options > OpenOffice.org Writer > Formatting Aids,
select both “Fields: Hidden text” and “Fields: Hidden
hidden sections are not visible regardless of these settings if
the condition for hiding them is true.
the top of the document: Insert
> Fields > Other > Variables.
DocType. Value: Model Answers.
the start of a one paragraph answer: Insert
> Fields > Other > Functions > Hidden Paragraph.
For the condition type DocType == “Test” (To make this easier to
insert repeatedly, create an autocorrect entry).
longer answers: Enter the model answer, select it, Insert
> Section, select Hide, and enter DocType == “Test”
for the condition.
print the document for a test, double-click the field at the top of
the document created in steps 2 and 3, and change the value to Test.
Print as usual.
field “Input list” has a name but this is not a variable so
its value cannot be used in the condition.
keep adding sections, it is easier if the selection does not
include the last paragraph. But if the last paragraph is selected,
simply move to the end of the document (Control+End
) and then press Alt+Enter.