語意包:帶有巢狀 \inference 的浮動前提

語意包:帶有巢狀 \inference 的浮動前提

我正在使用包semantic及其命令輸入來設定一些大步驟語義\inference

我使用 LuaLaTeX 編譯器。

然而,當我編寫更多inference命令時,其中一個表示一個公理,即沒有任何前提的規則,另一個前提開始浮動。看起來它正在嘗試進行一些垂直對齊。

這是一個例子:

\inference[\(\mathcal{E'}=\) \textsc{EC-IfF}]
{ 
    % ------- THIS PREMISE FLOATS
    \overset{\mathcal{E'_0}}
    {
             \langle b, σ \rangle \downarrow \texttt{false}
    }
    &
    {
        \inference
        [\textsc{EC-Skip}]
        {}
        {
        \langle \texttt{skip}, σ \rangle \downarrow σ
    }
    }
}
{
            \langle
            \texttt{if } b \texttt{ then } 
            (c_0 ; \texttt{ while } b \texttt{ do } c_0)
            \texttt{ else skip}, σ
            \rangle
    \downarrow
    σ''
}

螢幕截圖

答案1

在OP的例子中,基線被保留在大「分子」中。儘管有人可能認為這是正確的方法,但人們可以透過\abovebaseline[-\dp\strutbox]{...}應用於 ED-Skip 推理來覆寫該預設值。

\documentclass{article}
\usepackage{semantic,amsmath,stackengine}
\begin{document}
\inference[\(\mathcal{E'}=\) \textsc{EC-IfF}]
{ 
    % ------- THIS PREMISE FLOATS
    \overset{\mathcal{E'_0}}
    {
             \langle b, σ \rangle \downarrow \texttt{false}
    }
    &
    {
        \abovebaseline[-\dp\strutbox]{\inference
        [\textsc{EC-Skip}]
        {}
        {
        \langle \texttt{skip}, σ \rangle \downarrow σ
    }}
    }
}
{
            \langle
            \texttt{if } b \texttt{ then } 
            (c_0 ; \texttt{ while } b \texttt{ do } c_0)
            \texttt{ else skip}, σ
            \rangle
    \downarrow
    σ''
}
\end{document}

在此輸入影像描述

相關內容