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.

1 Answer 1

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}
3
  • Awesome, thank you! (I'm assuming the last % is unnecessary, although harmless?)
    – Roly
    Dec 31, 2016 at 8:58
  • Yes, that's right. I'll remove that one. Dec 31, 2016 at 9:00
  • Cool. I also applied your fix to tex.stackexchange.com/questions/47400 (awaiting moderator approval).
    – Roly
    Dec 31, 2016 at 9:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .