Making your CV with Markdown, Pandoc and LibreOffice

Hello guys, today I will be guiding you to making your curriculum vitae using a text editor, pandoc and libreoffice's pdf export feature.

First of all, make your CV in markdown. Start with a decent text editor which takes care of markdown highlighting. If you are using Linux, I suggest you to use Gedit which supports markdown highlighting.

Lets start with a sample CV. Text block below is a sample CV which will be used for our article. Do not use it as your own CV, though you can add or modify the contents to make your CV

# Maik Wechsler 

✉ : maikwechsler@armyspy.com 
✆ : (+49) 6211 354 117 
✍ : Scharnweberstrasse 91, 68309 Mannheim Käfertal 

## Education 

1. __Masters of Engineering in Media__ (Oct 2014 - Oct 2016) 
   _Hochschule Altenheim_, 
   Altenheim, Germany 
   
   __Dissertation:__ 
   
   > Analyzing the behavior of chimpanzees when flashy pictures are displayed before them. 

2. __Bachelors of Art__ (Sep 2010 - Sep 2014) 
   _University of Phony_, 
   Phony Island, Iraq 

   __Thesis__ 

   > How globalization has affected the color perception in mammals. 

## Experiences 

1. __Pulmonary function technologist__ 
   _University stereo_, Outland of Romania, Italy 

   __Responsibilities:__ 

   * SOA Tools and Best Practices utilization 
   * Test Cases, Plans and Scripts preparation 
   * Acceptance testing and Regression testing 

## Others 

1. __Software systems__ -> Ms Office Suite, Windows Vista XP, Unix 
2. __Languages__ -> Basic understanding of symbol languages, English, and 
   Proto Indo-European language. 

## References 

Not available even upon request.

Save the markdown as cv.md.

The next step is to install pandoc. If you are using debian based operating system then, you can just run the following command:

sudo apt-get install pandoc

I guess you already have libreoffice suite installed. If it is not installed, then it is the best time to install it. You can use the following command to install libreoffice in debian based distribution.

sudo apt-get install libreoffice

A whole lot of packages will be installed, because LibreOffice is a complete office suite which includes Writer for writing documents, Calc for calculating and plotting charts and graphs, Base for your record keeping and Impress for impressing your professor, managers or bosses depending on where you are and what you are doing.

Lets come back to the guide. Since LibreOffice and pandoc are installed at this point. Lets try to convert your CV from markdown to LibreOffices's document

Run the following command:

pandoc -s -o cv.odt -f markdown cv.md

Here, -s orders to create a standalone file. -f markdown is the pandoc's markdown format, which we will be using as our markdown flavor. Lastly, cv.md is your markdown file.

You should see cv.odt file which should like the figure below.

I am pretty sure you do not like the default fonts and styles of LibreOffice writer. Now we will do something different. We will try to change styles and regenerate the odt file from our markdown file. For this, we need a reference odt file. pandoc will copy the styles from the reference file and apply to the generated odt file.

When you open and check the odt file which you have just created, you can see the following styles used.

  • Heading 1
  • Heading 1
  • Heading 2
  • Heading 3
  • Title
  • Subtitle
  • Footer
  • Horizontal Line (This is useful if you use horizontal line later)
  • First paragraph
  • Text Body

Create a new odt document. Add some dummy texts and apply above styles. Fiddle around the styles and create your perfect format.

I have created a sample reference odt document, which I will attach at the end of this article. But before, let me show you how the CV looks like with my reference document.

I will also attach the generated pdf at the end of this article.

Now, you have a reference odt file, generate your CV odt document with the following command:

pandoc -s -o cv.odt --reference-odt=reference.odt -f markdown cv.md

You see, there is a new switch added to the command --reference-odt=reference.odt. This switch instructs pandoc to use the style of reference.odt file and apply to the cv.odt file.

Lastly, LibreOffice can be used to export to pdf by using the following command:

libreoffice --headless --convert-to pdf cv.odt

Note: My LibreOffice version is 5.2. Check your LibreOffice installation for your version. Above command will run LibreOffice without GUI and will convert cv.odt to cv.pdf.

LibreOffice requires odt file to convert to pdf. So, before running the above command make sure that you have generated the odt document from markdown using pandoc. Also, I found out if you have LibreOffice open when you run the above command, LibreOffice does nothing. Close all the instances of LibreOffice and try the command again if nothing happens.

That is it. Isn't it simple?