Robert Pogson

One man, closing all the windows.

Writing a Book Using Debian GNU/Linux

  • Oct 03 / 2013
  • 15

Writing a Book Using Debian GNU/Linux

GNU/Linux is a special operating system for all kinds of computers. It’s special in that it wasn’t originally produced as a product to sell but rather to share. It’s Free/Libre Open Source Software. The GNU part was started ~1984 by Richard Stallman. The Linux part, the kernel that controls hardware and processes, was started ~1990 by Linus Torvalds. Richard Stallman wanted to produce a UNIX-like OS that would be free of the bloat and restrictions placed on many operating systems by money-grubbing corporations not interested in freeing the user to use hardware to the maximum. Linus Torvalds wanted a UNIX-like OS for desktop PCs so he started building the last remaining piece of the GNU puzzle. Torvalds and Stallman both shared their projects with the world using the GPL (GNU Public Licence). The rest is history. The world discovered that sharing works well in information processing and millions of developers and thousands of corporations now contribute to this ecosystem which has spawned hundreds of distributions of GNU/Linux such as Debian GNU/Linux and Ubuntu GNU/Linux and Linux-based Android/Linux which runs on everything from desktop PCs to lawnmowers.

With such a diverse background it is no wonder that in the GNU/Linux ecosystem one can find many tools useful for writing books. The computer geeks that started all this needed to document their work and created tools to do that. Later, businesses wanted smoother graphical tools such as word-processors and even office suites so there are many tools available for every task. I will list those that I use to give the reader an idea what is out there. This is by no means exhaustive. You can find what Debian distributes at Check out editors, text-processing, databases, graphics, search engines and much more

With so many choices one has to give thought to how one works. If you are a writer who does a lot of research collecting data and images, you need a means of doing all that handy to the books you write. If you need your ideas and impressions to flow from your fingertips rather than having some application tell you what to do all the time, you need tools that separate content and style. The typical word-processor won’t do it. When you create text, you don’t want to have to set any styles if they interfere with your thoughts. GNU/Linux is a true multiuser multitasking operating system. You can easily have various processes and applications dealing with all these matters running simultaneously.

For work like this blog it is quite convenient to do everything in the web browser and to run a database and blogging software on a server somewhere but that doesn’t work well for books unless you can break the book up into chapters or pages per HTML page. I use FireFox web browser, MySQL database and WordPress blog here. If you want to work on big pieces, it’s probably best to use a desktop application. Then you can easily jump around in different parts that link together and gather statistics on the whole work easily. It’s obviously faster to have the whole work in RAM (fast memory) instead of dealing with pauses in the network. For medium-sized works, a word-processor is easy and does a decent job but for a full-sized book a word-processor or office suite does not scale. The reason is that the “look” of each page is determined by what’s on all previous pages. Change one thing affecting the length of a page and all following pages have to change. Dance around in the file and it soon becomes slow and jerky, not what you want. You have to keep the “look” of the page separate from the text, the ideas. Then you just merge a list of characters, words, paragraphs, chapters or whatever and nothing else need change except what you are thinking about. You do want to be the centre of your world instead of just a slave to the technology, right?

No, the right way to work on a book or other big work is to divide it up into small pieces with a common style or completely separate the style from the writing/text/content. The former helps the computer manage but fragments your thoughts, not good. The latter is the way to go. Writing a paragraph? The computer needs only to know it is a paragraph, not the indent, font, font-effects etc. The computer can apply your settings when you are done or when you want to check how it will turn out. By doing less during the writing, the document processor will give you instant responsiveness no matter the size of the document or where you are in the document. When you do want to produce the finished document the application merely processes a list starting from the beginning in a single pass instead of wasting time constantly during the work and annoying you with pauses. Think those pauses are no problem? Imagine a 500 page book using a few thousand characters per page, a few megabytes of text. It can easily fit in RAM and be edited as fast as you can go. Imagine a 500 page book that has to be redrawn every minute all day long… Jump to the conclusion and see how much your time is worth. The speed of your CPU, hard drive and the quality of your RAM won’t help much if the whole book has to be redrawn just to determine a page number. That page number is nothing that should get in your way. It’s not part of your content that you worry about.

The solution I use is LyX. No matter if a book is 10, 100 or 1000 pages, the editing of any page is just as snappy as a single-page document. The only time LyX redraws the whole document is when you want it to do that and it looks beautiful by default.

For finding stuff to include in the book, I keep track of thousands of documents using Recoll, a Xapian search engine client. I can tune it to index only certain directories to avoid indexing stuff I don’t care about. For heavy-duty indexing of static content, I use Swish-e which can handle millions of documents. I use that for my library of 20K books. Stuff that’s in the databases such as my ~100K recipes is searched using my own script for accessing recipes. I also can search other databases generally with the database client applications.

For image manipulations I like ImageMagick and GIMP (GNU Image Manipulation Program). ImageMagick is fastest for certain routine operations like resizing and cropping and GIMP can do almost anything.

I remember working on my master’s thesis in the bad old days of typewriters. With this technology, I could have written it in much less time using software to do all the drafting and calculations. That took me about a year back then. One month, tops, with the hardware we have today and the software available in Debian GNU/Linux.


  1. Robert Pogson

    R S Chakravarti wrote, “since this is your own website, you don’t have to try to be objective”.

    I always try to be objective. My objects are just different from others. I don’t need to accept other objectives. i.e. global control of IT

    I like technology that works well. I prefer it to be Free Software and so far I have not seen any reason at all that non-Free software has to be widely used. The world of IT is gliding smoothly to a mode that I like: OEMs are shipping FLOSS on GNU/Linux on Intel and ARM, even the USAian government has seen that FLOSS works for them, governments of France, Netherlands, UK, Italy, Germany, Spain, Brazil, India and China are all promoting FLOSS and GNU/Linux, and more retailers are offering GNU/Linux and Android/Linux every day. I think it’s great that M$ is now competing openly with the OEMs that formerly bundled only M$’s OS and I look forward to the next quarterly report due in a week and a bit.

    It’s interesting that went FLOSS on GNU/Linux and worked very smoothly but went closed-source and lowest-bidder on GNU/Linux and is a royal pain. Now that the source code has been revealed the FLOSS community may yet save Obamacare in spite of them using Oracle DB. This apparent disaster may be an expensive lesson for USA and many large organizations. Catering to would-be monopolists is not in the interests of most of us.

  2. R S Chakravarti

    I appreciate (and fully agree with) your point of view. There’s no need to support “that other platform”. And since this is your own website, you don’t have to try to be objective. On the other hand, if people could be persuaded to use Free Software, even if their OS is non-Free, then maybe it would become easier for them to switch to GNU/Linux.

  3. oiaohm

    bw Linux work on wayland when it lands brings 3d accelerated thin workstation locations base on Linux down to 100 dollars per user per year. This is true proper multi-seat support.

    Only 100 dollars per year is a problem bw. Even using Microsoft multi point server it also not that bad.

    $1,096 for service license.
    77 dollars per user/device x 20 for the multi point= $1500. $199.00×4 for the the normal windows server cals=796.
    $3392 in software licenses just to run Windows applications in a thin system.

    Windows 8 Pro 159 or 3180 when times 20. + the server cals $3976.

    See the problem yet bw I still have not acquired windows 2012 server. Thick is more expensive than thin. Running Windows without MS Office adds 1/3 more to your costs.

  4. oiaohm

    Libreoffice bad example. bw
    Windows version of Libreoffice is always feature behind.

    Also you get programs like gimp that by design hit where NT is weak so are faster on Linux.

    Sorry a OS X user can claim they are no different to a Linux user when it comes to FOSS software. OS X kernel Darwin has similar strengths and weakness to Linux.

    100 dollars per user per yearis quite a lot bw. Particularly when you are comparing to multi seat solutions that place 10-20 users per PC. Each seat controller is 100 dollars. Screen and monitor combination is about 200 dollars. So 3 years you have the price of the seat. 5 years is the price to replace the it all.

    Yes 20 user x 100 is 2000 dollars a year. 4 thousand is a very decent tower computer. 4 thousand in keyboards, screens and mice and cables. 2 thousand in thin clients.

    Yes its a 10 000 dollar budget. Yes it works out to 100 dollar per user per year of operation min.

    Sorry employee workstations could be 100 dollars per year. Using Office 360 is doubling your costs.

  5. bw

    Office 365 costs $100/year, enjoy your rental software to create documents

    Successful businesses don’t seem to mind. Their employee’s workstation costs far more than that. In any case you totally miss the point as usual. If you are using LibreOffice with your Windows computer you are no different than someone using it with Linux. Ditto for all the other open source programs.

  6. bw

    Re-re-reboots, malware and lock-in are not without costs

    I think you are vastly overstating the effect of these things. Once in a blue moon my PC reboot after an update that occurs automatically in the middle of the night. I think that it happens about once a month, but I am not around. I use the free Microsoft AV stuff and I have never had any problem. Finally how would “lock-in” bother me if I simply used the same Libre Office that you appear to use? It is available for Windows, you know, and most likely 99% of the people using it are using it on Windows.

  7. Robert Pogson

    bw, foolishly, wrote, ” the only savings possible are the small cost of the OS that may be paid every few years when new hardware is acquired.”

    Re-re-reboots, malware and lock-in are not without costs. Real-world migration continue to show huge savings with GNU/Linux. I don’t care about the cost because I can move my software from one PC to another with a high expectation that it will work, unlike that other OS. Read the GPL. Everything it empowers users to do is covered from Day One at no extra cost, forever.

    e.g. French Nation Police, Munich and many others migrated not because of costs but utility and the savings was a resulting benefit. The cost of paying for M$’s life-style forever is infinite, not a few dollars per annum.

  8. bw

    I am not interested in supporting other platforms

    It seems to me that you are not supporting any platform with these applications. You are simply a user, waiting on the developers in the project to do something different than what is out at the moment. If all this software is available for Windows as well, for example MySQL, Firefox, Libre Office, Open Office, PHP, and the rest, the only savings possible are the small cost of the OS that may be paid every few years when new hardware is acquired.

    You are fussing about for a net gain of $10 a year or so and if you calculate that as an hourly rate for what you are doing, it likely comes out to less than 2 cents.

    Just my 2 cents.

  9. Robert Pogson

    R S Chakravarti wrote, “I wonder if most or all of the tools you mention are available for other platforms as well. If so, you should mention it.”

    I am not interested in supporting other platforms. I wasted years of my life struggling to keep that other OS running with endless re-re-reboots and malware. I don’t want to run any applications on that other OS and I would prefer others do not.

  10. R S Chakravarti

    I’m a committed GNU/Linux user but I wonder if most or all of the tools you mention are available for other platforms as well. If so, you should mention it.

  11. Randall Wood

    Great article – I have written three books using Linux tools now and am convinced there’s no better way for me. For a company with a specific markup language Jedit allowed me to create custom syntax highlighting and checking tools, and when writing the Dictator’s Handbook LaTeX, Gimp, and some custom shell scripts for backup and archive were unbeatable. I wrote a bit about it here:

  12. ram

    TeX and emTex were among the first open source programs for wordprocessing and scientific typesetting. They are now well integrated into other FLOSS word processing packages.

Leave a comment