Template Latex: Buku

28
Template L A T E X Bahasa Indonesia Hayi Nukman cb

description

Preview Template Latex Buku. File source Latexnya dapat di download di: http://www.mediafire.com/?whzovex4kbopemq

Transcript of Template Latex: Buku

Page 1: Template Latex: Buku

Template LATEXBahasaIndonesia

Hayi Nukman

cb

Page 2: Template Latex: Buku

Kata Pengantar

Ini adalah template yang saya buat dari dari kumpulan beber-apa template yang saya dapatkan di internet. Untuk beberapakonfigurasi seperti Style Section yang diberi kotak sumbernyasaya sudah lupa (soalnya sudah lama) sehingga mohon ma’afjika sumbernya tidak saya sertakan.Dokumen ini dikompilasi dengan XeLatex atau Texlive, denganmenggunakan Editor Gummi untuk mempermudah saya dalammenanggulangi error dalam penulisan syntax LATEX. Bagi yangberminat untuk mengembangkan lebih lanjut, atau membuattemplate versinya sendiri, silahkan saja didownload dan digu-nakan. Dokumen ini berlisesi CC-BY, dimana anda bebas untukmengcopy, mengembangkan dan mendistribusikannya baik se-cara komersial maupun tidak.

i

Page 3: Template Latex: Buku

Daftar Isi

I Mengenal LATEX 1

1 Programming 21.1 Gambar dalam LATEX . . . . . . . . . . . . . . . . . . . 21.2 Sourcecode . . . . . . . . . . . . . . . . . . . . . . . 3

1.2.1 Verbatim Environment . . . . . . . . . . . . . 31.2.2 Listing Environment . . . . . . . . . . . . . . . 31.2.3 Verbatim full Color . . . . . . . . . . . . . . . . 4

1.3 Algoritma dan Pseudocode . . . . . . . . . . . . . . . 41.3.1 If - Else . . . . . . . . . . . . . . . . . . . . . . 41.3.2 For loop . . . . . . . . . . . . . . . . . . . . . . 51.3.3 While Loop . . . . . . . . . . . . . . . . . . . . 51.3.4 Return Variable . . . . . . . . . . . . . . . . . 51.3.5 Blok Algoritma . . . . . . . . . . . . . . . . . . 51.3.6 INFO . . . . . . . . . . . . . . . . . . . . . . . 6

II Scientific 8

2 Grafik 92.1 Grafik dengan TikZ . . . . . . . . . . . . . . . . . . . 9

2.1.1 Grafik Sederhana . . . . . . . . . . . . . . . . 9

ii

Page 4: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

2.1.2 Grafik 3 Dimensi . . . . . . . . . . . . . . . . . 102.1.3 Beberapa Contoh lainnya . . . . . . . . . . . . 112.1.4 Info detail . . . . . . . . . . . . . . . . . . . . 13

2.2 Grafik dengan Paket XY . . . . . . . . . . . . . . . . 132.2.1 Contoh 1 . . . . . . . . . . . . . . . . . . . . . 132.2.2 Contoh 2 . . . . . . . . . . . . . . . . . . . . . 132.2.3 Contoh 3 . . . . . . . . . . . . . . . . . . . . . 142.2.4 Info . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Matematika 153.1 Matematika . . . . . . . . . . . . . . . . . . . . . . . 15

3.1.1 Equation . . . . . . . . . . . . . . . . . . . . . 153.1.2 Akar . . . . . . . . . . . . . . . . . . . . . . . . 153.1.3 SUM . . . . . . . . . . . . . . . . . . . . . . . . 163.1.4 Integral . . . . . . . . . . . . . . . . . . . . . . 163.1.5 Fungsi . . . . . . . . . . . . . . . . . . . . . . . 16

3.2 Penggunaan lebih lanjut di Matematika . . . . . . . 173.2.1 Beberapa Contoh . . . . . . . . . . . . . . . . 17

4 Kimia 194.1 Grafik Kimia . . . . . . . . . . . . . . . . . . . . . . . 194.2 ION . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Lampiran 22

A Contoh Lampiran 22A.1 Konversi byte Array ke Bitmap . . . . . . . . . . . . 22

iii

Page 5: Template Latex: Buku

BAGIAN I

Mengenal LATEX

1

Page 6: Template Latex: Buku

BAB

1

Programming

1.1 Gambar dalam LATEX

Gambar 1.1: Contoh Gambar

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pu-rus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Cur-abitur dictum gravida mauris. Nam arcu libero, nonummy eget,consectetuer id, vulputate a, magna. Donec vehicula augue euneque. Pellentesque habitant morbi tristique senectus et netus etmalesuada fames ac turpis egestas. Mauris ut leo. Cras viverrametus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultri-ces. Phasellus eu tellus sit amet tortor gravida placerat. Integersapien est, iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. Aenean faucibus. Morbi do-lor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabiturauctor semper nulla. Donec varius orci eget risus. Duis nibh mi,congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orcisit amet orci dignissim rutrum.

2

Page 7: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

1.2 Sourcecode

1.2.1 Verbatim Environment

13 <RadioGroup14 android:id=”@+id/radioGroup1”15 android:layout_width=”match_parent”16 android:layout_height=”wrap_content” >17

1.2.2 Listing Environment�1 package lab.andro.tes;2

3 public class Sample {4 private String sample;5

6 public Sample(String sample) {7 this.sample = sample;8 }9 public String getSample() {10 return sample;11 }12 }� �

Sample

1.2.3 Verbatim full Color

1 <TextView2 android:id=”@+id/textView1”3 android:layout_width=”wrap_content”4 android:layout_height=”wrap_content”5 android:text=”Nilai” />6 <RadioGroup7 android:id=”@+id/radioGroup1”

3

Page 8: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

8 android:layout_width=”match_parent”9 android:layout_height=”wrap_content” >

Untuk ketiga bagian di atas, slihakan baca source latex dari doku-men ini.

1.3 Algoritma dan Pseudocode

1.3.1 If - Else

if i ≥ maxval theni← 0

elseif i+ k ≤ maxval then

i← i+ kend if

end if

1 \begin{algorithmic}2 \If {$i\geq maxval$}3 \State $i\gets 0$4 \Else5 \If {$i+k\leq maxval$}6 \State $i\gets i+k$7 \EndIf8 \EndIf9 \end{algorithmic}

1.3.2 For loop

for i = 1→ 10 doi← i+ 1

end for

1 \begin{algorithmic}2 \For{$i = 1 \to 10$}3 \State $i \gets i + 1$4 \EndFor5 \end{algorithmic}

4

Page 9: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

1.3.3 While Loop

while i ≤ 10 doi=i+1;

end while

1 \begin{algorithmic}2 \While{$i \leq 10$}3 \State i=i+1;4 \EndWhile5 \end{algorithmic}

1.3.4 Return Variable

function Increment(a)a← a+ 1return a

end function

1 \begin{algorithmic}2 \Function{Increment}{$a$}3 \State $a \gets a+1$4 \State \Return $a$5 \EndFunction6 \end{algorithmic}

1.3.5 Blok Algoritma

StartStartStart One(x)EndingStart Unknown(0)Until (True)

EndStartEnd

End

1 \algblock[Name]{Start}{End}2 \algblockdefx[NAME]{START}{END}%

5

Page 10: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

3 [2][Unknown]{Start #1(#2)}%4 {Ending}5 \algblockdefx[NAME]{}{OTHEREND}%6 [1]{Until (#1)}7 \begin{algorithmic}8 \Start9 \Start10 \START[One]{x}11 \END12 \START{0}13 \OTHEREND{\texttt{True}}14 \End15 \Start16 \End17 \End18 \end{algorithmic}

1.3.6 INFO

Untuk Algoritma dan Pseudocode, dapat andabaca detailnya beserta contoh-contohnya di:http://en.wikibooks.org/wiki/LaTeX/Algorithms_and_Pseudocode

6

Page 11: Template Latex: Buku

Halaman Kosong

Page 12: Template Latex: Buku

BAGIAN II

Scientific

8

Page 13: Template Latex: Buku

BAB

2

Grafik

2.1 Grafik dengan TikZ

2.1.1 Grafik Sederhana

..

6

.

4

.

5

.

1

.

2

.

3

1 \begin{tikzpicture}2 [scale=.8,auto=left,every node/.style={circle,fill=blue!20}]3 \node (n6) at (1,10) {6};4 \node (n4) at (4,8) {4};5 \node (n5) at (8,9) {5};6 \node (n1) at (11,8) {1};7 \node (n2) at (9,6) {2};8 \node (n3) at (5,5) {3};9

10 \foreach \from/\to in {n6/n4,n4/n5,n5/n1,n1/n2,n2/n5,n2/n3,n3/n4}

9

Page 14: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

11 \draw (\from) -- (\to);12

13 \end{tikzpicture}

2.1.2 Grafik 3 Dimensi

.

.

.

.

.

.

..

.

.

.

.

.

.

.

1 \usetikzlibrary{calc,3d}2 \newcommand{\setxyz}[1]{%3 \pgfmathsetmacro{\xone}{cos(180+#1)}%4 \pgfmathsetmacro{\yone}{sin(180+#1)}%5 \pgfmathsetmacro{\xtwo}{cos(360-#1)}%6 \pgfmathsetmacro{\ytwo}{sin(360-#1)}%7 }8 \setxyz{17}9 \begin{tikzpicture}%10 [x = {(\xone cm,\yone cm)},11 y = {(\xtwo cm,\ytwo cm)},12 z = {(0cm,1cm)}]

10

Page 15: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

13 \GraphInit[vstyle=Shade]14 \SetVertexNoLabel15 \begin{scope}[canvas is xy plane at z=-5]16 \Vertex{x}17 \end{scope}18 \begin{scope}[canvas is xy plane at z=0]19 \grEmptyCycle[prefix=a]{5}20 \end{scope}21 \EdgeFromOneToAll{x}{a}{}{5}22 \Edges(a0,a1,a2,a3,a4,a0)23 \begin{scope}[canvas is xy plane at z=5]24 \Vertex{y}25 \end{scope}26 \EdgeFromOneToAll{y}{a}{}{5}27 \end{tikzpicture}

2.1.3 Beberapa Contoh lainnya

. ..

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

1 \begin{tikzpicture}2 \usepgflibrary{arrows}3 \GraphInit[vstyle=Art]4 \SetUpEdge[style={->,>=angle 45,bend right=10},color=blue]5 \grCirculant[RA=3]{9}{1,-2,3,-4}6 \end{tikzpicture}

11

Page 16: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

.

1 \begin{tikzpicture}2 \draw (-1,0) to[bend left] (1,0);3 \draw (-1.2,.1) to[bend right] (1.2,.1);4 \draw[rotate=0] (0,0) ellipse (100pt and 50pt);5 \end{tikzpicture}

..sinα

.cosα

.−1

.−1

2

.1

.

−1

.

−12

.

12

.

1

1 \begin{tikzpicture}[scale=3]2 \draw[step=.5cm, gray, very thin] (-1.2,-1.2)3 grid (1.2,1.2);4 \filldraw[fill=green!20,draw=green!50!black]5 (0,0) -- (3mm,0mm) arc (0:30:3mm) -- cycle;6 \draw[->] (-1.25,0) -- (1.25,0) coordinate (x axis);7 \draw[->] (0,-1.25) -- (0,1.25) coordinate (y axis);8 \draw (0,0) circle (1cm);9 \draw[very thick,red] (30:1cm) -- node[left,fill=white]10 {$\sin \alpha$} (30:1cm |- x axis);11 \draw[very thick,blue] (30:1cm |- x axis) -- node

12

Page 17: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

12 [below=2pt,fill=white] {$\cos \alpha$} (0,0);13 \draw (0,0) -- (30:1cm);14 \foreach \x/\xtext in {-1, -0.5/-\frac{1}{2}, 1}15 \draw (\x cm,1pt) -- (\x cm,-1pt) node16 [anchor=north,fill=white] {$\xtext$};17 \foreach \y/\ytext in {-1, -0.5/-\frac{1}{2},18 0.5/\frac{1}{2}, 1}19 \draw (1pt,\y cm) -- (-1pt,\y cm) node20 [anchor=east,fill=white] {$\ytext$};21 \end{tikzpicture}

2.1.4 Info detail

Info lebih lengkap untuk Grafik menggunakan TikZ ini silahkanakses: http://graphtheoryinlatex.blogspot.com

2.2 Grafik dengan Paket XY

2.2.1 Contoh 1

A // B

��D

OO

Coo

1 \begin{displaymath}2 \xymatrix{ A \ar[r] & B \ar[d] \\3 D \ar[u] & C \ar[l] }4 \end{displaymath}

2.2.2 Contoh 2

A

�� ��@@@

@@@@

@

''PPPPP

PPPPPP

PPPP

B C D

13

Page 18: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

1 \begin{displaymath}2 \xymatrix{3 A \ar[d] \ar[dr] \ar[drr] & & \\4 B & C & D }5 \end{displaymath}6

2.2.3 Contoh 3

A f //

g��

B

g′

��D f ′ // C

1 \begin{displaymath}2 \xymatrix{3 A \ar[r]|f \ar[d]|g & B \ar[d]|{g’} \\4 D \ar[r]|{f’} & C }5 \end{displaymath}

2.2.4 Info

Lebih detail bagaimana cara menggunakan serta contoh-contohlainnya dapat dilihat di: http://en.wikibooks.org/wiki/LaTeX/Xy-pic

14

Page 19: Template Latex: Buku

BAB

3

Matematika

3.1 Matematika

3.1.1 Equation

x = a0 +1

a1 +1

a2 +1

a3 + a4

(3.1)

1 \begin{equation}2 x = a_0 + \cfrac{1}{a_13 + \cfrac{1}{a_24 + \cfrac{1}{a_3 + a_4}}}5 \end{equation}

3.1.2 Akar √a

b

1 \[2 \sqrt{\frac{a}{b}}3 \]

15

Page 20: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

Atau

n√1 + x+ x2 + x3 + . . .

1 \[2 \sqrt[n]{1+x+x^2+x^3+\ldots}3 \]

3.1.3 SUM10∑i=1

t2i

1 \[2 \sum_{i=1}^{10} t_i ^23 \]

3.1.4 Integral ∫ ∞

0

e−x dx

1 \[2 \int_0^\infty e^{-x}\,\mathrm{d}x3 \]

3.1.5 Fungsi

f(n) =

{n/2 if n is even−(n+ 1)/2 if n is odd

1 \[2 f(n) = \left\{3 \begin{array}{l l}4 n/2 & \quad \text{if $n$ is even}\\5 -(n+1)/2 & \quad \text{if $n$ is odd}\\6 \end{array} \right.7 \]

16

Page 21: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

Serta masih banyak lagi yang lainnya. Detail lengkap silahkanbuka http://en.wikibooks.org/wiki/LaTeX/Mathematics.

3.2 Penggunaan lebih lanjut diMatematika

3.2.1 Beberapa Contoh

Diambil dari: http://en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics

limx→0

ex − 1

2x

[ 00 ]=Hlimx→0

ex

2=

1

2

1 \[2 \lim_{x\to 0}{\frac{e^x-1}{2x}}3 \overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}}4 \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}}5 \]

z =

complex number︷ ︸︸ ︷x︸︷︷︸real

+ iy︸︷︷︸imaginary

1 \[2 z = \overbrace{3 \underbrace{x}_\text{real} +4 \underbrace{iy}_\text{imaginary}5 }^\text{complex number}6 \]

z =

complex number

xreal

+ iy

imaginary

1 \[2 z = \overbracket[3pt]{

17

Page 22: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

3 \underbracket{x}_{\text{real}} +4 \underbracket[0.5pt][7pt]{iy}_{\text{imaginary}}5 }^{\text{complex number}}6 \]

Athis way←−−−−− B −−−−−−−→

or that wayC

1 \[2 A \xleftarrow{\text{this way}} B3 \xrightarrow[\text{or that way}]{} C4 \]

Serta masih banyak lagi yang lainnya.

18

Page 23: Template Latex: Buku

BAB

4

Kimia

4.1 Grafik Kimia

...A..B

.. C..

D

..

E

..

F

1 \chemfig{A*6(-B-C-D-E-F-)}

.........................

1 \chemfig{*6(=-=-=-)}

4.2 ION

.......

O−

..

O

....

19

Page 24: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

1 \chemfig{-(-[1]O^{-})=[7]O}

..... ⊕N..

O

......

O⊖

1 \chemfig{-\chemabove{N}{\scriptstyle\oplus}2 (=[1]O)-[7]O^{\ominus}}

20

Page 25: Template Latex: Buku

Lampiran

21

Page 26: Template Latex: Buku

Lampiran

A

Contoh Lampiran

A.1 Konversi byte Array ke Bitmap

Source:[2]�1 byte[] albumArt = mediaRetriever.getEmbeddedPicture();2 if (albumArt != null) {3 Bitmap artwork = BitmapFactory.decodeByteArray(

albumArt, 0,4 albumArt.length);5 imageView.setImageBitmap(artwork);6 }� �

Konversi byte Array ke Bitmap

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pu-rus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Cur-abitur dictum gravida mauris. Nam arcu libero, nonummy eget,consectetuer id, vulputate a, magna. Donec vehicula augue euneque. Pellentesque habitant morbi tristique senectus et netus etmalesuada fames ac turpis egestas. Mauris ut leo. Cras viverrametus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultri-ces. Phasellus eu tellus sit amet tortor gravida placerat. Integersapien est, iaculis in, pretium quis, viverra ac, nunc. Praesenteget sem vel leo ultrices bibendum. Aenean faucibus. Morbi do-lor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabiturauctor semper nulla. Donec varius orci eget risus. Duis nibh mi,congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci

22

Page 27: Template Latex: Buku

Hayi Nukman (2012), LATEXTemplate

sit amet orci dignissim rutrum.Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi.Morbi auctor lorem non justo. Nam lacus libero, pretium at, lobor-tis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsanbibendum, erat ligula aliquet magna, vitae ornare odio metus ami. Morbi ac orci et nisl hendrerit mollis. Suspendisse ut massa.Cras nec ante. Pellentesque a nulla. Cum sociis natoque pe-natibus et magnis dis parturient montes, nascetur ridiculus mus.Aliquam tincidunt urna. Nulla ullamcorper vestibulum turpis. Pel-lentesque cursus luctus mauris.

23

Page 28: Template Latex: Buku

Bibliography

[1] Wikibook LATEXhttp://en.wikibooks.org/wiki/LaTeX

[2] byte[] to Image Androidhttp://stackoverflow.com/questions/2714700/byte-to-image-android

[3] Graph Theory in LaTeXhttp://graphtheoryinlatex.blogspot.com/

24