Featured Post

We've moved to tex.my!

It’s been great writing on Blogger.com, but we’ve decided to move to a new platform, thanks to some valuable help from a great, great friend...

Saturday, April 10, 2010

Creating book cover with PSTricks


I don't know, maybe since was triggered by Lian's post, I decided to try creating my book cover as well. I always wanted to write some books since I think always need of extra money hehe. Note that the example above is using wallpapers from an open source project, while the following bird is from my own photo collections.




The following codes actually were modified from here [PDF] . At first I thought by modifying few stuffs I can straight away used to code.. but maybe because of different configuration that I have (I'm using Ubuntu 9.04 with the default TexLive).. I met several issues. I'm using pdflatex by the way.. perhaps that caused the problem.
\documentclass[12pt]{article}
% load the necessary packages
\usepackage[paperheight=9in,paperwidth=13.24in,margin=0in]{geometry}
\usepackage[dvipsnames,prologue,table]{pstricks}
\usepackage{pst-all}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{rotating}
\usepackage{color}
\usepackage[ISBN=978-80-85955-35-4]{ean13isbn}
%\EANisbn[SC4]
% begin the document and suppress page numbers
\begin{document}
\pagecolor{Maroon}
\pagestyle{empty}
% create the box with the front cover picture
\newsavebox\IBox
\sbox\IBox{\includegraphics[height=9in]{itik2.png}}
% set up the picture environment
\psset{unit=1in}
\begin{pspicture}(13.24in,9in)
% set up the fonts we use
\DeclareFixedFont{\PT}{T1}{ppl}{b}{it}{0.5in}
\DeclareFixedFont{\PTsmall}{T1}{ppl}{b}{it}{0.4in}
\DeclareFixedFont{\PTsmallest}{T1}{ppl}{b}{it}{0.3in}
\DeclareFixedFont{\PTtext}{T1}{ppl}{b}{it}{11pt}
\DeclareFixedFont{\Logo}{T1}{pbk}{m}{n}{0.3in}
% place the front cover picture
\rput[lb](7.24,0){\usebox\IBox}
% put the text on the front cover
\rput[lb](8,7){\PTsmall \color{white}{Anak Itik yang Sombong}}
\rput[lb](8.94,6.5){\PTsmallest \color{white}{Najmi Zabidi}}
\rput[lb](9.04,0.8){\PTsmallest \color{white}{Fesbuk Press}}
% put the text on the spine (note the rotation over 270 degrees)
%\rput[b](6.62,8,0.75){\PTsmallest \color{black}

\rput[b](6.62,3,0.75)
{
\begin{turn} {-90}
{
\PTsmallest \color{white}Anak Itik yang Sombong
}
\end{turn}
}

% put the publisher’s logo on the spine
\rput[b](6.62,0.75){\color{white}{\fbox{\Logo FP}}}
% Create a Box containing the text for the back cover
\newsavebox\Blurbbox
\sbox\Blurbbox{\begin{minipage}{4.5in}
\textcolor{white}{\lipsum[1]}
\end{minipage}}
% And position the box
\rput[tl](1,8){\usebox\Blurbbox}
% Then we close all open environments

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5

\newsavebox\Authorbox
\sbox\Authorbox{\includegraphics[width=.75in]{najmi-pass.png}}
%\psframe[fillstyle=solid,fillcolor=white](1,4)(1.7,4.95)
% now place the picture
\rput[lb](1.1,4.1){\usebox\Authorbox}
% create a savebx for the biography. The width has been adjusted so
% that the right margin matches with that of the book blurb
\newsavebox\Biobox
\sbox\Biobox{\begin{minipage}{3.6in}
\textcolor{white}{Najmi Zabidi is toying around with \LaTeX{}. Contact him
by at bla@bla.com}
\end{minipage}}
% and put it where it belongs
\rput[tl](1.9,4.95){\usebox\Biobox}

\rput(4.5,1.2){
\colorbox{white}{\EANisbn[SC1]}}

\rput[lb](1,1.2){\color{white}{\fbox{\Logo FP}{\PTsmallest { Fesbuk Press}}}}
\rput[lb](1,1){\PTtext \color{white}{Kuala Lumpur --- MY}}
\rput[lb](1,0.8){\PTtext \color{white}{http://www.latex-my.blogspot.com}}
\end{pspicture}

\end{document}


Thursday, March 25, 2010

Shameless Barcode Ads

\documentclass{article}

\usepackage{fancyhdr}
\usepackage{soul}
% Font für Code 39
\font\xlix=wlc39 scaled 1200
\newcommand{\barcode}[1]{{\xlix@#1@}}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}

\rhead{\begin{tabular}{ll|ll}
\multicolumn{2}{c|}{\barcode{0193870980}} & \multicolumn{2}{c}{\barcode{0361965666}} \\
\textsc{\textbf{\sc{{{\so{ Muhammad}}}}}} & \so{019$\;$3870980} & \textsc{\textbf{\sc{{{\so{Najmi}}}}}} &\so{03$\;$61965666}
\end{tabular}}

\begin{document}

\centering{\ul{Cheap}\so { \LaTeX{} trainer for hire, at risk}}\\
\centering{\texttt{\small{najmi.zabidi@gmail.com}}}
\end{document}



Code was modified from somebody else on the web, I don't remember the link. I invoke the soul package for space between characters.

Monday, March 22, 2010

LaTeX Documentation in Malay language

Hello,

I am gradually writing for a booklet for LaTeX in Malay language. If you also want to contribute, you're welcome. Lian and some other friends also had contributed on comments and others stuffs.

Feel free to download:

PDF

Note that I don't use version number for the PDF as of now, since I assume it's a BETA for every time I commit. But it's readable and hopefully beneficial.


Or, if you're cool enough, download the .tex files and the rest by yourselves and compile it. I have created a script called Make, just chmod +x and ./Make

hg clone https://latex-my-docs.googlecode.com/hg/ latex-my-docs

Thursday, March 18, 2010

Using the TeX FAQ

The (English language) TeX FAQ is a real treasure trove, maintained by the amazing Robin Fairbairns, who also co-maintains CTAN. (Yep, that repository of all contributed TeX & friends packages!!)

I would say 80% of the time, a LaTeX user can find a solution or pointers to a question in the FAQ, so the next time you're tempted to hack your own solution or is frustrated by all the old, obsolete advices churned up by Google, try searching in the TeX FAQ first.

In fact, you might even have a local copy on your LaTeX installation. Here's how to access them:
  • On TeXLive, run texdoc faq-en at the CLI.
  • On MiKTeX, run mthelp --view faq-en at a DOS prompt, or in the Windows Start → Run dialog.
Another alternative is via the Visual FAQ. Run texdoc visualfaq (or mthelp --view visualfaq). Browse through the PDF and click on an element which effect you're trying to replicate; you will be directed to the relevant entry in the online TeX FAQ.

Tuesday, March 9, 2010

Introductory Workshop to LaTeX at MMU Cyberjaya

I conducted an Introductory Workshop to LaTeX at MMU (Cyberjaya Campus) yesterday (8 March). If anyone's interested, the workshop materials (slides, worksheet, sample code, MiKTeX installation guide) are available here.

Saturday, March 6, 2010

Bibtex2html and Springerlink BibTeX converter

I found out these useful tools:

BibTeX2HTML : http://www.lri.fr/~filliatr/bibtex2html/doc/

Springerlink BibTeX converter; http://www.cs.usyd.edu.au/~niu/cgi-bin/springer.cgi

...and I wonder why on earth Springerlink did not put their BibTeX export format by default...? IEEE and ACM did that!

Tuesday, March 2, 2010

Latest version of geometry.sty breaks beamer

So if you updated all your packages in one go and finds that your beamer presentations don't compile anymore, this is why. Don't panic though (42), there's a workaround: put the following line before \documentclass{beamer}:

\makeatletter\let\ifGm@compatii\relax\makeatother
\documentclass{beamer}

Read this post for more information.