Appendix A
Appendix A
A
Installation
TEX Live : for all Unix & GNU/Linux systems including Apple
Macintosh OS X, and for Microsoft Windows;
TEX Live is also available specially packaged for installation
on Linux systems through the Linux repositories for each
system.
i i
i i
i i
APPENDIX A. INSTALLATION
i i
i i
i i
install-tl -s small
install-tl -s basic
i i
i i
i i
APPENDIX A. INSTALLATION
Package managers
If you pick the ‘full’ option when you installed TEX, you will have
pretty much everything there is already installed.
Some distributions of LATEX like MiKTEX (Windows) can recognise
when you try to use a new or updated class or package in your
document that isn’t installed, and automatically download and
install it for you right there and then, and carry on compiling
your document.
Others like TEX Live and MacTEX have a separate package man-
ager (tlmgr) which can be used to add classes and packages if
you find you need them.
and have a cup of coffee while they automatically install all the
necessary components.
The 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 (Ubuntu) and
dnf (Red Hat):
244 Formatting Information
i i
i i
i i
i i
i i
i i
APPENDIX A. INSTALLATION
f 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);
f the default paper size (the PAPER option), if the installed size
is not your most common one (A4 or Letter);
f 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 step 4. on page 77) on multiuser shared
systems after adding new or updated packages.
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 usually needed with
PDF output.
246 Formatting Information
i i
i i
i i
i i
i i
i i
APPENDIX A. INSTALLATION
2. Click on the
MacTeX.pkg link to
download the
installer
248 Formatting Information
i i
i i
i i
1. Click on the
Downloads icon to
see the package
and click on it to
start installation
2. The Introduction
screen explains
what to do
Formatting Information 249
i i
i i
i i
APPENDIX A. INSTALLATION
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
250 Formatting Information
i i
i i
i i
9. Install the
developer tools (this
step will not occur if
you have them
already installed)
Formatting Information 251
i i
i i
i i
APPENDIX A. INSTALLATION
252 Formatting Information
i i
i i
i i
Formatting Information 253
i i
i i
i i
APPENDIX A. INSTALLATION
\documentclass{article}
\begin{document}
Hello, World!
\end{document}
254 Formatting Information
i i
i i
i i
Formatting Information 255
i i
i i
i i
APPENDIX A. INSTALLATION
Figure A.3 – The ProTEXt setup program on the TEX Collection DVD
4. The typeset
document is shown
in a Preview window
i i
i i
i i
2. Click on the
protext.exe link to
download the
installer
Formatting Information 257
i i
i i
i i
APPENDIX A. INSTALLATION
258 Formatting Information
i i
i i
i i
2. Choose your
Downloads folder
and click OK
Formatting Information 259
i i
i i
i i
APPENDIX A. INSTALLATION
1. When unpacking
has finished, run
your File Explorer.
In older versions of
Windows, this was
called My Computer
or just Computer
2. Go to the folder
where you
unpacked the
installation files and
double-click on
Setup.exe
260 Formatting Information
i i
i i
i i
4. Choose a private
installation or one
that everyone who
uses your computer
can use, and click
Next to continue
Formatting Information 261
i i
i i
i i
APPENDIX A. INSTALLATION
5. Accept the
installation folder
that MikTEX
suggests (unless
you are an expert or
have a special disk
setup) and click
Next to continue
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
262 Formatting Information
i i
i i
i i
8. During installation,
MiKTEX will list the
files it is installing
and show a
progress bar
Formatting Information 263
i i
i i
i i
APPENDIX A. INSTALLATION
1. Go back to the
ProTEXt setup
window and click on
the TEXStudio Install
button
2. The TEXStudio
installation
program will start
and ask you to
select the language
to use during
installation and click
OK to continue
264 Formatting Information
i i
i i
i i
4. Accept the
installation folder
that TEXStudio
suggests (unless
you are an expert or
have a special disk
setup) and click
Next to continue
Formatting Information 265
i i
i i
i i
APPENDIX A. INSTALLATION
8. Wait a few
moments while
TEXStudio installs
266 Formatting Information
i i
i i
i i
1. If there is a new
version available,
you will be notified.
You download it
from the TEXStudio
web site at
texstudio.org/
as described below
Formatting Information 267
i i
i i
i i
APPENDIX A. INSTALLATION
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
3. Download a new
version from the
TEXStudio web site at
texstudio.org/.
Click on
Download now to get
the latest version
4. Downloading a new
version of TEXStudio
268 Formatting Information
i i
i i
i i
\documentclass{article}
\begin{document}
Hello, World!
\end{document}
1. When TEXStudio
runs, click File New
and type the 4–line
document as shown
above
Formatting Information 269
i i
i i
i i
APPENDIX A. INSTALLATION
3. Typeset the
document by
clicking on the
green double-arrow
icon (Build & View)
One last thing to do: add a Personal TEX Directory for extra
downloads such as additional fonts.
MiKTEX and TEXnicCenter
270 Formatting Information
i i
i i
i i
mkdir ~/texmf
Or : use a file-manager:
1. Open a file-manager window (eg Thunar, Nautilus,
Dolphin, etc) on your Home directory;
2. Right-click in an empty area of your Home directory
so the menu dialog appears;
3. Click Create New Folder ;
Formatting Information 271
i i
i i
i i
APPENDIX A. INSTALLATION
mkdir ~/Library/texmf
i i
i i
i i
cd %USERPROFILE%
md texmf
i i
i i
i i
APPENDIX A. INSTALLATION
2. Click the Roots tab and the Add button, and navigate in
the window to the place where you created the texmf
folder above
274 Formatting Information
i i
i i
i i
Warning
In MiKTEX you MUST click on the Refresh FNDB button any time you
make changes to the contents of your Personal TEX Directory
(the texmf folder), otherwise MiKTEX will not be able to find the
files.
i i
i i
i i
APPENDIX A. INSTALLATION
i i
i i
i i
fc-cache -fv
$ fc-list|grep -i comic|sort
/home/peter/texmf/fonts/truetype/
windows/comicbd.ttf: Comic Sans MS:style=Bold
windows/comici.ttf: Comic Sans MS:style=Italic
windows/comic.ttf: Comic Sans MS:style=Regular
windows/comicz.ttf: Comic Sans MS:style=BoldItalic
You can then see the exact font name to use in your documents, eg
\usepackage{fontspec}
\setsansfont{Comic Sans MS}
i i
i i
i i
APPENDIX A. INSTALLATION
5. If you are using MiKTEX, run your TEX indexer program (see
step 4. on page 77).
Unix & GNU/Linux systems, including Apple Macintosh OS X,
don’t need this last step.
That’s it. Unlike PostScript fonts, METAFONT fonts generate
their own font metric files (.tfm files) automatically on-the-fly
the first time the font is used, so there is normally nothing
else to install.
Now you can put a \usepackage command in your Preamble
with whatever name the .sty file was called, and read the
documentation to see what commands it gives to use the font
(refer to item1 on page 73 and step 2. on page 75).
If the font came without .fd or .sty files, you’ll need to find
someone who can make them for you.
i i
i i
i i
installed TEX hundreds of times and very rarely had any difficulties,
but these are a few of the occasions when I did.
Bad hard disks : If you are using Microsoft Windows, you should
run a scan and defragmentation of your hard disk[s] before
you start. It should take under an hour on a modern
machine unless you have a very large disk, but it may need
overnight on an older machine. Clean your DVD drive if
it has been in heavy use. TEX is made up of a very large
number of very small files, so there is a lot of disk activity
during an installation. Microsoft Windows runs very slowly
when installing a lot of small files, so be patient.
On any system, if you are installing a new hard disk for
your typesetting work, you have the chance to reformat
it beforehand. Pick the smallest granularity (cluster size)
possible, usually 1024 bytes (1Kb). This minimises the space
needed for systems with a very large number of very small
files like TEX has, and may help improve the speed and
reliability of the system.
i i
i i
i i
APPENDIX A. INSTALLATION
Use the latest versions : Before installing, check the CTAN web
site at www.ctan.org/ for the latest version of ProTEXt
(Windows), MacTEX (Macs), or TEX Live (all platforms) for
the latest copy of the installation program. Just occasionally
a bug slips through onto the production DVD, and although
it’s always fixed and notified on comp.text.tex, that’s a
high-volume newsgroup and even the sharpest eyes may
miss an announcement.
Unix and GNU/Linux users will always get the latest repository
copy from their system’s package manager, but this may not
be the absolute latest copy of TEX (see the Note on p. 245tlc
for why). If you are installing on Unix manually from the
TEX Collection DVD instead, check on CTAN for an updated
version of the file install-tl.sh.
i i
i i
i i
i i
i i
i i
APPENDIX A. INSTALLATION
for each directory tree they need to look in. This is known as
the ls-R database, from the Unix command (ls -R) which creates
it. The program which does this for TEX is actually called after
this command: mktexlsr, although it may be aliased as texhash or
something else on your system. This is the program referred to
in step 4. on page 77.
However, to know where to make these indexes, and thus
where to search, TEX needs to be told about them. You
don’t normally need to change the configuration, but sometimes
you might want to move directories between disks to free up
space or use faster equipment, which would mean changing the
configuration.
In a standard TEX installation this information is in the main (not
the local) installation directory, in texmf/web2c/texmf.cnf. The
file is similar to a Unix shell script, but the only lines of significance
for the search paths are the following (this is how they appear in
the default Unix installation, omitting the comments):
TEXMFMAIN = /usr/share/texmf
TEXMFLOCAL = /usr/local/share/texmf
HOMETEXMF = $HOME/texmf
TEXMF = {$HOMETEXMF,!!$TEXMFLOCAL,!!$TEXMFMAIN}
SYSTEXMF = $TEXMF
VARTEXFONTS = /var/lib/texmf
TEXMFDBS = $TEXMF;$VARTEXFONTS
282 Formatting Information
i i
i i
i i
$ kpsewhich article.cls
/usr/share/texmf-texlive/tex/latex/base/article.cls
Better, there is an option to tell you where your main, local, sys-
tem, and personal trees (directories) are installed, and even
where LATEX puts its map files and format files (internal setups),
and where shared BIBTEX files can be stored:
Formatting Information 283
i i
i i
i i
i i
i i