Jan 13, 2008

memo of Tex I

MikTex 2.7 + TexnicCenter

1.Layout

\evensidemargin -20mm %even page's left margin, 0mm as -40mm
\oddsidemargin -20mm %odd page's left margin, 0mm as -40mm
\topmargin -30mm %top margin, 0mm as -40mm
\textwidth 170mm %width of main text
\textheight 272mm %height of main text
\columnsep 3mm %gap between columns
\headheight 0mm %no head

2.Command

\newcommand{\dx}{\, \mathrm{d}x}

3.Math Mode

$...$ %normal math mode, multi lines will compress in one line

$...$ or \[...\] %math mode with display style(used a whole row, different from "\displaystyle")

$\displaystyle ...$ %deal well with multi-lines' equations, but the linespacing increases

\mathrm{}
%font 'Roman' in math mode

\quad or
\qquad %a gap like a tab

\
begin{cases} %cases expressions, use '&' to connect expressions in a row
0 & \mathrm{if}\, f(-x)=-f(x) \\
1 & \mathrm{if}\, f(-x)=f(x)
\end{cases}

\begin{array}{c} %array, argument is the number of columns and alignment of every column {l(eft), c(enter), r(ight)}, e.g. {cc}{lcr} for multi-column
\displaystyle a_n=\frac{1}{L}\int_{-L}^{L}{f(x)\cos \frac{n\pi x}{L}}\dx\\
\displaystyle b_n=\frac{1}{L}\int_{-L}^{L}{f(x)\sin \frac{n\pi x}{L}}\dx
\end{array}

\left\{ & \right\}
%let Latex choose the size of delimiters, left and right can't be used separately(in case of single delimiters, write \left. or \right.), e.g. $\left \right.$ $\left. \right)$

_
or ^ %subscript and superscript, e.g. A_3^2 or \int_0^{\infty}