Linux

  1. Home
  2. Computing & Technology
  3. Linux

From Authors, for About.com

rarely used symbols, its portability across many different platforms, and the popularity of the file format. Its weakness is the relative complexity of use.

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

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.