How to have a sorted list of your installed packages

When you want to install a new released version of your Linux system, it might be interesting to have a list of the installed packages you have in the previous version.

If you have a RPM-based distribution, all you have to do is:

rpm -qa | sort

Advertisements
Posted in Personal technotes. Comments Off on How to have a sorted list of your installed packages

Doing arithmetic in TeX

I have just discovered accidentally how to perform simple arithmetic operations in TeX:

\number\numexpr 5+5\relax

And this will print the result, not the operands.

Posted in Personal technotes, TeX. Comments Off on Doing arithmetic in TeX

\include and \input

Thanks to this comment, I have realized the main difference between \include and \input in LaTeX: \include has a page break before and after the file and \input doesn’t.

Posted in Personal technotes, TeX. Comments Off on \include and \input

Magnifying with XeTeX

When magnifying with XeTeX using the geometry package is important not to forget that the documentclass should not have the page size set on it, instead of having it set on the proper geometry option.

Posted in Personal technotes, TeX. Comments Off on Magnifying with XeTeX

When openSUSE seems not be able to handle a DHCP connection

For some strange reason, my openSUSE 11.1 distribution seems not to be able to negotiate a DHCP Ethernet connection at home. Ubuntu 9.04 and Fedora 11 (live versions) are able to do that using the same computer and connections.

The only way it seemed to work was typing dhcpcd -k eth0 and after that dhcpcd -n eth0 (both as root). I don’t know what does it actually change, since I must keep that window open and the system considers that it isn’t connected.

It might be a bug, but sorry, too tricky to be reported.

Posted in openSUSE, Personal technotes. Comments Off on When openSUSE seems not be able to handle a DHCP connection

How to generate a booklet from a PDF file

Using ConTeXt (taken from the imposition explanation):

\definepapersize	[filius][width=136mm, height=232mm]
\setuppapersize		[filius][A4,landscape]
\setuparranging		[2UP,doublesided]
\setuplayout [backspace=0pt,
    topspace=0pt,
       width=middle,
      height=middle,
    location=middle,
      header=0pt,
      footer=0pt,
      grid=no, marking=off]
\starttext
\insertpages
  [document.pdf][width=0pt]
\stoptext

You have to replace the document.pdf with the real file name and filius with the original paper size.

Posted in Personal technotes, TeX. Comments Off on How to generate a booklet from a PDF file

Searching for text in directories

To find which pure text files contains a given text from the command line, this is the proper command:

grep -ilr "pattern" directory

The -i option makes the search case-insensitive, -r searches the pattern recursively (that is, in the subdirectories that the actual directory might contain), and -l shows the file list where the pattern occurs.

Thanks to Juan Luis Belmonte for the tip (credit where credit is due).

Posted in Personal technotes. Comments Off on Searching for text in directories