TITLE:		LyX from scratch
LFS VERSION:	4.1
AUTHOR:		Marnix Kaart <marnix_lfs@mkaart.net>

SYNOPSIS:	How to install LyX

HINT:

Contents:
 1. Preface
 2. Requirements
 3. Installing tetex-2.0.2
 4. Installing ImageMagick-5.5.6
 5. Installing Lyx-1.3.2
 6. Additional settings
 7. Changelog

1. Preface
----------
I am not an expert on the area of LaTeX of LyX, I just managed to get it
running on my box. This hint describes how I did it. Please send all
questions to the blfs mailinglist. Suggestions for improving this hint are
welcome.

Please refer to the DISCLAIMER at
http://hints.linuxfromscratch.org/hints/DISCLAIMER

2. Requirements
---------------
This hint assumes you have the following installed on your box already:
	- XFree86-4.3.0
	- qt-3.1.2
	(Older versions may work, but above is the setup I have)

For viewing or exporting to postscript you need at least:
	- ghostscript-8.00
	- gsview-4.3
	(gsview is not supported in the "view" menu. I tried to make a symlink
	gv to gsview but this does not work. You probably need gv or ghostview
	if you insist on previewing your work as postscript. Exporting to ps
	and later viewing it with gsview DOES work.)

For viewing or exporting to pdf you need:
	- xpdf-2.02

For importing older LyX files you need:
	- python-2.2.2

Setup instructions for these packages are in the BLFS book
I am not sure if this list is complete, but this is what I have.
As far as I know the "reconfigure" option in the "edit" menu can be used when
you later install some package that can be used by LyX.

3. Installing tetex-2.0.2
-------------------------
Download the following packages:

ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/2.0/distrib/tetex-src-2.0.2.tar.gz
ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/2.0/distrib/tetex-texmf-2.0.2.tar.gz
ftp://sunsite.informatik.rwth-aachen.de/pub/comp/tex/teTeX/2.0/distrib/tetex-texmfsrc-2.0.2.tar.gz

I copied these instructions from the BLFS book:

TeX is installed slightly differently than a typical GNU package, these
instructions will assume /usr/src to be the current working directory,
containing the three TeX tarballs.

Install TeX by running the following commands:

mkdir -p /usr/share/texmf &&
tar zxvf tetex-src-2.0.2.tar.gz &&
cd tetex-src-2.0.2 &&
gzip -dc ../tetex-texmf-2.0.2.tar.gz \
      | (umask 0; cd /usr/share/texmf; tar xvf -)

If the optional texmf source code tarball was downloaded, untar it now:

gzip -dc ../tetex-texmfsrc-2.0.2.tar.gz \
      | (umask 0; cd /usr/share/texmf; tar xvf -)

./configure --prefix=/usr \
    --without-texinfo   --with-system-ncurses --with-system-zlib \
    --exec-prefix=/usr --bindir=/usr/bin &&
make world &&
texconfig dvips paper letter &&
texconfig font rw

Mind that I left the --with-x=no option out, since I like to have xdvi for
previewing my work.

4. Installing ImageMagick-5.5.6
-------------------------------
The convert tool from ImageMagick is used for displaying inline figures.

Download ImageMagick at
ftp://ftp.imagemagick.net/pub/ImageMagick/ImageMagick-5.5.6.tar.gz

Configure and build it with:
./configure --prefix=/usr --sysconfdir=/etc --with-gslib \
	--with-gs-font-dir=/usr/share/ghostscript/fonts --with-x &&
make &&
make install

To verify the build run:
./utilities/display
or
make check

5. Installing Lyx-1.3.2
-----------------------
Download Lyx at
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.3.2.tar.bz2

Configure and build with:
./configure --with-frontend=qt --prefix=/usr -sysconfdir=/etc \
	--with-qt-dir=/usr/local/qt &&
make all &&
make install

6. Additional settings
----------------------
I use the IEEEtran.cls classfile for writing articles, but I had some trouble
in setting it up the first time. The IEEE template is already present in lyx,
you just need to place the IEEEtran.cls file somewhere latex can find it.
Here is how I did it:

Download the author kit (IEEEtran.tar.gz) from
http://www.ieee.org/organizations/pubs/transactions/stylesheets.htm

As root:
- Unpack the file and copy IEEEtran.cls into /usr/share/texmf/tex/latex
- Run texhash

As normal user (inside Lyx):
Edit --> Reconfigure and restart LyX

Now you should be able to actually create documents using the IEEEtran.lyx
template.

Enjoy!

7. Changelog
------------
20030527	Initial document
