[TYPES] seeking stupid LaTeX tricks for laying out sets of typing rules

Filip Sieczkowski phil.sieczkowski at gmail.com
Thu Nov 28 08:14:41 EST 2019


Hi,

I usually like to put the judgment form on its own line, similar to what
Gabriel suggests, and in that case one solution is to take the judgment
form outside the mathpar environment and use something like the
flushleft/flushright environments and an \fbox. This works reasonably well
unless you define several judgments at the same time, and would like the
judgment forms grouped together, since \fbox doesn't do paragraphs. One
(somewhat nasty) workaround is to stick the forms in the aligned
environment, like so:

\begin{flushleft}
\fbox{$
  \begin{aligned}
  &\judgmentForm1\\
  &\judgmentForm2 %etc.
  \end{aligned}$}
\end{flushleft}
\begin{mathpar}
%rules go here
\end{mathpar}

This works reasonably well, although of course if you define a lot of
judgments simultaneously it tends to consume a fair bit of space.

However, your question got me experimenting, and in the end the clue lies
in Didier's documentation for mathpar: it's a normal paragraph with some
clever spacing mechanisms. This means that most commands you would expect
to work within a paragraph work here too — including, in particular,
\hfill. Thus, the easy approach is to stick the judgment form on the left
and leave the rest of the line blank:

\begin{mathpar}
\fbox{$\judgmentForm$}\hfill\\
%rules
\end{mathpar}

You can stick some of the rules on the same line, too, but this would
require some fiddling with fills, as \hfill is more aggressive than the
spacing macros in mathpar (otherwise the trick wouldn't work at all), and
the rules will likely get squashed closer together than you would like.
It's still a bit of a hack, but at the very least the form with the
judgment on its own line should work reliably.

Hope this is of some use,
— Filip

On Thu, Nov 28, 2019 at 6:47 AM Norman Ramsey <nr at cs.tufts.edu> wrote:

> [ The Types Forum, http://lists.seas.upenn.edu/mailman/listinfo/types-list
> ]
>
> Dear Colleagues,
>
> I'm looking for advice on preparing figures full of typing rules.
> What I'd like is to create a figure that has a boxed form of judgment
> in the top left, then collects all the rules that can prove judgments
> of the boxed form.
>
> At present, I'm using Didier Rémy's mathpartir package.
> The inference rules are nice and readable, and I can collect them
> easily enough in a `mathpar` environment.  But the boxed judgment is
> placed as if it were just another rule, where it really ought to be in
> the upper left corner (or some other location which can indicate that
> it classifies all the rules).  I'm sure there must be a trick, but I
> haven't yet discovered it.
>
> How are you typesetting collections of inference rules?
>
>
> Norman
>
>

-- 
Filip Sieczkowski
http://cs.au.dk/~filips
e-mail, JID: phil.sieczkowski at gmail.com
phone: +48 603289181

"Two roads diverged in a wood, and I--
I chose the one less traveled by,
And that has made all the difference."
-- Robert Frost, "The road not taken"


More information about the Types-list mailing list