Chinaunix首页 | 论坛 | 博客
  • 博客访问: 540739
  • 博文数量: 51
  • 博客积分: 8000
  • 博客等级: 中将
  • 技术积分: 1040
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-28 17:26
文章分类

全部博文(51)

文章存档

2011年(1)

2010年(20)

2009年(27)

2008年(3)

我的朋友

分类: LINUX

2009-11-22 21:30:47

This HOWTO explains step by step procedure to install LaTeX - TeXlive
and a very good front-end for editing called Texmaker.

Note: If you like Kile instead of Texmaker, follow this-

Furthermore, this explains also howto install any new , that may be required for your work, into TeXlive installation.

Quote:
Virtually all TL packages come from .
||

This is as a result of several ideas collected and consolidated from various sources [google, this forum, etc].

I am writing this because of 3 main reasons:
1. to use it as a reference for myself in the future as i have a habit of forgetting what i did earlier.
2. there was so much of a confusion to get the texmaker working with texlive and also the texlive itself.
3. to get all the required info at the same place [as much as possible].

Various steps are:

I. Download Texlive.

1. Obtain TeXlive . The latest version is 2005.
2. Burn it as iso image into a CD.

II. Install Texlive2005 to disk. [this is not for running it live]

1. this is quite easy. mount the texlive2005 CD and navigate to that directory using a terminal.

Code:
cd /media/cdrom0
2. now install process.

Code:
sudo sh install-tl.sh
3. You will be prompted with various options. I didnt change any of the suggested dir locations etc. just do this:
Code:
 i
and enter.

lots of stuff will happen and enjoy the scrolling text...you can smile at the screen if you like

4. Now this is very important. set the PATH. [this information is provided in pp.11]

I did this before I could run texconfig. Its good if we could set the PATH first, I think.

Code:
PATH=/usr/local/texlive/2005/bin/i386-linux:$PATH; export PATH
you can do this at the terminal or put it at the end in /etc/bash.bashrc
This way, the path will be set when you login as this file is run at login.

Code:
sudo gedit /etc/bash.bashrc
copy-paste the above PATH at the end of the file. save and close.

check the path and make sure that the path is there...
Code:
echo $PATH
discussions on setting env variables can be found .

5. Now run

Code:
texconfig
if it returns 'command not found' the the Path is not set properly. i would suggest re-login after setting the path. Else, what you could do is to run the above path command at the terminal to activate it for the time being.

6. run
Code:
sudo texhash
or
Code:
sudo texconfig rehash
this updates various file name databases. [pp. 13 of tex live guide]

7. make sure it works...at the terminal type,

Code:
tex --version
you should see this:

Code:
TeX 3.141592 (Web2C 7.5.5)
kpathsea version 3.5.5
Copyright 2005 D.E. Knuth.
Kpathsea is copyright 2005 Karl Berry and Olaf Weber.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the TeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the TeX source.
Primary author of TeX: D.E. Knuth.
Kpathsea written by Karl Berry, Olaf Weber, and others.
Good. Its working ! Make sure all the tex commands are working by trying at the terminal (any directory) one by one...

latex, dvips, bibtex, gv, makeindex, xdvi, pdflatex, dvipdfm, ps2pdf, xpdf or acroread (install separately and make it executable), and mpost.

if xpdf is not working then you can install it like,
Code:
sudo apt-get install xpdf
..

in Dapper you can get acroread7. add this to /etc/apt/source.list
deb dapper universe main restricted multiverse

if you need gv then open a terminal

Code:
sudo apt-get install gv
note: if you like to deal with graphics then its good to have gv installed so that you can view you .eps file (it also helps to get the BoundingBox coordinates for advanced graphics handling)

An excellent document on graphics using latex is available in pdf format.


Note: After you login, the texlive2005 is ready for action. you can navigate to the directory where your .tex files are and use the command line directly to run using appropriate commands, or use gedit or some editor as applicable. But I like Texmaker for its simplicity, user friendly GUI, and light weight set up etc...

I have seen some permission issues preventing the commands running even from the terminal. so you can actually set the permissions using chmod command. Below is a sample (be careful when setting permission: do some research on issues when setting permissions or get help from some guru if in doubt). Couple of good references on this are (detailed) and (brief)

Code:
sudo chmod -R  755 /usr/local/texlive/2005/bin/i386-linux
III. Download and install texmaker:

1. download the texmakerunix_install.sh

2. I moved the file to

Code:
sudo mv /usr/local
and installed by

3.
Code:
sudo sh texmakerunix_install.sh
(This is provided in texmaker website ... Qt4 is not required.)
Now texmaker is ready for some customization.

4. Configure texmaker.

Open Texmaker and go to

Code:
Options > Configure Texmaker
Here is the screenshot of what I have. You dont need to put the entire paths of all commands in there. Just the command will do: for e.g.,
xdvi %.dvi or pdflatex --interaction=nonstopmode %.tex etc., as given in texmaker documentation.

The idea is, if you have all the latex commands working from the terminal after login then just by giving the commands (without entire path) should work.

5. Using the quick build option.

This is a nice option to use. I use the pdflatex + xpdf to directly convert and view pdf from somefile.tex. if you enter 'acroread' instead of 'xpdf' as in step III-4 would get you the pdf file opened in acroread... [as such...for other applications...]

NOTE: Texmaker can be used with tetex2/3 as required. Important thing is to have the PATH set up properly. Thats it.
-------------------------------------------------------------------------

How to add LaTex packages (*.sty/*.bib) etc into Texlive.

While you are at it, I thought it is a good idea to explain how we could install new LaTeX packages into texlive: [this is a copy of what I have written in one of the messages in the same thread]

In texlive it can be done pretty easily. There are 3 steps involved:

1. Locate my_package.sty file. sometimes it comes as my_package.ins or my_package.dtx. Download it to somewhere easily accessible.
for e.g., /home/latexpacks

then go to that folder and run

Code:
cd /home/latexpacks
latex my_package.dtx
to get the my_package.sty , etc.

2. Now, create a new folder called my-package here

Code:
sudo mkdir usr/local/texlive/2005/texmf-dist/tex/latex/my_package
then copy the my_package.sty to this dir.

Code:
sudo mv my_package.sty usr/local/texlive/2005/texmf-dist/tex/latex/my_package
so you have you new package in place now.

2.1 Its good to have a copy of the .ins and .dtx file here like this.


Code:
sudo mv mypackage.ins /usr/local/texlive/2005/texmf-dist/source/latex/my_package
2.2 similarly for my_package.bib (if any)
Code:
sudo mv my_package.bib /usr/local/texlive/2005/texmf-dist/bibtex/bib/my_package
3. Then run,

Code:
sudo texhash
you are set!...It's good to check the documentation of the package to see if you need anyother files...

on using Kile with TeXLive.

Thanks in advance for any suggestions/comments/corrections...

Good day and latex away.
阅读(1605) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~