Linux

  1. Home
  2. Computing & Technology
  3. Linux
Some Essential Linux Applications
Part 6 of the Linux Newbie Administrator Guide
 
 Related Resources
• Linux Newbie Administrator Guide
• 0. Linux Benefit
• 1. Before Installation
• 2. Linux Resources/Help
• 3. Basic Operations FAQ
• 4. Newbie Admin FAQ
• ~ 4.1 Lilo
• ~ 4.2 Drives
• ~ 4.3 X-Windows
• ~ 4.4 Configurations
• ~ 4.5 Networking
5. Shortcuts / Commands
• 6. Linux Applications
• 7. Learn Linux Commands
• A. How to Upgrade Kernel?
 

6.1.4 lyx and latex

(Type lyx in an X-windows terminal). lyx is a front end (WYSIWYG, running under X-Windows) for Latex. [There is also Klyx, which is a "K-desktop" variant of Lyx, but it is not updated any more.] Latex has for years been the heavy-duty document preparation and typesetting program, particularly popular in academia because it is good with equations, can handle very large documents, etc.

The good news is that even if you do not know what Latex is, you may still be able to use lyx. Think of lyx as a word processor, although its philosophy is different from that of other popular word processors, and therefore it may require an adjustment of your mindset. Latex (and lyx) philosophy is to type in the text, define the "styles" and leave the formatting to the typesetting program. This means you never adjust the spacing (between words, sentences, paragraphs, chapter, etc.) manually. When done with typing of your document, you "compile" your text to create a device independent file ("*.dvi").  The *.dvi file can be viewed using a dvi viewer and printed. The quality of the output is usually outstanding, but its creation process is typically somewhat more frustrating than using a regular word processor.

The strength of Latex is the excellent quality of the printouts, its capability to cope with long, complex documents (technical books, math, etc.), availability of all foreign characters and even rarely used symbols, its portability across many different platforms, and the popularity of the file format. Its weakness is the relative usage complexity.

lyx
is free and it is included on your Mandrake or RedHat CD for you to try. As almost any piece of Linux software, you can also download it from Linuxberg: http://idirect.linuxberg.com/kdehtml/off_word.html or any other fine Linux software depository on the Internet.

If instead of easier lyx, you wanted to try straight, hard-core Latex, here is some intro to get you started:
  • Use your favorite plain-text editor to create a Latex document, spell check it, etc., save the text file with the extension "*.tex". Read on to see my sample Latex document.
  • Invoke Latex to "compile" the text file into a "*.dvi" ("device independent") file by typing on the command line:
latex my_latex_file.tex
  • Print the "my_latex_file.dvi" file which was created by the previous command by invoking the dvi to postscript utility, that on default send the output to the lpr printer:
dvips my_file.dvi
  • You can also save the output to postscript file by typing:
dvips -o output_file.ps my_file.dvi

The option -o introduces the output file.
  • You can also create a pfd file using
dvipdf my_file.dvi output_file.pdf
or
ps2pdf my_file.ps my_file.pdf
  • You can view any of the files (dvi, ps, or pdf), for example using (in X terminal):
kdvi my_file.dvi&
or
kghostview my_file.pdf&

Here is my sample Latex file:
 
% Any line starting with "%" is a comment.
% "\" (backslash) is a special Latex character which introduces a Latex
% command.
\documentclass[10pt]{article}
\begin{document}
% Three commands are present in every Latex document. Two of them are
% above and one at the very end of this sample document.
This is a simple document to try \LaTeX. Use your favorite plain text
editor to type in your text. See how the command \LaTeX produces the
\LaTeX logo. Here is the end of the first paragraph.
Here starts the second paragraph (use one or more empty lines in your
input file to introduce a new paragraph).
The document class of this sample is ``article'' and it is defined at the
very beginning of the document. Other popular classes are ``report'',
``book'' and ``letter''.
Please note that the double quote is hardly ever used, utilize
two ` to begin a quote and two ' to close it. This nicely formats the
opening and closing quotes.
Here are different typefaces:
{\rm This is also roman typeface. It is the default typeface.}
{\bf This is bold typeface. }
{\em This is emphasize (italic) typeface.}
{\sl This is slanted typeface, which is different from the italic.}
{\tt This is typewriter typeface.}
{\sf This is sans serif typeface.}
{\sc This is small caps style.}
You can itemize things:
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
You can also enumerate things:
\begin{enumerate}
\item one
\item two
\item three
\end{enumerate}
Try some foreign letters and symbols:
\aa \AA \o \O \l \L \ss \ae \AE \oe \OE \pounds \copyright \dag \ddag \S
\P. There are also three dashes of different length: - -- ---.
Try some accents over the letter ``a'': \'{a} \`{a} \"{a} \^{a} \~{a}
\={a} \.{a} \b{a} \c{a} \d{a} \H{a} \t{a} \u{a} \v{a}. Other letters can
be accented in a similar way.
The pair of ``\$'' marks a math context. Many special characters are
available only in the ``math'' context. For example, try the Greek
alphabet:
Small: $ \alpha \beta \gamma \delta \epsilon \varepsilon \zeta \eta
\theta \vartheta \iota \kappa \lambda \mu \nu \xi o \pi \varpi
\rho \varrho \sigma \varsigma \tau \upsilon \phi \varphi
\chi \psi \omega $
Capital: $ A B \Gamma \Delta E Z H \Theta I K \Lambda M \Xi \Pi P
\Sigma T \Upsilon \Phi X \Psi \Omega $
Try some equations: $ x^{y+1} + \sqrt{p \times q}=z_{try_subscripts} $
\begin{center}
$ \frac{x \times y}{x/2+1}=\frac{1}{3} $
\end{center}
\LaTeX math commands are very similar to those in the old ``Word Perfect''
equation editor.
Use the verbatim mode to print the 10 special symbols which normally have
special meaning in \LaTeX: \verb|%${}_#&^~\|. The special symbols must be
contained between any two identical characters which in the example above
is |. Most of these special symbols can also be printed by preceding the
character with a backslash: \% \$ \{ \} \_ \# \& \^.
% This command ends the document (this is the third one that *must* be
% present in every document).
\end{document}

Next > 6.1.5 WordNet (dictionary / thesaurus /synonym / antonym finder)

Can't find what you are looking for?
Search the

Stay up-to-date!
Subscribe to the Linux free newsletter.

Explore Linux

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Linux

  1. Home
  2. Computing & Technology
  3. Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.