You are currently browsing the Carl’s notes weblog archives for July, 2008.

SSH tunneling

The university SMTP server won’t allow posts from off campus except via the VPN. When connecting from a hotspot or another university there is often no SMTP server available for me to use. I could use webmail or connect to the VPN but another quick solution is to set up an SSH tunnel to the university’s SMTP server via another server also hosted at the university and then configure my e-mail client to use localhost:9999 as the outgoing server. Run the following command to set up the tunnel, and leave it running in the background or in a screen session.

ssh -L 9999:smtp.university.ac.uk:25 my.server.university.ac.uk

Of course you need to be able to login to the intermediary server.

Figures for publication

When producing camera ready versions of publications it seems best to create a Postscript file and then convert to PDF. Some printers (printing companies) require the Postscript files and it’s also the only way I’ve found to correctly embed all the fonts in the PDF.

In Matlab I’ve been using set(gcf, 'PaperPositionMode', 'auto'); print -depsc myfigure.eps; to create the eps file for including in LaTeX.

Run latex mypaper.tex to produce the dvi file.

Run dvips -Ppdf -G0 -tletter mypaper.dvi to produce the PS.

Run ps2pdf -dPDFSETTINGS=/printer -dCompatibilityLevel=1.3 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sPAPERSIZE=letter mypaper.ps to produce the final PDF file. Use pdffonts mypaper.pdf to check that all fonts are correctly embedded.

Replace letter with a4 in the dvips and ps2pdf commands if you’re publishing for Europe.

Some useful links: