Skip to content

Instantly share code, notes, and snippets.

@Blaisorblade
Created July 11, 2020 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blaisorblade/74184a18c024065664014a2278a4f292 to your computer and use it in GitHub Desktop.
Save Blaisorblade/74184a18c024065664014a2278a4f292 to your computer and use it in GitHub Desktop.
Tune output from busproofs to be closer to mathpartir
% Ensure that bussproofs and mathpartir rules have the same thickness.
%
% bussproofs uses hrule, defaulting to 0.4pt. Instead, testing and docs show
% that mathpartir uses \over, both by default and here.
% Horizontal rule thickness for \over depends on font parameters.
%%
% Read the thickness of fraction rule.
%%
% 1. We use https://tex.stackexchange.com/a/96063/1340 to read font parameters.
% 2. The parameter in question is \fontdimen8\textfont3,
% according to
% https://tex.stackexchange.com/a/88993/1340 (where that's abbreviated as x3)
% We use twbp@ (for TWeakBussProofs) as prefix for local identifiers.
\newlength{\twbp@overRuleThickness}
%\makeatletter
\AtBeginDocument{
\check@mathfonts\setlength{\twbp@overRuleThickness}{\fontdimen8\textfont3}
%% Default setting for bussproofs:
% \def\ruleScoreFiller{\hrule}
%% aka:
% \def\ruleScoreFiller{\hrule height 0.4pt}
%% We use
\def\ruleScoreFiller{\hrule height \twbp@overRuleThickness}
}
%\makeatother
%% Using \the\twbp@overRuleThickness after \begin{document} shows that here
%% \twbp@overRuleThickness is 0.56pt, so the above is equivalent here to:
% \def\ruleScoreFiller{\hrule height 0.56pt}
%% but I'm not hardcoding that value.
% This code is included purely for debugging purposes.
\RequirePackage{amsmath}
\newcommand\twbp@testHspace{\hphantom{a}}
\newcommand\twbpShowHRules{
\begin{gather*}
% {\twbp@testHspace \@@over}
{\twbp@testHspace \@@overwithdelims..}
% {\twbp@testHspace \@@abovewithdelims...4pt}
% {\twbp@testHspace \@@abovewithdelims...56pt}
% {\twbp@testHspace \@@abovewithdelims...6pt}
{\twbp@testHspace \@@abovewithdelims.. \twbp@overRuleThickness}
{\twbp@testHspace \@@abovewithdelims.. \fontdimen8\textfont3}
\end{gather*}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment