Grad School Tools: LaTeX

One of the things I’ve noticed so far is that the tools and softwares and programs you use can drastically affect how you work. For example, based on the type of data you’re dealing with and how you need to modify it after/during collection, you might want to use one coding language over another. The plug-ins you choose to include on your computer can help save you from distractions, or create them. Or, which reference organizer (Endnote/JabRef/Mendeley) should you use? Aren’t they all pretty much the same?

In this series of posts, I’d like to talk about the various tools of grad school. What works, what doesn’t; what I use, or don’t use; and compare and contrast the different options available to you.

And today, I’m starting with LaTeX: what it is, why you would consider using it, and if you’re going to use it, how to get started.

I have talked about LaTeX in a previous post, and now I’m going to recapitulate and expand upon what I wrote there. (Also, I’m going to just type Latex going forward because proper capitalization is too much work.)


What is Latex?

Well, the place to start, I think, is what is Word?

Word (and LibreOffice’s Writer) is a text processor. It is often called a ‘What You See is What You Get’ (WYSIWYG) service. When you type something in Word, what you see in the software resembles closely the final product.

Image result for Word, dummy document

There is no conversion process, no ducking behind the GUI to modify formatting. You just type what you want and use the ribbon commands to format it how you want, and then you’re done.

Latex, simply put, is a system that allows you to create a document from the ground up. There is no preset formatting. Unlike in Word, you have complete and utter control over all the formatting decisions. And it’s not WYSIWYG.

image10

What I typed is on the left. On the right, is what the document looks like. It looks nothing alike, and this is the difference between WYSIWYG and a typesetter like Latex.

Now, Latex is a mark-up language, like HTML (where you might put <p>to signify the start of a new paragraph</p>). Similarly, instead of clicking a command button to create a bold phrase in your sentence, instead you will use \textbf{to create the bold word/phrase} in Latex. When you want a new chapter header, you don’t hit enter two or three times, increase the font size, and then bold/underline. You just write \section{Chapter 2} and you’re done.

And this gets to the heart of the issue with Latex, and why it’s not as mainstream as it should be, I think: you need to know the syntax in order to format your document the way you want. There is a learning curve. In my experience, it’s a short and shallow learning curve. You can learn almost everything you need to put together a research article in one afternoon. And for anything complicated, there is a whole host of resources online.

But learning Latex can look intimidating, the same way learning stats is intimidating. There is a lot of stuff for you to learn if you want to be an expert in stats, but truth-be-told, most of what you need to learn to get by doing day-to-day stats can be learned quickly and painlessly, without proofs or in-depth theoretical jargon. Same with Latex. Start simply, start with an easy document, and you will pick up almost everything you’ll need to know in a day or two.


Word Vs Latex

Now that you know what Latex is, why would you ever use it instead of Word? Both have their strengths and weaknesses, and I can’t truthfully say that you should use Latex all the time and for everything you do. Sometimes it’s just not practial. But there are also situations in which Latex is far superior than Word. For example, you should never use Word to create a resume/cv, in my opinion.

But here’s the breakdown. You should use Word when:

  1. You just want to write something down and don’t care about format. For example, I write short articles for Science in the News, and those are roughly 250 words. They will be posted as a blog in SITN’s own wordpress account. For that, whatever formatting I do while writing won’t matter as soon as I copy and paste, so doing the work in Latex would be a waste of time and effort. It’s all about just getting my ideas on paper and making sure the content is good.
  2. You are collaborating with people who don’t know how to use Latex. Unfortunately, the time to learn Latex is not during a group project, especially when you’re the only one who knows it and will be the only insisting on using it. Better to just go with Word on this one.
  3. The journal you’re submitting to only accepts .doc submission format. For a lot of journals, this is no longer the case and they might even provide their own Latex template (a .tex file with pre-set formatting, so all you really need to do is plug and chug). So, before you start writing, look at the journals’ specific submission requirements.

And you should use Latex when:

  1. You are doing anything with equations or symbols, figures, complex tables (more than just bare-bones), page columns, bibliographies and references, tables of content, journal-like formatting, or extreme space restrictions (e.g. page limits and margins). Latex is simply better at Word at handling these situations, and gives you the control to create, place, and tweak these things in ways Word never could.
  2.  The journal provides a tex template and you and your collaborators agree to use Latex. If you and your team have the capabilities and are willing to use Latex, then do it.

 

sfhtj

Now, we come to the issue of collaborative writing. Traditionally, Word has always beaten Latex out for collaborative writing simply because of the commenting and track-changes features, and this is why Word has continued to dominate academic writing and formatting. However, this is no longer the case. Before I explain how, though, I need to explain the different Latex options available to you.

There are two main ways you can use Latex.

First, you can download software, called TeX editors, onto your computer and use it as you would any other app. And there are two different flavors of TeX software. The first type is a standard ‘source’ editor, such as TeXStudio.

Image result for texstudio

The second type of software is WYSIWYM (what you see is what you mean), such as Lyx.

Image result for LyxAnd WYSIWYM is kind of this weird in-between format between source and WYSIWYG. You insert a latex code box, type the equation, and then when you’re done, the equation appears as it would in the outputted document, rather than in the mark-up style.

I’ve used both and I prefer source. I’ve used Lyx to create several documents and it has it’s own learning curve and quirks that I never could get a hang of quickly enough to make the process worth it. Additionally, there aren’t as many resources and tutorials available to help with Lyx as there are with source-editors.

The second way to use Latex is to use an online editor, rather than software that you download.  The two main online editors I’m familiar with are ShareLatex and Overleaf (formerly WriteLatex), but there are quite a few options. I predominantly use an online editor (Overleaf) to create latex documents, and I do so for several reasons.

First, I don’t have to worry about updating the software or downloading packages I want to use but don’t have on my hard-drive, and I can work directly on my latex document from any computer and don’t have to worry about transfering it via USB or dropbox. Also, latex editors normally have a selection of templates to choose from. For example, if I want to create a cover letter, I don’t have to start from scratch, necessarily. I can search the template database for a style of cover letter I like, open the template in the editor at the push of a button, and start plugging and chugging my information into the pre-written mark-ups with minimal effort on my part.

And Overleaf has an optional version of WYSIWYM, called ‘Rich Text’. It’s been around for a bit and they are always working on improving it, but I still favor the source view over rich text.

RichText_1
Source view for one of my quals resumes.
RichText_2
Rich Text view of the same lines.

Let’s get back to the idea of collaboration with Latex. As I said, until recently, Word and Google Docs were pretty much the way to go if you wanted track changes and have commenting features. However, ShareLatex and Overleaf (which have recently teamed up to create Overleaf V2, in beta, to ‘outshine both ShareLatex and Overleaf’ ) have come out with these features, as well. It is now possible to do collaborative, academic writing using an online Latex editor.

overleafv2.png
in V2: a HW template to show the comment feature and the track changes feature.
OverleafV2_History
And here I’m looking at the version history.

You have the same functionality in Latex as you do with Word.

But there is a bit of a snag: it’s not all free. In ShareLatex, the majority of these features are behind a paywall (50% off for students): 1+ collaborator, version history, and track changes, and only commenting is available to non-paying users. At the moment, it appears that you can have any number of collaborators and access to both track changes and commenting in Overleaf V2 because it is in beta. However, once all the bugs are worked out, ShareLatex and Overleaf will officially migrate over to V2. All three are functioning right now, with V2 tied to a user’s Overleaf account, but when they merge, user accounts from both ShareLatex and Overleaf will be transferred over to V2 and that will be the only remaining platform. When that happens, it appears that the number of collaborators will not be limited for non-paying users in V2, but that track-changes and version history might be pro-account only features.

Also, these features don’t really exist for the downloadable TeX editors. There’s a “Track Changes” package you can download, but it’s more hassle than it’s worth, in my opinion. At this stage, using an online Tex editor is completely comparable to using Google docs to write a manuscript.

There are other options you can look into, as well, like Authorea (short ‘about’ video). From what I can tell, Authorea isn’t Latex-specific, but more of a catch-all, WYSIWYG type editor. I have never used it personally, but I like the style and will probably experiment with it in the near future just to see what it’s about. It feels familiar to R Markdown, in a way.

And the last, unofficial reason I have for why you should learn Latex? So that you can be ready to use it in case you need to. It’s the same reasoning behind why schools might require you to take a coding class even though you do chemistry, or take a math class even if you’re a lit major. It takes almost no time to learn and become proficient, and it could come in handy one day.


Getting Started

If you’ve gotten this far, hopefully I’ve convinced you to start learning Latex, even if it’s just to experiment.

First, before you decide to download software onto your PC, I highly recommend playing around and learning on Overleaf or ShareLatex first. Online editors take out a lot of unnecessary complexity in generating a finished document. The TeX editors allow for a lot of customization and control over your document, but if you’re learning, all that stuff can just get in the way and add to the confusion. Learn syntax first in a simple online system, and then learn the software.

Next, open a simple homework assignment template in Overleaf and literally just play around. If you like to do things on your own without a tutorial, then try figuring out how to bold. Try to figure out how to quickly change font size (small, normal, and large). Try to make sections and subsections and subsubsections. Try to import an image.

Try to define a new command: let’s pretend you’re creating a guide on the quadratic eqution, and you know you’ll be typing it a lot. Instead of typing it out and copying and pasting, you could define a new command, \quadratic, and everytime you type \quadratic, the quadratic equation shows up in the document instead. You’ll learn a lot of math syntax and how to create your own personal shortcuts in this exercise. Worth it.

And if you like following tutorials, here is a variety:

Sharelatex Video Tutorials

Latex Tutorial Lessons

Overleaf PPT-Style Tutorial

And finally, the best resources:

CTAN, for whenever you need to look at the documentation of a specific package. Like the fontawesome package. Try finding the pdf documentation for that package.

Detexify, for when you need to write a specific symbol, like a tilda (~) and can’t quite figure out how to do it. Detexify lets you draw the symbol and then gives you a variety of “closest matches”, and what packages will let you use the symbol and what command will call for it. Very, very handy.

Latex Wiki, which covers a lot of the basic stuff you will need to know and could be a tutorial in it’s own right.

Lastly, google and stack exchange. Pretty much every problem you encounter, or any particular formatting thing you’re trying to accomplish, somebody will have encountered it before or wanted to do it before (or something close to it and you’ll be able to adapt their solution). Very, very rarily do I find myself trying to do something with no clear-cut solution already on the web.


Modifying and creating my own Latex documents is one of my favorite things to do, and I love introducing others and helping them learn it. And while I’m obviously and unabashedly biased, I still believe grad students should be familiar with and have some basic Latex experience under their belt, because you’ll never know when you’ll need. And you could end up like me, and love it. Have fun!

Cheers,

Z

 

 

 

4 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s