kosmikus / lhs2tex

Preprocessor for typesetting Haskell sources with LaTeX
Other
99 stars 28 forks source link

forall.fmt doesn't use \mathpunct on `.` #54

Open Blaisorblade opened 7 years ago

Blaisorblade commented 7 years ago

Experiments on my thesis suggest that \mathpunct{.} is typically more correct than plain. for separators after \forall, and can be specified via:

% Hook into forall.fmt:
% Add proper spacing after forall-generated dots.
%format period_ = "\mathpunct{.}"

This could either be added to forall.fmt (but unsafe for existing documents, not sure what's your policy) or suggested in the documentation.

\mathpunct is a \mathrel brother for mathematical punctuation (like comma), which adds a bit more space after. I've still felt like adding even more space explicitly in especially complicated, but usually this looks quite nice IMHO (and has the right semantics).

For instance, $\forall x \mathpunct{.} x^2 > 0$ gives the following: image (tested in plain TeX with pdftex '\relax $\forall x \mathpunct{.} x^2 > 0$ \end').

EDIT: I'm just realizing there's an amazing amount of published material which doesn't use \mathpunct, here or for lambdas (#53), but I'm not yet convinced the result there looks as good or is as readable.