The Linux ArabTeX-Howto

Markus F. Rothbauer, mrothbau@ag.or.at
v1.0, 24 October 1999

This document is intended to explain how to install the
Unix-standard-distribution of ArabTeX on a linux-machine with teTeX
installed. It describes only the way how to install ArabTeX, that all
users can use it.




1.   Introduction

There are some difficulties installing ArabTeX together with
teTeX. The main problem is, that ArabTeX uses a file structure, which
allows ArabTeX to work together with emTeX under DOS very pretty (as
far as I was told) - but it will not work together very pretty with a
standard teTeX installation using the TDS
(TeX-Directory-Standard).

This document provides you all the necessary informations and explains
the steps to get it working.

You will need root-privileges on your machine to follow the procedures 
given to you. If you do not have root-privileges, please consult your
system administrator - he will be able to install ArabTeX for you!



1.1. Disclaimer

The information in this document is, to the best of my knowledge,
correct, and should work. However, there may be typos, there may be
mysterious transmission errors, language errors, and there may be
strange incompatibilities within your own system that prevent the
techniques described herein from working properly.

So no liability for the contents of this document can be accepted.
Use the concepts at your own risk. You have been warned.



1.2. Related documents

There are a lot of related documents. Please read all the
documentation of ArabTeX very carefully - there is a lot of
information about the mechanisms of ArabTeX. And read the
documentation of teTeX. You will find a lot of important information
about configuring teTeX and how teTeX works.



1.4. Versions

The procedures given in this document have been tested with teTeX
(and telatex) version 1.0.6-3, ArabTeX 3.09 and SuSE Linux 6.2



2.   The mechanism of teTeX for searching additional styles etc.

As stated in the teTeX manual, teTeX uses the kpathsea library, which
provides efficient access by names to files stored hierarchically. But
it will look in certain directories for specific types of files. The
directories have to be stored in the "main texmf tree" (texmf ... "TeX
and friends") in a proper way:

TeX macros      ...   tex/<format>/<package>/
font files      ...   fonts/<type>/<supplier>/<typeface>/
METAFONT files  ...   metafont/<package>/
documentation   ...   doc/<package>/
etc. (For more details see the teTeX and the TDS-documentation).

To speed up searching in this tree, a file name database is used. A
file-name database exists in the root of each texmf tree and has the name
ls-R. You can use texconfig or texhash to rebuild this database after
installing ArabTeX.




3.   Installation



3.1. First steps: Extracting ArabTeX

ArabTeX usually comes as zipped tar-archive. For the next steps I
assume, that you login to your computer as a "normal" user (not as
root) and that you are in your home-directory (/home/<user>/). A
little remark to the notation for the following steps: The intended
line shows commands that you have to execute from the shell.

Create a temporary directory (skip this step if you already have one!)

      mkdir temp

Change to this directory:

      cd temp

Store the zipped tar-archive of ArabTeX to the temp-directory.
(e.g. cp <sourcedir>/arabtex_tar.Z ~/temp/ )
Now, unpack (untar) this archive:

      tar -xvzf arabtex_tar.Z arabtex/



3.2. Building a file-structure conforming to teTeX

Create a directory for the style-files of arabtex (the necessary
parent directories will be created because of parameter -p):

      mkdir -p arabcorrect/texmf/tex/latex/arabtex 

Move all files of arabtex from texinput to this directory:

      mv arabtex/texinput/* arabcorrect/texmf/tex/latex/arabtex/

Create a directory to contain the fonts:

      mkdir -p arabcorrect/texmf/fonts/pk/arabtex/hcaption
      mkdir arabcorrect/texmf/fonts/pk/arabtex/hclassic
      mkdir arabcorrect/texmf/fonts/pk/arabtex/nash
      mkdir arabcorrect/texmf/fonts/pk/arabtex/xnsh
      mkdir arabcorrect/texmf/fonts/pk/arabtex/yarborn
      mkdir -p arabcorrect/texmf/fonts/source/arabtex
      mkdir -p arabcorrect/texmf/fonts/tfm/arabtex
      mkdir -p arabcorrect/texmf/fonts/type1/arabtex

Move the font-files to these directories:

      mv arabtex/laser.pk/hcaption* arabcorrect/texmf/fonts/pk/arabtex/hcaption/
      mv arabtex/laser.pk/hclassic* arabcorrect/texmf/fonts/pk/arabtex/hclassic/
      mv arabtex/laser.pk/nash14* arabcorrect/texmf/fonts/pk/arabtex/nash/
      mv arabtex/laser.pk/xnsh14* arabcorrect/texmf/fonts/pk/arabtex/xnsh/
      mv arabtex/laser.pk/yarborn* arabcorrect/texmf/fonts/pk/arabtex/yarborn/
      mv arabtex/mfinput/* arabcorrect/texmf/fonts/source/arabtex/
      mv arabtex/tfm/* arabcorrect/texmf/fonts/tfm/arabtex/
      mv arabtex/psfonts/* arabcorrect/texmf/fonts/type1/arabtex/

Create a directory for the documentation:

      mkdir -p arabcorrect/texmf/doc/arabtex 

Move the doc-subdirectory to the documentation-subdirectory:

      mv arabtex/doc arabcorrect/texmf/doc/arabtex/

Move the report-subdirectory to the documentation-subdirectory:

      mv arabtex/report arabcorrect/texmf/doc/arabtex/ 

Move the examples-subdirector to the documentation-subdirectory:

      mv arabtex/examples arabcorrect/texmf/doc/arabtex/ 

Move the patches-subdirectory to the documentation-subdirectory (so
you can choose later, if you want to install the patches or not):

      mv arabtex/patches arabcorrect/texmf/doc/arabtex/ 

Delete the empty directories in arabtex (e.g. texinput; note: ignore
the error-messages "rmdir: arabtex/announce.txt: Not a directory"
etc.)

      rmdir arabtex/* 

And now - move the rest of ArabTeXs documentation to the
doc-directory:

      mv arabtex/* arabcorrect/texmf/doc/arabtex/ 

Remove the arabtex-directory:

      rmdir arabtex

Now we did the the second step - creating a teTeX-conform directory
structure.



3.3. Changing owner and group of ArabTeX:

Now we have to change the owner and group of arabtex. To do this, we
first have to get administration privilegs - change to user root and
enter the appropriate password when prompted:

      su root

Remember: From now on you have all the privilegs of root - be very
carefully with your commands. If you enter them in a wrong way, data
loss can be the consequence. You have been warned.
Change the owner and the group of arabtex:

      chown -R root arabcorrect
      chgrp -R root arabcorrect



3.4. Copying arabtex to your texmf-directory:

Now we have to look, where all this TeX-stuff is stored on your
computer:

      kpsewhich -expand-var='$TEXMF'

You will get some directories, where you can store arabtex to. I
suggest to use /usr/share/texmf/ (This is the 'normal' texmf-directory
for teTeX; I will refer to this directory as $TEXMF from now on).

So copy all arabtex-files to this directory:

      cp -r arabcorrect/texmf/* $TEXMF

(remember: Substitute $TEXMF with your appropriate texmf-directory; if
it is /usr/share/texmf/ the command is: "cp -r arabcorrect/texmf/*
/usr/share/texmf/" )



3.5. Rebuilding teTeXs hash-database

This is very simple: Just start the "texconfig"-program from the
teTeX-package:

      texconfig

When the menu comes up on the screen, choose the point "REHASH rebuild 
ls-R database". When you are back in the menu, choose "EXIT".

Now you should change back the group and owner of arabtex:

      chgrp -R users arabcorrect
      chown -R <username> arabcorrect

And exit from root-privileges:

      exit



3.6. Creating an archive of the new structured arabtex:

Store the corrected arabtex-package in a new archive - so you do not
have to restructure it next time and you can start at point 3.3 of
this procedure:

      tar -czvf arabcorr.tgz arabcorrect/*

(You can restore this archive with tar -xzvf arabcorr.tgz)



3.7. Removing the arabcorrect-directory:

Simply enter:

      rm -r arabcorrect/



3.8. Test your arabtex-installation

This can be done by compiling the documentation of arabtex (now in
$TEXMF/doc/arabtex/report/): First copy this documentation to a
directory in your home-directory, then start latex with arabdoc.tex.

That's all!




4.   A little shell-script for step 3.2

You can load this document into an editor and extract the part between
the two remarks (% -------- ...) to a file, e.g. corr_arabtex in YOUR
temp-direectory (~/temp). You have to set the executeable flag for
this file:

      chmod u+x corr_arabtex

and then you can execute it with

      ./corr_arabtex.


% ------------ START of restructuring script
#!/bin/bash
echo "Restructuring ArabTeX \n"
mkdir -p arabcorrect/texmf/tex/latex/arabtex 
mv arabtex/texinput/* arabcorrect/texmf/tex/latex/arabtex/
mkdir -p arabcorrect/texmf/fonts/pk/arabtex/hcaption
mkdir arabcorrect/texmf/fonts/pk/arabtex/hclassic
mkdir arabcorrect/texmf/fonts/pk/arabtex/nash
mkdir arabcorrect/texmf/fonts/pk/arabtex/xnsh
mkdir arabcorrect/texmf/fonts/pk/arabtex/yarborn
mkdir -p arabcorrect/texmf/fonts/source/arabtex
mkdir -p arabcorrect/texmf/fonts/tfm/arabtex
mkdir -p arabcorrect/texmf/fonts/type1/arabtex
mv arabtex/laser.pk/hcaption* arabcorrect/texmf/fonts/pk/arabtex/hcaption/
mv arabtex/laser.pk/hclassic* arabcorrect/texmf/fonts/pk/arabtex/hclassic/
mv arabtex/laser.pk/nash14* arabcorrect/texmf/fonts/pk/arabtex/nash/
mv arabtex/laser.pk/xnsh14* arabcorrect/texmf/fonts/pk/arabtex/xnsh/
mv arabtex/laser.pk/yarborn* arabcorrect/texmf/fonts/pk/arabtex/yarborn/
mv arabtex/mfinput/* arabcorrect/texmf/fonts/source/arabtex/
mv arabtex/tfm/* arabcorrect/texmf/fonts/tfm/arabtex/
mv arabtex/psfonts/* arabcorrect/texmf/fonts/type1/arabtex/
mkdir -p arabcorrect/texmf/doc/arabtex 
mv arabtex/doc arabcorrect/texmf/doc/arabtex/
mv arabtex/report arabcorrect/texmf/doc/arabtex/ 
mv arabtex/examples arabcorrect/texmf/doc/arabtex/ 
mv arabtex/patches arabcorrect/texmf/doc/arabtex/ 
rmdir arabtex/* 
echo "corr_arabtex: Ignore above error messages!\n"
mv arabtex/* arabcorrect/texmf/doc/arabtex/ 
rmdir arabtex
echo "Done. \n"
% ------------ END of restructuring script




6.   Comments

I hope, that this documentation helps you to install ArabTeX on your
Linux-machine. Send any comments to this document to:
mrothbau@ag.or.at
































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































