[Tex/LaTex] Entire document typed in monospace font


I want to put an entire document into monospace font for various reasons. This is nominally fairly easy; you can say \renewcommand{\familydefault}{\ttdefault}. However, there at least two problems with this approach (and possibly more). Thus, my question is really three separate ones:

  1. So far, I'm having a problem with the spaces not working as they should; this seems to be fixed by \obeyspaces, but I am unsure of how well this really works. The only references to it I could find were on this site, and they didn't really explain that command well. Could you please provide a reference for this or at least explain what the command does and what its limitations are?
  2. My other problem is that sometimes LaTeX generates symbols (such as smart quotes), and these do not obey the monotype spacing. LaTeX even seems to generate these when the symbols are in the font used. Is there any way of finding out when this happens, and preferrably of telling LaTeX to use existing characters when possible? Update: This is not a problem at all; see below.
  3. I have found these by myself, but it seems quite likely that there are other problems as well. Are there other things I should look out for, like accented characters? Bold seems to work correctly (at least in the Courier font), but will all such formatting?

Update: In case it is relevant (which, now that I think of it, it almost certainly is), I am using XeTeX and fontspec. I would prefer to keep this setup, but would be open to not using fontspec or to using pdflatex instead.

Update 2: The "smart quotes" problem was actually a problem with spaces after punctuation. I turned on French spacing, but this just emphasizes the need for part three of my question.

Best Answer

The easiest (but not the most flexible) way is to use memoir with the ms option. Then you get something that look like a good, old typewriter manuscript.

memoir also hard code the monospace font to be cmtt, se line 12643 in the memoir.cls. If you want another monospaced font, you need to change at least the lines:


Changing to scaled luximono:


I also recommend the package csquotes to ensure correct quoting marks.

EDIT: I forgot that you preferred XeLaTeX and it sems that memoir and the ms-option does not work with XeLaTeX.

Here is a new (near) MWE:


% Comment the line above and uncomment the following
% ten line to change monotype font.






Computer Modern

Computer Modern

Scaled Luximono
enter image description here