Reputation: 33
Is it possible to remove the numbering on hidden text/sections in libreoffice writer?
For instance, I have a document that hides several sections depending on a user defined variable (which is used to define the document type) that looks like this:
(1) Section A
(2) Section B
(3) Section C
I want to hide Section B so it looks like this:
(1) Section A
(2) Section C
Instead of:
(1) Section A
(3) Section C
Is it possible?
Upvotes: 2
Views: 419
Reputation: 13790
If there are not too many sections, then it may work to use conditional text fields to show the appropriate number. This would work based on that same user defined variable that you used to show or hide sections.
So in your example where it says (3) Section C
, remove 3
and instead insert a conditional text field. To do this, go to Insert -> Fields -> More Fields, and select the Functions tab. Type should be "Conditional text". In the Condition box, enter the same expression that you used to hide section B. In the Then box enter 2
, and in the Else box enter 3
.
Now press Insert to insert the field. It should now say (2) Section C
if section B is hidden, or (3) Section C
if it is not.
See also http://www.openoffice.org/documentation/manuals/userguide3/0214WG3-WorkingWithFields.pdf.
If you need something a little more complex (but still without too many sections), this idea can be expanded. For example:
(1) Section A
(2) Section B
(3) Section C
(4) Section D
Let's say that depending on the document type, either section B, section C, or both B and C may be hidden. Then the numbering for section D will need several conditional text fields. Set the first field condition to an expression like (MyDocType EQ "HideB") OR (MyDocType EQ "HideC")
and the Then value to 3
. Leave the Else blank, in which case it won't show up at all when printed.
Insert another field for section D with condition MyDocType EQ "HideB_and_C"
and the Then value to 2
. Add a third field for section D with condition MyDocType EQ "ShowAll"
and the Then value to 4
. It should now show the appropriate number for Section D.
For a lot of sections or more document types, it would probably be better to write a macro.
Upvotes: 1