latex

recent posts related to LaTeX

LaTeX if then examples (LaTeX ifthen package)

Here is a LaTeX example file where I'm experimenting with the LaTeX "ifthen" package (ifthen.sty).

These are simple examples, where I'm playing with the if/then decision making capability with the LaTeX "ifthen" package. These two examples are pretty easy, but make a nice introduction to the "ifthen" package.

Without any further ado, here are my LaTeX if/then examples:

LaTeX example: How to create your own commands with ‘newcommand’

LaTeX question: Can you show a simple example of creating your own LaTeX command?

Here is an example LaTeX file where I'm experimenting with various newcommand and renewcommand capabilities. The file actually contains six LaTeX examples, and in each step I add one more LaTeX feature that is a little harder than the previous step.

LaTeX HTML package - control your output alvin July 25, 2004 - 4:31pm

The LaTeX "html" package (html.sty) can be very useful for the times that you want to conditionally controlling the output in LaTeX documents, but very specifically, when you want one set of output for normal Latex processing (LaTeX PDF output), and another set of output for LaTeX HTML processing.

Here's a very simple example of how you can use this LaTeX HTML package to conditionally control what is output by the LaTeX processor:

LaTeX versions - conditionally control your output

The "versions" package (versions.sty) can be very useful in conditionally controlling your output in LaTeX PDF and HTML documents.

LaTeX conditional output

Here's a very simple example of how you can use this package to conditionally control what is output by the LaTeX processor:

LaTeX multiline comments

I often have a need to create LaTeX comments that span multiple lines. Of course you can create single line comments in LaTeX using the percent character like this:

% this is a comment

But I want to be able to create LaTeX comments that go on for multiple lines. Fortunately, if you know that you're supposed to include the verbatim package, this is pretty easy.

LaTeX multiline comments example

The first step is to include the verbatim package, like this:

A crazy sed script to convert HTML code to LaTeX

The crazy sed script below is my first attempt at a script that will convert as much HTML as possible to LaTeX. For my purposes I'm mostly interested in tables, lists, buttons, and comboboxes, but I included a few other things as well.

This is in an extremely experimental state, and is included here as much for backup purposes and sharing as anything else.

Here's how you run the sed script on an HTML file named test.html:

sed -f html2latex.sed test.html > test.tex

That being said, here's the current source code for the html2latex.sed file:

LaTeX box - how to create a box

Okay, now I'm getting into the crazy LaTeX code. I'm converting HTML UI prototype images into LaTeX so I can include the prototypes in my Requirements Specification docs.

So, that being my motivation, here's some LaTeX example code that shows how to display the equivalent of a textfield inside of a table. At the very least, this demonstrates how to use the LaTeX fbox command. :)

LaTeX example - Print a chapter or section without a corresponding sectioning number?

LaTeX FAQ: How can I print a chapter or section without a corresponding sectioning number?

Use the * version of the chapter and section commands, like this:

% a sample chapter
\chapter*{Latex FAQs}

% a sample section
\section*{Latex FAQs}

Note that the "normal" way of doing a chapter or section, which would include the correspond chapter or section number, is like this:

% a sample chapter
\chapter{Latex FAQs}

% a sample section
\section{Latex FAQs}

 

LaTeX example - enumerate and itemize line spacing

LaTeX line spacing FAQ: How can I control the line spacing in itemize and enumerate tags?

What I did was to create my own LaTeX command, and then use that command instead of the traditional enumerate tag. (This works just as well for the itemize tag.)

The LaTeX example below shows how to create your own command named packed_enum. After you define this command, just use it instead of enumerate or itemize, and your line spacing will essentially be reduced to single line spacing.