# LaTeX: Hyphenation of \texttt

I have been using  since I was 17 and still love it. But one thing has been bugging me for a long time. For a while I had been manually tweaking documents to get proper linebreaks when using the \texttt{} macro. Now I had finally come to the point where this did not work any longer. A search gave me this snippet:

\renewcommand{\texttt}[1]{%
\begingroup
\ttfamily
\begingroup\lccode~=/\lowercase{\endgroup\def~}{/\discretionary{}{}{}}%
\begingroup\lccode~=[\lowercase{\endgroup\def~}{[\discretionary{}{}{}}%
\begingroup\lccode~=.\lowercase{\endgroup\def~}{.\discretionary{}{}{}}%
\catcode/=\active\catcode[=\active\catcode.=\active
\scantokens{#1\noexpand}%
\endgroup
}`

It works great!

# Using LaTeX with Windows 7

For those who are lazy and look for a relatively quick and easy setup guide for LaTeX with Windows 7, you should have a look at http://schlosser.info/latexsystem-en . Another interesting PDF document is here (German only).

Where I have deviated is the installation of Emacs. For several years now I have been using the distribution from http://ourcomments.org/Emacs/EmacsW32.html (patched version) which auto-installs all you need, incl.  gnuserv and gnuclientw. There is one caveat, however.  At the end of the installation you can have Emacs started automatically (on by default). This will most likely cause problems on Windows 7 (and probably also on Vista), because the installer is usually running with admin rights. In such a case the directory ~/.emacs.d and its subdirectories will not be created with the proper account as owner. Instead the admin user or group will own things. This will show itself in two problems:

• The window “Emacs Client” will display the message “Waiting for Emacs server to start” until a timeout occurs
• You will see the message “The directory ~/.emacs.d/server is unsafe” in the status line of your main Emacs window

To correct things, go to %USERPROFILE%\AppData\Roaming and change the owner of .emacs.d/ to your own user (make sure to apply this change to all sub-directories!).

Update October 2015