1

I'm using egreg's solution to removing vertical space around \align environments, and finding an unwanted interaction with the mathpartir.sty package for typesetting inference rules.

enter image description here

If I set \abovedisplayskip and \belowdisplayskip as per egreg's suggestion, the placement of any text attached to the right of an inference rule is affected, as shown above. Any text on the left is unaffected.

Here's how things normally look:

enter image description here

And here's the code:

\documentclass{article}

\usepackage{mathpartir}
\usepackage{etoolbox}

\newcommand{\zerodisplayskips}{%
  \setlength{\abovedisplayskip}{2pt}
  \setlength{\belowdisplayskip}{2pt}
  \setlength{\abovedisplayshortskip}{2pt}
  \setlength{\belowdisplayshortskip}{2pt}}
\appto{\normalsize}{\zerodisplayskips}
\appto{\small}{\zerodisplayskips}
\appto{\footnotesize}{\zerodisplayskips}

\begin{document}
\begin{mathpar}
\inferrule*[left={Ok},right={Too far!}]
{
    \strut  
}
{
    A * B
}
\end{mathpar}
\end{document}

Maybe this is how things should work, but either way, I would like a way to keep the specified change to vertical spacing around display environments, whilst simultaneously preserving the usual layout of inference rules.

Roly
  • 4,221
  • 4
  • 26
  • 56

1 Answers1

2

There are unwanted spaces in the macro \zerodisplayskips. Put % at the end of the lines to suppress these.

\documentclass{article}

\usepackage{mathpartir}
\usepackage{etoolbox}

\newcommand{\zerodisplayskips}{%
  \setlength{\abovedisplayskip}{2pt}%
  \setlength{\belowdisplayskip}{2pt}%
  \setlength{\abovedisplayshortskip}{2pt}%
  \setlength{\belowdisplayshortskip}{2pt}}
\appto{\normalsize}{\zerodisplayskips}
\appto{\small}{\zerodisplayskips}
\appto{\footnotesize}{\zerodisplayskips}

\begin{document}
\begin{mathpar}
\inferrule*[left={Ok},right={Too far!}]
{
    \strut  
}
{
    A * B
}
\end{mathpar}
\end{document}