Sie sind auf Seite 1von 6

5/7/13

Sample LaTeX file

Sample LaTeX file


The name of this file is intro.tex.
\ d o c u m e n t c l a s s [ 1 2 p t ] { a r t i c l e } \ u s e p a c k a g e { a m s m a t h } \ u s e p a c k a g e { g r a p h i c x } \ u s e p a c k a g e { v e r b a t i m } \ u s e p a c k a g e { c o l o r } \ u s e p a c k a g e { s u b f i g u r e } \ u s e p a c k a g e { h y p e r r e f } %n e e df o rs u b e q u a t i o n s %n e e df o rf i g u r e s %u s e f u lf o rp r o g r a ml i s t i n g s %u s ei fc o l o ri su s e di nt e x t %u s ef o rs i d e b y s i d ef i g u r e s %u s ef o rh y p e r t e x tl i n k s ,i n c l u d i n gt h o s et oe x t e r n a ld o c u m e n t sa n dU R L s

%d o n ' tn e e dt h ef o l l o w i n g .s i m p l yu s ed e f a u l t s \ s e t l e n g t h { \ b a s e l i n e s k i p } { 1 6 . 0 p t } %1 6p tu s u a ls p a c i n gb e t w e e nl i n e s \ s e t l e n g t h { \ p a r s k i p } { 3 p tp l u s2 p t } \ s e t l e n g t h { \ p a r i n d e n t } { 2 0 p t } \ s e t l e n g t h { \ o d d s i d e m a r g i n } { 0 . 5 c m } \ s e t l e n g t h { \ e v e n s i d e m a r g i n } { 0 . 5 c m } \ s e t l e n g t h { \ m a r g i n p a r s e p } { 0 . 7 5 c m } \ s e t l e n g t h { \ m a r g i n p a r w i d t h } { 2 . 5 c m } \ s e t l e n g t h { \ m a r g i n p a r p u s h } { 1 . 0 c m } \ s e t l e n g t h { \ t e x t w i d t h } { 1 5 0 m m } \ b e g i n { c o m m e n t } \ p a g e s t y l e { e m p t y }%u s ei fp a g en u m b e r sn o tw a n t e d \ e n d { c o m m e n t } %a b o v ei st h ep r e a m b l e \ b e g i n { d o c u m e n t } \ b e g i n { c e n t e r } { \ l a r g eI n t r o d u c t i o nt o\ L a T e X }\ \%\ \=n e wl i n e \ c o p y r i g h t2 0 0 6b yH a r v e yG o u l d\ \ D e c e m b e r5 ,2 0 0 6 \ e n d { c e n t e r } \ s e c t i o n { I n t r o d u c t i o n } \ T e X \l o o k sm o r ed i f f i c u l tt h a ni ti s .I ti s a l m o s ta se a s ya s$ \ p i $ .S e eh o we a s yi ti st om a k es p e c i a l s y m b o l ss u c ha s$ \ a l p h a $ , $ \ b e t a $ ,$ \ g a m m a $ , $ \ d e l t a $ ,$ \ s i nx $ ,$ \ h b a r $ ,$ \ l a m b d a $ ,$ \ l d o t s $W ea l s oc a nm a k e s u b s c r i p t s $ A _ { x } $ ,$ A _ { x y } $a n ds u p e r s c r i p t s ,$ e ^ x $ ,$ e ^ { x ^ 2 } $ ,a n d $ e ^ { a ^ b } $ .W ew i l lu s e\ L a T e X ,w h i c hi sb a s e do n\ T e X \a n dh a s m a n yh i g h e r l e v e lc o m m a n d s( m a c r o s )f o rf o r m a t t i n g ,m a k i n g t a b l e s ,e t c .M o r ei n f o r m a t i o nc a nb ef o u n di nR e f . ~ \ c i t e { l a t e x } . W ej u s tm a d ean e wp a r a g r a p h .E x t r al i n e sa n ds p a c e sm a k en o d i f f e r e n c e .N o t et h a ta l lf o r m u l a sa r ee n c l o s e db y \ $a n do c c u ri n\ t e x t i t { m a t hm o d e } . T h ed e f a u l tf o n ti sC o m p u t e rM o d e r n .I ti n c l u d e s\ t e x t i t { i t a l i c s } , \ t e x t b f { b o l d f a c e } , \ t e x t s l { s l a n t e d } ,a n d\ t e x t t t { m o n o s p a c e d }f o n t s . \ s e c t i o n { E q u a t i o n s } L e tu ss e eh o we a s yi ti st ow r i t ee q u a t i o n s . \ b e g i n { e q u a t i o n } \ D e l t a= \ s u m _ { i = 1 } ^ Nw _ i( x _ i-\ b a r { x } ) ^ 2.


sip.clarku.edu/tutorials/TeX/intro.html 1/6

5/7/13

Sample LaTeX file

\ e n d { e q u a t i o n } I ti sag o o di d e at on u m b e re q u a t i o n s ,b u tw ec a nh a v ea e q u a t i o nw i t h o u tan u m b e rb yw r i t i n g \ b e g i n { e q u a t i o n } P ( x )=\ f r a c { x-a } { b-a },\ n o n u m b e r \ e n d { e q u a t i o n } a n d \ b e g i n { e q u a t i o n } g=\ f r a c { 1 } { 2 }\ s q r t { 2 \ p i }.\ n o n u m b e r \ e n d { e q u a t i o n } W ec a ng i v ea ne q u a t i o nal a b e ls ot h a tw ec a nr e f e rt oi tl a t e r . \ b e g i n { e q u a t i o n } \ l a b e l { e q : i s i n g } E=J\ s u m _ { i = 1 } ^ Ns _ is _ { i + 1 }, \ e n d { e q u a t i o n } E q u a t i o n ~ \ e q r e f { e q : i s i n g }e x p r e s s e st h ee n e r g yo fac o n f i g u r a t i o n o fs p i n si nt h eI s i n gm o d e l . \ f o o t n o t e { I ti sn e c e s s a r yt op r o c e s s( t y p e s e t )a f i l et w i c et og e tt h ec o u n t e r sc o r r e c t . } W ec a nd e f i n eo u ro w nm a c r o st os a v et y p i n g .F o re x a m p l e ,s u p p o s e t h a tw ei n t r o d u c et h em a c r o s : \ b e g i n { v e r b a t i m } \ n e w c o m m a n d { \ l b } { { \ l a n g l e } } \ n e w c o m m a n d { \ r b } { { \ r a n g l e } } \ e n d { v e r b a t i m } \ n e w c o m m a n d { \ l b } { { \ l a n g l e } } \ n e w c o m m a n d { \ r b } { { \ r a n g l e } } T h e nw ec a nw r i t et h ea v e r a g ev a l u eo f$ x $a s \ b e g i n { v e r b a t i m } \ b e g i n { e q u a t i o n } \ l bx\ r b=3 \ e n d { e q u a t i o n } \ e n d { v e r b a t i m } T h er e s u l ti s \ b e g i n { e q u a t i o n } \ l bx\ r b=3. \ e n d { e q u a t i o n } E x a m p l e so fm o r ec o m p l i c a t e de q u a t i o n s : \ b e g i n { e q u a t i o n } I=\ !\ i n t _ { \ i n f t y } ^ \ i n f t yf ( x ) \ , d x\ l a b e l { e q : f i n e } . \ e n d { e q u a t i o n } W ec a nd os o m ef i n et u n i n gb ya d d i n gs m a l la m o u n t so fh o r i z o n t a l s p a c i n g : \ b e g i n { v e r b a t i m } \ ,s m a l ls p a c e \ !n e g a t i v es p a c e \ e n d { v e r b a t i m } a si sd o n ei nE q . ~ \ e q r e f { e q : f i n e } . W ea l s oc a na l i g ns e v e r a le q u a t i o n s : \ b e g i n { a l i g n } a&=b\ \ c& =d, \ e n d { a l i g n } o rn u m b e rt h e ma ss u b e q u a t i o n s : \ b e g i n { s u b e q u a t i o n s } \ b e g i n { a l i g n } a&=b\ \ c& =d. \ e n d { a l i g n } \ e n d { s u b e q u a t i o n s } W ec a na l s oh a v ed i f f e r e n tc a s e s :
sip.clarku.edu/tutorials/TeX/intro.html 2/6

5/7/13

Sample LaTeX file

\ b e g i n { e q u a t i o n } \ l a b e l { e q : m d i v } m ( T )= \ b e g i n { c a s e s } 0&\ t e x t { $ T>T _ c $ }\ \ \ b i g l ( 1-[ \ s i n h2\ b e t aJ ] ^ { 4 }\ b i g r ) ^ { \ !1 / 8 }&\ t e x t { $ T<T _ c $ } \ e n d { c a s e s } \ e n d { e q u a t i o n } w r i t em a t r i c e s \ b e g i n { a l i g n } \ t e x t b f { T }& = \ b e g i n { p m a t r i x } T _ { + + }\ h f i l l&T _ { + }\ \ T _ { + }&T _ { }\ h f i l l \ e n d { p m a t r i x },\ n o n u m b e r\ \ &= \ b e g i n { p m a t r i x } e ^ { \ b e t a( J+B ) }\ h f i l l&e ^ { \ b e t aJ }\ h f i l l\ \ e ^ { \ b e t aJ }\ h f i l l&e ^ { \ b e t a( J-B ) }\ h f i l l \ e n d { p m a t r i x } . \ e n d { a l i g n } a n d \ n e w c o m m a n d { \ r v } { \ t e x t b f { r } } \ b e g i n { e q u a t i o n } \ s u m _ i\ v e cA\ c d o t\ v e cB=P \ ! \ i n t \ !\ r v\ c d o t \ h a t { \ m a t h b f { n } } \ ,d A=P \ ! \ i n t\ !{ \ v e c\ n a b l a }\ c d o t\ r v \ ,d V . \ e n d { e q u a t i o n } \ s e c t i o n { T a b l e s } T a b l e sa r eal i t t l em o r ed i f f i c u l t .T e X a u t o m a t i c a l l yc a l c u l a t e st h ew i d t ho ft h ec o l u m n s . \ b e g i n { t a b l e } [ h ] \ b e g i n { c e n t e r } \ b e g i n { t a b u l a r } { | l | l | r | l | } \ h l i n e l a t t i c e&$ d $&$ q $&$ T _ { \ r mm f } / T _ c $\ \ \ h l i n e s q u a r e&2&4&1 . 7 6 3\ \ \ h l i n e t r i a n g u l a r&2&6&1 . 6 4 8\ \ \ h l i n e d i a m o n d&3&4&1 . 4 7 9\ \ \ h l i n e s i m p l ec u b i c&3&6&1 . 3 3 0\ \ \ h l i n e b c c&3&8&1 . 2 6 0\ \ \ h l i n e f c c&3&1 2&1 . 2 2 5\ \ \ h l i n e \ e n d { t a b u l a r } \ c a p t i o n { \ l a b e l { t a b : 5 / t c } C o m p a r i s o no ft h em e a n f i e l dp r e d i c t i o n s f o rt h ec r i t i c a lt e m p e r a t u r eo ft h eI s i n gm o d e lw i t he x a c tr e s u l t s a n dt h eb e s tk n o w ne s t i m a t e sf o rd i f f e r e n ts p a t i a ld i m e n s i o n s$ d $ a n dl a t t i c es y m m e t r i e s . } \ e n d { c e n t e r } \ e n d { t a b l e } \ s e c t i o n { L i s t s } S o m ee x a m p l eo ff o r m a t t e dl i s t si n c l u d et h e f o l l o w i n g : \ b e g i n { e n u m e r a t e }
sip.clarku.edu/tutorials/TeX/intro.html 3/6

5/7/13

Sample LaTeX file

\ i t e mb r e a d \ i t e mc h e e s e \ e n d { e n u m e r a t e } \ b e g i n { i t e m i z e } \ i t e mT o m \ i t e mD i c k \ e n d { i t e m i z e } \ s e c t i o n { F i g u r e s } W ec a nm a k ef i g u r e sb i g g e ro rs m a l l e rb ys c a l i n gt h e m .F i g u r e ~ \ r e f { f i g : l j } h a sb e e ns c a l e db y6 0 \ % . \ b e g i n { f i g u r e } [ h ] \ b e g i n { c e n t e r } \ i n c l u d e g r a p h i c s { f i g u r e s / s i n e } \ c a p t i o n { \ l a b e l { f i g : t y p i c a l } S h o wm eas i n e . } \ e n d { c e n t e r } \ e n d { f i g u r e } \ b e g i n { f i g u r e } [ h ] \ b e g i n { c e n t e r } \ s c a l e b o x { 0 . 6 } { \ i n c l u d e g r a p h i c s { f i g u r e s / l j } } \ c a p t i o n { \ l a b e l { f i g : l j } P l o to ft h e L e n n a r d J o n e sp o t e n t i a l $ u ( r ) $ .T h ep o t e n t i a li sc h a r a c t e r i z e db yal e n g t h $ \ s i g m a $a n da ne n e r g y $ \ e p s i l o n $ . } \ e n d { c e n t e r } \ e n d { f i g u r e } \ s e c t i o n { L i t e r a lt e x t } I ti sd e s i r a b l et op r i n tp r o g r a mc o d ee x a c t l ya si ti st y p e di na m o n o s p a c e df o n t .U s e\ v e r b\ b e g i n { v e r b a t i m }a n d \ v e r b\ e n d { v e r b a t i m }a si nt h ef o l l o w i n ge x a m p l e : \ b e g i n { v e r b a t i m } d o u b l ey 0=1 0 ;/ /e x a m p l eo fd e c l a r a t i o na n da s s i g n m e n ts t a t e m e n t d o u b l ev 0=0 ; / /i n i t i a lv e l o c i t y d o u b l et=0 ; / /t i m e d o u b l ed t=0 . 0 1 ;/ /t i m es t e p d o u b l ey=y 0 ; \ e n d { v e r b a t i m } T h ec o m m a n d\ v e r b\ v e r b a t i m i n p u t { p r o g r a m s / S q u a r e . j a v a } \a l l o w s y o ut ol i s tt h ef i l e\ t e x t t t { S q u a r e . j a v a }i nt h ed i r e c t o r y p r o g r a m s . \ s e c t i o n { S p e c i a lS y m b o l s } \ s u b s e c t i o n { C o m m o nG r e e kl e t t e r s } T h e s ec o m m a n d sm a yb eu s e do n l yi nm a t hm o d e .O n l yt h em o s tc o m m o n l e t t e r sa r ei n c l u d e dh e r e . $ \ a l p h a , \ b e t a ,\ g a m m a ,\ G a m m a , \ d e l t a , \ D e l t a , \ e p s i l o n ,\ z e t a ,\ e t a ,\ t h e t a ,\ T h e t a ,\ k a p p a ,


sip.clarku.edu/tutorials/TeX/intro.html 4/6

5/7/13

Sample LaTeX file

\ l a m b d a ,\ L a m b d a ,\ m u ,\ n u , \ x i ,\ X i , \ p i ,\ P i , \ r h o , \ s i g m a , \ t a u , \ p h i ,\ P h i , \ c h i , \ p s i ,\ P s i , \ o m e g a ,\ O m e g a $ \ s u b s e c t i o n { S p e c i a ls y m b o l s } T h ed e r i v a t i v ei sd e f i n e da s \ b e g i n { e q u a t i o n } \ f r a c { d y } { d x }=\ l i m _ { \ D e l t ax\ t o0 }\ f r a c { \ D e l t ay } { \ D e l t ax } \ e n d { e q u a t i o n } \ b e g i n { e q u a t i o n } f ( x )\ t oy\ q u a d\ m b o x { a s }\ q u a dx\ t o x _ { 0 } \ e n d { e q u a t i o n } \ b e g i n { e q u a t i o n } f ( x )\ m a t h o p{ \ l o n g r i g h t a r r o w } \ l i m i t s _ { x\ t ox _ 0 }y \ e n d { e q u a t i o n } \ n o i n d e n tO r d e ro fm a g n i t u d e : \ b e g i n { e q u a t i o n } \ l o g _ { 1 0 } f\ s i m e qn \ e n d { e q u a t i o n } \ b e g i n { e q u a t i o n } f ( x ) \ s i m1 0 ^ { n } \ e n d { e q u a t i o n } A p p r o x i m a t ee q u a l i t y : \ b e g i n { e q u a t i o n } f ( x ) \ s i m e qg ( x ) \ e n d { e q u a t i o n } \ L a T e X \i ss i m p l ei fw ek e e pe v e r y t h i n gi np r o p o r t i o n : \ b e g i n { e q u a t i o n } f ( x )\ p r o p t ox ^ 3. \ e n d { e q u a t i o n } F i n a l l yw ec a ns k i ps o m es p a c eb yu s i n gc o m m a n d ss u c ha s \ b e g i n { v e r b a t i m } \ b i g s k i p \ m e d s k i p \ s m a l l s k i p \ v s p a c e { 1 p c } \ e n d { v e r b a t i m } T h es p a c ec a nb en e g a t i v e . \ s e c t i o n { \ c o l o r { r e d } U s eo fC o l o r } { \ c o l o r { b l u e } { W ec a nc h a n g ec o l o r sf o re m p h a s i s } } , { \ c o l o r { g r e e n } { b u t } }{ \ c o l o r { c y a n } { w h oi sg o i n gp a yf o rt h ei n k ? } } \ s e c t i o n { \ l a b e l { m o r e f i g } S u b f i g u r e s } A ss o o na sm a n ys t u d e n t ss t a r tb e c o m i n gc o m f o r t a b l eu s i n g\ L a T e X ,t h e yw a n t t ou s es o m eo fi t sa d v a n c e df e a t u r e s .S ow en o ws h o wh o wt op l a c et w o f i g u r e ss i d eb ys i d e . \ b e g i n { f i g u r e } [ h ! ] \ b e g i n { c e n t e r } \ s u b f i g u r e [ R e a la n di m a g i n a r y . ] { \ i n c l u d e g r a p h i c s [ s c a l e = 0 . 5 ] { f i g u r e s / r e i m } }


sip.clarku.edu/tutorials/TeX/intro.html 5/6

5/7/13

Sample LaTeX file

\ s u b f i g u r e [ A m p l i t u d ea n dp h a s e . ] { \ i n c l u d e g r a p h i c s [ s c a l e = 0 . 5 ] { f i g u r e s / p h a s e } } \ c a p t i o n { \ l a b e l { f i g : q m / c o m p l e x f u n c t i o n s }T w or e p r e s e n t a t i o n so fc o m p l e x w a v ef u n c t i o n s . } \ e n d { c e n t e r } \ e n d { f i g u r e } W ef i r s th a v et oi n c l u d et h en e c e s s a r yp a c k a g e , \ v e r b + \ u s e p a c k a g e { s u b f i g u r e } + ,w h i c hh a st og oi nt h ep r e a m b l e( b e f o r e \ v e r b + \ b e g i n { d o c u m e n t } + ) .I ts o m e t i m e sc a nb ed i f f i c u l tt op l a c eaf i g u r ei n t h ed e s i r e dp l a c e . Y o u rL a T e Xd o c u m e n tc a nb ee a s i l ym o d i f i e dt om a k eap o s t e ro ras c r e e n p r e s e n t a t i o ns i m i l a rt o( a n db e t t e rt h a n )P o w e r P o i n t .C o n v e r s i o nt oH T M Li s s t r a i g h t f o r w a r d .C o m m e n t so nt h i st u t o r i a la r ea p p r e c i a t e d . \ b e g i n { t h e b i b l i o g r a p h y } { 5 } \ b i b i t e m { l a t e x } H e l m u tK o p k aa n dP a t r i c kW .D a l y ,\ t e x t s l { AG u i d et o \ L a T e X :D o c u m e n tP r e p a r a t i o nf o rB e g i n n e r sa n dA d v a n c e dU s e r s } , f o u r t he d i t i o n ,A d d i s o n W e s l e y( 2 0 0 4 ) . \ b i b i t e m { w e b s i t e } S o m eu s e f u ll i n k sa r e g i v e na t\ u r l { } . \ e n d { t h e b i b l i o g r a p h y } { \ s m a l l\ n o i n d e n tU p d a t e d5D e c e m b e r2 0 0 6 . } \ e n d { d o c u m e n t } Updated 6 February 2006.

sip.clarku.edu/tutorials/TeX/intro.html

6/6

Das könnte Ihnen auch gefallen