Showing posts with label LaTeX. Show all posts
Showing posts with label LaTeX. Show all posts

Thursday, March 29, 2007

Generating 3D Pictures in PSTricks for TeX

Sketch is a small, simple system for producing line drawings of two- or three-dimensional solid objects and scenes. It began as a way to make illustrations for a textbook after we could find no suitable tool for this purpose.

Existing scene processors emphasized GUIs and/or photo-realism, both un-useful to us. We wanted to produce finely wrought, mathematically-based illustrations with no extraneous detail.

The input language is reminiscent of PSTricks, so will be easy to learn for current PSTricks users.

It is easy to use and works across platforms!

Download

Documentation

Install

Wednesday, February 28, 2007

EMacs+AUCTex

This is the best solution for writing Latex. There is a fundamental question for all latex editors: how to jump between latex source file and output dvi/pdf file? In Mac, TexShop provides a simple and good solution: Apple + CLICK will try to match locations of source file and pdf file. Lyx and Texmacs are WYSIWYM editors. The price you pay is the slow typing speed (the desirable typing speed will simulate your thinking) and difficulty of collaboration. Preview-latex, a built-in package of AUCtex, strikes a balance. Let me copy the following paragraph from preview-latex manual:

WYSIWYG (what you see is what you get) sometimes is considered all
the rage, sometimes frowned upon. Do we really want it? Wrong
question. The right question is _what_ we want from it. Except when
finetuning the layout, we don't want to use printer fonts for on-screen
text editing. The low resolution and contrast of a computer screen
render all but the coarsest printer fonts (those for low-quality
newsprint) unappealing, and the margins and pagination of the print are
not wanted on the screen, either. On the other hand, more complex
visual compositions like math formulas and tables can't easily be taken
in when seen only in the source. preview-latex strikes a balance: it
only uses graphic renditions of the output for certain, configurable
constructs, does this only when told, and then right in the source code.
Switching back and forth between the source and preview is easy and
natural and can be done for each image independently. Behind the scenes
of preview-latex, a sophisticated framework of other programs like
`dvipng', Dvips and Ghostscript are employed together with a special
LaTeX style file for extracting the material of interest in the
background and providing fast interactive response.

Monday, September 11, 2006

BibTeX

Introduction

BibTeX
is a tool for formatting lists of references used by the LaTeX document preparation system. BibTeX was created by Oren Patashnik and Leslie Lamport in 1985.


Why BibTeX

BibTeX makes it easy to cite sources in a consistent manner, by separating bibliographic information from the presentation of this information. This same principle of separation of content and presentation/style is used by LaTeX itself, by XHTML and CSS, etc.

References and citations are best handled in a consistent way by using BibTeX. In this method, you supply all the relevant information about references in a ``.bib file'' without regard to ordering or style. Then you let BibTeX format all citations and reference entries according to the chosen bibliographic style, and you don't have to sweat all the font and punctuation and ordering details yourself.


Standard Entry Types


@article
An article from a journal or magazine
@book
A book with an explicit publisher
@booklet
A work that is printed and bound, but without a named publisher or sponsoring institution
@conference
The same as inproceedings
@inbook
A part of a book, which may be a chapter (or section or whatever) and/or a range of pages
@incollection
A part of a book having its own title
@inproceedings
An article in a conference proceedings
@manual
Technical documentation
@mastersthesis
A Master's thesis
@misc
Use this type when nothing else fits
@phdthesis
A PhD thesis
@proceedings
The proceedings of a conference
@techreport
A report published by a school or other institution, usually numbered within a series
@unpublished
A document having an author and title, but not formally published

Standard Fields
address
Usually the address of the publisher or other type of institution. For major publishing houses, van Leunen recommends omitting the information entirely. For small publishers, on the other hand, you can help the reader by giving the complete address.
annote
An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.
author
The name(s) of the author(s), in the format described in the LaTeX book.
booktitle
Title of a book, part of which is being cited. See the LaTeX book for how to type titles. For book entries, use the title field instead.
chapter
A chapter (or section or whatever) number.
crossref
The database key of the entry being cross referenced. Any fields that are missing from the current record are inherited from the field being cross referenced.
edition
The edition of a book---for example, ``Second''. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.
editor
Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.
howpublished
How something strange has been published. The first word should be capitalized.
institution
The sponsoring institution of a technical report.
journal
A journal name. Abbreviations are provided for many journals.
key
Used for alphabetizing, cross referencing, and creating a label when the ``author'' information is missing. This field should not be confused with the key that appears in the cite command and at the beginning of the database entry.
month
The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation, as described in Appendix B.1.3 of the LaTeX book.
note
Any additional information that can help the reader. The first word should be capitalized.
number
The number of a journal, magazine, technical report, or of a work in a series. An issue of a journal or magazine is usually identified by its volume and number; the organization that issues a technical report usually gives it a number; and sometimes books are given numbers in a named series.
organization
The organization that sponsors a conference or that publishes a manual.
pages
One or more page numbers or range of numbers, such as 42--111 or 7,41,73--97 or 43++' in this last example indicates pages following that don't form a simple range). To make it easier to maintain Scribe-compatible databases, the standard styles convert a single dash (as in 7-33) to the double dash used in TeX to denote number ranges (as in 7--33). (the `
publisher
The publisher's name.
school
The name of the school where a thesis was written.
series
The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.
title
The work's title, typed as explained in the LaTeX book.
type
The type of a technical report---for example, ``Research Note''.
volume
The volume of a journal or multi-volume book.
year
The year of publication or, for an unpublished work, the year it was written. Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as `\hbox{(about 1984)}'.

A Simple Example

Suppose we have a bib database mybib.bib generated with the following item:

@Book{hicks2001,
author = "Michael {von Hicks III} ",
title = "Design of a Carbon Fiber Composite Grid Structure for the
GLAST
Spacecraft Using a Novel Manufacturing Technique",
publisher = "Stanford Press",
year = 2001,
address = "Palo Alto",
edition = "1st",
isbn = "0-69-697269-4"
}


Then we write this simple test test.tex file:

\documentstyle{article}
\begin{document}
\bibliographystyle{abbrv}
\section{Introduction}

Test my bibliography database: \cite{hicks2001}.

\bibliography{mybib}
\end{document}

With these two files ready, we just need to run in a terminal:
latex test
bibtex test
latex test
latex test

For WinEdt users, you just need texify your test.tex file and
.dvi will be generated automatically.



Bibliography Styles


In the last example, \bibliographystyle{abbrv} specify the style used for this document.
There are many other choices in the standard LaTeX distribution. For more examples, see
http://www.cs.stir.ac.uk/~kjt/software/latex/showbst.html.

Wednesday, June 14, 2006

PSTricks

PSTricks is a set of macros that allow the inclusion of PostScript drawings directly inside TeX or LaTeX code.

For a short and extendable introduction, see Wiki page or the official PSTricks website. You can find everything, from documentations to great examples. You can also go directly to look at this manual.

This is a great tool for TeX users. Thank Long Chen for recommending this package!

Beamer: Introduction

Beamer is a LaTeX class for creating presentations. It works together with pdflatex and dvips. The name derives from the German word "Beamer", a pseudo-anglicism for video projector.

Beamer allows you to create slides featuring overlays, animation and so on in LaTeX. For LaTeX users, it is just great for presentation. Here is a not so short tutorial!

For installation, first you can get beamer(including xcolor and pgf) and guide from the Beamer official site.

1. Once you have them all downloaded, extract them and put them in the following directory: texmf/tex/latex/ (this directory may be in different place in different systems and you check this with admin).

2. For Unix/Linux users, just run "texhash" or "mktexlsr" to notice the MiKTex that you have new class files installed; For WinEdt users, Goto Accessories->MiKTex Options and click on "Refresh now" and then you are done.

3. For questions related to using Chinese charecters within Beamer, go to CTEX.

Enjoy!

Friday, December 09, 2005

LaTeX

Why LATEX?

The advantages of LaTeX are that

1. It's free.

2. It's available for many machines.

3. LaTeX files are ASCII and are portable. Because they're ASCII it's easy to discover how someone achieved an effect.

4. You can use the editor of your choice.

5. The typesetting's better, especially the maths.

6. Style changes are neater in LaTeX. Style files for many periodicals exist. Many Word users don't use styles or templates, and there's a limit to what can be done.

7. LaTeX is extensible. If you want a new feature, you can look around for a free add-on or write one yourself.

8. LaTeX's floats are no more awkward than Word's anchored frames, and the latter don't always work well.

Disadvantages are

1. Font selection is difficult compared to selection in Word and Framemaker.

2. LaTeX's not good at flowing text around pictures.

3. LaTeX encourages (almost insists on) structured writing and the separation of style from content. This is not the way that many people (especially non-programmers) are used to working.

4. Without a WYSIWYG front end, it's not always easy to find out how to do things.

For details, see Why LATEX?.


Short Introduction

There is a wonderful short introduction to LATEX by Wenguang Wang.

For more, see the official site www.latex-project.org

For Chinese version, see http://www.ctex.org


Math Symbols in LATEX

This is what I really interested in. There is a great introduction by on AMS site. This is a PDF file. A simpler web-based symbol list can be find at LaTex Math Symbols.

Wednesday, December 07, 2005

Using LaTeX in Xfig

Introduction

xfig is a drawing package that's ideal for producing diagrams that can be imported into LATEX and many other word processing packages.

First familiarise yourself with the layout. Down the left is a panel of command buttons. Put the pointer on the icons to see what they do. The boxes along the bottom change according to the command you're using. Along the top is a menubar. The File option is concerned with loading and saving. The Help menu leads to full documentation.

Top left, under the menu bar, is a description of the current mode. Initially it says READY. Select a mode or load a file. Top right in the Mouse Buttons box, is a description of what the 3 mouse buttons currently do.

Unlike some graphics editors, xfig makes you select the function, then choose the object. Try drawing some objects. Keep an eye on the top corners of the window to get feedback. You'll notice that the objects sometimes have little boxes (handles) at their extremities. These are what you need to click on when you need to choose an object or vertex. Try moving and rotating some objects.

If you want to change the color of an object, fill it in, add arrows to lines, etc, click the edit button then select the object. A dialog box will appear that lets you change many features. If you want to change the same feature(s) of many objects, use the Update command.

For More: User's Manual

FAQ


Use LATEX In Your Fig

1. Inside xfig, add the LaTeX expressions to the figure, using $...$ to switch to math-mode where necessary.

2. Use the "special text" mode using the "Text flags" menu at the bottom of the screen to add math symbols.

3. Export the figure from xfig twice: firstly using the format "Combined PS/LaTeX (both parts)" to a file such as "test.pstex". This step will give two outputs: "test.pstex" and "test.pstex_t".

4. Create a driver file (e.g., test.tex) containing something like:

\documentclass{article}
\usepackage{epsfig}
\usepackage{color} (note: you might not might not need to do this)
\setlength{\textwidth}{100cm}
\setlength{\textheight}{100cm}
\begin{document}
\pagestyle{empty}
\input{test.pstex_t}
\end{document}

5. Run the commands:

latex fig1.tex
dvips -E test.dvi -o test.eps

6. You should now have a file named "test.eps" which can be included (with scaling and rotation if desired) in other LaTeX documents.



Installation

Download

For Unix/Linux users, see instruction . (It works fine for me with 3.2.4 amd 3.2.5 alpha. )

For Windows users, see instruction . (Never tried.)