Exporting to ODT/DOCX

You can export both individual documents or entire books to either ODT or DOCX. The export process involves taking an existing file in the given format (the template file) and filling in the different sections of the document and book within that file. You can customize the output by styling the template file and organize it so that it contains the different sections of your document in the order you want them.

Creating a template file for documents

A template file is just a regular DOCX or ODT file and it works the same in both cases.

In the place where you want a specific one-line section to go, you write the id of that section surrounded by curly brackets (these: {}). So, for example, if you want to put the title of the text in a specific place, write {title} there. This will replace the text {title} with the actual title of the document.

If, on the other hand, you want to place a multi-line section (a rich-text section like an abstract or a body or a bibliography), you add an @ at the beginning of the id of that section and then surround it by curly brackets. So, for example, if you want to place the body somewhere, you create a paragraph containing the text {@body}. This will replace the entire paragraph and insert additional paragraphs to accommodate this section's contents.

Where to find the ID of a section

You can find the IDs of the various document sections in the document template manager. Additionally, the id bibliography is automatically generated and will contain the document's bibliography.

Where to put the template file for documents

The template files are connected to document templates, as each document template defines which sections will exist within that template. By default, Fidus Writer comes with a standard document template that already contains templates for export to DOCX and ODT. If you want to add your template files, you can copy the standard template by selecting it and then choosing "Duplicate selected" in the dropdown menu. This should give you a second template named "Copy of Standard Article".

You can enter the template editor by clicking on the title "Copy of Standard Article". Within the editor, scroll to the bottom and upload your templates where it says "Export Templates".

Remember that if you make any adjustments to the template such as adding or removing sections, you should also upload new export templates that contain the updated section IDs.

How to export a document to ODT or DOCX

There are two places you can export a document to ODT or DOCX. Note that you need to have DOCX and/or ODT export templates registered with the template of the document you want to export in order for the menu options mentioned below to show up.

Within the document editor itself, at the top of the page is a menu titled "Export". Inside of it you get options to export to the various formats, including each of the registered ODT/DOCX export templates.

Alternatively, on the documents overview page, you can select the document(s) you want to export and then select the export format in the file selector dropdown menu.

Creating a template file for books

Basic

If you want a basic template, you can reuse the same template file you use for documents for books. Instead of just filling in the fields in the right places, it will then take a copy of the entire contents of the template file and use that as a template for each chapter. It will automatically insert page breaks between each chapter.

Advanced

If you want to create a more complex template file that also includes the metadata of the book itself, you can do so by adding a preamble to the beginning of the template and/or a postamble at the end of it. You need to mark where the preamble starts by adding a bookmark to the beginning of the document and giving that bookmark the title "preamble". You also need to show where the body of the document starts by adding another bookmark at the first line of the body contents with the title "body". If you want to add a postamble, show where it starts by adding a bookmark with the title "postamble".

Fidus Writer will include the preamble and postamble once in the output document, and the body once for every chapter. Note that it will add page breaks between each chapter, but not before the first chapter and after the last chapter. If you want page breaks there, make sure to include them as part of the preamble and postamble.

Within the preamble and postamble, you can now add these metadata inline sections the same way you can with document sections:

Where to put the template file for books

Unlike documents, there are no predefined book templates and export template files need to be added to individual books. If you haven't created a book already, do so on the "Book" tab by clicking on "Create new book" which will open up the book editing dialog.

Under the tabs DOCX and ODT, you can upload a DOCX and a ODT template.

How to export a book as DOCX or ODT

After you have added the export templates to the book, you can export books in DOCX and ODT format in two places:

At the bottom right of the book editing dialog, if you click on "Export" you get a drop down menu that allows you to export to any of the supported formats.

Alternatively, on the books overview page, you can select the book you want to export and then select the format from the file selector dropdown.