Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Appendix A: Installation

Section 1: Installing the software

A.1.1 Unix and GNU/Linux

Users of modern GNU/Linux systems don’t even need the TEX Collection DVD, as TEX installation packages are available online, built into the package manager for your system.

Figure A.1: Installing TEX Live from Synaptic, an Ubuntu package manager

synaptic-install 

If your system has a graphical package manager (eg Ubuntu’s Synaptic or Software Center, see Figure A.1), run it and install texlive-full, ghostscript, gv, okular, biber, kile (or texstudio or emacs), and jabref. Some of them may already be installed on your system. Go and have a cup of coffee while they automatically install all the necessary components.

The new Ubuntu Software Centre only allows one package to be installed at a time, so you may prefer to use a typed command in a console window (other Linux users may prefer this approach anyway). The command name varies from distribution to distribution; but two common ones are apt and yum:

sudo apt install texlive-full biber ghostscript gv \
  okular biber kile texstudio emacs jabref

sudo yum install texlive-full biber ghostscript gv \
  okular biber kile texstudio emacs jabref
	

Unfortunately, the Okular and Evince PDF/DVI viewers have cumbersome interfaces: Okular prematurely replaced two older and much better-designed viewers, kdvi and kpdf; but you could install qpdfview instead, which is faster and lighter.

Unix and GNU/Linux installers

I strongly recommend this method for all GNU/Linux users. You should only install from the TEX Collection DVD if you are using an older, hand-built, or commercial Unix system which has no package manager, or where the version provided by the package manager is seriously out of date. Installing for a multi-user system from the TEX Collection DVD for Unix requires root privileges and a good understanding of Unix systems management, and is beyond the scope of this book.

The date of the version can be a drawback: the Linux repository versions of TEX can be up to a year out of date, because of the enormous volunteer effort required to put them together. For new users this should not be a concern, as most updates do not seriously affect core facilities. If there are very recently-updated packages you badly need, you can install them separately, using the instructions in § 3.2.

If you do decide to switch to the TEX Live DVD, make sure you completely uninstall and purge the texlive-full package first, otherwise your system will get hopelessly confused. This will leave your system in a conflicted state, because it will try to uninstall all the packages above that depend on TEX. The solution is a ‘shim’ Debian package that pretends that the Debian distribution of TEX Live is still installed, while actually using the DVD-installed version.

After installation, run texconfig (see Figure A.2) in a terminal window to adjust your local settings. This is a console utility, so type texconfig just to adjust your own personal settings, or sudo texconfig to adjust them system-wide (for all users). In the utility, use the arrow keys to go up and down the options, and the TAB key to jump to (and switch between) the OK, Cancel, and other ‘buttons’ at the foot of the screen. The spacebar or the Enter key selects a menu item or button. Most settings are correct as installed, but you might want to change one of the following:

  • the first option, DEST, lets you specify whether you normally want to print straight onto the printer, or ‘print’ into a file (to attach to email or upload somewhere)

  • the default paper size (the PAPER option), if the installed size is not your most common one (A4 or Letter)

  • the printer resolution (the MODE option), where you can adjust your printer settings; this allows you to fine-tune it for, say, a typesetter that you want to send output to instead of your own printer;

  • in the DVIPS option you can adjust your printer OFFSET (left and top margins), which is useful for older, less accurate printers.

You may also need the REHASH option later on. It is used to update TEX’s fast-find database (see the last step ‘Shared systems and MIKTEX: update your index’) after adding new or updated packages.

Figure A.2: Running the post-installation program texconfig

texconfig 

If your printer is a conventional home or office ink-jet or laser printer, and is not shown, the LaserJet5 setting (600dpi) is probably a good bet. While still in the utility, you can test the margin settings in another window by running the testpage.tex document through LATEX (by typing latex testpage and responding to the questions about paper size and double-sided printing). Print the resulting .dvi file with the command dvips -f testpage | lpr and adjust the margins in texconfig if necessary. These adjustments are not needed with PDF output.

A.1.2 Apple Mac OS X

Double-click the MacTeX-yyyy-DVD.mpkg package in the mactex folder of the TEX Collection DVD (replace the yyyy with the year of your distribution as shown on the DVD sleeve). Install the package in the normal Mac way by dragging the package icon onto the hard disk icon.

If you don’t have the DVD, download the MacTeX.pkg package from http://tug.org/mactex/mactex-download.html and click it in your Downloads to start the installation.

Depending on how your Mac is set up, you may be asked to download and install the developert tools during the TEX installation. Do so.

When it’s all finished, open your Applications folder in the Finder and go to the TEX subfolder and drag TEXshop out onto your Dock. TEXshop is the editor supplied with MacTEX which you use for writing your documents.

If you are going to use Adobe Acrobat Reader instead of Preview, make sure you clear the font cache and set the resolution to the system default (112dpi) otherwise you may get very weird displays.

If you are using the El Capitan version of the operating system, it is possible that TEXshop will not recognise the folder where MacTEX installed the system. If you get an error claiming pdflatex does not exist in /usr/texbin, then use the TEXshop PreferencesEngine menu to change the first Path Setting to /Library/TeX/texbin.

If you are unused to installing Mac software, here’s a click-by-click guide:

A.1.2.1 Download the MacTEX installer

  1. In the TEX Users Group web page for MacTEX at http://tug.org/mactex, click on MacTEX Download

    TUG MacTEX page

    macinstall/MacTeXInstall-2017-01-22T14:26:24.png 


  2. Click on the MacTeX.pkg link to download the installer

    MacTEX download page

    macinstall/MacTeXInstall-2017-01-22T14:27:06.png 


  3. The installer will be downloaded into your Downloads area

    Mac Downloads area

    macinstall/MacTeXInstall-2017-01-22T14:28:46.png 


A.1.2.2 Running the installer

  1. Click on the Downloads icon to see the package and click on it to start installation

    Click to start the installation

    macinstall/MacTeXInstall-2017-01-22T14:29:09.png 


  2. The Introduction screen explains what to do

    Introduction screen

    macinstall/MacTeXInstall-2017-01-22T14:29:34.png 


  3. The ReadMe screen lists what will be installed

    readMe screen

    macinstall/MacTeXInstall-2017-01-22T14:29:48.png 


  4. The License screen explains your rights: read it

    License screen

    macinstall/MacTeXInstall-2017-01-22T14:29:54.png 


  5. Click Agree to continue

    License agreement

    macinstall/MacTeXInstall-2017-01-22T14:30:06.png 


  6. The Destination screen lets you choose where to install. Normally you want to install for all users, even if you are the only user on the machine

    Destination screen

    macinstall/MacTeXInstall-2017-01-22T14:30:14.png 


  7. Pick the Standard Installation

    Standard installation

    macinstall/MacTeXInstall-2017-01-22T14:30:21.png 


  8. Wait while the files are installed

    Installation progress

    macinstall/MacTeXInstall-2017-01-22T14:31:12.png 


  9. Install the developer tools (this step will not occur if you have them already installed)

    Developer tools prompt

    macinstall/MacTeXInstall-2017-01-22T14:33:13.png 


  10. Agree to the developer tools license

    Developer tools license

    macinstall/MacTeXInstall-2017-01-22T14:33:22.png 


  11. The installer will check the location of the developer tools

    Software location

    macinstall/MacTeXInstall-2017-01-22T14:33:30.png 


  12. The developer software will be installed

    Developer software installation continues

    macinstall/MacTeXInstall-2017-01-22T14:33:40.png 


  13. The MacTEX installation scripts will be run

    Installation scripts

    macinstall/MacTeXInstall-2017-01-22T14:34:00.png 


  14. The developer software installation will continue

    Developer installation

    macinstall/MacTeXInstall-2017-01-22T14:35:57.png 


  15. The MacTEX installer will complete

    Installation finished

    macinstall/MacTeXInstall-2017-01-22T14:36:27.png 


  16. You can now dispose of the installer package

    Move the installer to the Trash

    macinstall/MacTeXInstall-2017-01-22T14:37:58.png 


A.1.2.3 Move the TEXShop editor into the Dock

  1. Open the Finder and locate the TeX folder in Applications. In it is the TEXShop application

    Locating the TEXShop application

    macinstall/MacTeXInstall-2017-01-22T14:38:41.png 


  2. Drag and drop the TEXShop application into your Dock

    TEXShop in the Dock

    macinstall/MacTeXInstall-2017-01-22T14:39:07.png 


A.1.2.4 Testing MacTEX

\documentclass{article}
\begin{document}
Hello, World!
\end{document}
	      
  1. Click TEXShop in the Dock to open it. Type the 4–line document as shown above

    Editing a test document

    macinstall/MacTeXInstall-2017-01-22T14:40:45.png 


  2. Set the LATEX processor to XƎLATEX in the drop-down menu and click Typeset. You will be asked to name and save the document: type a name, check the Encoding is set to UTF-8, and click Save

    Saving and typesetting

    macinstall/MacTeXInstall-2017-01-22T14:41:16.png 


  3. The processing log will record what LATEX does (this is also where any error messages get shown)

    Processing log

    macinstall/MacTeXInstall-2017-01-22T14:41:31.png 


  4. The typeset document is shown in a Preview window

    Typeset document

    macinstall/MacTeXInstall-2017-01-22T14:42:37.png 


A.1.3 Microsoft Windows

You can install ProTEXt from the TEX Collection DVD or from the downloadable installation from the TEX Users Group web site.

A.1.3.1 Installing from the DVD with Autorun turned on

If your system has auto-run enabled, inserting the TEX Collection DVD should start the setup program automatically. Click on the Open proTeXt button to start. Continue from § A.1.3.6 below.

If your system has auto-run turned off, insert the DVD, go to the protext folder, and double-click on the Setup.exe program as shown in Figure A.3. Continue from § A.1.3.6 below.

Figure A.3: The ProTEXt setup program on the TEX Collection DVD

dvd-unwrapped 

A.1.3.3 Downloading the ProTEXt installation program

Skip this if you have the TEX Collection DVD and go straight to § A.1.3.6

  1. In the TEX Users Group web page for proTEXt at http://tug.org/protext/, click on download the self-extracting protext.exe file

    The TUG web site proTEXt page

    wininstall/01-tugsite.png 


  2. Click on the protext.exe link to download the installer

    proTEXt download page

    wininstall/02-tugdownload.png 


  3. The installer will be downloaded into your Downloads area

    Windows Download

    wininstall/03-download.png 


  4. When it has finished downloading, wait while it is checked for malware. When the Run button appears, click it to start installation.

    You may be challenged by Windows Security asking if it is OK to run this program. Answer Yes

    Download finished

    wininstall/04-donedownload.png 


A.1.3.4 Extracting the installation files

  1. The first thing is to extract the installation files. Click on Browse to pick a folder

    Unpacking folder choice

    wininstall/06-extract.png 


  2. Choose your Downloads folder and click OK

    Selecting the folder to unpack to

    wininstall/11-setfolder.png 


  3. Click Extract to start extracting the installation files

    Ready to extract the installation files

    wininstall/10-extractwindow.png 


  4. The installation files will be unpacked to the folder you chose

    Unpacking the installation files

    wininstall/12-extract.png 


A.1.3.5 Locating your unpacked installation files

  1. When unpacking has finished, run your File Explorer. In older versions of Windows, this was called My Computer or just Computer

    File Explorer in the Windows 10 menu (lower left corner)

    wininstall/08-findfileexplorer.png 


  2. Go to the folder where you unpacked the installation files and double-click on Setup.exe

    The folder where you unpacked the installation files

    wininstall/13-seesetup.png 


A.1.3.6 Installing proTEXt

By now you should be able to double-click the Setup.exe program in the proTeXt folder.

  1. In the ProTEXt setup window, select your language and click on the MiKTEX Install button

    Installation of ProTEXt

    wininstall/14-startsetup.png 


  2. Click in the box to accept the MiKTEX licence and click Next to continue

    Accepting the MiKTEX licence

    wininstall/15-acceptconditions.png 


  3. Make sure the Complete MiKTEX option is selected and click Next to continue

    Selecting the complete installation

    wininstall/16-setcomplete.png 


  4. Choose a private installation or one that everyone who uses your computer can use, and click Next to continue

    Private or shared use

    wininstall/17-allowanyone.png 


  5. Accept the installation folder that MikTEX suggests (unless you are an expert or have a special disk setup) and click Next to continue

    The MiKTEX installation folder

    wininstall/18-setdest.png 


  6. In the Options screen, select your paper size (A4 or US Letter), and whether or not you want extra packages to be downloaded and installed automatically (Yes or No) — on a laptop where a network connection is not always present, choose ‘Ask first’ instead, then click Next to continue

    Paper size and package installation options

    wininstall/19-a4anddownload.png 


  7. Finally, accept the settings as shown (or change them by clicking Back), and then click Start to start the installation process

    Review your installation settings

    wininstall/20-confirm.png 


  8. During installation, MiKTEX will list the files it is installing and show a progress bar

    MiKTEX installing

    wininstall/21-progress.png 


  9. When it is all done, wait while it indexes your fonts, then click Finish

    Finishing the installation

    wininstall/22-waitforfonts.png 


  10. Click Close to finish the installation of MiKTEX

    Closing the installation

    wininstall/24-closetofinish.png 


A.1.3.7 Installing TEXStudio

  1. Go back to the ProTEXt setup window and click on the TEXStudio Install button

    Starting TEXStudio installation

    wininstall/25-startsetup.png 


  2. The TEXStudio installation program will start and ask you to select the language to use during installation and click OK to continue

    Selecting the language to use during TEXStudio installation

    wininstall/26-setlanguage.png 


  3. Click Next in the following screen to continue

    The TEXStudio installation introductory screen

    wininstall/27-tswelcome.png 


  4. Accept the installation folder that TEXStudio suggests (unless you are an expert or have a special disk setup) and click Next to continue

    The TEXStudio installation folder

    wininstall/28-tssetdirectory.png 


  5. Also accept the suggested location for the TEXStudio shortcut and click Next to continue

    The TEXStudio shortcut

    wininstall/29-tssetshortcut.png 


  6. Add icons to your desktop and Quick Launch bar by selecting the boxes, then click Next to continue

    Setting icons

    wininstall/30-tsseticons.png 


  7. Finally, accept the settings as shown (or change them by clicking Back), and then click Install to start the installation process

    Review the settings

    wininstall/31-tsconfirminstall.png 


  8. Wait a few moments while TEXStudio installs

    Installing TEXStudio

    wininstall/32-tswaitinstall.png 


  9. When it is all done, click Finish and TEXStudio will start

    Finishing installation of TEXStudio

    wininstall/33-tsfinishandstart.png 


  10. Close down the installer

    Exit the installer

    wininstall/36-installerexit.png 


A.1.3.8 Verifying the version of TEXStudio

  1. If there is a new version available, you will be notified. You download it from the TEXStudio web site at http://texstudio.org/ as described below

    New version available

    wininstall/34-tsnewversion.png 


  2. If TEXStudio claims it cannot find the installation of LATEX, it is out of date and should be replaced by an updated version from their web site as described here

    Error message from an obsolete version

    wininstall/35-tsversionbug.png 


  3. Download a new version from the TEXStudio web site at http://texstudio.org/. Click on Download now to get the latest version

    The TEXStudio web site

    wininstall/38-texstudiosite.png 


  4. Downloading a new version of TEXStudio

    Downloading from SourceForge

    wininstall/39-sourceforgewait.png 


  5. When the download has finished, click Run

    Starting the installation from a downloaded copy

    wininstall/40-tsdownloaddone.png 


Continue the procedure from the step ‘The TEXStudio installation program will start …’.

A.1.3.9 Testing TEXStudio

\documentclass{article}
\begin{document}
Hello, World!
\end{document}
	      
  1. When TEXStudio runs, click FileNew and type the 4–line document as shown above

    Editing a test document

    wininstall/45-typeset.png 


  2. Click the OptionsConfigure TeXStudio menu and set the processor (Default Compiler) to XƎLATEX

    Changing the default compiler

    wininstall/43-tssetxelatex.png 


  3. Typeset the document by clicking on the green double-arrow icon (Build & View)

    Your typeset document appears in a PDF window

    wininstall/50-tsfirstdoc.png 


  4. Shortcuts make life simpler

    New shortcuts in TEXStudio

    wininstall/47-tsshortcutnotice.png 


One last thing to do: add a personal TEX folder for extra downloads such as additional fonts.