1

I'm looking for a math environment that would allow me to write two lines/equations, that needn't be aligned per se, but in which one of the lines looks like this: a = {a(x), where a(x) is a system of two equations that would get individual tags denoting the domain of each functional form of a(x).

The following MWE produces the look I'm going for, without the tags.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Some text to show vertical spacing.
\begin{align*}
    &a = \left\{
            \begin{aligned}
                b x - x^3 \\
                0 
            \end{aligned}
         \right. \\
    &\text{where } b = \frac{d^2}{e}.
\end{align*}
Some more text to show vertical spacing.
\end{document}

I tried different packages, such as empheq, but nothing quite seems capable to produce what I'm looking for. I've come up with a few ways to get something that looks almost right, one being a minipage of width equal to the \linewidth and containing a centering command. The other is very similar, but consists of defining a new environment (from an answer to another question here):

\documentclass{article}
\usepackage{empheq}
\newenvironment{mycenter}
    {\parskip=0pt\par\centering}
    {\par\noindent\ignorespacesafterend}
\begin{document}
Some text to show vertical spacing.
\begin{mycenter}
    \begin{empheq}[left={a=\empheqlbrace}]{alignat*=1}
    &b x - x^3 \tag{$x \leq 0$} \\[1em]
    &0 \tag{$x > 0$}
    \end{empheq}
    where $b = \dfrac{d^2}{e}.$
\end{mycenter}
Some more text to show vertical spacing.
\end{document}

The problem with this solution (and the minipage one), apart from the fact that it feels forced, is that the vertical spacing at the bottom is too small. Presumably this is due to the fact that I'm using \dfrac in the bottom line, but this is non-negotiable. I will not have an ugly in-line fraction there.

1

I would use the cases environment:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    Some text to show vertical spacing.
    \begin{equation}
    \begin{aligned}
    &a = \begin{cases}
        b x - x^3 & x \leq 0 \\
        0 & x > 0,
    \end{cases} \\
    &\text{where } b = \frac{d^2}{e}.
    \end{aligned}
    \end{equation}
    Some more text to show vertical spacing.
\end{document}

enter image description here

1
  • Thanks for the suggestion. It's not quite what I'm looking for, but if there's really no way of getting that I guess this is the next best thing. – Wouter Nov 28 '18 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.