I'm quickly approaching the end of my PhD and, after years of inactivity and full-time dedication to my studies, I believe it's a good time to get back to this long-forgotten space. I spent the last 6 months working on my thesis, which involved a lot of literature research, frustrating days in the lab working on my Schlenk lines, weekends spent in the X-ray lab...and the list goes on and on. Despite all the energies I invested in my adventure as an experimental chemist, I found myself enjoying the write-up phase of my PhD more than I initially expected. This is due to a number of reasons:
1 - I could see the light at the end of the tunnel, hence adrenaline ((R)-(–)-L-Epinephrine or (R)-(–)-L-adrenaline) was pumping hard in my body and I've been somewhat high for the past 6 months.
2 - I was quickly approaching the end of my career as a student and, despite all the perks of not paying taxes and a relatively relaxed life style, the goal of stepping into the real world is electrifying.
3 - I finally had the chance to go back to some of my old passions: writing and LaTeX.
So, why LaTeX? I first fell in love with LaTeX in 2007, when I was working on the final dissertation of my Bachelor degree. I was already disillusioned with Microsoft Word at the time and was growing more and more tired of the nervous breakdowns caused by it. So I approached LaTeX and everything changed. It wasn't easy at the start since, after years of laziness caused by the extensive use of allegedly user friendly word editors, I was scared by the idea of gaining full control of the typing process. So here's the secret: using LaTeX is not that hard! I first started with the renown "Not so Short Introduction to LaTeX" by Tobias Oetiker and even after all these years this is still my personal LaTeX bible. By following this guide I started creating my first simple LaTeX documents, starting from the construction of my personal version of the the so-called "preamble": this is the section of the .tex file in which the user defines style, format and packages (which are just collections of macros) used throughout the document. And here is the first big difference with Word: you don't need to undergo constant format changes, adaptations of page margins, changes in line spacing and justifications! The style of the document is nicely set up right from the get-go and a high degree of customisation can be achieved - although invasive customisation is recommended only for experienced users. In case you're curious, here is the preamble I used for my thesis, which is the result of nearly seven years of development.
It's worth keeping in mind that the syntax of TeX is very simple. It doesn't require previous experience with other programming languages (although if you have any it's a bonus) and it's very easy to use and understand - as long as you're willing to change your word editing mentality! Every command is introduced by the symbol "\", followed by brackets used for defining the objects of the command. Something like this:
\commandname[x]{n}
The symbol "%" can be used to deactivate a specific command without deleting it from the text, so that it can be recalled later if necessary. In addition, it allows the user to insert additional comments in the text, a feature that becomes quite handy in very dense preambles.
%\commandname[x]{n}
\commandname[x]{n} %this is a comment
And this is pretty much all you need to know really! Just remember to close the brackets, if you want to avoid annoying errors when compiling your .tex file. I hope I'm not giving the wrong idea here: it's not my intention to write a LaTeX manual! I'm more interested in stimulating your curiosity and, hopefully, convince you that using LaTeX is not that hard after all. I hope my intentions are clear now!
Creating a good preamble can take a lot of time, but usually this happens over the years. Just to give an idea of what you'll be dealing with, this is the usual initial content of the preamble, which defines document class and line spacing:
\documentclass[a4paper,oneside, 10pt]{book}
\linespread{1.6}
As you can see, this is very intuitive and will prevent us from getting lost into the mist created by a series of stupid icons and very elaborate pull-down menus. OK, I do realise that I might come across as a bit of a Nazi, although this nomenclature shouldn't apply to word editing. Also, I have no intention to draw idiotic parallels with the Holocaust, unlike the ex-Prime Minister of my native country. I still respect people that have the will to lose their patience in the hopeless fight against Microsoft Word. Yes, I feel your pain and you have my compassion.
The following part of the preamble defines the packages and commands to be used in the text. I won't go into too much detail, it would be an insane job and, frankly, not particularly enjoyable. Being a chemist I had to fill my thesis with chemical formulae, and I was more than relieved when I added the following line to the preamble:
\usepackage{mhchem}
Mhchem is a great package for chemists, as it allows to write chemical formulae in the right format, without having to worry about superscripts and subscripts. The command is "\ce{}", and when applied it should look something like this:
I hope you all know what that formula means, If not, I redirect you to a useful information sheet which illustrates the hazards associated to the use of dihydrogen oxide. Anyway, think of how many times you had to click on the subscript button for writing formulae, causing annoying collateral changes in the format of the sentence due to the inability of Word of distinguishing between active and passive spacing in the text. But here come LaTeX and mhchem to save the day. I guess that what I'm really trying to communicate is the general idea and the level of control you reach on every aspect of the word processing experience. Do you want to write something in bold? Use the command "\textbf{}" so that whatever you type in as a parameter will appear in bold in the final document. Like:
And if you think I'm the only one on this planet who despises this evil Bill Gates' creation, well...you're horribly wrong, my friend. Compared to some hardcore Microsoft Word haters, I could be considered, using an Italian term, a democristiano. Which means "member of the Christian Democratic party". Now, for you who never had the chance to experience the varied Italian political landscape, the Italian Christian Democratic party ruled the Bel Paese for over 40 years after the end of WWII. They did so via a political agenda consisting of extreme compromise, arising from a disgustingly benevolent behaviour of their political leaders and party members. They created the Compromesso Storico (Historic Compromise) with the Italian Communist Party, a mutual agreement and political accommodation which guaranteed a decade of uncontested dominance to the two parties, while bribing, organised crime and corruption grew endemically and the country was affected by an internal underground civil war fought by left and right wing extremists. In synthesis, a democristiano is someone who, in the name of political compromise, forgets his/her own identity and agrees to everything, turning himself/herself into a docile and condescending spineless bigot - whilst being associated with criminal organisations and bribing scandals...but this is another story.
\ce{H2O}
I hope you all know what that formula means, If not, I redirect you to a useful information sheet which illustrates the hazards associated to the use of dihydrogen oxide. Anyway, think of how many times you had to click on the subscript button for writing formulae, causing annoying collateral changes in the format of the sentence due to the inability of Word of distinguishing between active and passive spacing in the text. But here come LaTeX and mhchem to save the day. I guess that what I'm really trying to communicate is the general idea and the level of control you reach on every aspect of the word processing experience. Do you want to write something in bold? Use the command "\textbf{}" so that whatever you type in as a parameter will appear in bold in the final document. Like:
I just wanted you to know that \textbf{I hate Microsoft Word}Which, upon compilation of the .tex file into the final .pdf document, becomes:
I just wanted you to know that I hate Microsoft Word
And if you think I'm the only one on this planet who despises this evil Bill Gates' creation, well...you're horribly wrong, my friend. Compared to some hardcore Microsoft Word haters, I could be considered, using an Italian term, a democristiano. Which means "member of the Christian Democratic party". Now, for you who never had the chance to experience the varied Italian political landscape, the Italian Christian Democratic party ruled the Bel Paese for over 40 years after the end of WWII. They did so via a political agenda consisting of extreme compromise, arising from a disgustingly benevolent behaviour of their political leaders and party members. They created the Compromesso Storico (Historic Compromise) with the Italian Communist Party, a mutual agreement and political accommodation which guaranteed a decade of uncontested dominance to the two parties, while bribing, organised crime and corruption grew endemically and the country was affected by an internal underground civil war fought by left and right wing extremists. In synthesis, a democristiano is someone who, in the name of political compromise, forgets his/her own identity and agrees to everything, turning himself/herself into a docile and condescending spineless bigot - whilst being associated with criminal organisations and bribing scandals...but this is another story.