在 Lyx 中,如何減少/增加案例環境中的垂直距離?

在 Lyx 中,如何減少/增加案例環境中的垂直距離?

cases我讀了一些相關的文章,但我仍然無法控制環境中的垂直距離。我正在使用Lyx。

例如,我想減少案例兩條線之間的垂直距離

在此輸入影像描述

我從 Latex Preview 複製了程式碼

\[
x_{ij}^{k}=
\begin{cases}
1, & \textrm{if vehicle \ensuremath{k} travels from \ensuremath{i} to \ensuremath{j}}\\
0, & \textrm{otherwise}
\end{cases}
\]

答案1

我提出兩種可能性:

– 將方程式嵌套在singlespace環境中,並使用cases*環境來mathtools簡化程式碼(在&自動處於文字模式後),

– 或加載empheq包(加載mathtools,加載amsmath)並使用同名環境align*代替cases

\documentclass{article}
\usepackage{empheq}
\usepackage{setspace}

\begin{document}

\doublespacing

Blahblahblah

\begin{singlespace}
\[ x_{ij}^{k}=\begin{cases*}
1, & if vehicle \ensuremath{k} travels from \ensuremath{i} to \ensuremath{j} \\
0, & otherwise
\end{cases*}\]
\end{singlespace}

\begin{empheq}[left={ x_{ij}^{k}=\empheqlbrace}]{align*}
1, & \quad\textrm{if vehicle \ensuremath{k} travels from \ensuremath{i} to \ensuremath{j}} \\[-2ex]
0, & \quad\textrm{otherwise}
\end{empheq}

\end{document} 

在此輸入影像描述

相關內容