Tag Archives: Latex

Who needs Ms Word anyway …

Kita sudah terlalu lama dikendalikan oleh format binary yang dikuasai oleh Microsoft. Akibatnya sering terjadi masalah ketidakcocokan versi dokumen dengan versi MsW nya. Biasanya file yang dibuat dengan versi MsW lebih lama akan tidak 100% kompatibel dengan MsW versi baru. Jalan keluarnya kita diminta menyimpan file dengan format “doc” yang berlaku umum untuk semua versi MsW.
 
Bagus … memang. Tapi akibatnya: file ukurannya jadi membesar tidak karuan dan beberapa fungsi masih juga tidak kompatibel.
 
Karena itu, selain karena banyak alasan lainnya, orang matematika akan akrab dengan LaTeX. Ini adalah file berjenis teks yang isinya adalah karya tulis kita dilengkapi beberapa simbol yang hanya dimengerti oleh mesin _typesetter_ LaTeX. Mesin ini harus diinstalasi secara terpisah. Dengan perintah-perintah itu mesin LaTeX mencetak dokumen menjadi file pdf yang cantik.
Karena itu, John Gruber seorang programmer mengembangkan markup language “Markdown”. Ia menyederhanakan berbagai perintah LaTeX agar dapat lebih mudah dipahami pemakai yang bukan programmer dan bukan ahli matematika.
Format inilah yang sedang saya pakai untuk mengerjakan PR Bab 1 dari Prana Ugi, dosen statistika muda dari USU dan sekaligus pengguna R.
multiMarkdown

 

Example of LaTeX presentation

rocket

(image from: www.imdb.com)

This post is actually a short tutorial on how to make a simple geoscience presentation. I made it for my undergraduate and master students. I posted the pdf at onlinewaterbook.wordpress.com.

The following is the LaTeX code of the slides. I am borrowing the template from Sascha Frank from University Freiburg.


% % % acknowledgement
% This text is proprietary.
% It's a part of presentation made by myself.
% It may not used commercial.
% The noncommercial use such as private and study is free
% Sep. 2005
% Author: Sascha Frank
% University Freiburg
% www.informatik.uni-freiburg.de/~frank/
% % %

documentclass{beamer}
% % % setting the footer
setbeamertemplate{footline}[text line]{%
parbox{linewidth}{vspace*{-6pt}made with: LaTeX hfillinsertshortauthorhfillinsertpagenumber}}
setbeamertemplate{navigation symbols}{}
% % % setting the TOC
setbeamertemplate{part in toc}[parts numbered]
setbeamertemplate{section in toc}[sections numbered]
setbeamertemplate{subsection in toc}[subsections numbered]
% % % setting the packages
usepackage{graphicx}
usepackage{multimedia}
usepackage{enumerate}
usepackage{hyperref}
% ——————————

begin{document}

title{Presentasi – Bagian 1}
author{Dasapta Erwin Irawan}
date{today}

frame{titlepage}

frame[allowframebreaks]{frametitle{Outline}tableofcontents[part=1]}

part{Persiapan}
section{Pemilihan topik: protecttextit{geoscience} is for everyone}

frame{frametitle{Hadirin pertama lihat topik, bukan anda}
begin{itemize}
item Pilih topik yang sesuai dengan hadirin
item Topik sederhana (ini yang dicari)
item Topik rumit tapi penyampaian harus:
begin{itemize}
item sederhana
item mudah dicerna
end{itemize}
end{itemize}
}

section{Materi: protecttextit{building your protectunderline{so called} ppt slides}}

frame{frametitle{Perkakas yang anda perlukan-1}
begin{itemize}
item Kertas bekas
begin{itemize}
item Mengapa perlu kertas? Agar anda bisa membuat sketsa textit{outline} presentasi anda.
item Mengapa harus bekas? Ingat lingkungan dan pepohonan yang harus ditebang agar anda bisa presentasi (yang belum tentu) berguna untuk banyak orang. textit{Sorry can’t help to throw a joke}.
end{itemize}
end{itemize}
}

frame{frametitle{Perkakas yang anda perlukan-2}
begin{itemize}
item Referensi, data, grafik, tabel. Jangan mulai sebelum komponen utama selesai dibuat
item Piranti lunak: LibreOffice, Keynote, Tex Studio (textit{I used this one}), and or ppt
item No dua textbf{tidak mutlak}. I’ve seen a mathematician presented his (only) one piece of A3 paper, with only an equation on it.
end{itemize}
}

frame{frametitle{Beberapa hal yang harus jelas sejak awal}
begin{itemize}
item Tujuan dan pesan kunci
item Outline (buat sketsa bila perlu)
item Cek logika outline
item Cek kelengkapan materi:
begin{itemize}
item Data
item Analisis
item Kesimpulan
item Hal-hal baru dan batasan yang ada
end{itemize}
end{itemize}
}

subsection{Slide latar belakang: protecttextit{background is the key}}%add “protect” if you need to use bolds, italics in sections

frame{frametitle{Slide-slide awal: kunci presentasi}
begin{itemize}
item Tarik perhatian hadirin
begin{itemize}
item Humor ringan yang relevan
item Gambar lucu yang relevan
item Sedikit menceritakan diri anda (bukan hal yang salah)
end{itemize}
item Latar belakang. Hadirin akan lebih tertarik kepada:
begin{itemize}
item Alasan anda memilih topik
item Kondisi yang saat ini sedang terjadi
item Masalah (genting) yang harus diselesaikan
end{itemize}
end{itemize}
}

subsection{Slide kajian literatur: protecttextit{the usual boring part}}%won’t compile if you delete the “protect”
frame{frametitle{textbf{Slide kajian literatur}: buat seperti dongeng}
begin{itemize}
item Bagian ini paling membosankan
item Ibaratkan anda seperti mendongeng
item Buat diagram kronologis siapa saja yang sudah pernah meneliti topik ini
item Buat ringkasan hal apa saja yang sudah diketahui dan yang belum diketahui
end{itemize}
}

subsection{Slide metodologi: protecttextit{even more boring part}}%won’t compile if you delete the “protect”
frame{frametitle{textbf{Slide metodologi}: riset harus bisa diulang}
begin{itemize}
item Harus jelas agar bisa diulang (textit{reproducible})
item Ibaratkan anda akan meminta seseorang untuk mengulang metode anda
item Tambahkan diagram alir untuk memperjelas
end{itemize}
}

subsection{Slide data: protecttextit{where audience start to look at their phone}}%won’t compile if you delete the “protect”
frame{frametitle{textbf{Slide data}: jelas tapi tidak rumit}
begin{itemize}
item Setiap textit{item} data yang anda ambil harus dijelaskan
item Jelaskan dengan cara meringkas
item Buat data tree agar lebih jelas
item Tambahkan grafik (textit{boxplot}, histogram) untuk memperjelas
end{itemize}
}

subsection{Slide analisis: protecttextit{maybe they go out for a coffee}}%won’t compile if you delete the “protect”
frame{frametitle{textbf{Slide analisis}: textit{it’s not a rocket science}}
begin{itemize}
item Jelaskan tiap textit{item} analisis dengan cara sederhana
item Yakinkan hadirin bahwa ini bukan textit{rocket science}
item Pilih hasil yang relevan untuk diketahui hadirin
item Tambahkan grafik, skema untuk memperjelas
end{itemize}
}

subsection{Slide kesimpulan: protecttextit{and they’re back with coffee in their hands}} %won’t compile if you delete the “protect”
frame{frametitle{textbf{Slide kesimpulan}: jangan berlebihan}
begin{itemize}
item Cek kembali tiap kesimpulan, bandingkan dengan data
item Jangan membuat kesimpulan tanpa analisis yang cukup
item Jangan membuat kesimpulan tanpa analisis yang terkait
item Apalagi tanpa analisis sama sekali
end{itemize}
}

frame{frametitle{textbf{Bersambung}}
begin{itemize}
item Bersambung ke bagian 2 — Eksekusi
item Bersambung ke bagian 3 — Kesalahan Umum
item Bersambung ke bagian 4 — Tips dan trik
end{itemize}
}

part{Eksekusi}

part{Kesalahan umum}

part{Tips dan trik}

end{document}

 

How to build a geoscience presentation (part 1)

rocket

 

(image from: www.imdb.com)

Geoscience has been placed as a rocket science, due to its complexity. The audience is considered to be very specific.

I mad these slides for my undergrad (and also my master students) in Bahasa Indonesia. It contains a few notes on how to make a worthy geoscience presentation.

I made it with LaTeX by the way. You can find the source code at: derwinirawan.wordpress.com

presentasi-part-1

Minimal LaTeX Packages

From: CTAN.org

(image from: CTAN.org)

Dear friends,

I’ve been using LaTeX (with TeX Studio) for about two years now. I use it mostly for long-formatted document. And by long, I mean more than five pages with several headings and subheadings. More light editing or letter, I use LibreOffice. As a typesetter (not a word processor), most begineer will bump into what package to use, or not to use, or a case of redundant packages.

So here I share what minimal packages that I used daily:

documentclass[a4paper]{scrartcl}
usepackage[ascii]{inputenc} % keyboard encoding tool
usepackage[T1]{fontenc} % keyboard encoding tool
usepackage[english]{babel} % language setting tool
usepackage{amsmath,amssymb,amsfonts,textcomp} % math font type tools
usepackage{color} % font color tool
usepackage{array,hhline} % tabular tool
usepackage{hyperref} % hyperlink tool
usepackage{graphicx} % figure insertion tool
usepackage[authoryear]{natbib} % bibliography tool

One can always search for another similar packages, other than the ones that listed above, but bare in mind that there are probably thousands of packages. So you might want to do a little research on a package before decide to use it.

Other applications a used in my writing are:

  • Zotero as reference manager. We have to convert the database to bibtex format, but it has an extension to work with LibreOffice or Microsoft Office.
  • Evernote as web clipper
  • MoU (on Mac) or Re-Text (on Ubuntu) for Markdown editor

Try LaTeX and leave “point and click” for a while. You might like it.

Wrong image gives you LaTeX error

texstudio

False image format can cause premature end{document} in LaTeX

Dear friends,

I posted my problems on Microsoft Powerpoint (ppt) yesterday, at my wp blog. Binaries just give you more than just a bunch of 0 and 1. Versioning problem was just one of them. Newer version creates file that older version can’t open. Or perhaps older version has more features but then got removed in the newer version.

That’s why I try to move slowly to text file or ASCII (http://www.computerhope.com/jargon/t/textfile.htm). Being formerly a binary guy, syntax error warnings give me cramps.

And this was another LaTeX adventure. This morning I managed to solve a weird problem with my LaTeX codes. It kept showing the following warnings (I used TeX Studio by the way):

  • no bibdata ... and
  • no bibstyle ...

The main TeX file seemingly couldn’t fine the bib file. Both text (or ASCII) files are two of main files in Latex typesetting. The Tex file stores the body text and commands, while the bib file stores the reference information in Bibtex format.

So as I took myself in pages of Stack Exchange discussions, most of the answers direct me to:

  1. check the bibtex format for missing , or missing {}.
  2. missing file in the latex distribution due to installation or upgrade failure.
  3. premature end{document} command. They argue the mis-placement of such command could also make Latex ignore the bibliography{} and bibliographystyle{} commands that usually placed at the end of the main text.

All of them was checked, and double checked, and yet, both warnings still popped.

Then I went sleep mode on it.

The next morning I tried the other way around. I checked the main tex file line by line from preamble section down to the bibliography section. So I made a new Tex file and then copy-paste each section and subsection from the existing tex file.

The preamble part was safe. It looked like this.


documentclass[english]{article}
usepackage[T1]{fontenc}
usepackage[latin9]{inputenc}
usepackage{setspace}
usepackage{graphicx}
usepackage{natbib}
usepackage{booktabs}
usepackage{url}
onehalfspacing
usepackage{babel}

And at the end of my file, I placed the following commands.

bibliographystyle{plainnat} %because I used natbib pkg
bibliography{foo}
end{document}

Then I checked the sections and subsections. All were ok, until I stumbled upon this lines.

begin{figure}
    includegraphics{abc.jpg}
    caption{abc is not def or even xyz}
    label{fig:abc}
end{figure}

They were basic commands to insert figure in Latex. If I deleted the lines, the compiling went smooth. But it was the other way around when I ran the lines.

Then I changed the jpg file with another file. Strangely it went OK. So I checked the image to see what was wrong with it.

It turned out that my jpg image was actually a gif image. Although both formats are classified as raster formats, but they are not completely twin brothers (or sisters). Hence I rename it.

And what do you know. The one line that all Latex users are looking for out of the compilation process.

process exited normally

[TeX] First TeX documents

latex-logo

After a long winding road working my first hydrological codes (following the Hydromad Tutorial by Felix Andrews, getting to know R environment in Willem Vervoort’s class, installing TeX, trying TeX, composing an R report using TeX via Sweave. Now here’s my first TeX document. However, I am still can not embed the picture in it. It’s still in my to do list :-).
hydromadsweave

PS: oh by the way, I am posting using Markdown syntax 🙂