2

I'm having trouble figuring out how to achieve some sort of consistency when I work with vertical spacing in cases environments where the cases themselves have multiple rows.

In the second version of the equation below, the multlined environment introduces too much space for the different cases. This can be adjusted by using e.g. \\[-3ex] and the like. While I'm not certain that there should be a need for it, the same method could be used to add extra spaces between the cases (\\[3ex]). But I'm pretty much just testing and trying to find something that doesn't look too bad.

Is there some way of giving this exercise a bit more structure and consistency? I want the rows of each case look like the belong together and the cases to look like they are distinct. Or am I just using a bad method of to reduce the amount space the equation takes up horisontally?

\documentclass{article}
\usepackage{amsmath,mathtools}
\begin{document}
  \begin{align}
    \Delta(i, x; \symbf{p}, \symbf{p}')
    &= \begin{cases}
      \mathrm{e}^{1 / \alpha} {\Bigl(\frac{q_{\mathrm{i}}}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \left(1 + (1 - \alpha) \frac{p_{\mathrm{h}}' - p_{\mathrm{h}}^{\mathrm{r}}}{q_{\mathrm{i}}}\right) - 1 & \text{if \(\nu = 1\), \(i = 1\)} \\
      \mathrm{e}^{1 / \alpha} {\Bigl(\frac{p_{\mathrm{h}} + \delta}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \left(1 + (1 - \alpha) \frac{p_{\mathrm{h}}' - p_{\mathrm{h}}}{p_{\mathrm{h}} + \delta}\right) - 1 & \text{if \(\nu = 1\), \(i \neq 1\)} \\
      {\biggl({\Bigl(\frac{q_{\mathrm{i}}}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \left(1 + (1 - \alpha) \frac{p_{\mathrm{h}}' - p_{\mathrm{h}}^{\mathrm{r}}}{q_{\mathrm{i}}}\right)\biggr)}^{1 / \alpha} - 1 & \text{if \(\nu \neq 1\), \(i = 1\)} \\
      {\biggl({\Bigl(\frac{p_{\mathrm{h}} + \delta}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \left(1 + (1 - \alpha) \frac{p_{\mathrm{h}}' - p_{\mathrm{h}}}{p_{\mathrm{h}} + \delta}\right)\biggr)}^{1 / \alpha} - 1 & \text{if \(\nu \neq 1\), \(i \neq 1\)}
    \end{cases} \\
    &= \begin{cases}
      \begin{multlined}
        \mathrm{e}^{1 / \alpha} {\Bigl(\tfrac{q_{\mathrm{i}}}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \\ \cdot \left(1 + (1 - \alpha) \tfrac{p_{\mathrm{h}}' - p_{\mathrm{h}}^{\mathrm{r}}}{q_{\mathrm{i}}}\right) - 1
      \end{multlined} & \text{if \(\nu = 1\), \(i = 1\)} \\
      \begin{multlined}
        \mathrm{e}^{1 / \alpha} {\Bigl(\tfrac{p_{\mathrm{h}} + \delta}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \\ \cdot \left(1 + (1 - \alpha) \tfrac{p_{\mathrm{h}}' - p_{\mathrm{h}}}{p_{\mathrm{h}} + \delta}\right) - 1
      \end{multlined} & \text{if \(\nu = 1\), \(i \neq 1\)} \\
      \begin{multlined}
        \biggl({\Bigl(\tfrac{q_{\mathrm{i}}}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \\ \hphantom{\biggl(} \cdot \left(1 + (1 - \alpha) \tfrac{p_{\mathrm{h}}' - p_{\mathrm{h}}^{\mathrm{r}}}{q_{\mathrm{i}}}\right)\biggr)^{1 / \alpha} - 1
      \end{multlined} & \text{if \(\nu \neq 1\), \(i = 1\)} \\
      \begin{multlined}
        \biggl({\Bigl(\tfrac{p_{\mathrm{h}} + \delta}{p_{\mathrm{h}}' + \delta}\Bigr)}^{1 - \alpha} \\ \hphantom{\biggl(} \cdot \left(1 + (1 - \alpha) \tfrac{p_{\mathrm{h}}' - p_{\mathrm{h}}}{p_{\mathrm{h}} + \delta}\right)\biggr)^{1 / \alpha} - 1
      \end{multlined} & \text{if \(\nu \neq 1\), \(i \neq 1\)}
    \end{cases}
  \end{align}
\end{document}

Results

2 Answers 2

3

Or am I just using a bad method for reducing the amount space the equation takes up horisontally?

I can't see a good reason for using multlined here. To enforce uniform sizes of the tall round parentheses, don't go back and forth between \Bigl/\Bigr and \left/\right. Instead, use \Bigl/\Bigr throughout, and don't hesitate to switch the delimiter type, say, to square brackets for the outermost delimiters. In the screenshot posted below, notice how the space between rows 3 and 4 is the same as that between rows 1 and 2 (and, for that matter, between rows 2 and 3); that's not the case in the screenshot posted by the OP.

Separately, feel free to use a spacing modifier such as \jot to increase the vertical separation between rows. And, do please see fit to get rid of the needless code clutter caused by encasing the \Bigl...\Bigr and \left...\right constructs in curly braces.

I can't see a good reason for using \mathrm for the h, i, and r subscripts/superscripts either. For sure, the OP uses a "regular", i.e., math-italic i in the conditioning phrases. Anyway, if it's essential to use upright lettering for the i, h, and r terms, I'd use \symup rather than \mathrm as the OP appears to be using the unicode-math package.

enter image description here

% !TEX TS-program = lualatex
\documentclass{article}
\usepackage{amsmath}      % for 'cases' environment and '\jot' macro
\usepackage{unicode-math} % for '\symbf' command

\begin{document}

\begin{equation}
\Delta(i, x; \symbf{p}, \symbf{p}')
= \begin{cases}
\mathrm{e}^{1/\alpha} \Bigl(\frac{q_{i}}{p_{h}' + \delta}\Bigr)^{\!1-\alpha} 
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}^{r}}{q_{i}}\Bigr) - 1 
   & \text{if \(\nu = 1\), \(i = 1\)} \\[2\jot]
\mathrm{e}^{1/\alpha} \Bigl(\frac{p_{h} + \delta}{p_{h}' + \delta}\Bigr)^{\!1-\alpha} 
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}}{p_{h} + \delta}\Bigr) - 1 
   & \text{if \(\nu = 1\), \(i \neq 1\)} \\[2\jot]
\Bigr[\Bigl(\frac{q_{i}}{p_{h}' + \delta}\Bigr)^{\!1-\alpha} 
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}^{r}}{q_{i}}\Bigr)
   \Bigr]^{1/\alpha} \!- 1 
   & \text{if \(\nu \neq 1\), \(i = 1\)} \\[2\jot]
\Bigl[\Bigl(\frac{p_{h} + \delta}{p_{h}' + \delta}\Bigr)^{\!1-\alpha} 
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}}{p_{h} + \delta}\Bigr)
   \Bigr]^{1/\alpha} \!- 1 
   & \text{if \(\nu \neq 1\), \(i \neq 1\)}
\end{cases} 
\end{equation}

\end{document}
8
  • Thanks for the many tips! Sorry for neglecting to include unicode-math... As for the math-italic i vs the roman letter, the former is a variable whereas the latter are labels. (This is me trying to follow CMOS 12.36: "Abbreviations or words that serve as labels in subscripts or superscripts are usually set in roman type".
    – Fredrik P
    Nov 21, 2023 at 8:42
  • 1
    @FredrikP - If you find it necessary to introduce a line break somewhere in the material to the left of the & dividers in a cases environment, I'd recommend you use aligned[b] environments, not multlined environments, and employ a fixed horizontal offset of, say, \quad or \qquad at the start of the continuation rows.
    – Mico
    Nov 21, 2023 at 9:42
  • 1
    Thanks for the aligned[b] tip!
    – Fredrik P
    Nov 21, 2023 at 9:53
  • 1
    @FredrikP - Ah, I was assuming that the letter i in the subscript position had the same meaning as the letter ì in \(i = 1\) or \(i \ne 1\) -- and hence should also be typeset the same way. If, to the contrary, the upright-i and italic-i letters have different meanings, you may want to choose a different letter for one of them...
    – Mico
    Nov 21, 2023 at 9:57
  • 1
    The letter i in \(i = 1\) and \(i \neq 1\) is indeed distinct from the subscript i. Perhaps there is still room for notational improvements...
    – Fredrik P
    Nov 21, 2023 at 10:01
3

With use of \medmath macro defined in the nccmath package (which reduce equation size for about 20 %) and dcases defined in the mathtools package you can get the following result:

enter image description here

\documentclass{article}
\usepackage{lipsum}
\usepackage{nccmath, mathtools}  
\DeclareMathOperator{\e}{e}


\begin{document}
\lipsum[66]
    \begin{equation}\medmath{
\Delta(i, x; p, p')
= \begin{dcases}
\e^{1/\alpha} \Bigl(\frac{q_{i}}{p_{h}' + \delta}\Bigr)^{1-\alpha}
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}^{r}}{q_{i}}\Bigr) - 1
   & \text{if } \nu = 1,\; i = 1    \\
\e^{1/\alpha} \Bigl(\frac{p_{h} + \delta}{p_{h}' + \delta}\Bigr)^{1-\alpha}
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}}{p_{h} + \delta}\Bigr) - 1
   & \text{if } \nu = 1,\; i \neq 1 \\
\biggl[\Bigl(\frac{q_{i}}{p_{h}' + \delta}\Bigr)^{1-\alpha}
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}^{r}}{q_{i}}\Bigr)
    \biggr]^{1/\alpha} - 1
   & \text{if } \nu \neq 1,\; i = 1  \\
\biggl[\Bigl(\frac{p_{h} + \delta}{p_{h}' + \delta}\Bigr)^{1-\alpha}
   \Bigl(1 + (1-\alpha) \frac{p_{h}' - p_{h}}{p_{h} + \delta}\Bigr)
    \biggr]^{1/\alpha} - 1
   & \text{if } \nu \neq 1\), \(\; i \neq 1 
\end{dcases}}
    \end{equation}
\end{document}
2
  • +1. Since you're using a dcases environment, you may also want to use \bigg[lr] instead of \Big[lr].
    – Mico
    Nov 21, 2023 at 9:45
  • @Mico, good point. Now they looks a bit to small. I will enlarge them ASAP
    – Zarko
    Nov 21, 2023 at 9:56

You must log in to answer this question.

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