5 Open-source Document Creation Tools I

Isaac Mulolani

Learning Outcomes

By the end of this chapter, the reader will be able to:

  1. Describe what the LaTeX document typesetting system is and how it can be used
  2. Identify some relevant packages/elements of LaTeX that can be used to create OER
  3. Describe the LaTeX installation process on a Windows systems
  4. Identify an appropriate LaTeX editor from a list of available options
  5. Describe the basic layout required to create a LaTeX document

The LaTeX Document Preparation System

Donald Knuth of Stanford University began working on a text processing system known as TeX and METAFONT. Knuth wrote in the forward to his  book, The TEXbook.[1]

TEX [is] a new typesetting  system intended for the creation of beautiful books – and especially for books that contain a lot of mathematics. By preparing a manuscript in TEX format, you will be telling a computer exactly how the manuscript is to be transformed into pages whose typographic quality is comparable to that of the world’s finest printers.

While Knuth was developing TeX in the early 1980s, Leslie Lamport began work on a document preparation system. This new system, called LaTeX, made use of TeX’s typesetting engine and macro system. In this system, high-level LaTeX commands allowed a user to easily compose a range of documents without worrying about typographical issues.

The first release of this system appeared in 1985 and was numbered 2.09. The release was accompanied by the second edition of LaTeX: A Document Preparation System, which led to a rapid spread of TeX-based document processing beyond the community of mathematicians. In the following decade, its use spread very rapidly becoming extremely popular in the scientific and academic communities and extensively used in industry.

Mirror Sites for Access to LaTeX

Since LaTeX has a current global following, it is helpful to describe the mirrors that exist across the globe. There are several different flavours of LaTeX that can be downloaded for installation on different platforms. These will be described in this section. There are three main variants of LaTeX available: MiKTeX, TeXLive and MacTeX. These systems can be used on different operating systems.

TeXLive

TeXLive is designed to be a straight forward way to get up and running with the TeX document preparation system. It provides a comprehensive TeX system with binaries for most flavors of Unix, including GNU/Linux, macOS, and also Windows. It includes all the major TeX-related programs, macro packages, and fonts that are free software, including support for many languages around the world. Many operating systems provide it via their own distributions. Instructions are provided on how to install these on different systems. This flavour can be installed on various Linux distributions and a specific version (MacTeX) has been designed for installation on MacOS personal PC and Intel platforms.

MiKTeX

From the TeX User Group mirrors, one can obtain proTeXt which is a MiKTeX distribution designed for installation on a Windows system. Prot guides[2] the MiK installation via a short pdf document (available in German, English, French and Italian), which provides clickable links to install the various components, along with explanations. For ease of use, Prot also adds studio, and Sumatra PDF.

MacTeX

Again, from the TeX User Group mirrors, one can obtain MacTeX which is an easy-to-install TeX distribution for MacOS. The distribution contains all of TeXLive along with GUI applications and the most recent  version of Ghostscript. One of the editors that can be used with MacTeX is TeXShop. As always, there are other options for editors as well.

TeX Collection DVD

All members of TUG can get a copy of the TeX Collection. This is the name given to the complete collection of software distributed by TUG each year. Non-members can also purchase the TeX Collection DVD from the TUG Store. The components that are included in the TeX Collection DVD are:

  • TeXLive – a comprehensive cross-platform system. It includes support for Unix-like systems, MacOS and Windows
  • MacTeX – an easy to install TeX system for MacOS based on TeXLive. Included are a native Mac installer and  the TeXShop editor in addition to some Mac specific tools.
  • proTeXt – an easy to install TeX system for Windows that is based on MiKTeX. It comes with a detailed installation guide and some Windows-specific tools including the TeXworks editor.
  • CTAN – the DVD contains a snapshot of the backbone CTAN server. It is a subset of what is available on the public servers.

The creation of the TeX Collection involves hundreds of people from all over the TeX world. There are contributers uploading packages, maintainers providing a repository, individuals building binaries for a variety of platforms, people testing results, developers supporting the software, user group members keeping the infrastructure TUG provides, etc. Every one of these individuals volunteers their time for this project.

Advantages and Disadvantages in using LaTeX

This section will discuss the pros and cons of using LaTeX to create documents. This way, potential users will have an opportunity to determine whether an investment of time in learning the system is worth it.  To start, the following are some common arguments against using LaTeX:[3]

  • LaTeX is a difficult program to learn. There is a learning curve to get up to speed with being able to use LaTeX. However, in the long run it will save you time through code re-use.
  • LaTeX is not a What You can See is What You Get (WYSIWYG) word processor. There are many editors that can be used with LaTeX plugins.
  • There is little support for physical markup. For most areas across subjects, there are packages that can be used without needing to tweak the look and feel.
  • Using non-standard fonts is difficult.  The fontspec package and XeLaTeX make this easy.
  • It takes practice to let text flow around pictures. Text flow can be improved by rearranging words but it does take practice.
  • LaTeX doesn’t provide spell check. Most editors have spell checkers. There are also commandline tools for this.
  • There are too many packages. While that may be true, a document only requires a few packages.
  • LaTeX encourages structured writing and the separation of style from content which is not how everybody works. There are more communities starting to use LaTeX which would indicate that this is not as big a problem anymore.

The advantages of using LaTeX are listed in the following.[4]

  • LaTeX provides state-of-the art typesetting.
  • Many conferences and publishers accept documents in LaTeX. The majority of them provide classes and packages to ensure that documents meet submission formatting requirements.
  • LaTeX is a Turing-complete programming language. This provides almost complete control over your document.[5]
  • LaTeX can be used to prepare several documents from the same source. Some recent document creation platforms such as Pressbooks have this feature.
  • LaTeX is highly configurable. The appearance of a document is determined by choosing the appropriate document class, class options, packages and package options. In addition, the proper use of command (from packages and user defined) gives control over the appearance of your document.
  • LaTeX can be translated to multiple formats including html/ps/pdf/DocBook, etc.
  • LaTeX automates chapter, section, equation, figure numbering among many others. Support for cross-reference is also provided.
  • LaTeX provides excellent support for bibliography. The organisation of the bibliography and the style of citations is also configurable.
  • Support for WYSIWYG document preparation exists: LyX, TeXmacs, etc. There are many editing environments that provide support for LaTeX, e.g., vim, emacs, eclipse, Sublime Text, etc.
  • LaTeX is very  stable and freely available on most operating systems.
  • As mentioned earlier, there is a worldwide active TeX/LaTeX user-base.
  • LaTeX has comments.
  • LaTeX is fun to work with.

LaTeX Installation on Windows

In this section, the installation of MiKTeX on windows is described.  The first step to this installation start with visiting the TUG site. The steps to installing are enumerated below. One should set aside at least  one hour for installation.

  1. Download ProTeXt-3.2-031721.zip from www.tug.org/protext/ directly from CTAN: https://ctan.org/pkg/protext
  2. Unzip ProTeXt-3.2-031721.zip into a temporary folder
  3. Navigate into this temporary folder and double-click on the setup.exe
    • Install MiKTeX from the ProTeXt Panel
    • Choose Complete MiKTeX
    • Choose Anyone who uses this computer (all users)
    • Install MiKTeX to C:/Program Files/MikTeX 2.9 (default)
    • Change Preferred paper to Letter
    • Set Install missing packages on the fly to YES
    • Start the installation
    • Click Finish when done
  4. Install the TeXstudio
    • In the window that opened after running setup.exe click the second install box.
    • Use all Defaults

Choice of Editors to use with LaTeX/TeXLive

As has been described, in order to use TeX, LaTeX, TeXLive etc., one must install an appropriate editor. There are many options available: free, freeware or commercial. Then there are some editors that need to be installed while others can be used online. The best editor will be the one that meets the typesetting requirements for the current project. Many people pick an editor or two and use those for the all their projects. We will start by looking at the free editors that are available. Our focus will be on using LaTeX on Windows.

Free Editors

This list will describe the free editors that are available to use. For each of these, we will examine the features in the editor that would be useful for editing projects.

      1. TeXWorks – TeXworks is free and open-source application software available for Windows, Linux and macOS. The software is licensed under the GPL. This is designed to be a simple editor available for all major operating systems (MS Windows, Gnu/Linux distros and MacOS). The following are some of the features available:
        1. Scripting
          • QtScript, Lua and Python languages are supported
          • use scripts to add new features or extend existing functionality
          • assign custom shortcuts for quick access
          • customizable access to other files and programs on your computer
          • use some of the bundled scripts to e.g., set the spellchecker language based on babel options or tune the lengthy console output into a concise list of TeX errors and warnings
        2. New features
          • use Follow focus to keep the source and preview in sync all the time
          • window positions and sizes are saved for recent documents
          • a command line parser allows for greater interoperability with other programs
          • resources (templates, scripts, …) are updated automatically when upgrading to a post-0.4 version
          • use one of numerous file encodings and line ending conventions to increase interoperability between different systems
          • save all open documents using this single menu item
          • auto-completion for the beamer class
        3. Major improvements & bug fixes
          • implement fine-grained synchronization using text searching to assist SyncTeX
          • support background color/font flags in syntax highlighting
          • show the spellchecker languages in human-readable form; no more ISO language codes, no more entries for the same language on unix platforms
          • preserve document view when reloading after external changes
          • switched to pdfLaTeX as the default engine on fresh installation
          • allow smart quotes to be applied to a selection
          • allow Esc and Return in the tags and search result windows
          • fix handling of external file links in PDFs
          • Fix handling of All Files in the Save As dialog on MS Windows
      2. TeXstudio – This is an open-source option that is available for all major operating systems. This started as a fork of TeXmaker  in 2009. It was originally called TeXmakerX with extensions for TeXmaker.  Since them, significant changes to the features and code base have result in a fully independent program. TeXstudio has the following features:
        1. Comfortable editing
          • Multi-Cursors
          • Auto-Completion
          • More than 1000 mathematical symbols
          • Bookmarks
          • Link Overlay
          • Assistants for tables, images, formula, …
          • Drag & Drop support for images
          • Table formatting
        2. Keep the overview
          • structure view
          • Code folding
          • Advanced syntax highlighting
          • Interactive spellchecker
          • Interactive grammar checker
          • Interactive reference checker
          • Clear display of LaTeX errors and warnings (in the editor and as a list)
        3. Advanced Build System
          • Built-in support for various LaTeX compilers, index, bibliography and glossary tools, Latexmk, and many more
          • Automatic detection of the need for multiple LaTeX runs
          • Run any program you like
          • Completely customizable for the creation of the complete document
        4. View the Result
          • Integrated PDF viewer with (almost) word-level syncing
          • Live-updating inline preview for formulas and code segments
          • Tooltip preview for included images
        5. Easy Setup
          • Installers or packages available for Windows, Linux, and Mac OS X
          • Portable USB version available
          • Automatic detection of MikTeX, TeX Live, Ghostscript and Standardlatex
          • SVN support
      3. TeXmaker – This is a free cross-platform (Windows, MacOSX, Linux) LaTeX editor that started in 2003. It is easy to use and configure and released under a GNU Public License (GPL). It has the following features:
          • Unicode Editor – fully unicode and supports a large variety of encodings
          • Spellchecker – includes spell checking while typing
          • Code folding – all part, chapter, section, etc., can be collapsed
          • Code completion – main latex commands can be quickly inserted while typing
          • Fast navigation – TeXmaker includes a structure view which is automatically updated while typing.
          • Master mode – TeXmaker allows you to work easily onto documents separated in several files with the master mode.
          • Integrated PDF viewer – TeXmaker includes a built-in pdf viewer with continuous scrolling and synctex support.
          • Easy compilation – One-click compilation with the predefined Quick Build commands.
          • Mathematical symbols – 370 mathematical symbols can be inserted in just one click.
          • Wizards – TeXmaker includes wizards to generate the most standard LaTeX code (Quick Document, Quick Beamer Presentation, Quick letter, tabular, tabbing and array environments)
          • Latex documentation – an extensive LaTeX documentation is furnished with TeXmaker.
          • Error handling – TeXmaker automatically locates errors and warnings detected in the log file after a compilation and you can reach the corresponding lines in the document in one-click.
          • Rectangular block selection – easy rectangular selection with mouse +Alt key. Users can easily cut/copy/paste columns of a table.
          • Find in folders – you can search for text in all the latex documents included in a folder (and subfolders) . If you click on a line, TeXmaker will open the corresponding document at the right line.
          • Rotation mode for pdf viewer – the integrated pdf viewer supports rotation mode.
          • Regular expressions support – you can use regular expressions for search and replace.
          • Full asymptote support – syntax highlighting (commands) compilation in one click.
          • Unlimited number of snippets – users can define an unlimited number of snippets with keyboard triggers.
      4. TeXnicCenter – This editor is licensed under GPL. The following are the features available in the editor.
              • User Interface
                • LaTeX code snippets – Simple insertion of LaTeX constructs via toolbars and menus
                • Tabbed MDI window – Open as many files as needed. Each open file is represented by a tab.
                • Customizable – All toolbars, menus and short cuts are customizable.
                • Customizable window layout – All panes can be docked to any window edge or undocked if required.
                • Integratable tools – Integrate any third party tools into TeXnicCenter’s tools menu
                • Multi-language – Out of the box support for English and German
              • Text Editor
                • Syntax highlighting – Highlighting of LaTeX constructs with customizable colors.
                • Auto completion – Simply hit [Ctrl]+[Space] to complete the command you’ve just started to type.
                • Paranthesis matching – Highlighting of missing and matching parenthesis.
                • Dynamic word wrapping – Wrap long lines at editor’s edge or defined text column while typing.
                • Spell checker – Integrated spell checker including check while you type.
                • Forward and inverse search – Support for forward and inverse search in conjunction with any viewer supporting these features
              • File Handling
                • Template based file creation – Comfortable feature for creating new projects or single files based on your own templates.
                • Plug-In interface for third party wizards – The Microsoft COM-interface provides the possibility to implement document and project wizards.
                • Document projects – Document projects keep all files of a document together and  ease your daily work.
              • Navigator View
                • Structure view – Browse the complete document structure grouped by the logical header levels.
                • Object view – Browse the list of all your document’s headers, figures, tables, equations and other environments.
                • File view – Browse all your project’s files grouped by type (LaTeX, Bibtex, Graphic files).
                • Reference view – Browse all your Project’s BibTeX references.
              • Building & Viewing Output
                • Concept of output profiles – Output profiles define the steps to be executed to compile your LaTeX files to the resulting output file (e.g., DVI, PDF) and how to view it.
                • Unlimited number of output profiles – Define as many output profiles as needed. Simply select the one to be used from the toolbar.
                • Flexible post processor mechanism – Define additional commands to be executed during the build process per output profile (e.g., dvips).
                • Flexible viewer integration – Define for each output profile how to invoke the viewer either by command line or DDE commands. This supports the integration of nearly every viewer including Adobe Reader and Ghostview.
                • Just one key press – Building or viewing your document’s output requires just one key press or menu selection.
                • Error Detection – Errors, warnings and box errors in LaTeX’s log output are highlighted and you can simply jump to the relevant text location.
                • Import/Export of output profiles – Share your output profiles with other TeXnicCenter users.
              • Setup
                • Easy Installation – TeXnicCenter comes with a standard Windows installer providing useful default. Installation is finished within a few minutes.
                • Easy Configuration – The configuration wizard just queries for the path of your LaTeX installation and then you are done.

Freeware Editor

The following is a LaTeX editor for use with MiKTeX installed on Windows 10.

WinEdt

WinEdt is a front-end Integrated Development Environment (IDE) for compilers and typesetting systems such as TeX, HTML of NSIS. It’s highlighting schemes can be customised for different modes and its spell checking functionality supports multilingual setups with dictionaries for many languages available on WinEdt’s Community Site. WinEdt may be used for an evaluation period of 31 days. Any further use requires a license, obtained through a Registration Procedure. The editor comes with a QuickGuide available from the WinEdt website. A few of its many features are:

    • Tree view can be customised
    • Automatically display your current location in TOC.
    • Colour coding that aids usability.
    • Intelligent defaults,
    • Options to customise almost anything.
    • Easy configuration interface with MiKTeX.
    • One click build process for LaTeX documents.
    • Intuitive default shortcut keys and intuitive alt menu letters.

The following video describes the workflow that can be used to create documents with WinEdt.

Download text transcript: WinEdt-share-video2-transcript Video length: 5:23 minutes

Commercial Editors

The following is a list of commercial editors and their respective features.

  1. Overleaf – Overleaf is an easy to use cloud-based LaTeX editor. It allows you to view document history, insert images, equations, bibliographies and more. It’s feature list includes:
    • Overleaf offers a wide range of templates.
    • It makes writing, editing and publishing documents quicker.
    • This application offers a real-time preview of code.
    • Share withe other people effortlessly.
    • You can switch to LaTeX and Rich Text mode.
    • Find LaTeX errors in less time.
    • You can track changes and comments in real-time.
  2. Authorea – Authorea is another online editor which allows you to write and publish easily. It supports commenting to discuss changes in real-time. It has the following features:
    • It helps you manage versions of documents without any hassle.
    • Authorea helps you start developing using templates.
    • This app provides 24 \times 7 hour support.
    • You can convert documents from PDF to Word.
    • The tool can add rich media to documents.
    • It offers collaboration in real time.
    • The supported platform is the web.
  3. Archimedes – Archimedes is a LaTeX and Markdown editor built from the ground up or the Mac and designed to make mathematical writing fun and easy. It has the following features
    • Markdown Editing – It is a fully-featured plain text and Markdown editor. It includes a fast syntax highlighter and provides convenient keyboard shortcuts for common actions, such as inserting images and links.
    • Math Mode + Autocomplete – Archimedes lest you write mathematics in a subset of LaTeX. Just enter $$ to get started. The editor autocompletes commands and intelligently matches closing braces, brackets and parentheses as you type.
    • Live Preview – As you work, a beautifully-typeset live preview of your document is always visible. You can even switch between horizontal or vertical orientation and select a custom theme.
    • Math Library – Browse the math library to see all available LaTeX commands and their previews in one place.
    • Macros – You can define macros for expressions you work with the most. The macros show up in autocompletion results alongside built-in completions.

Basic Document Layout in LaTeX

Leslie Lamport wrote LaTeX as an extension of Donald Knuth’s TeX program.[6] LaTeX consists of a Turing-complete procedural markup language and a typesetting processor. This combination allows one to control both the visual presentation and the content of a document. The following steps outline the use of LaTeX.

  1.  A document is written in a LaTeX (.tex) input (source) file. This a human readable file containing a combination of commands, text and special characters.
  2. A typesetting processor (latex, pdflatex, xetex, xelatex etc.,) is run on the input file. This converts the input file into a device independent (.dvi) file or a portable document format (.pdf) file. if the processors flags errors in the input file, they should be fixed before moving on to step 3.
  3. The dvi of pdf file can then be viewed on the computer. For printing, the dvi file must be converted to either postscript or pdf format.

In general, working with editors makes these steps seamless and easier to manage. These editors also make finding and fixing errors much easier in many instance. You are also able to preview the processed document within most editors. Some even have a live preview which automatically generates the preview once the processing is complete.

The following steps lead to the creation of a basic LaTeX document.

This document can be run using any LaTeX editor to show the typeset result.

Typeset latex document
Figure 4. Visual result of typesetting the LaTeX document

A manner of documents can be created using LaTeX and it associated editors. The TUG website maintains a catalogue of all packages currently available for use in LaTeX documents. Every aspect of a document can be automated using these packages:

  • creating a book cover
  • cover page for reports, articles
  • classes covering a range of different document types including those for masters and doctoral theses
  • many different classes for creating books and manuals
  • commands to create tables of contents,  lists of figures, list of tables
  • packages that cover a range of different mathematical needs with special symbols and formulae
  • mechanism for creating reference, bibliographies, and index, glossary, list of acronyms, etc.
  • there are  several packages for creating graphics within LaTeX documents, i.e., PGF/Tikz, PSTricks, Asymptote, etc. These allow the creation of graphics using macros.
  • convertors to allow a LaTeX document to be provided in multiple formats, i.e., postscript, PDF, HTML, ePUB, etc.

As can be seen from this, LaTeX is a self-contained publishing environment that is used to create complete documents without the need for any external graphics programs.

Summary

In this chapter, the open-source document creation platform LaTeX has been briefly described. Its connection to Donald Knuth’s TeX  was mentioned and the different variants of the software for different platforms described. LaTeX’s power is the ability to select as many or as few packages as needed to create a given document.

To help work with documents, there are a number of editors with built-in tools that make working with LaTeX documents straight-forward. Tools such as conversion to PDF and viewing the result is provided by most editors, for example. These editors also provide helps in the form of provide command completion, menus with mathematical symbols, buttons for index creation, etc.

One of the key aspects of using LaTeX is the ability to tap into a global group of users in document creation. There are many different TeX User Groups across the globe that one can turn to for help. There are also a number of community forums that can also be leveraged (LaTeX Community, TeXample.net, LaTeX Project, LaTeX Stack Exchange, etc.).


  1. See Donald Knuth. The TEXbook, volume A of Computers and Typesetting. Addison-Wesley, Reading, MA, USA, 1986.
  2. See ProTeXt.
  3. See LaTeX and Friends by M.R.C. Van Dongen, Springer 2012.
  4. See LaTeX and Friends by M.R.C. Van Dongen, Springer 2012.
  5. See Dev Community.
  6. See LaTeX and Friends by M.R.C. Van Dongen, Springer 2012.

License

Icon for the Creative Commons Attribution 4.0 International License

Tools for Creating OER by Isaac Mulolani is licensed under a Creative Commons Attribution 4.0 International License, except where otherwise noted.

Share This Book