## Wednesday, February 26, 2014

### Compare PDFs

Sometimes, we have different versions of pdf files which at some point lead to confusion.

What are the differences with version A and version B?

The lists go on and you feel like you want to bite your finger nail now......

Luckily, there is a free software, Diffpdf (Windows version) that can be easily used to compare your document side by side.

No instruction is needed to use this software. It pretty straight forward.

Arch Linux/Manjaro Version

diffpdf is available in the AUR. Installation is straight forward using command:

yaourt -S diffpdf

Other Method

Other than methods described above, linux user can also try method explained here.

pdftotext file1.pdf
pdftotext file2.pdf
kdiff3 file1.txt file2.txt

Happy "comparing"!!

## Monday, February 24, 2014

### LaTeX Series: XeLaTeX

Knowledge of the day:

You can use XeLaTeX to use system fonts instead of limited to fonts provided by TeX.

Try it yourself using the following codes, and compile with XeLaTeX

\documentclass[11pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{fontspec}
\setmainfont{Arial Narrow}
\begin{document}
\blindtext
\end{document}

Happy "XeLaTeX"ing

## Sunday, February 23, 2014

### Manjaro Series: Dropbox

You can install dropbox from AUR as detailed in ArchWiki

yaourt -S dropbox

As for my installation, dropbox popup for syncing didn't appear at all. So, I need to do some simple tweaking [via dropbox]. Run the following codes one by one:

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
~/.dropbox-dist/dropboxd

You should be prompted with dropbox welcoming screen and from here, you need to log in and select the desired Dropbox destination folder.

Upon completion, your Dropbox should be syncing and you can safely quit.

Now, you can restart your dropboxd from Internet->Dropbox

Finally we can remove unused our manual installation dropbox folder and tarball downloaded:

rm -rf ~/.dropbox-dist dropbox-lnx.86_64-2.6.7.tar.gz

You can enjoy your Dropbox happily ever after ~hopefully.

## Saturday, February 22, 2014

### Manjaro Series: Font Rendering

After a while using Manjaro with infinality font rendering, I wanted to further improve font rendering on my Manjaro.

What I had done was simply:

1. Install ttf-ms-fonts, ttf-microsoft-tahoma, ttf-ubuntu-font-family [via here]
2. Add fonts.conf at HOME/USER_NAME directory [via here]
3. Change Appearance->Font to Ubuntu, Regular, 10
Wallaaaaa~!!!

Happy "FontRendering"!!

## Tuesday, February 18, 2014

### LaTex Series: Tex @Manjaro

It is a remarkable experience to use Tex with my xfce-Manjaro. It took me sometime to work out the configuration before I could generate my first IEEE paper with Tex in unix environment.

What you need are:
• Tex Live
• Texstudio

To install Tex Live, I use:

yaourt -S gedit-latex

Then, you can run your first Tex doc with either

latex sample.tex

or

pdflatex sample.tex

It is difficult, however, to write a Tex document without auto-completion function which require deep understanding on each syntax. Texstudio (my favourite so far) did help me a lot. Easy to understand and simple to use. Installation is simple:

yaourt -S texstudio

You need to modify the command for latex, pdflatex and any other stuff for compilation. To configure latex and pdflatex, the steps are detailed below:

• Option -> Configure TeXstudio -> Commands
• Click open folder icon on latex and pdflatex -> Select latex and pdflatex in "bin/" folder

Now you can run your TeXstudio, write your first TeX conference/journal paper.

Happy "TeXing"

## Equation Editor

Writing long equation in latex is challenging for beginner. Luckily TeXaide from MathType (obsolete) is (was) around (ask Dr. Google).

This simple program acts like Equation Editor in MS Word (Equation editor 3.0) and output latex code. It is very easy.
1. Write equation
2. Copy
3. Paste (latex code is automatically generated)
If you want to use this equation later using TeXaide, tick on the Edit->Translator->Include MathType data in translation. When you paste the equation, it will also paste a lines of commented weird text. These text is actually the one that you can paste into TeXaide and it will automatically translate into understandable equation.

### LaTex Series: Table II

If you have tried latex, I'm sure you would pray someone could lend you a hand to create a beautiful tables. It is a nightmare to create table in latex. Luckily, we could use excel2latex macro in MS Excel and calc2latex in Calc. I'm not sure if calc2latex work with LibreOffice Calc.

Have fun "tabling"

## Friday, February 14, 2014

### Personal Cloud Storage

BitTorrent Sync is an alternatives to the currently popular Dropbox

No web hosting is required. Just your PC!!

uptime, downtime? Up to you.... You are required to leave your PC "ON" to ensure your files are up-to-date

## Monday, February 3, 2014

### LaTex Series: How to EPS

I spent a lot of time to figure out this eps stuff.

Cut the story short.

## Save Powerpoint/Excel images as EPS

### Method 1 (Recommended):

2. Open a Powerpoint slide or Excel with LibreOffice
3. Export it as a EPS file:
• Powerpoint : File->Export->Choose EPS file type
• Excel          : Right click an image->Export as Image->Choose EPS file type
4. Open the generated EPS file with GhostView, and turn on menu "Option->EPS Clip and EPS Warn". Choose the menu "File->PS to EPS", allow the bounding box to be automatically calculated, and save with a different filename, say, figure_final.eps.

### Method 2:

In case anyone needs to (e.g. for LaTeX compatibility)

These instructions are for windows 7.  See bottom of this page for older instructions I found somewhere on the Web.

Start button -> type in window "add printer"

in "add printer" dialog, go to:
in "choose a printer port", do "use an existing port" and select 'print to file'.
In "install the printer driver", select any PS printer, I chose HP ->  HP Color LaserJet 2800 Series PS

For printer name, chose e.g. "My Awesome .eps Printer Driver".

When the wizard finishes and it is installed, type "print" (ctrl-P" from an Office program.  These instructions are for Office 2010.
I selected "My Awesome .eps Printer Driver", and just below that selector there is "printer properties" link.
Select that, choose "advanced tab", expand "PostScript Options", and for "PostScript Output Option", select "Encapsulated PostScript (EPS)" from the drop-down menu.

You can print with this driver to create .eps files.
Note that, at least from PowerPoint, the bounding-boxes may not be quite right (e.g. may correspond to the notional page rather than to your actual content).
I fixed this inside LaTeX with e.g.:

\includegraphics[width=1.0\columnwidth,bb=60 215 705 755]{sgmm_fig}

These co-ordinates are upper-left (x,y), lower-right (x,y), I believe.  You can look at the .eps file in Ghostview and hover over the corners of your image to get the bounding-box co-ordinates (thanks to Mike Seltzer for this tip).

---
Comment from Rich Webb on how to automatically get these bounding box co-ordinates if you are using miktex:

Stop after the add-printer wizard completes. Do not go into the printer properties to change anything (I think that is what broke my earlier setup). Instead, just "print" through that virtual printer to .plt. This file is the plain-text PostScript job.

Run that file through ps2epsi (included in the MikTex distribution) from a command line as "ps2epsi .plt .eps". The resulting .eps file slides right into LaTeX with a bounding box that works perfectly for figures. Now if I can just convince it not to substitute Arial for Helvetica ...

Things to consider:
1) Place the figure on top left most of the slide. Otherwise, annoying white spaces will be haunting you forever as I had experienced. #grrrrrr
2) Rewrite the boundry box using notepad or similar editor. Save you the hassle of writing codes in latex.

Extra reading [graphics manual and another one here]

Other methods related to EPS can be found here

## Convert PDF to EPS

1. Open pdf file with inkscape
2. Save as EPS
3. In case you need to crop image area in inkscape, follow tutorial here