Category 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

 

New (RMarkdown) post from OS X 10.10 (Yosemite)

This is my first post on OSX 10.10 (nick name: Yosemite). Yep I always late…

As I did mostly, I blog using RMarkdown. It allows you to manipulate your source file in to a structured text and convert it to almost any formats: odt, docx, pdf, html, etc.

Basically you can make any docs containing:

  • outline
  • bullets and numbering
  • basics formatting:
    • make it bold = bold,
    • or italic = italic,
    • even make an superscript symbol = superscript and off course subscript subscript ,
    • strikethrough
    • write equations: $ Q = CA(dh/dl) $
    • insert a link: DasaptaErwinBlog
    • insert a figure: itb_logo
    • insert a quote or lines of code: quote from Einstein
    • insert a table:
Name Age (ya)
Rex 65,000,000
Mankind 100.000
me 39
wife 35
Radit 8
Bila 4
- make a chart out of it
Name <- c('Rex', 'Mankind', 'Me', 'Wife', 'Radit', 'Bila')
Age <- c(65, 0.1, 39, 35, 8, 4)
df <- data.frame(Name, Age)
plot(df, main="Age comparison", xlab="Species", ylab="Age (mya)")

Rplot01
  • and a whole lot more

Another good thing is you can built the entire doc in plain text (ASCII). So it’s:

  • light weight: in kb
  • connected to any word-processor:
    • Libreoffice
    • MS office
  • or text-editor:
    • notepad
    • wordpad
  • virus-free

//

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