| 1 |
@c install.texi |
| 2 |
@c |
| 3 |
@c Part of the dvipng distribution |
| 4 |
|
| 5 |
@include macros.texi |
| 6 |
@ifset rawfile |
| 7 |
@chapter Installing dvipng |
| 8 |
|
| 9 |
@end ifset |
| 10 |
@c ----------------------- |
| 11 |
Installing dvipng should be simple: merely @code{./configure}, |
| 12 |
@code{make}, and @code{make install}. |
| 13 |
|
| 14 |
@ifclear rawfile |
| 15 |
@menu |
| 16 |
* Prerequisites:: |
| 17 |
* Configure:: |
| 18 |
* Build/install:: |
| 19 |
* Installation outside the texmf tree:: |
| 20 |
* Advice for non-privileged users:: |
| 21 |
@end menu |
| 22 |
@end ifclear |
| 23 |
|
| 24 |
@node Prerequisites |
| 25 |
@section Prerequisites |
| 26 |
|
| 27 |
@itemize @bullet |
| 28 |
@item The GD Graphics Draw library, libgd |
| 29 |
|
| 30 |
The drawing library @samp{libgd} is necessary, and is downloadable at |
| 31 |
@uref{https://bitbucket.org/libgd/gd-libgd/downloads}, and there are |
| 32 |
binary packages for most operating systems from their respective |
| 33 |
distributors. In any case, the library installs using @samp{autoconf} so |
| 34 |
it should not be difficult for you to install it from source, and then |
| 35 |
proceed with installing dvipng. |
| 36 |
|
| 37 |
@item The path-searching library kpathsea |
| 38 |
|
| 39 |
Kpathsea is most likely included in your @LaTeX{} installation, but it |
| 40 |
may happen that ./configure does not find it; see below. If you do not |
| 41 |
have it, download it from @uref{http://www.ctan.org} and compile it. |
| 42 |
I have no experience with this, so I cannot help much here. |
| 43 |
|
| 44 |
@item The font-rendering library FreeType 2 |
| 45 |
|
| 46 |
While not strictly necessary, a recent FreeType 2 is recommended since |
| 47 |
dvipng currently will produce better-quality images when this library is |
| 48 |
available. To take advantage of this, you should have at least FreeType |
| 49 |
2.1.9. |
| 50 |
|
| 51 |
FreeType 2 will enable direct support for PostScript and TrueType fonts, |
| 52 |
so that dvipng will not need to generate bitmapped variants on disk of |
| 53 |
the @TeX{} fonts since modern @TeX{} distributions include PostScript |
| 54 |
versions of them. Then, you can render images at different (and unusual) |
| 55 |
resolutions without cluttering the disk with lots of bitmapped fonts. |
| 56 |
|
| 57 |
Finally, it will enable subfont support in dvipng. That is, if you want |
| 58 |
to render CJK-@LaTeX{} characters, you must have FreeType 2 installed. |
| 59 |
|
| 60 |
@item libpng and libz |
| 61 |
|
| 62 |
To be able to compress and write PNG files to disk, dvipng (or really |
| 63 |
libgd) uses libpng which in turn uses libz. These should be available on |
| 64 |
any modern system, if not, download them and install them. |
| 65 |
|
| 66 |
@item The @code{texinfo} package |
| 67 |
|
| 68 |
This is needed for building the documentation. |
| 69 |
@end itemize |
| 70 |
|
| 71 |
@node Configure |
| 72 |
@section Configure |
| 73 |
|
| 74 |
The first step is to configure the source code, telling it where |
| 75 |
various files will be. To do so, run |
| 76 |
|
| 77 |
@example |
| 78 |
./configure @var{options} |
| 79 |
@end example |
| 80 |
|
| 81 |
(Note: if you have fetched dvipng from CVS rather than a regular |
| 82 |
release, you will have to first generate @file{./configure} by running |
| 83 |
@code{autoconf} 2.53 or later.) |
| 84 |
|
| 85 |
On many machines, you will not need to specify any options, but if |
| 86 |
@code{configure} cannot determine something on its own, you'll need to |
| 87 |
help it out. For a list of the options type |
| 88 |
|
| 89 |
@example |
| 90 |
./configure --help |
| 91 |
@end example |
| 92 |
|
| 93 |
On some machines, the libraries will be installed in directories that |
| 94 |
are not in the linker's search path. This will generate an error when |
| 95 |
running @file{./configure}, indicating that it cannot find libgd or |
| 96 |
libkpathsea (most likely). You then need to specify the path to the |
| 97 |
respective library's object files. They are typically called e.g., |
| 98 |
@file{libgd.a} or @file{libgd.so}. If they are located in e.g., |
| 99 |
@file{/sw/local/lib}, do |
| 100 |
|
| 101 |
@example |
| 102 |
./configure LDFLAGS=-L/sw/local/lib |
| 103 |
@end example |
| 104 |
|
| 105 |
If the library is available as a shared object file (@file{.so}), the |
| 106 |
runtime linker may also need to be told where to find the library, |
| 107 |
then use |
| 108 |
|
| 109 |
@example |
| 110 |
./configure LDFLAGS='-L/sw/local/lib -R/sw/local/lib' |
| 111 |
@end example |
| 112 |
|
| 113 |
When either of these is necessary, it is likely that the C header |
| 114 |
files are also installed in directories that are not in the C |
| 115 |
preprocessor's search path. This will also generate an error when |
| 116 |
running @file{./configure}, indicating that it cannot find e.g., |
| 117 |
@file{gd.h} or @file{kpathsea.h} (most likely). You then need to |
| 118 |
specify the path to the respective library's C header files. If they |
| 119 |
are located in e.g., @file{/sw/local/include}, do |
| 120 |
|
| 121 |
@example |
| 122 |
./configure CPPFLAGS=-I/sw/local/include |
| 123 |
@end example |
| 124 |
|
| 125 |
On my SUN Solaris workstation, I had to combine this into |
| 126 |
|
| 127 |
@example |
| 128 |
./configure CPPFLAGS='-I/sw/local/include -I/sw/tex/teTeX/1.0/include'\ |
| 129 |
LDFLAGS='-L/sw/local/lib -R/sw/local/lib -L/sw/tex/teTeX/1.0/lib/' |
| 130 |
@end example |
| 131 |
|
| 132 |
@noindent |
| 133 |
where the backslash denotes a continuation of the line. |
| 134 |
|
| 135 |
@node Build/install |
| 136 |
@section Build/install |
| 137 |
|
| 138 |
Once @file{configure} has been run, simply enter |
| 139 |
|
| 140 |
@example |
| 141 |
make |
| 142 |
@end example |
| 143 |
|
| 144 |
@noindent |
| 145 |
at the prompt to compile the C code, and build the documentation files. |
| 146 |
To install the files into the locations chosen earlier, type |
| 147 |
|
| 148 |
@example |
| 149 |
make install |
| 150 |
@end example |
| 151 |
|
| 152 |
@noindent |
| 153 |
You may need special privileges to install, e.g., if you are installing |
| 154 |
into system directories. |
| 155 |
|
| 156 |
@node Installation outside the texmf tree |
| 157 |
@section Installation outside the texmf tree |
| 158 |
|
| 159 |
In some cases, a dvipng binary installed outside the texmf tree will |
| 160 |
not be able to find virtual fonts, or the PostScript font maps |
| 161 |
(normally used by dvips). This may be because @emph{only} |
| 162 |
$SELFAUTOLOC, $SELFAUTODIR, and $SELFAUTOPARENT are used in the texmf |
| 163 |
tree configuration file @samp{texmf.cnf}. If so, give the switch |
| 164 |
@samp{--enable-selfauto-set} to @samp{./configure}. This will make |
| 165 |
dvipng adjust these three internally so that kpathsea thinks that |
| 166 |
dvipng @emph{is} installed in the texmf tree. |
| 167 |
|
| 168 |
@node Advice for non-privileged users |
| 169 |
@section Installation for non-privileged users |
| 170 |
|
| 171 |
Often people without system administration privileges want to install |
| 172 |
software for their private use. In that case you need to specify more |
| 173 |
options to the @file{configure} script, usually this is done by using |
| 174 |
the @samp{--prefix} option to the @file{configure} script, and let it |
| 175 |
point to the personal home directory. In that way, resulting binaries |
| 176 |
will be installed under the @file{bin} subdirectory of your home |
| 177 |
directory, manual pages under @file{man} and so on. That way, it is |
| 178 |
reasonably easy to maintain a bunch of additional packages, since the |
| 179 |
prefix argument is supported by most @file{configure} scripts. |
| 180 |
|
| 181 |
You'll have to add something like @file{/home/myself/bin} to your |
| 182 |
@code{PATH} shell variable, if it isn't there already, and similarly |
| 183 |
set the @code{INFOPATH} and @code{MANPATH} variables to be able to |
| 184 |
access the documentation. |
| 185 |
|
| 186 |
@ifset rawfile |
| 187 |
@section Copying |
| 188 |
|
| 189 |
This program is released under the GNU Lesser General Public License |
| 190 |
version 3, see the COPYING file in the dvipng distribution or |
| 191 |
@url{http://www.gnu.org/licenses/}. |
| 192 |
|
| 193 |
Copyright @copyright{} 2002-2015, 2019 Jan-@AA{}ke Larsson |
| 194 |
@end ifset |