Czech version
logolink

< Back to the list of lessons

LaTeX Practically II

ostatni-sinContent of the lesson:

  • Assignment of the Problem
  • Typesetting

Assignment of the Problem

Our task is to create a one-sided document in LaTeX which will contain several mathematical symbols. The final document can be seen in the following image.

ukázka výsledného dokumentu

The Fifth Paragraph

Take a look at the fifth paragraph. You can see a combinatorial number inside. We have to find out how to write such a symbol:

  • combinatorial number - {text above \choose text below} (do not forget to use the braces, otherwise the command will not be functional)
  • three dots - you cannot use three classical dots, use the command \ldots instead

A factorial can be added as a simple exclamation mark, the rest of this paragraph should be clear from the previous lesson.

The Fifth paragraph of text in LaTeX
Pravděpodobnost výhry při losování $k$ čísel z $n$ možných lze vypočítat pomocí kombinačního čísla ${n \choose k} $. Například při losování $6$ čísel ze $49$ je
$${49 \choose 6} =\frac{49!}{43!6!} =\frac{49\cdot 48\cdot \ldots \cdot 44}{6!} =49\cdot 4\cdot 47\cdot 46\cdot 3\cdot 11\doteq 14\cdot 10^6$$
tedy 1 : 14 milionům.

The Sixth Paragraph

The last paragraph is remaining. You have to add limits, an inequality and a function g(ξ). For the first part you need to know:

  • notation of the Greek letter delta which is easy - \Delta (be aware of the first upper-case letter, \delta returns lower-case delta)
  • to be able to add numbers inside the function, you have to use \begin{equation} ... \end{equation} again
  • notation of the set of real numbers ℜ - \Re

In the following part we get to a more complex inequality. Imagine it as a table (array) which consists of three rows and three columns. We will use another environment - array, concretely its mathematical form eqnarray (this array centers lines according to the sign):

  • inequality should be bordered with commands \begin{eqnarray} and \end{eqnarray}, the sign should be placed between symbols &, every row should be ended by 2 backslashes
  • logarithm can be written by \log number
  • special brackets can be written by commands \lceil (left) and \rceil (right)

In case you generate the PDF file now, you can see 2 problems:

  • rows of inequality are numbered, you can remove this by adding the symbol * behind the parameter eqnarray - \begin{eqnarray*} ... \end{eqnarray*}
  • brackets do not have proper size - you should let the compiler compute the size according to inner text when compiling - add \left before \lceil and \right before \rceil

We have this code at this moment:

Placing text inside LaTeX document
Co je derivace $f'(x)$? Je to limita
\begin{equation}
\lim_{n\to 0} \frac{f(x)-f(x+\Delta x)}{\Delta x} ,
\end{equation}
což je v geometrické interpretaci směrnice tečny v bodě x. Pro výpočet bitové šířky $x$ desítkového čísla $C \in \Re $ řešíme nerovnici:
\begin{eqnarray*}
C&\le& 2^x \\
\log{C} &\le&x\cdot \log{2} \\
x&=&\left \lceil \frac{\log{C} }{\log{2} } \right \rceil \\
\end{eqnarray*}

We can continue with the last equation. There are several problems in this part:

  • Greek letter ξ (ksi) which can be written by \xi.
  • Size of the braces should be optimized by command \left and the single brace should be written by \{ .
  • The rest of the equation should be inserted between \begin{array} and \end{array}.
  • The word "pro" is written using a common font, not in italics. You have to insert it inside the command \textrm{pro}. Textrm should contain every non-mathematical text (serif font).
  • Symbol ∈ ("in") can be written by \in.
  • Broken brackets cannot be written as < or >, you have to use the commands \langle and \rangle instead.

The environment array contains an optional parameter which can be inserted into braces behind \begin{array}. In this case we used {ll} to allign the text to the left.

  • the number of letters inside braces sets the number of columns
  • you can use these letters: l - allign to left, c - allign to center, r - allign to right.
The remaining part of source code:
Nespojitá funkce $g(\xi )$ je definována takto:
$$g(\xi )=\left\{
\begin{array}{ll}
0&\textrm{pro $\xi < 0$} \\
\xi &\textrm{pro }\xi \in \langle 0;1) \\
1&\textrm{pro $\xi > 1$} \\
\end{array}
$$

The whole source code is available here: Zdrojovy_kod.txt and you can also view the PDF version here: prepsany_dokument.pdf.

Congratulations, you have created your first mathematical text.

Additional Texts

Links

Questions

  1. How can you insert more equations in LaTeX?
  2. How can you find help articles for LaTeX in the Internet?
  3. How can you find a way to write a concrete specific symbol?
  4. What is the meaning of $ or $$ in LaTeX?
  5. Where can you use LaTeX in the Internet in case you do not want to install any software to your computer?
webdesign, xhtml, css, php - Mgr. Michal Mikláš