latex 周志遠 陳韋名. outline introduction compile basic use article structure form graph...

22
LaTeX 周周周 周周周

Upload: angel-quinn

Post on 17-Dec-2015

234 views

Category:

Documents


2 download

TRANSCRIPT

LaTeX

周志遠陳韋名

Outline

• Introduction• Compile• Basic use• Article structure• Form• Graph processing• Math mode

Introduction

• TeX system : Created by Donald E. Knuth• Purpose : For typesetting• LaTeX : a macro for TeX (by Leslie Lamport)• The applications on different system– Unix : teTeX– Windows : MiKTeX, fpTeX– Mac : iTeXmac

Setup

• MiKTeX• Texmaker• Jabref• http://yenlung.math.nccu.edu.tw/~site/

drupal-5.1/idisk/installLaTeX.pdf

Compile

• latex paper.tex• bibtex paper.tex• latex paper.tex • latex paper.tex (make a .dvi file)• dvips paper.dvi -o paper.ps (make a .ps file)• ps2pdf paper.ps paper.pdf (make a .pdf file)

Compile

.bib

Jabref

Basic use

• 1. % (Comment)– Example : It's easy to learn LaTeX. %(Of course

not)

• 2. Quotation marks– Example : It's 'wrong' and it's `right'.

– Example : It's "wrong" and it's ``right''.

Basic use

• 3. Ellipsis– Example : It's difficult... so difficult\ldots\

• 4. Dash– Example : one-dash, two--dash, three---dash

Basic use

• 5. Line and Page Breaking

\\ New paragraph \\* New line, but not new page

\newline New line \nolinebreak No line break here

\newpage New page \nopagebreak No page break here

\pagebreak Encourage page break

Article structure

• Structure \documentclass{article} <preamble> \begin{document} <article> \end{document}

• Preamble region : – macro, package– Some instruction (\linespread)

Article structure

• Structure

• Footnote– \footnote{}– ABC\footnote{abc}

depth Inst. depth Inst.

-1 \part{} 3 \subsubsection{}

0 \chapter{} 4 \paragraph{}

1 \section{} 5 \subparagraph{}

2 \subsection{}

Form • tabbing \begin{tabbing} column1 \= column2 \= column3 \\ item1 \> item2 \> item3 \\ itemA \> itemB \> itemC \end{tabbing}

• tabular \begin{tabular}{||c|c|c||} \hline column1 & column2 & column3 \\ \hline item1 & item2 & item3 \\ itemA & itemB & itemC \\ \hline \end{tabular}

Form• \documentclass{article} • \usepackage{textcomp} • \renewcommand{\arraystretch}{1.2}• \tabcolsep=12pt • \begin{document} • \centering • \section*{SPECIFIC HEATS (20 \textcelsius\ AND 1 ATM)} • \begin{tabular}{@{\sf }lll@{}} • \hline• & \multicolumn{2}{c}{\bf Specific Heats} \\• \cline{2-3}• & $c$ (J/kg$\cdot$K) & $C$ (J/mol$\cdot$K) \\ • \hline Aluminum & 900 & 24.3 \\ • Copper & 385 & 24.4 \\ • Gold & 130 & 25.6 \\ • Steel/Iron & 450 & 25.0 \\ • Lead & 130 & 26.8 \\ • Mercury & 140 & 28.0 \\ • Water & 4190 & 75.4 \\ • Ice ($-$10 \textcelsius) & 2100 & 38 \\ • \hline • \end{tabular} • \end{document}

Graph processing

• Draw an easy graph\documentclass{article}\usepackage{epic}\begin{document}\unitlength=1mm\begin{picture}(80, 60)\multiput(30, 0)(5, 5){11}{\line(-1, 1){50}}\multiput(30, 0)(-5, 5){11}{\line(1, 1){50}}\end{picture}\end{document}

Graph processing

• Add a graph into article\documentclass{article}\usepackage{graphicx}\begin{document}\begin{figure}\includegraphics{pic1.png}\caption{The position of typhoon} \end{figure}\end{document}

Math mode

• $ : Into/Leave the math mode• ^ : Superscript• _ : Subscript• {} : The range of effect region• math inline mode : – \begin{math} 1111 \end{math} or \(1111 \)

• math display mode– \begin{displaymath} 1111 \end{displaymath}– or \[ 1111 \]

Math mode

• $a^{b^{c^{d^{e_{f_{g_{h_{i}}}}}}}}c$

• $f(x)=2x+3$• f(x)=2x+3

• $\log(xy)=\log(x)+\log(y)$

Math mode

• \frac (fraction)• (2x+3y)/(3x-2y) => $\frac{2x+3y}{3x-2y}$

• \sqrt (sqrt)• sqrt(x+y+z-2) => $\sqrt[3]{x+y+z-2}$

Math mode

• Integral• $L(s)=\int^2_1{x^2}dx$

• Limit• $\lim_{x\rightarrow \infty} {\frac{2x+6}{x-3}}$

• Module• $x \equiv 2 \pmod 3$