One LibreOffice document for multiple uses
Automating the Use of Fields and Sections
Field windows stay open after you insert a field, allowing you to move to the next position for a field in the document. Section windows do not, but you can use the navigator to jump from one section to the next.
However, changing the conditions for each field or section individually eats up time. If the same field appears more than once, you can copy and paste or use Edit | AutoText so that you can add information with a couple of keystrokes instead of making changes manually.
Better yet, you can set a general variable that toggles all fields at the same time:
- Place the cursor at the start or end of the document, or anywhere else that is easy to locate.
- Click Insert | Fields | More Fields | Variables | Set variable.
- Set the Format. You can leave it as General or specify it as Text or one of the number formats.
- At the bottom of the window, give the variable a name. The name can indicate one of the document versions or be something like MasterSwitch.
- Enter a value. It can be text or simply 0 or 1, but make sure it uses the format entered in the fields.
- Click the Invisible box so that the variable cannot be seen in the document. Then click the Insert button. Locating the variable later can be difficult, which is why you should place it in some easy-to-find place. You might choose to leave it visible while you work. If you do lose track of the variable – something that is surprisingly easy to do – search for it using Edit | Track Changes | Manage Changes. When you highlight it in the Manage Changes window, the variable is revealed on the screen as a thin, light-blue field.
- In all the Conditional text, Hidden text, and Hidden Paragraph fields in the Functions tab, as well as Sections (which I discuss in the next section), set the condition to the variable name, followed by the value in quotation marks (e.g., MasterSwitch "0" or AdminGuide "1".
Now you show or hide all the fields in the document by changing only the variable, much as you would with a style.
If you have more than two versions of the document, you can create other variables, to toggle each one off and on. However, make sure that the values are different for each and that each is placed where you can easily find it.
Hiding with Sections
Sections are areas with properties that are different from the main body of text. These properties may be formatting or content that is password-protected from editing. Sections work in much the same way as fields:
- Place the cursor where you want an empty section, or highlight existing text. Select Insert | Section. The Insert Section dialog window opens (see Figure 6).
- Give the section a unique name that reflects its contents and, if desired, protect it with a password.
- Click the Hide box or set the With Condition field to 1. One or the other is necessary, but not both. When you close the dialog window, the section and the space above and below it are no longer visible in the document. A section set to hide is visible until you remove the mouse cursor from it, so do not be surprised if it remains visible for a moment.
When you want to edit the section, click Format | Sections. The dialog window lists the document's sections, with an open or closed lock beside the name to indicate whether it is hidden. Sections can be formatted without unlocking them, but they must be unlocked to edit the text.
Figure 6: From the Insert Section dialog, you have another way to hide or reveal large sections of text.
Getting Organized
Hiding text might seem confusing at first, especially when Boolean logic is mentioned. However, if you think of these features as essentially off and on switches, then perhaps they will seem more straightforward.
Of course, being organized always helps, as well. If you are faced with maintaining multiple versions of a text, specify in your outline in which version or versions to include each topic. You might change your mind as you write, but if you do, a change of paragraph or character style should be all you need to revise the document.
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.
-
ZorinOS 17.1 Released, Includes Improved Windows App Support
If you need or desire to run Windows applications on Linux, there's one distribution intent on making that easier for you and its new release further improves that feature.
-
Linux Market Share Surpasses 4% for the First Time
Look out Windows and macOS, Linux is on the rise and has even topped ChromeOS to become the fourth most widely used OS around the globe.
-
KDE’s Plasma 6 Officially Available
KDE’s Plasma 6.0 "Megarelease" has happened, and it's brimming with new features, polish, and performance.
-
Latest Version of Tails Unleashed
Tails 6.0 is based on Debian 12 and includes GNOME 43.
-
KDE Announces New Slimbook V with Plenty of Power and KDE’s Plasma 6
If you're a fan of KDE Plasma, you'll be thrilled to hear they've announced a new Slimbook with an AMD CPU and the latest version of KDE Plasma desktop.
-
Monthly Sponsorship Includes Early Access to elementary OS 8
If you want to get a glimpse of what's in the pipeline for elementary OS 8, just set up a monthly sponsorship to help fund its continued existence.