November 23, 2008 at 11:50 am · Filed under latex
Latex provides great tools for designing your documents. If you are writing a book, an article or a manual with code snippets, figures, and tables and you’d like to count and number them you can do it fairly easily.
First you can use built in listing tools like \equation \figure \table and so on. But let’s say you want to distinguish between Figures which are illustrations and Pictures which are real world picture, or lets say you want to number out code snippet in your document, or number out examples of solutions to exercises.
For this purpose comes the real power of Latex, custom commands. Here I’ll briefly show you how to create a custom command to count examples in your text book.
In the permeable of the document we’ll add a new counter, and add +1 to it, since Latex by default, starts counting from 0.
\newcounter{example}
\addtocounter{example}{1}
Now we have a new counter which can be accessed in the document with the call \arabic{example} or with the call \theexample. But that’s really something easy. Let’s say I want the numbering scheme to be: X.Y like before, X is the chapter and Y the example. For this will have to create a new command in the permeable of the document. Here is how it is easily done:
\newcommand{<\thenameofyournewcommand>}[<Number of variables the command takes>]{<a set of latex command to be executed in your new command>}
So we see a custom command is a little Macro or Latex script if you want to think about it like that.
Read the rest of this entry »
November 16, 2008 at 11:09 pm · Filed under Linux, latex
I found my self looking for a solution how to make a custom list in latex. I found many solutions, but I didn’t really find what I wanted: custom lists which are chapter aware. Let me explain better what I mean. Let’s say you write a book and at the end of each chapter you want to give questions, which are numbered x.y, where x is the number of chapter, and y is the number of question.
Here is how to do it:
\documentclass[12]{book}
\newcounter{question}
\begin{document}
\chapter{beginning}
\section{hello}
hello world
\begin{list}{Question \arabic{chapter}.\arabic{question}}{\usecounter{question}}
\item one
\item two
\item three
\end{list}
\chapter{More into your book}
\section{hello}
hello world
\begin{list}{Exercise \arabic{chapter}.\arabic{question}}{\usecounter{question}}
\item one
\item two
\item three
\end{list}
This will result in out put of two chapters, having in the end of each chapter list of questions numbered 1.1, 1.2, 1.3 and 2.1, 2.2, 2.3.
Further customization can be done with more complex numbering such as:
\begin{list}{Exercise \arabic{chapter}.\arabic{section}
.\arabic{question}}{\usecounter{question}}
which will yield numbering like 1.1.2 and so on.
That’s it. A quick one this time…
P.S more on lists can be found here.
October 27, 2008 at 2:15 pm · Filed under Debian, science
In this post I will document my playing arround with mapserver. I’ll do my best to update this as best I can, but consider this as on ‘under construction status’…
Debian Lenny comes with version 5 of mapserver, so in order to install it you just need to type in the terminal as root:
apt-get install cgi-mapserver mapserver-bin mapserver-doc php-mapscript python-mapscript.
If you don’t have apache2 running and configured than you should also install apache2.
In debian cgi-scripts are install by default to /usr/lib/cgi-bin but are linked to /cgi-bin in the default install of apache2 in debian.
Read the rest of this entry »
October 27, 2008 at 1:04 am · Filed under Debian, Linux
I sometimes wonder how come most of the computer users around the world live in democracy, yet when it comes to who governs their data and privacy they like living in dictatorship.
Most users cling to their silly microsoft computers. They will buy Vista even though they heard it’s bad. A few of my friends really despise Vista, but they won’t even consider an alternative. Why ? Because Microsoft is the king. For them a computer is Microsoft. And they wait for the king to release a better service pack or what ever. Read the rest of this entry »
October 13, 2008 at 6:53 pm · Filed under Debian
Personally I don’t really favor the K Desktop Environment, but I do happen to use a lot of the application it provides. I actually did decide to give a try to the new KDE, in Debian, version 4.
So I added the repositories of the Debian KDE team, and install was a breeze. The first thing I wanted to check if rumors are true: that KDE4 is lighter. So I switch the default Log-in manager to KDM, and restarted the computer.
Here are my first observations regarding memory usage of KDE4: Read the rest of this entry »
October 9, 2008 at 10:23 am · Filed under Debian, Linux
In the previous part of this long inventory post, I’ve finished with Debian Etch. After a year and a half of distro hoping, I’ve decided that I’m experienced enough to try the new Debian Etch. I’ve already had an experience with the Ubuntu alternate installer, and I knew more or less what I was doing.
But back then, if you read something about Debian, the constant theme was that Debian is hard and only for advanced users. But hey, there’s Etch. It had a new shiny fancy graphical installer. So I downloaded the CD, burned it and started the install.
Being young and sometimes impatient I started the install with out reading the help options. Read the rest of this entry »
Next entries »