Who Needs LibreOffice
LibreOffice (and MS Office) are Bloat
Most people I know go day to day using one of two productivity suites; the dreaded Microsoft office suite (which costs an arm and a leg) or the open source LibreOffice suite. For many, these seem to be the only reasonable choices. I too used to use LibreOffice for making documents, presentations, and spreadsheets. LibreOffice also has a vector graphics application and a database front end that I never made use of. LibreOffice isn’t poor quality software with respect to the clearly defined goals that the developers of the Document Foundation have set out to do, but there are some salient issues that warrant consideration on the part of end users. For one, the output files are rather large even relative to the likes of Microsoft Office. There is also the issue of the interface, which is akin to Microsoft Office 2003; this brings welcomed familiarity for your average user, but the gallimaufry of various buttons and widgets serves as a distraction for power users. A tertiary concern of mine are the amount of system resources consumed from the applications in the suite. This is partially due to a large portion of the suite being written in Java, but other than Gnumeric, which is arguably a better spreadsheet application than LibreOffice Calc, I’ve fully replaced the functionality of LibreOffice with simple command line tools that suit my workflow much better.
Tools of the Trade
I’ve supplanted the functionality of LibreOffice that I need with a few tools:
- pandoc
- vim
- $$ \LaTeX $$
Dealing with file formats
Pandoc is an extremely versatile tool that converts file formats to other file formats. It can handle (in various capacities) over 40 different file formats along with user created templates. Beyond converting to and from a wide range of formats, it can be used to make ebooks, presentations, doctoral theses, and many other useful documents.
One editor to rule them all
The breadth of functionality that the vim text editor affords it’s user not only with in the core application, but through an immense number of plugins is dizzying. Vim in and of itself
deserves it’s own post as its plenary attributes are well outside the scope of the current topic. In the context of productivity software, it is a full replacement for a word processor.
Vim is a natural choice, as it is an all purpose editor that is highly convenient due to it’s modal editing style and keyboard driven interface. That means that there is no need to
ever take your hands away from the keyboard. There are many good tutorials out there for learning how to use vim, but I recommend using vim tutor by running the vimtutor
command in
the terminal. Vim is not just a fantastic programming editor, but a great word processing tool and makes the use of something as clunky as LibreOffice Writer unnecessary. Vim has inline
grammar checking and enabling it with :set spell spelllang=en_us
will catch any misspelled words or common grammatical errors. To fix the error, all one must do is move the cursor to
the beginning of the word and hit z=
and suggestions will appear in an enumerated list which you can choose from. Entering the corresponding number to the word in the list will change
the initial word to that.
$$\LaTeX$$
$$\LaTeX$$ is a highly versatile type setting language. It is extremely powerful and is the beating heart of my productivity tools as it allows one to make well formatted documents; this includes everything from a curriculum vitae, to presentations, to research papers, and more. It’s also the tool of choice for most who do mathematics due to its extensive mathtools package. $$\LaTeX$$ ships as a large assortment of tools and has many software packages; CTAN (essentially the main package repository for $$\LaTeX$$ packages) has over 5800 unique packages! There are a few main precompiled “distributions” of $$\LaTeX$$. The best way to obtain it is via your operating system’s package manager (or ports collection in the case of the BSDs) or downloading TeX Live directly from tug.org.
To understand some of the real world applications of using $$\LaTeX$$, it is imperative to understand document classes; these are layout standards that tell $$\LaTeX$$ how to format the text in a given document. There is a myriad of them that can be used for many different purposes as we’ll see.
Use cases
The orchestration of some or all of these tools together allow me to do most of the things I need to do productivity wise. The convenience of being able to focus on typing and letting $$\LaTeX$$ and or markdown do all of the formatting for me is a huge efficiency gain. The following are some examples of things that can easily be accomplished with this suite of applications.
Composing a resume/CV
$$\LaTeX$$ has two document classes that are suitable for creating a resume: europecv and moderncv. Today, we’ll be only looking at moderncv, as europecv is irrelevant outside of Europe as one can infer from the package name. To start, we declare the document class on the first line and then fill in the requisite preamble information before initializing the beginning of the document
After the document preamble, we begin the document and add sections for education, skills, and experience:
This Figure is fairly self explanatory with respect to how to make entries in each respective section. Once all relevant information has been added, we use pdflatex
to take the latex
document and compile it into a beautiful pdf. This is done with pdflatex my-resume.latex -o my-resume.pdf
. The finished product is immaculate:
Making a presentation
I am a contributor at my local area Linux user group, so I need a simple solution for making presentations. The beamer document class is a superb choice for this task as it allows the user to make visually appealing presentations, complete with graphics and animations, and assorted themes. There are other presentation solutions that I may go over in a future post, but I only use beamer as of the time of this post. I don’t utilize every feature of beamer, so this won’t be comprehensive, but I’ll elucidate the process I go through when making a presentation for my user group. Like with the previous example, we start with declaring the document class on line one and include any required packages:
This may be rather confounding to those unfamiliar with beamer and $$\LaTeX$$. Lets break it down:
- frame creates slides; from the \begin{frame} to \end{frame} is a single slide
- item creates entries within the slides
- itemize makes entries bulleted
- enumerate numbers entries
- setbeamertemplate allows a user to pick what style they want the bullet points to be (i.e triangle, square)
- pause initiates a break on all lines after its use, so that all content on a frame isn’t displayed all at once
Sometimes, the content inside a frame will fill more than a single page and will not be properly displayed. To mitigate this issue, append [allowframebreaks]
on the \begin{frame}
statement.
In this figure, there is a slide that has adjacent columns. The number to the left of column
specifies their width. The statement \includegraphics
is a part of the graphicx package
initialized at the top of the document that lets us insert images into the frame. This is what the above code looks like rendered:
You can also insert fancy templates into columns called blocks by encapsulating the desired information with \begin{block}
and \end{block}
inside of a column. Beamer in conjunction
with the multimedia
package can handle playing external audio and video files within the pdf. As implied by the previous statement, we once again use pdflatex
to compile to compile
the beamer document into a pdf presentation.
I don’t implement fancy slide transitions within my presentations as I think they’re distracting, but Beamer makes it trivial to implement for those who want a little extra “pzazz” in theirs. Only few PDF viewers (notably Acrobat Reader) support slide transitions. There are a sizable amount of different animations that beamer can use, but I’ll only show one example here.
\begin{frame}
\title{Something}
\transdissolve
\begin{itemize}
\item thing 1
\item thing 2
\item thing 3
\end{itemize}
\end{frame}
The insertion of the \transdissolve
statement creates an animation when the slide is switched to that reveals the slide by “dissolving” the preceding slide.
Typing a research paper
$$\LaTeX$$ is more than capable of handling all the requisite document matter for a research paper or report. Adding margin notes and footers is quite simple. For example, to put a
footnote placement at the bottom of the page, we initialize with \usepackage[bottom]{footmisc}
. Then, adding a footnote is as easy as typing out
This is my highly edifying statement that requires elaboration.\footnote{said elaboration}
Figures can be inserted using the figure
statement. Like with frames from beamer, we encapsulate the content with begin and end statements. Below is example code that will generate a
figure that one may expect to see in a textbook:
\begin{figure}
\centering
\includegraphics[width=10cm]{Menger-Sponge.png}
\caption{The Menger Sponge is a fractal curve whose faces are Sierpinski carpets}
\label{fig:Menger-Sponge.png}
\end{figure}
This code (when compiled) renders this:
Bibliographies are a crucial part of any research. Luckily, $$\LaTeX$$ provides an environment called thebibiliography
, which one can invoke above the \end{document}
statement. With
this tool, one can list off all of the references necessary as shown below
\begin{thebibliography}
\bibitem{smith1776}
\textit{The Wealth of Nations},
Adam Smith, Scotland,
1776
\end{thebibliography}
For every entry, we add with \bibitem
. When a reference has been inserted into the bibliography, it can be referenced with the cite
statement like so
The profit of stocks is inversely proportional to the wages of labor.\cite{smith1776}
$$\LaTeX$$ provides a number of different bibliography styles that one can choose from, but that is outside the scope of this post.
More often than not, the lexicon of a researcher or other subject matter expert is broader than that of the potential reading audience. Thus, a glossary is useful for those who want to
ascertain the meaning of more esoteric terminology or concepts. $$\LaTeX$$ deals with glossaries via the package glossaries
. To enable glossary support in a research paper or book,
we use \usepackage[toc]{glossaries}
to display the glossary within the table of contents. In the document preamble, the statement \makeglossaries
must be added, and then we’re all
set. The syntax for an entry looks like this:
\newglossaryentry{Antidisestablishmentarianism}
{
name=Antidisestablishmentarianism
description={A 19th century movement in the United Kingdom in opposition to the efforts to dissolve the Anglican Church of England that ultimately led to the Church's preservation}
}
Writing a simple document
If your use case is nothing more than typing a spartan document with some degree of formatting, markdown and pandoc is all you need. There are plenty of online guides that explain the basics of typing markdown, so I won’t cover that here. Once your document is completed, you can use pandoc to convert it to a docx or pdf document with
pandoc -V geometry:"top=2cm, bottom=1.5cm, left=2cm, right=2cm" -o sample.pdf sample.md
These options adjust the page margins so that the content is centered. To get a Microsoft Word compatible document, we just change the target
pandoc -s -o sample.docx sample.md
We can use multiple markdown files as input arguments if desired.