Monday 13 April 2009

LaTeX Introduction 4: Simple Math 2

This tutorial is still on simple mathematical expression. Processing document using Latex is very different from using proprietary word processing software which is based on GUI (Graphical User Interface). Using Latex, what you see in winEdt is not the final result you will get. Always compile the document after you make make any change and see the result.

Try this template first and after that do make exploration by yourself.


\documentclass[11pt]{article}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{latexsym}

\setlength{\textwidth}{16cm}
\setlength{\hoffset}{-2cm}
\setlength{\textheight}{24.5cm}
\setlength{\voffset}{-2cm}

\setlength{\parindent}{0cm}
\addtolength{\parskip}{2mm}

\newcommand{\R}{\mathbb{R}} % What is this ?

\pagestyle{empty}

\begin{document}

\leftline{{\bf Demo 4 \hfill LEARNING \LaTeX{}}} % Header for first page different way with demo 3

\medskip % This is for medium skip

\leftline{{\bf 2008 -- 2009}}

\bigskip

\centerline{\bf Demo \LaTeX{} 4}

\bigskip

\subsection*{Some common mistakes}

\begin{itemize}
\item Always put numerals in math mode. Thus, do $27.3$, not 27.3.
\emph{When you have numerals like 27.3 in emphasized text, you usually want them in roman,
like $27.3$, not emphasized.} Also, a negative number, -273, will look wrong if left in
text mode. In math mode you get a proper minus sign $-273$.

When giving a range, $200-300$ will look like a subtraction. Here you can do
$200$-$300$ if you prefer. Notice the difference in the various dashes:
one dash is $200$-$300$, two dashes is $200$--$300$, three dashes is
$200$---$300$.

For numerals with units you can do $42\text{km}^2$.

\item Avoid blank lines around displays. Thus do not do
\begin{verbatim} % Hurufnya verbatim dan menampilkan apa adanya tanpa mengeksekusi perintah
For $W_1 = \{(q_1,\,0,\,0,\,0)\st q_1\in\R\}$ we have

$$
W_1^\perp = \{(q_1,\,q_2,\,0,\,p_2)\st q_1, q_2, p_2\in\R\}.
$$

For $W_2 = \{(q_1,\,q_2,\,0,\,0)\st q_1,q_2\in\R\}$ we have
% baris kosong tidak boleh
$$
W_2^\perp = \{(q_1,\,q_2,\,0,\,0)\st q_1, q_2 \in\R\} = W_2.
$$
\end{verbatim}
If you want to `set off' displays in your tex file, do this:
\begin{verbatim}
For $W_1 = \{(q_1,\,0,\,0,\,0)\st q_1\in\R\}$ we have
% % Untuk menampilkan spasi kosong hendaknya pakai % saja jangan dibiarkan kosong
$$
W_1^\perp = \{(q_1,\,q_2,\,0,\,p_2)\st q_1, q_2, p_2\in\R\}.
$$
%
For $W_2 = \{(q_1,\,q_2,\,0,\,0)\st q_1,q_2\in\R\}$ we have
%
$$
W_2^\perp = \{(q_1,\,q_2,\,0,\,0)\st q_1, q_2 \in\R\} = W_2.
$$
\end{verbatim}
\end{itemize}


\end{document}

No comments:

Post a Comment