rmagick ubuntu installation problem

Problem:

Can't install RMagick 2.9.1. Can't find MagickCore.h.

Solution:

apt-get install libmagick++9-dev

Posted by wojtek Fri, 17 Apr 2009 16:30:00 GMT




ubuntu update 7.04 to 7.10

Problem:

Getting upgrade prerequisites failed
The system was unable to get the prerequisites for the upgrade. The upgrade will abort now and restore the original system state.

Please report this as a bug against the 'update-manager' package and include the files in /var/log/dist-upgrade/ in the bugreport.

Solution:

Download the Ubuntu 8.10 and install it! :D I found none of the posted on the web solutions working :/

Posted by wojtek Mon, 13 Apr 2009 14:49:00 GMT




ruby gem update system is disabled on Debian

Problem:

ERROR:  While executing gem ... (RuntimeError)
    gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.

Unfortunately the apt-get update does not help at all.

Solution:

gem install update_rubygems
cd /var/lib/gems/1.8/bin
./update_rubygems

or

gem install rubygems-update
cd /var/lib/gems/1.8/bin
./update_rubygems

Posted by wojtek Sun, 12 Apr 2009 18:49:00 GMT




trac password store problem

Problem:

"... is disabled because the password store does not support writing."
or
"This password store does not support listing users"

Solution: configure your trac.ini, may be something including this:


[account-manager]
password_file = /home/xxx/yy/zzz/conf/.htpasswd
password_store = HtPasswdStore

[components]
acct_mgr.admin.accountmanageradminpage = enabled
acct_mgr.htfile.htpasswdstore = enabled
acct_mgr.web_ui.loginmodule = enabled
acct_mgr.web_ui.registrationmodule = enabled
trac.web.auth.loginmodule = disabled

Posted by wojtek Thu, 09 Apr 2009 06:55:00 GMT




latex bibtex escape characters problem

If the escape character \ does not work for example:

@misc{SIFTWiki,
  title =   "SIFT Atricle",
  author =  "Wikipedia",
  year =    "2008",
  howpublished = "http://en.wikipedia.org/wiki/Scale-invariant\_feature\_transform",
}

is a correct bibtex entry, but you still could get some error messages. The solution is to delete the *.bbl temporary file and run latex/bibtex again. It worked for me. It is because you probably use the latex-bibtex-latex-latex execution flow, and the first latex can not complete, so the bibtex is not started.

Posted by wojtek Fri, 26 Dec 2008 17:29:00 GMT




problem with not loadable latex fonts

Problem:

./file.tex:56:Font TS1/cmr/m/n/12=tcrm1200 at 12.0pt not loadable: Metric (TFM) file not found. \item W

Solution (for Ubuntu):

apt-get install cm-super

Posted by wojtek Thu, 25 Dec 2008 11:11:00 GMT




latex variable image size based on text width

The best way to have an image in latex with width depending on text width in my opinion is:

\begin{figure}[H]
    \begin{center}
        \includegraphics[width=0.4 \textwidth]{path/to/image.eps}
    \end{center}
    \caption{Sample image description}
    \label{fig:image_sample}
\end{figure}
  1. Use of the [H] makes the image not float around. To use it you have to download and include the library: http://www.ctan.org/tex-archive/help/Catalogue/entries/float.html

  2. Notice the “width=0.4 \textwidth”, which makes the images width 40% times the text width.

Posted by wojtek Sun, 14 Dec 2008 14:10:00 GMT




linux less command and color logs

When you have a script to colour your logs from an application and its name is “colorize” you should place it in the PATH environment variable and the do the following:

Create:

$HOME/bin/lessopen.sh
#!/bin/sh
case "$1" in
*.log)
     tail -n+1 -f $1 | colorize > /tmp/less.$$ &
     echo $[$! - 1] > /tmp/tail_pid.$$
     echo /tmp/less.$$
    ;;
esac

Create:

$HOME/bin/lessclose.sh
#! /bin/sh
rm $2
old_pid=`echo $2 | sed 's/\/tmp\/less\.//'`
kill -9 `cat /tmp/tail_pid.$old_pid`
rm /tmp/tail_pid.$old_pid

Add to .bash_profile

export LESSOPEN="$HOME/bin/lessopen.sh %s"
export LESSCLOSE="$HOME/bin/lessclose.sh %s %s"

And the run less, with the working “+F” option:

less -R +F /some/file/server.log

Posted by wojtek Sun, 14 Dec 2008 13:58:00 GMT




latex eps images quality dvi to pdf problem

When you have a problem with image quality in latex, when included a eps image or whatever, and you get a compressed and ugly jpeg in the resulting pdf image, you have to do the following. Instead of whatever you use, use this makefile to build your project. Is runs latex/bibtex, so that all references are updated (the known latex issue), and than runs the default DVIPDFMx configuration, which performs very nice in converting included eps images, without loosing quality.

The makefile:

all: 
        latex file.tex
        latex file.tex
        bibtex file
        latex file.tex
        dvipdfmx file.dvi

Posted by wojtek Sun, 30 Nov 2008 11:43:00 GMT




problems with polish language in tex and latex

File polski.sty not found. \usepackage

I hate this error. I have searched the net and found nothing that worked for me. I use ubuntu. The solution to make it work is to install texlive-lang-polish:

apt-get install texlive-lang-polish

And include the polish language declaration like this (change the encoding if you like):

\usepackage{polski}
\usepackage[latin2]{inputenc}
\usepackage[OT4]{fontenc}

Finally… it works :)

Posted by wojtek Mon, 10 Nov 2008 22:03:00 GMT