13.3 ⁎Online LaTeX Editors
Online LaTeX editors allow you to store your source code on the provider's server and edit it using your web browser. The source code is compiled using the TeX distribution installed on the server. This means you don't need to worry about co-authors having a different TeX distribution (or even having a distribution at all). However, it means that you're limited to the classes and packages installed on the server and they may not be the most recent version.
The two most popular online LaTeX editors appear to be Overleaf (formerly WriteLaTeX) and ShareLaTeX. The information provided here (such as available features and pricing) may have changed since the time of writing this chapter.
- ShareLaTeX
- There are four plans: Personal, Student,
Collaborator, and Professional. The pricing and available features
are listed in
Table 13.1. The site supports the
following languages: Italian, Japanese, Korean, Portuguese, Czech,
Dutch, Chinese (Simplified), Norwegian, English, German, Danish,
Russian, French, Swedish and Turkish.
Table 13.1: ShareLaTeX Plans (as at December 2014) Personal Student Collaborator Professional GBP £ per month Free £6 £12 £24 GBP £ per year Free £60 £144 £288 EUR € per month Free €7 €14 €28 EUR € per year Free €70 €168 €336 USD $ per month Free $8 $15 $30 USD $ per year Free $80 $180 $360 Maximum Number of Collaborators 1 6 10 Unlimited Full Document History? No Yes Yes Yes Sync to Dropbox? No Yes Yes Yes Sync to GitHub? No Yes Yes Yes
To create a free personal account, just go to https://www.sharelatex.com/register and enter your email address and the password you want to use. To create a new project, go to https://www.sharelatex.com/project and click on the “New Project” button. This will drop-down a list of options, such as a blank project, upload a project, import from GitHub, or create a project from a template. There's a wide selection of templates:
- Bibliographies: BibTeX,
thebibliography
environment, natbib, biblatex, biblatex with split bibliographies, IEEE BibTeX style, and notes2bib. - Books: includes Springer styles, Tufte style, classic thesis,
Wiley styles, MIT styles and sffms (science fiction and
fantasy manuscripts).
- Exams.
- Cover letters: moderncv styles and Illinois University.
- Other: includes business cards, pst-barcode, homework
styles, various letter styles, brochures, flyers, posters, business
reports, recipe, lab reports, assignment sheets, invoices, grant
applications, and proposals.
- CV or Résumé: includes moderncv styles, europecv styles,
classic, academic, professional, fancy, curve, curvita.
- Thesis: there are a lot of templates in this category, some
are general and some are specific to particular institutes.
- Presentations: again there are a lot of templates, many of
them using various beamer themes.
- Journals: many different journal styles.
- Bibliographies: BibTeX,
- Overleaf
There are four plans available: Free, Personal+, Pro and Pro+. The pricing and available features are listed in Table 13.2. There are also tailored solutions for universities, publishers and enterprise. Students get all the features of the Pro account for half price.
When you create a new project with Overleaf, a unique identifier is generated that's used in the link to the project. The files that make up the project are private as long as that link remains private. It's unlikely that anyone will guess the link, but if it does get published or shared then the project can be accessed and edited. It's your responsibility to ensure you don't share the link with anyone who shouldn't access it. (Be careful of the link appearing in your browser history if you use a shared computer.) With the Pro plans you can create protected projects for added security. Overleaf uses Amazon S3 for secure data storage.
Table 13.2: Overleaf Plans (as at December 2014) Personal Personal+ Pro Pro+ GBP £ per month Free £5 £6.50 £9.50 GBP £ per year Free £48 £60 £90 EUR € per month Free €6.50 €7.50 €11.50 EUR € per year Free €60 €72 €108 USD $ per month Free $9 $10 $15 USD $ per year Free $84 $96 $144 Storage space up to 1GB 2GB 10GB 20GB Files per project 60 120 240 500 Unlimited projects and collaborators Yes Yes Yes Yes Save and restore version history Yes Yes Yes Yes Tag, filter and clone projects Yes Yes Yes Yes Quick save to Dropbox No Yes Yes Yes Integrated spell-check No Yes Yes Yes Editor themes No Yes Yes Yes LaTeX auto-complete No Yes Yes Yes Compare versions and see tracked changes No No Yes Yes Access control on protected projects No No Yes Yes Priority support No No Yes Yes Full project history (coming soon) No No Yes Yes PeerJ Free lifetime Publishing Plan No No Basic Enhanced
To create a free Overleaf account, just go to https://www.overleaf.com/signup, fill in your name and email and click on the create new account button. This takes you to the dashboard and sends you an email with a link to confirm your account registration and choose a password.
To create a new project, click on the “create new project” button in the dashboard. This pops up a window where you can select a template for your document. The available templates are divided into categories:
- Basic: blank paper, sample paper, presentation.
- Academic journals:
IEEE Transactions, Springer LNCS, IEEE sponsored
conferences and symposia, BioMed Central, MDPI, PeerJ, Elsevier,
OSA Express journals, IEEE for Computer Science Journals, IOP
journals, Optica, F1000Research, Language Science Press, Springer
Journals, APS, Public Library of Science, Advances in Optics and
Photonics (AOP), Royal Society Open Science, Copernicus Publications.
- Bibliography: IEEE with BibTeX, biber and biblatex,
natbib, Chicago citation style with biblatex.
- Book: Tufte, ePub/eBook, Language Science Press,
fiction.
- Formal letter: includes newlfm, memo, professional formal letter,
Aalto School of Business Letter, Carleton letter
- Homework assignment: a selection of templates for homework or
lab reports.
- Newsletter: Tufte handout template, memo template, a
newsletter template, a flowfram template.
- Poster: a selection of templates including a sciposter
and a beamer template.
- Presentation: a selection of templates, most of them seem to
use beamer with different themes.
- Project lab reports: a large selection of report-like
templates.
- Résumé/CV: a selection of CV templates.
- Thesis: a large selection of thesis templates, many of them for specific universities.
One thing I noticed when trying out the templates was that once I had created a project by selecting a template, there was no way to permanently delete it. If you delete a project from the project list on the dashboard, the project is moved to trash and after 30 days, the project will be removed from the dashboard, but the project itself isn't deleted. This was a bit annoying as I only created the projects to see what the templates looked like. Only some of the templates actually included information in their description about the packages used within the template.
- Basic: blank paper, sample paper, presentation.
I tried both sites using Mozilla Firefox (v33.1) and Google Chrome (v39.0.2171.71) running under 64-bit Fedora 19. In addition, to test accessibility support for visually-impaired users, I tried both sites with the text-only browser Lynx (v2.8.8dev.15) and with the text-to-speech Jovie plugin for Konqueror (v4.11.5).
User Interface
- Overleaf
- The interface was mostly fine on Firefox and Chrome. In
general on the site, if the window isn't wide enough for the
navigation bar, the navigation links are replaced by a button that
drops-down a list of links so a horizontal scroll bar is never
required by the browser. When editing a project in the source
code pane, there were some issues with trying to copy selected text
in the source code pane to the clipboard. If I used the popup menu's
“copy” item, I received a message “This action isn't yet
available from the menu, but you can press Ctrl-C instead.” This
cleared the selection, and I had to reselect the text and use
Ctrl-C. (Firefox's Edit→Copy menu item and
Chrome's Copy button worked. The issue was just with the
popup menu.)
An example document with Overleaf is shown in Figure 13.3. This has a split pane area with the source code on the left and a preview image on the right. The divider bar between the two panes can be moved to make one pane wider than the other. If the source code pane isn't wide enough for all the menu buttons, you can access the remaining buttons through the “More” drop-down menu.
The preview is automatically updated whenever the file is modified, which I found distracting, but the automatic compilation can be switched off by selecting the “Manual” button on the menu bar above the preview image. The only way of enlarging the preview image is to make the preview pane wider.
The source code can also be viewed as rich text. This gives a partial WYSIWYG feel, which may suit some users. To enable this feature, just click on the “Rich Text” button. The document shown in Figure 13.3 is reproduced in Figure 13.4 with this feature on. To switch back to viewing the source code, click on the “Source” button. At the time of writing, the rich text function is still in beta.
Another interesting feature is that if I click on an area of the preview pane (for example, on the first section header) the corresponding line in the source code is highlighted. (There's a short delay between clicking and the source code line being found, so be patient, especially if you have a slow Internet connection.) I wasn't expecting SyncTeX support given that the preview window is an image, so I was pleasantly surprised by this.
The free version of Overleaf doesn't have spell-checking or the ability to change the editor themes, but it does have syntax highlighting.
The list of source files that make up a project can be viewed using the “Menu” button on the main Overleaf navigation bar at the top of the window. Select the “Project” item from this drop-down menu and a window will list the files (shown in Figure 13.5). To add new files, you can click on the “Add files…” button which drops-down a menu where you can choose various options, such as create a new file or folder, or upload from your computer or off-site storage, such as GoogleDocs or Dropbox.
You can use the file list to switch the editor to a different source file or you can use the drop-down menu next to the filename to rename or delete the file or perform other operations.
There is also a settings button to the left of the account holder's name on the top navigation bar. The spell check is disabled because it's not available for the free plan, but it's possible to set the editor mode to Vim or Emacs, and the font size can be made smaller or larger.
- ShareLaTeX
- I had no problems with the interface on Firefox or
Chrome. As with
Overleaf, if you resize the browser, the contents expand or contract
with line wrapping in the source rather than introducing a
horizontal scrollbar. As you type a command, a drop-down list of
suggestions appears. You can click on an item in this list to
complete the command name or to fill in the begin and end of an
environment. Lines are numbered, but a widget appears next to a line
number where an environment begins. You can click on this widget to
collapse the environment, hiding its contents from view. This
widget is also available for other commands, such as the sectioning
commands. When you open a project, it's automatically compiled, but
once you edit the source code, you need to manually recompile by clicking on
the “Recompile” button.
The ShareLaTeX project window (Figure 13.6) has three panels: the file list panel, the source code panel, and the preview panel. The file list panel has buttons that allow you to create new files or folders, upload files, rename files or delete files. You can click on a filename in the list to switch the source code panel to that file. The preview panel has zoom buttons that are displayed when you move the mouse over the top of the preview image. Again SyncTeX is enabled. You can double-click on an area of the preview image to jump to the corresponding line of code in the middle panel or you can use the right and left arrows between the source code and preview panels.
The style of the source code panel can be changed using the menu widget (the left-most button above the file list panel) which pops up the panel shown in Figure 13.7. (The editor theme is in the lower part of the panel off the edge of the window but can be reached using the vertical scroll bar.) The configurable settings are: compiler (PDFLaTeX, LaTeX, XeLaTeX or LuaLaTeX), main document file, spell check language, auto-complete, theme (various available), key-bindings (none, Vim1 or Emacs), font size, and PDF viewer (built-in or native). There are also hotkeys that you can use to navigate your way around the source code. These can be displayed by clicking on the “Show Hotkeys” button below the settings list. To close the settings panel, just click on one of the other panels.
Error Handling
To test the error handling, I misspelt a command. (I removed the
“f” from the command \pdfcreationdate
.)
- Overleaf
- The line where the error occurs is highlighted and a popup window
displays the message immediately below the line (see
Figure 13.8). Moving the cursor away from the
error line will make the message disappear. Moving the cursor back
to the error line will make the message reappear. At the right-hand
end of the menu bar above the preview pane, there's a red drop-down
menu labelled “compile error”. There are two items: “go to first
error/warning” and “open latex log”.
I couldn't find any way to open the log file when there weren't any
errors or warnings. (There are some useful bits of information in log
files that aren't error or warning messages, which I sometimes like
to check even if the document appears okay.)
- ShareLaTeX
- The line where the error occurs has a small red box with a white
cross in it next to the line number. If you move the mouse over this
box, the error message will be displayed. You can also click on the
“Log and output files” button above the preview window to display
more details about the error (as shown in
Figure 13.9). Below the detailed error message
are buttons that allow you to view the full transcript, clear cached
files and a drop-down menu that allows you to view the auxiliary
files.
TeX Engine
- Overleaf
- I was interested to discover that Overleaf seems to be able to determine what
engine to use when compiling the document. The example document shown in
Figure 13.3 uses
\pdfcreationdate
, which is a PDFTeX primitive. Inspecting the log file shows that PDFLaTeX is being used and the command successfully produces the date stamp. However, if I add the pstricks package to this document, I get an “Undefined control sequence” error for this command. Investigating the log file shows that XeLaTeX is being used (which doesn't provide\pdfcreationdate
). - ShareLaTeX
- With ShareLaTeX you need to explicitly set the engine you want to
use. You have a choice of PDFLaTeX, LaTeX, XeLaTeX and
LuaLaTeX. The default is PDFLaTeX.
Available Classes and Packages
I tried out the classes and packages described in this book. Unsurprisingly, packages that aren't on CTAN, such as pgfornament, also aren't available with the online editors nor are some packages that require external scripts, such as piechart and vc. Neither site had the non-TeX Live packages eforms, draftmark, pgf-pie and rtsched. Inspecting the generated log files showed that both sites use TeX Live on a Unix-like system.
In addition to the above, Overleaf didn't have drm or gitinfo2 installed (but it did have gitinfo2's predecessor, gitinfo) nor did it have the pressrelease class. (Both drm and pressrelease were released in September 2014, three months before the time of writing this, and gitinfo2 was new in May 2014.) ShareLaTeX had drm, gitinfo2 and pressrelease installed.
Therefore it seems that, at the time of writing, both Overleaf and ShareLaTeX have reasonably up-to-date TeX Live distributions, but ShareLaTeX's distribution is more up-to-date. This may, of course, have changed since I tested both sites.
External Applications
To test commonly-used external applications, I added an example bib file (called example.bib) that contained a sample entry:
@book{sample, title = "A Sample Book", author = "Ann Author", publisher = "A Publisher", year = 2014 }I added this sample citation to my document and also added an index (with the makeidx package), and a glossary and list of acronyms (with the glossaries package).
Both Overleaf and ShareLaTeX correctly generated the bibliography, index, glossary and list of acronyms. I didn't need to specify any of the external applications, both sites automatically ran bibtex and makeindex on the appropriate files.
Interaction Between Collaborators
- Overleaf
- I viewed my example source file in both Firefox and
Chrome at the
same time. As I edited the text in one window, the other window was
automatically updated, so it seems that all collaborators should
always be viewing the latest version of the code.
Each collaborator can add comments to the code using the “Add a comment” button (it looks like a speech bubble with a plus inside it). I added a comment, and the source code pane was switched to rich text format, as shown in Figure 13.10. The comment can be hidden using the “Hide Comment” button on the top left of the comment box. When the comment is no longer needed, it can be closed using the “close” link at the bottom of the comment box or another author can reply to the comment using the “reply” link. If you switch back from the rich text mode to the regular source code mode, the comment is present using TeX's standard commenting mechanism with the % character, but it also includes the commenter's email address and the date the comment was made.
- ShareLaTeX
- The free plan that I tried out didn't support multiple
collaborators.
Accessibility
Given the complexity and visual nature of both sites, I didn't expect either site to work well with a simple text-only browser such as Lynx, but that and the Konqueror Jovie plugin were the only means I had to test accessibility for the visually impaired.
- Overleaf
- The site doesn't appear to provide alternative text for images. For
example, on the pricing and plans
page
the ticks and crosses that
indicate which options are available with which plans are invisible
to the text-to-speech synthesizer, which is useless for any users
who can't see the images. On the other hand, text that isn't
visually displayed on the page is read out, which is a bit confusing.
The project window doesn't render correctly in either Lynx or Konqueror and I wasn't able to view or edit the document source code. It's possible that a more sophisticated screen reader, such as Jaws, can produce better results with a different browser.
- ShareLaTeX
- Again there didn't appear to be any alternative text for images.
When viewed in Lynx, the prices weren't visible on the
Plans and
Pricing
page,
however they were read out by Konqueror's Jovie plugin.
I couldn't view the project window in Konqueror. I just got an
error claiming that the project had been modified by collaborators
and that I should ask the project owner to upgrade the account.
Again, it's possible that a more sophisticated speech reader can
produce better results with a different browser.
Mobile Devices
I tried both sites on my Arnova 7GB tablet. This is a very basic mobile device and my rural broadband is a little iffy, so I didn't expect a fast response from either site. I also borrowed my brother's iPad and my son's “it tablet” and tried both sites on those.
Both sites worked fine with the iPad and the it tablet, but they didn't work well with the Arnova tablet.
- Overleaf
- I was able to login with the Arnova's default web browser and with
Opera Mobile, but whenever I tried to access my list of projects
from the dashboard, I was redirected to the site's home page.
- ShareLaTeX
- The Arnova's default web browser and also the Opera Mobile browser were
unable to render the email and password fields in ShareLaTeX's login page,
so I was unable to test out the site as I was unable to login.
Summary
Both sites are impressive and have similar interfaces, but they are not browser-independent, only fully-functioning with the big well-known browsers (which is not really surprising given the complexity of the sites). If you have collaborators who have difficulty using complicated web interfaces (for example, if they are visually-impaired) you may want to consider using a version control repository instead so that they can use their preferred text editor and other tools that are accessible for them.
ShareLaTeX's paid plans have the ability to sync to GitHub, but remember that private GitHub repositories also require payment. Both sites have paid plans that also provide the ability to save to Dropbox. Overleaf's paid plans are cheaper than ShareLaTeX's.
If any of your collaborators are wary of LaTeX and are easily confused by the document commands, they may be swayed by Overleaf's rich text view if all they need to do is write text (as opposed to complicated equations or diagrams).
ShareLaTeX's free plan comes with a spell checker, multiple editor themes and auto-complete, but Overleaf's free plan doesn't. (The paid plans do.) On the other hand, ShareLaTeX's free plan doesn't allow multiple collaborators whereas Overleaf's free plan does.
Both sites displayed the time stamp in UTC+0, which also happens to be my current time zone (GMT) at the time of writing. This surprised me as I was expecting at least one of the sites to use a server in a different time zone. I can't tell if they are actually in the same time zone as me or if they can determine my location and set the time zone at the start of the document compilation.
Footnotes
- ... Vim1
- The Vim key-bindings with the “terminal” editor theme provided an interface similar to my accustomed editing preferences, which I liked.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).