Tag Archives: text

Strict inequalities (greater/less than) in text-mode

Strict inequalities are widely used in math equations as well as within text for comparisons. They can be produced using the ordinary (inline) math-mode ($...$) without loading a specific package.

c > d

$c > d$

d < c

$d < c$

In order to omit the math-mode within a text-paragraph, LaTeX knows text-mode commands for these symbols.

Greater than (>):

\textgreater

Less than (<):

\textless

Non-strict inequalities (\le and \ge), however, can only be produced using the inline math mode.

a \le b

$a \le b$

b \ge a

$b \ge a$

Finally, the equal symbol (=) is available in both text- and math-mode.


Generating dummy text/blindtext with Latex for testing

I was often using any of the available “lorem ipsum” generators on the web while testing different things in Latex until I discovered that the Latex distribution provides packages generating blind text, which is definitely more convenient. With just a few lines of code, these packages will generate paragraphes, even whole documents with sections, paragraphs of text, lists, etc.

The first package that I will introduce is the “blindtext” package. First the language option as well as the package have to be loaded. Make sure you get the order right, otherwise your text might appear in latin by default.

\usepackage[english]{babel}
\usepackage{blindtext}

The language options english, (n)german and latin are available. French is also available, but in a preliminary version. Try it out yourself :-) .

Now you are ready to create a paragraph or even a whole document with just one line of code.

For few/more paragraphs of normal text:

\blindtext
\Blindtext

For a small/large document:

\blinddocument
\Blinddocument

In an arbitrary number of repetitions, e.g.

\blindtext[5]

Furthermore,

\blindlist{env}[x]

creates a list with “x” being the number of items generated. The environment can be set to itemize, enumerate or description.

A more direct way to generate lists is by using the commands:

\blinditemize
\blindenumerate
\blinddescription

and their extended versions with capital letters are available. Similarly, the number of items is defined through the optional argument, e.g.

\blindenumerate[10]

If you want math within the text, use

\blindmathtrue
\blindmathfalse

respectively.

It is also possible to generate text with math including formulas, using

\blindmathpaper

The “lipsum” package is a more basic package. It generates a certain number of the standard “lorem ipsum” text:

\usepackage{lipsum}
...
\lipsum
\lipsum[3-56]

By default, the package will either generate slightly more than a single page (fist line). Alternatively, it generates an arbitrary number of paragraphs (second line).

For more information, please refer to the package information of the blindtext as well as the lipsum packages.


Displaying text inside the math-environment

By default, Latex will print text within formulas in italics, omitting white spaces. Now if you need to add normal text into a formula or even write a formula using words, you can do this with the text-command inside the math-environment:

\text{...}

Example:

\text{velocity} = \frac{\text{distance}} {\text{unit of time}}

velocity=\frac{distance}{unit of time} \to \text{velocity} = \frac{\text{distance}}{\text{unit of time}}

Btw. The “text-command” will also take care of the spaces, which would otherwise be ignored.

Note:
Spaces in the math-environment can be produced using:

  • \; for a thick space,
  • \: for a medium space,
  • \, for a thin space and
  • \! for a negative thin space.
Intertext

Using the math-environment align to display a series of equations, whole lines of text can be added in between using the “intertext”-command without affecting the alignment of the equations:

\begin{align}
...
\intertext{...}
...
\end{align}

Example:

\begin{align}
F = f_1+f_2+f_3+...+f_n
\intertext{can be written as}
\sum_1^n{f_i}
\end{align}


Follow

Get every new post delivered to your Inbox.

Join 316 other followers