Clase y estilo (class and style) en LaTeX

14 views
Skip to first unread message

Fabián

unread,
Aug 20, 2008, 12:08:37 PM8/20/08
to LaTeX-EPN
Este artículo del The PracTeX Journal, Class & Style, es para
principiantes y se lo encuentra en

http://dw.tug.org/pracjourn/2008-2/clsandsty/

Sugiero ir a la página para que usen los links que abajo no aparecen
como tales.

Fabián Barba


Class & Style

An introduction to LaTeX document classes and styles

by The Editors

A reader wrote, An article that I would certainly read with enormous
interest would have the title "Compleat Idiot's guide to using .class
and .sty files". In other words a blow-by-blow description of how to
use those types of files for someone very new to LaTeX.

Let's start with class and style in LaTeX. Consider this short
document:

\documentclass{article}

\begin{document}

A Pascal (Pa) is equal to a Newton per square meter, $N/
(m^2)$.

\end{document}

Class. This document uses the article document layout, also called the
article documentclass. A documentclass defines the general appearance
of a document: it sets margins, the type size for section heads, the
placement of page numbers, and other document design features.

Style. A LaTeX style introduces new functionality and commands. As an
illustration, let's add some style changes to make the document above
more professional looking. The scientific units, $N/(m^2)$, as they
stand will format, but not correctly for a scientific journal. There
are standards for this, and you could look them up and try to get
LaTeX to follow the rules. Fortunately, there is an easier way. A
LaTeX user developed a package or style called SIunits that will
correctly format scientific units.

If you use a style package your LaTeX document will look like the
following:

\documentclass{article}

\usepackage{SIunits} % Scientific units package

\begin{document}

A Pascal (\pascal) is equal to a Newton per square
meter,
\newton\per\square\metre.

\end{document}

Notice that a new command, \usepackage{SIunits}, appears in the
document preamble. Also notice that now you can use some new commands:
\pascal, \newton, \per, etc. These were introduced by the style
package SIunits. If this document is formatted, you will see that the
scientific units are formatted correctly. (It's nice that someone else
figured this out so that you don't have to!)

In the above example, we have shown how to format a LaTeX document
using a documentclass, and how to add new LaTeX commands by the use of
a style package.

Class & Style. To tie this in to the theme of this issue, Class &
Style: the article documentclass is found in a file called article.cls
and is sometimes called a Class (.cls) file; the package SIunits is
found in a file called SIunits.sty and is sometimes called a Style
(.sty) file.
Changing the Class

One way to change the appearance of a LaTeX document is through the
\documentclass command options. To change the text font size, for
example, add an option to \documentclass:

\documentclass[12pt]{article}

This will change the text size from 10 point (the default) to 12
point.

Another way to change the appearance of a document is to change to
another documentclass. For example, change \documentclass{article} to

\documentclass{memoir}

Format the document and notice that the overall appearance is slightly
different. Some alternate Classes are shown in the TeX Catalogue. Note
that the TeX Catalogue has an easy way to view documentation for
Classes and Styles.
Finding Styles

In the above example we used a package SIunits to format scientific
units. You can find this in the TeX Catalogue Topic Index under
Science and then Typesetting Physical Units.

There are more than 2,000 LaTeX Style packages. The TeX Catalogue is a
good starting point to locate the package you need. Another resource
is CTAN. You can also try an online search engine. Try typing LaTeX
physical units package into Google.com, for example, and it will find
a few references to the SIunits package.

JcTo

unread,
Aug 20, 2008, 8:30:11 PM8/20/08
to LaTeX-EPN
> Sugiero ir a la página para que usen los links que abajo no aparecen
> como tales.
Uno de los links me llevó al siguiente pdf:
http://www.tug.org/pracjourn/2005-4/hefferon/hefferon.pdf

A más de un ejemplo de cómo armar nuestros paquetes, un par de leyes
sobre la programación:

I have seen on the Internet (credited to different people) the two
Laws of Program
Writing.
The First Law is: don’t. Instead, see if someone has already written
a version of the program that you can crib. If not, see if someone has
written a program like what you need that you can adapt.

The Second Law is: if no one has ever written a program anything
like what you need, and you really must write it fresh, then spend a
lot
of time and effort on it so that your program can be adopted or
adapted
by people who come along later trying to follow the First Law.

Hay que buscarnos el tiempo para esto
Reply all
Reply to author
Forward
0 new messages