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

### 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

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

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.

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:

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

TUG MacTEX page

#### 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

2. The Introduction screen explains what to do

Introduction screen

3. The ReadMe screen lists what will be installed

5. Click Agree to continue

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

7. Pick the Standard Installation

Standard installation

8. Wait while the files are installed

Installation progress

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

Developer tools prompt

10. Agree to the developer tools license

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

Software location

12. The developer software will be installed

Developer software installation continues

13. The MacTEX installation scripts will be run

Installation scripts

14. The developer software installation will continue

Developer installation

15. The MacTEX installer will complete

Installation finished

16. You can now dispose of the installer package

Move the installer to the Trash

#### 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

2. Drag and drop the TEXShop application into your Dock

TEXShop in the Dock

#### 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

2. Set the LATEX processor to XƎLATEX in the drop-down menu and click . 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

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

Processing log

4. The typeset document is shown in a Preview window

Typeset document

### 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 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

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

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

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

#### A.1.3.4 Extracting the installation files

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

Unpacking folder choice

Selecting the folder to unpack to

3. Click to start extracting the installation files

Ready to extract the installation files

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

Unpacking the installation files

#### 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)

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

#### 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 button

Installation of ProTEXt

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

Accepting the MiKTEX licence

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

Selecting the complete installation

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

Private or shared use

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

The MiKTEX installation folder

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 to continue

Paper size and package installation options

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

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

MiKTEX installing

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

Finishing the installation

10. Click to finish the installation of MiKTEX

Closing the installation

#### A.1.3.7 Installing TEXStudio

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

Starting TEXStudio installation

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

Selecting the language to use during TEXStudio installation

3. Click in the following screen to continue

The TEXStudio installation introductory screen

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

The TEXStudio installation folder

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

The TEXStudio shortcut

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

Setting icons

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

Review the settings

8. Wait a few moments while TEXStudio installs

Installing TEXStudio

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

Finishing installation of TEXStudio

10. Close down the installer

Exit the installer

#### 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

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

The TEXStudio web site

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

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

Changing the default compiler

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

Your typeset document appears in a PDF window

4. Shortcuts make life simpler

New shortcuts in TEXStudio