## Thursday, July 9, 2009

### Latex Samples

Here is an inline math $\sum_{i=1}^nx_iy_i$ and $\displaystyle \sum_i^n a_i$ this is a display math $$\sum_{i=1}^nx_iy_i$$. You can hover your mouse over the math symbols to see the corresponding latex code.
$\sum_{i=1}^n a^2+b^2$
If you dont't like the border around the image, go to the dashboard---> layout ---> edit html and look at the following code

.post img {
border:1px solid #CCCCCC;
}

and remove the second line (border:... etc) or replace 1px into 0px.

Here are more examples:

Matrix
$\begin{pmatrix}a&b&c\\d&e&f\\g&h&i\end{pmatrix}$

Multiline Equation
\begin{aligned}x^2+4x-21&=0\\x^2+4x&=25\\x^2+4x+4&=21+4\\(x+2)^2&=25\\x+2&=\pm 5\\x&=-2\pm 5\end{aligned}

Commutative Diagram
$\usepackage[all]{xy}\xymatrix{0\ar[r]&A\ar[d]\ar[r]^f&B\ar[d]&\\&C\ar[r]_g&D\ar[r]&0}$

With Color
$\color{Magenta}\usepackage[all]{xy}\xymatrix{0\ar[r]&A\ar[d]\ar[r]^f&B\ar[d]&\\&C\ar[r]_g&D\ar[r]&0}$

$\color{Blue}A^2+z^5$
$\begin{tabular}\tiny{a}&\scriptsize{b}\end{tabular}$

1. $\int_a^b f(x)\, dx$

2. $\usepackage[all]{xy}\xymatrix{0\ar[r]&A\ar[d]\ar[r]^f&B\ar[d]&\\&C\ar[r]_g&D\ar[r]&0}$

3. $$f\left( {a,b} \right) = \sqrt {{a^2} + {b^2}}$$

4. $$f:X \hookrightarrow Y$$

5. $f:A \hookrightarrow B$

6. $\usepackage[all]{xy}\xymatrix{\ar@/^1.5pc/[rr]^{\mathrm{res}_{u,w}}F(u)\ar[r]_{\mathrm{res}_{u,v}}&F(v)\ar[r]_{\mathrm{res}_{u,v}}&F(w)}$

7. $\usepackage[all]{xy}\xymatrix@C+2em@R+2em{ Q \ar@/_10pt/[ddr]_{q_1} \ar@/^10pt/[drr]^{q_2} \ar@{-->}[dr]|*+<3pt,3pt>{\scriptstyle u} & & \\ & P \ar[d]_(0.4){p_1} \ar[r]^(0.4){p_2} & Y \ar[d]^{g}\\ & X \ar[r]_{f} & Z }$

8. $\prod_i=|A_i|$

9. \begin{definition}
A (meet) semi-lattice L is a poset in which each pair of elements has an infimum.
\end{definition}

10. for $P<i$ then $x = 4$

11. $x^2 +2x +1$

12. $\sum_{i=1}^nx_i$

13. Just testing this out, having trouble getting it working on my blog

$\frac{a}{b}$

14. This comment has been removed by the author.

15. $c_i = {1 \over \pi_i}$

16. $c^2=b^+a^2$