## Use LaTeX templates to write scientific papers

As researchers, we have to write and publish scientific papers to let the world know about our work. The process of preparing a scientific paper can be enjoyable, but it can also be arduous.

Different journals and publishers have different requirements about how we should format our submission. The title page should include certain items, the headers should be bold and italic, references should be formatted in this style, etc. The Instructions to Authors of many journals are long and overwhelming, which may deter potential authors.

When I was a PhD student, I found it strange that journals had so many Instructions on how to prepare a manuscript, but never provided a downloadable template as a .doc or .docx. If I had a template with [Insert title here], [Insert Abstract here; 400 words], etc, where the various elements were already formatted correctly, I could focus on writing my paper and not on formatting my paper. Moreover, editors and reviewers would likely have an easier time of dealing with submissions that were more uniform in their style.

Fear not! Many journals and publishers have LaTeX templates that can be downloaded and used in just this way. While these LaTeX files may seem a little intimidating if you have never opened up a .tex file before, most are fairly straightforward and actually include key points from the Instructions to Authors as dummy text in the article or as comments.

### Example: writing a paper for a PLOS journal

How do we find LaTeX templates? As is often the case, Google is your friend.

A simple Google search reveals that there is a LaTeX template for all of the PLOS journals. You can download the plos-latex-template.zip file, which contains three files:

1. plos_latex_template.tex: This is the file you would open in your text or LaTeX editor to write your paper.
2. plos_latex_template.pdf: This is the PDF file generated from the current text entered in the plos_latex_template.tex file.
3. plos2015.bst: This is the file that LaTeX will use to appropriately format the references in your paper. References, managing references, and formatting references are a huge topic and will be the focus of one or more future posts.

A copy of these files is also available here.

The title and author section of the first page of plos_latex_template.pdf looks like this:

As you can see it looks very professional and complies with the journal format.

If you open up the plos_latex_template.tex file, there are approximately 70 lines of comments and instructions on how to prepare your article. If you are new to LaTeX, many of these instructions will seem like gibberish. But don’t worry, this won’t stop you from drafting your first article. With a little bit of patience, and possibly reading our series of LaTeX blog posts, you will soon be able to make sense of these instructions.

The actual document starts on line 175. Below we can see the part of the LaTeX document that relates to the title and author section from the PDF document:

\begin{document}
\vspace*{0.2in}

% Title must be 250 characters or less.
\begin{flushleft}
{\Large
\textbf\newline{Title of submission to PLOS journals} % Please use "sentence case" for title and headings (capitalize only the first word in a title (or heading), the first word in a subtitle (or subheading), and any proper nouns).
}
\newline
% Insert author names, affiliations and corresponding author email (do not include titles, positions, or degrees).
\\
Name1 Surname\textsuperscript{1,2\Yinyang},
Name2 Surname\textsuperscript{2\Yinyang},
Name3 Surname\textsuperscript{2,3\textcurrency},
Name4 Surname\textsuperscript{2},
Name5 Surname\textsuperscript{2\ddag},
Name6 Surname\textsuperscript{2\ddag},
Name7 Surname\textsuperscript{1,2,3*},
with the Lorem Ipsum Consortium\textsuperscript{\textpilcrow}
\\
\bigskip
\textbf{1} Affiliation Dept/Program/Center, Institution Name, City, State, Country
\\
\textbf{2} Affiliation Dept/Program/Center, Institution Name, City, State, Country
\\
\textbf{3} Affiliation Dept/Program/Center, Institution Name, City, State, Country
\\
\bigskip

% Insert additional author notes using the symbols described below. Insert symbol callouts after author names as necessary.
%
% Remove or comment out the author notes below if they aren't used.
%
% Primary Equal Contribution Note
\Yinyang These authors contributed equally to this work.

% Additional Equal Contribution Note
% Also use this double-dagger symbol for special authorship notes, such as senior authorship.
\ddag These authors also contributed equally to this work.

% Current address notes
\textcurrency Current Address: Dept/Program/Center, Institution Name, City, State, Country % change symbol to "\textcurrency a" if more than one current address note
% \textcurrency b Insert second current address
% \textcurrency c Insert third current address


While some of the LaTeX commands might seem intimidating at first, you can safely ignore them. Simply replace the dummy text with your own text. For example, if I wanted to write the title of my paper, I would enter the following:

{\Large
\textbf\newline{ScientificallySound as a resource for scientists} % Please use "sentence case" for title and headings (capitalize only the first word in a title (or heading), the first word in a subtitle (or subheading), and any proper nouns).
}


As you can see, I simply entered the title of my paper “ScientificallySound as a resource for scientists” between the curly brackets. Also, I followed the instructions provided in the document, which tell me that I should use “sentence case”. Speaking of these instructions, note that text that follows a percentage sign (i.e. %) is a comment in LaTeX. Comments do not appear in the final PDF.

Special symbols and characters.

If the percentage sign is used to start comments in LaTeX documents, how do we obtain a percentage sign in our final PDF document? In this case, you would put a back slash in front of it, for example 25\%. This tells LaTeX that you want a percentage sign in your text, not start a comment.

This convention may seem overly complex, especially if you are not used to computer programming. It does take a little time to get use to, but soon enough it will become automatic.

What about other special characters? We will address some of these in a future post, but the easiest thing is to Google your question. Also, many modern LaTeX editors such as Texmaker, Lyx and Texstudio have look-up tools similar to the special character look-up in Microsoft Word. You look up the symbol or character you want, click on it and the correspond LaTeX command gets inserted into your text.

### Templates for other journal and publishers

Many publishers provide LaTeX templates. For example:

Some journals offer their own templates, and researchers who have created templates that adhere to the Instructions to Authors for a given journal often make these files freely available. For example:

Given that many journals now accept a generically formatted PDF for a first submission, it is possible to use a generic article template to prepare your paper.

Lastly, there are online services that let researchers prepare LaTeX articles in the cloud. These services, such as Overleaf and authorea, provide hundreds of templates. Importantly, using these services means you don’t need LaTeX installed on your computer. Depending on the service and whether or not your institution has an agreement or contract with the service, you may be able to collaborate simultaneously with other authors, regardless of where they are located in the world. Moreover, you can leave comments, track changes, retain a history of your changes, and integrate version control software such as git and github. Given the benefits of such services, they will be the focus of an upcoming post.

### Summary

LaTeX templates can save you lots of time.

However, there is more to writing a paper in LaTeX then simply downloading a template and filling in the required bits. How do you generate the pretty PDF? How do you get references and figures into the document? How do I share these files with my co-authors? These are all important questions, and we will be deal with them in the next few blog posts.