gonium.net » latex http://gonium.net/md so much time, so little to do. Sat, 11 Sep 2010 16:42:09 +0000 en hourly 1 http://wordpress.org/?v=3.0.1 Sending Faxes from my Router http://gonium.net/md/2010/09/11/sending-faxes-from-my-router/ http://gonium.net/md/2010/09/11/sending-faxes-from-my-router/#comments Sat, 11 Sep 2010 16:40:41 +0000 md http://gonium.net/md/?p=295

Faxes are an rather old method for communication, but in Germany they have one advantage: as opposed to emails, faxes are legally binding in the same way as letters are. So, from time to time, sending out a fax is useful. In addition, I have a telephone flatrate included in my data plan, so I don’t have to pay the postage for letters any more. The plan: use the USB port on my router to attach a modem and send out faxes using the mgetty package.

For 3 Euro I acquired an old ELSA Microlink 56k USB modem. I did some research, this modem is one of the few ones supported by the Linux usb-cdc kernel drivers. In addition it can be powered from USB only, so I don’t need another power supply. A week after winning an auction on ebay it arrived today.

My router runs OpenWRT. I installed the following packages using the opkg system:

kmod-usb2
kmod-usb-uhci
kmod-usb-net
kmod-usb-core
kmod-usb-acm
mgetty

mgetty contains a program called “sendfax”, which can be used to dial a number and send the data. The latter needs to be in G3 format. Since I write all my letters using LaTeX, I integrated a “fax” target into my Makefile for LaTeX documents. This target reads the PDF output of LaTeX and converts it to G3 using Ghostscript. The essential command is:

gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=dfaxhigh -sOutputFile=fax.g3.%d -q main.pdf

This creates a bunch of fax.g3.* files, one for each page within the PDF file. Then, I simply copy these files to my router and issue the sendfax command, for example:

sendfax #fax number# fax.g3.1 fax.g3.2

The command dials the fax number and sends the specified g3 files:

root@nibbler:~# sendfax 032121xyzxyz fax.g3.1 fax.g3.2
Trying fax device '/dev/ttyACM0'... OK.
Dialing 032121xyzxyz... OK.
sending 'fax.g3.1'...
sending 'fax.g3.2'...

If an error occurs, the command will fail and tell you about it. The mgetty package also contains various scripts for building a fax spooler, but for my personal usage, I will stick to raw sendfax. Please note that it is also possible to receive faxes, but I did not install these components so far.

No more postage for me. Yay!

Picture: CC-BY-SA-NC vtengr4047, thanks!

]]>
http://gonium.net/md/2010/09/11/sending-faxes-from-my-router/feed/ 0
Installing Hoefler Text in LaTeX http://gonium.net/md/2008/11/23/installing-hoefler-text-in-latex/ http://gonium.net/md/2008/11/23/installing-hoefler-text-in-latex/#comments Sun, 23 Nov 2008 10:08:27 +0000 md http://gonium.net/md/?p=113 The Hoefler Text Ampersand

Not that straightforward, actually. Apple includes the Hoefler Text font in Mac OS X – its a really nice and readable professional font. Here’s what I did:

(1) You need to obtain the font in the opentype format (otf). Be careful: for me, the TTF version didn’t work. The Postscript type 1 version worked great.
(2) Use otftotfm -a to convert and install the files:

otftotfm -a -e texnansx HoeflerText-Regular.otf -fkern -fliga LY1--HoeflerText-Regular

This installs the regular form in the .texlive subdirectory of your home directory. Do this for all the font shapes you want to use. In the last step you need to create a .fd file:

\DeclareFontFamily{LY1}{HoeflerText}{}\DeclareFontShape{LY1}{HoeflerText}{m}{n}%
{ < -> LY1--HoeflerText-Regular }{}
\DeclareFontShape{LY1}{HoeflerText}{m}{it}{ < -> LY1--HoeflerText-Italic }{}
\DeclareFontShape{LY1}{HoeflerText}{m}{sl}{ < -> LY1--HoeflerText-Bold }{}
\DeclareFontShape{LY1}{HoeflerText}{b}{n}{ < -> LY1--HoeflerText-Bold }{}\DeclareFontShape{LY1}{HoeflerText}{b}{it}%
{ < -> LY1--HoeflerText-BoldItalic }{}

Put this in ~/.texlive2008/texmf-var/tex/latex/HoeflerText/LY1HoeflerText.fd. Again, make sure that all font shapes you want to use are included.

In your Latex document, put

\usepackage[LY1]{fontenc}
\renewcommand{\rmdefault}{HoeflerText}

to use the font.

The picture above was CCed on flickr by liikennevalo, thanks!

]]>
http://gonium.net/md/2008/11/23/installing-hoefler-text-in-latex/feed/ 0