expatiari expatria

Conversion from TeX to Postscript, PDF, and PNG

[ TeX source: hello.tex ][ PDF output: hello.pdf ]
[ PNG first page: 43 dpi 87 dpi 144 dpi ]
[ PNG last page: 43 dpi 87 dpi 144 dpi ]
First page generated from TeXLast page generated from TeX


\documentclass[a4paper,12pt,onecolumn]{article}
\usepackage[utf8]{inputenc}

\begin{document}

\title{Conversion from \TeX{} to \\ Postscript, PDF, and PNG}
\author{Alexander Edward Genaud}

\maketitle

\begin{abstract}
\TeX{} document describing its own processing
(some human intervention required).
We convert from TeX to PS, two methods of conversion to PDF,
full multi-page PNG as well as small image snippets (math equation).
\end{abstract}

\section{PS Postscript}

To convert this \verb\hello.tex\ or any other TeX document to PS,
we must first convert to DVI using the \verb\latex\ command.
Then we can convert from DVI to PS with \verb\dvips\:
\begin{verbatim}
$ latex hello
$ dvips hello.dvi -o hello.ps
\end{verbatim}

\section{PDF Portable Document Format}

To convert from TeX to DVI to PDF,
we use \verb\dvipdf\ instead of \verb\dvips\,
with slightly different arguments (sans \verb\-o\):
\begin{verbatim}
$ latex hello
$ dvipdf hello.dvi hello.pdf
\end{verbatim}
However, we could have instead jumped straight from TeX to PDF with a single command:
\begin{verbatim}
$ pdflatex hello
\end{verbatim}

\section{PNG Portable Network Graphics}

We can convert a multi-page TeX to full page PNG images.
We must first convert to PS as before
then, using ImageMagick's \verb\convert\ command, to PNG:
\begin{verbatim}
$ latex hello
$ dvips hello.dvi -o hello.ps
$ convert -density 144 hello.ps hello.png
\end{verbatim}

The \verb\dvips\ command accepts an \verb\-E\ flag which should produce EPSF
output. EPSF only works with single pages and the \verb\-E\ flag should be
ignored with multiple page documents.
The EPSF contains minimal white space margins and is useful for
generating small graphics such as complex AMS math equations.

The \verb\-o\ flag of \verb\dvips\ seems to be optional as long as the default
output file extension \verb\*.ps\ is acceptable.

The \verb\-density\ flag of the convert command indicates the output resolution.
While 72 DPI is default and standard for computer monitors,
in my opinion, it is too low for legible text.
Many printers can handle hundreds if not thousands of pixels
per inch. For casual reading, I prefer well over a hundred,
hence \verb\-density 144\ above.

\begin{thebibliography}{1}

\bibitem{robertsabs} Andy Roberts {\em Absolute Beginners -
Getting to Grips with LaTeX} \\

http://www.andy-roberts.net/writing/latex/absolute\_beginners

\bibitem{robertspdf} Andy Roberts {\em PDFs -
Getting to Grips with LaTeX} \\

http://www.andy-roberts.net/writing/latex/pdfs

\bibitem{mitcite} Hermes, MIT. {\em How do I create
bibliographies in LaTeX?} 2088: Information
Services \& Technology, Massachusetts Institute of Technology. \\

http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907111

\bibitem{png} Michael Mazack {\em Converting TeX/LaTeX to PNG} \\

http://mazack.org/unix/tex2png.php

\end{thebibliography}

\end{document}

Xmonad on Oneiric Ocelot, Gnome Classic

Following up on Karmic, Lucid and Natty, we have Xmonad on Oneiric Ocelot. Let’s get my biases out of the way. I love Xmonad. I hate Ubuntu Unity.


$ sudo apt-get install gnome-panel xmonad

$ sudo vi /usr/share/applications/xmonad.desktop
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Xmonad
Exec=xmonad
NoDisplay=true
X-GNOME-WMName=Xmonad
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=true

$ sudo vi /usr/share/xsessions/xmonad-classic.desktop
[Desktop Entry]
Name=XMonad Classic
Comment=Tiling window manager that works
TryExec=/usr/bin/gnome-session
Exec=gnome-session --session=xmonad
Type=XSession

$ sudo vi /usr/share/gnome-session/sessions/xmonad.session
[GNOME Session]
Name=Xmonad Classic
RequiredComponents=gnome-settings-daemon;
RequiredProviders=windowmanager;panel;
DefaultProvider-windowmanager=xmonad
DefaultProvider-panel=gnome-panel
FallbackSession=gnome-classic

$ mkdir -p ~/.xmonad

$ vi ~/.xmonad/xmonad.hs
import XMonad
import XMonad.Config.Gnome
import XMonad.Layout.NoBorders
import XMonad.Layout.ThreeColumns

main = xmonad
    gnomeConfig {
            modMask = mod4Mask
          , layoutHook = smartBorders (layoutHook gnomeConfig)
         ||| ThreeCol 1 (3/100) (1/2)
         ||| ThreeColMid 1 (3/100) (1/2)
    }

$ xmonad --recompile

After you logout, be sure to select “Xmonad Classic” from the login menu (gear). I’ve added a command cheat sheet to a previous post (trust me, if you’ve never used Xmonad before you need to learn five command before you even begin). Perhaps you’d prefer something more visual:

Thanks to Haskell Wiki and myszek123.

Inferno 4

Inferno is a distributed operating system developed by the same geniuses who invented UNIX, C, UTF-8, Plan-9 from Bell Labs/Lucent. It’s cutting edge research and I’m installing it to do, well, research. If things work out, I’ll be installing it on another machine, and will clean this up then. But for now on Ubuntu 11.04 (386):

I cloned the mercurial repository as well as downloaded the tar with fonts. I haven’t decided which path is smarter. I installed graphics libraries. I also ran most of this as root in /usr/lib (was that smart?):

hg clone https://code.google.com/p/inferno-os/
wget http://www.vitanuova.com/dist/4e/inferno-20100120.tgz
apt-get install libxext-dev libxpm-dev x11proto-xext-dev

Extracted/moved to /usr/lib/inferno (not sure that’s wise)
edited mkconfig, set ROOT to the path above, set OBJTYPE=386, etc
PATH=/usr/lib/inferno/Linux/386/bin:$PATH
And this was not anywhere reasonable (like INSTALL, the repo web site, nor vita nuova) except Ueber.net:
./makemk.sh && mk -s nuke mkdirs install

Very fast boot time!

$ /usr/lib/inferno/Linux/386/bin/emu -r/usr/lib/inferno -c0 -g1024x768
; wm/wm

http://www.vitanuova.com/inferno/downloads.html

http://www.ueber.net/who/mjl/inferno/getting-started.html

Xmonad on Natty Narwhal

Three Xmonad tiles, including some basic commands in a web browser, config and compilation in a terminal window, and a clock

Xmonad on Natty Narwhal is a snap to set up. Just install xmonad 0.9.1:
$ sudo apt-get install xmonad

Create a config directory:
$ mkdir ~/.xmonad

Create a new config:

$ vi ~/.xmonad/xmonad.hs

import XMonad
import XMonad.Config.Gnome
import XMonad.Layout.NoBorders
main = xmonad
    gnomeConfig {
            modMask = mod4Mask
          , layoutHook  = smartBorders (layoutHook gnomeConfig)
    }

Compile (if/when successful, end with “:q”):
$ ghci ~/.xmonad/xmonad.hs
:q

Create the Gnome session files:
$ sudo vi /usr/share/gnome-session/sessions/xmonad.session

[GNOME Session]
Name=Xmonad
Required=windowmanager;panel;filemanager;
Required-windowmanager=xmonad
Required-panel=gnome-panel
Required-filemanager=nautilus
DefaultApps=gnome-settings-daemon;

And desktop:
$ sudo vi /usr/share/xsessions/xmonad.desktop

[Desktop Entry]
Encoding=UTF-8
Name=XMonad
Comment=Lightweight tiling window manager + Gnome
Exec=gnome-session --session=xmonad
Icon=xmonad.png
Type=Application
X-Ubuntu-Gettext-Domain=gnome-session-2.0

Then when you log out, enter your user name, select “Xmonad” from the bottom menu (as opposed to “Ubuntu”, “Unity”, or “Classic”), then enter your password, and enter. Note that I set the meta key to the “Win” key which seems to be most compatible with Gnome. See the previous post for the basic dozen Xmonad commands (here are two: Win-Shift-q to logout of Xmonad and Win-Shift-Return to open a terminal window).

An earlier image including many tiles, one floating, featuring a water color image of my dog in Greenland

Immortal Beloved

My angel, my everything, my very self.

– only a few words today, and with a pencil (with yours) – … why this deep grief, where necessity speaks – can our love exist but by sacrifices, by not demanding everything. Can you change it, that you are not completely mine, that I am not completely yours … look upon beautiful Nature and calm your mind about what must be – love demands everything and completely with good reason, that is how it is for me with you, and for you with me – only you forget too easily, that I must live for myself and for you as well, if we were wholly united, you would not feel this as painfully, just as little as I would – my journey was terrible … Esterhazi had … the same problems … now quickly to the interior from the exterior. We will probably see each other soon, only, today I cannot convey to you my observations which I made during these few days about my life … my heart is full with so much to tell you – Oh – There are moments when I feel that language is nothing at all – cheer up – remain my faithful only darling, my everything, as I for you, the rest is up to the Gods, what must be for us and what is in store for us. –

your faithful ludwig –

Monday evening on 6 July – You are suffering, you my dearest creature – only now do I realize … the only days when the mail is delivered to K. – you are suffering – Oh, wherever I am, you are with me, I talk to myself and to you, arrange that I can live with you, what a life!!!! as it is!!!! without you … as much as you love me – I love you even more deeply, but – but never hide yourself from me – Good night … Oh God – so near! so far! Is not our love a true edifice in Heaven – but also as firm as the firmament. –

Good morning on 7 July – while still in bed my thoughts turn towards you my Immortal Beloved, now and then happy, then sad again, waiting whether fate might answer us – I can only live either wholly with you or not at all, yes I have resolved to stray about in the distance, until I can fly into your arms, and send my soul embraced by you into the realm of the Spirits – yes unfortunately it must be – you will compose yourself all the more since you know my faithfulness to you, never can another own my heart, never – never – O God why do I have to separate from someone whom I love so much, and yet my life in Vienna as it is now is a miserable life – Your love makes me at once most happy and most unhappy – at my age I would now need some conformity[,] regularity of my life – can this exist in our relationship? – Angel, … be patient – only through quiet contemplation of our existence can we achieve our purpose to live together – be calm – love me – today – yesterday – What yearning with tears for you – you – you my life – my everything – farewell – oh continue to love me – never misjudge the most faithful heart of your Beloved L.

Forever thine

forever mine

forever us.

(Ludwig van Beethoven, Bohemian spa of Teplitz on 6/7 July 1812, likely never sent)