Hacking free software for creative writing
Binary Diffs
I covered diffoscope [7] in depth in the November 2020 issue of Linux Magazine [8]. Here, I will only say that diffoscope is a new command that brings the time-honored diff
command to the desktop and works with over 60 binary formats, including LibreOffice's ODT format. Although originally written by Debian's Reproducible Builds project, diffoscope is an important building block for writers who choose to work more like developers.
At its simplest, diffoscope requires no more than the command and two file names to compare versions (Figure 3). However, if you choose, you can specify options such as the length of each excerpt from the two files and regular expressions to include or omit. You can also experiment with fuzzy logic.
Merging Files
One of the barriers to using git
or diff
commands for writing is that they usually work with text files, while most writers work in binary formats or at least have to submit their work in one. In addition, as I write, diffoscope is too new to have automated merge capacity. Consequently, most merges have to be manual, although there are several ways to go about it.
If you only want to append files, ooo_cat
[9] will do the job. From the desktop, you can connect files to each other in LibreOffice using File | Send | Create Master Documents (Figure 4). This feature not only appends documents but also allows files to be rearranged and new text entered. The files in a master document remain separate but can be printed or saved as a single document.
More complicated file merges can be done with LibreOffice's Edit | Track Changes | Compare Documents (Figure 5). You can open a second file so that you can approve all the changes, one at a time. Alternatively, you can use Merge Documents to combine both documents all at once. The Compare Documents option in particular has an interface complicated enough to take some getting used to, although it is a powerful solution.
You also have the option of working in plain text so you can use Git's own merge features. In order to do so, you need to convert ODT files to plain text, using a solution like odt2text [10] for LibreOffice files or PDFMiner [11] for PDF files. Unfortunately, while you can convert text back to ODT format by opening a file in LibreOffice and then saving it, much of the formatting to prepare a manuscript for submission still needs to be added – a task eased by styles, but still a tedious one. A more practical solution would be to write in LaTeX or HTML, markup languages that work with plain text and therefore allow you to work directly with Git's merge
command. When you are finished editing, you can compile a LaTeX file or run a script to convert text to ODT or HTML to ODT.
The New Workflow
None of the tools mentioned here is promoted as being specifically for writers. However, with a little ingenuity, writers can benefit from them almost as much as developers. They require a change in workflow that takes a while to learn, but the effort is worth the struggle. In the last few months, I have found that thanks to these tools I am getting organized in my habits. I no longer have to hunt for background notes, or figure out where my drafts are, or scroll up and down as much as I once did. These development tools have helped me to organize my workflow and increase my efficiency – improvements that, like most writers, I have badly needed.
Infos
- Williams, Robin. The PC is Not A Typewriter. Peachpit Press, 1992:https://www.amazon.com/Pc-not-typewriter-Robin-Williams/dp/0938151495
- VimWiki: https://vimwiki.github.io/
- Zim: https://zim-wiki.org/
- xkcdpass: https://pypi.org/project/xkcdpass/
- Git: https://git-scm.com/
- Mercurial: https://www.mercurial-scm.org/
- Diffoscope: https://diffoscope.org/
- "A modern diff utility" by Bruce Byfield, Linux Magazine, issue 240, November 2020, pp. 30-32
- ooo_cat: http://ooopy.sourceforge.net/
- odt2text: https://medium.com/@mbrehin/git-advanced-diff-odt-pdf-doc-xls-ppt-25afbf4f1105
- PDFMiner: https://github.com/euske/pdfminer
« 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
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.