LATEX stuffs

  1. How to install LATEX1
    LATEXcan be installed in various ways, here the ones that I have tried with success
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install texlive texlive-base texlive-base-bin texlive-common}
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install texlive-latex-base texlive-latex-extra texlive-math-extra}
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install texlive-pstricks texlive-science}
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install texlive-extra-utils}
}
} (will install epstopdf too)

    and then install some dvi viewers
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install xgdvi}
}
} .
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install xpdf}
}
} .

  2. How to compile LATEX files from the terminal
    i.if having pdf figures: You can produce pdf's directly using pdflatex, as follows
    \framebox{
\texttt{
\textcolor{red}{\bf pdflatex FILENAME.tex}
}
}

    Notice however, that pdflatex doesn't work with eps figures, You will have to convert all eps figures to pdfs using the command epstopdf. However, pdflatex will work with png's and jpg's which is really nice.

    ii.if having eps figures: Here we have to compile the file in steps

    1. eps to dvi
      \framebox{
\texttt{
\textcolor{red}{\bf latex FILENAME.tex}
}
} or just \framebox{
\texttt{
\textcolor{red}{\bf latex FILENAME}
}
}
      this will produce a .dvi file, i.e. FILENAME.dvi

    2. dvi to ps
      To produce a .ps file from the .dvi file, type \framebox{
\texttt{
\textcolor{red}{\bf dvips FILENAME.dvi}
}
}

      Notice that dvips mean dvi-$ >$ps.

    3. ps to pdf
      To produce a .pdf file from the .dvi file, type \framebox{
\texttt{
\textcolor{red}{\bf dvipdf FILENAME.dvi}
}
}

    This syntax seems to be good when having .eps figures. Notice also that we can easily transform each .eps figure to pdf using epstopdf FILENAME.eps.

  3. How to count the number of words in a .TeX file
    This is kind of pain, and is hard to count exactly the number of words from a .tex file, but here is what I know (without having to install other fancy software). First, we have to install untex as follows \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install untex}
}
}
    then at the terminal type
    \framebox{
\texttt{
\textcolor{red}{\bf untex FILENAME.tex $>$ target \&\& wc -w target}
}
}

  4. How to count the number of words in a .pdf file
    This might be a solution to the problem mentioned above. According to my experience, this works better sometimes. First, we have to install pdftext as follows \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install pdftext}
}
}
    then at the terminal type
    \framebox{
\texttt{
\textcolor{red}{\bf pdftext FILENAME.pdf output.txt}
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf wc output.txt}
}
}

    or just

    \framebox{
\texttt{
\textcolor{red}{\bf pdftext FILENAME.pdf -l wc - w}
}
}

  5. How to use LATEX within Emacs
    First, we need to install Emacs \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install emacs}
}
}

    Notice, that some futures about the appearance of Emacs can be modified using the definition file of Emacs. This file is currently located in /home/christian/. I cannot see it, when using ls, but you can edit it, using sudo gedit .emacs or editing with Emacs sudo emacs .emacs.

    and then, to install auctex (needed to compile LaTeX in Emacs) \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install auctex}
}
}

    then, we can just open a .tex file within Emacs, typing at the terminal emacs FILENAME.tex, and the LATEX options will appear.

  6. How to use LATEX within Gedit (the Gnome editor)
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install lmodern}
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install rubber}
}
}

    then go to Gedit, in add-onn select LATEX, and ready to go!

  7. How to install LaTeX Style Files (.sty)
    At the terminal type:

    \framebox{
\texttt{
\textcolor{red}{\bf cd /usr/share/texmf-texlive/tex/latex}
}
}

    To install a style file ``STYFILE'' you have to do as follows
    1. create a directory named ``STYFILE'' on /usr/share/texmf-texlive/tex/latex
    2. copy the file STYFILE.sty and the file STYFILE.tex to the directory /usr/share/texmf-texlive/tex/latex/STYFILE
    3. run at the terminal \framebox{
\texttt{
\textcolor{red}{\bf sudo mktexlsr}
}
}
    when installing style files for Beamer (slides presentation with LATEX), do the same as follows
    1. copy the file STYFILE.sty to the directory /usr/share/texmf/tex/latex/beamer/themes/theme/
    3. run at the terminal \framebox{
\texttt{
\textcolor{red}{\bf sudo mktexlsr}
}
}

    Notice that the .sty and .tex files should be able to open by any user, and not only by the root, then the properties of them must be checked.

    If the package came as .dtx and .ins files, first do
    \framebox{
\texttt{
\textcolor{red}{\bf latex FILENAME.dtx }
}
}
    \framebox{
\texttt{
\textcolor{red}{\bf latex FILENAME.ins}
}
}

    and then take the produced .sty file, and proceed as before.

  8. Paper size
    \framebox{
\texttt{
\textcolor{red}{\bf sudo gedit /etc/papersize}
}
}
    and in that file put ``letter'', that is.

    Also, one can type at the terminal \framebox{
\texttt{
\textcolor{red}{\bf sudo texconfig}
}
} , and select the paper size there

  9. How to install Beamer
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install latex-beamer}
}
}

  10. How to install LATEX2html
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install latex2html}
}
}

  11. How to install MetaPost
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install texlive-metapost}
}
} (will install MetaPost)
    \framebox{
\texttt{
\textcolor{red}{\bf sudo apt-get install context}
}
} (is needed for using mptopdf in MetaPost)

Webmaster: Christian E. Salas Eljatib, E-mail: christian.salas@yale.edu