3

I am looking for the best way to align systems of equations in a subequations environment with a brace on the left side and an introductive sentence. This is what I have for now :

\documentclass{article}
\usepackage{amssymb}  
\usepackage{amsmath}
\usepackage{empheq}

\begin{document}

\begin{subequations}\label{pb:init} 
  \begin{empheq}[left=\empheqlbrace]{gather}
  \textnormal{find $u_1 : \Omega_1 \to \mathbb{R}$ and $u_2 : \Omega_2 \to \mathbb{R}$ such that}, \nonumber\\
  \begin{gathered}\label{eq:initOmega1}
    \begin{array}{rclll}
      -\mu_1 \Delta u_1 & = & f_1 & \text{ in } & \Omega_1, \\
      u_1 & = & 0 & \text{ on } & \Gamma_1,
    \end{array}
  \end{gathered} \\
  \begin{gathered}\label{eq:initOmega2}
    \begin{array}{rclll}
      -\mu_2 \Delta u_2 & = & f_2 & \text{ in } & \Omega_2, \\
      u_2 & = & 0 & \text{ on } & \Gamma_2,
    \end{array}
  \end{gathered}\\
  \begin{gathered}\label{eq:initCouplage}
    \begin{array}{rclll}
      u_1 & = & u_2 & \text{ on } & \Gamma, \\
      \mu_1\nabla u_1 \cdot n_1 & = & -  \mu_2 \nabla u_2 \cdot n_2 & \text{ on } & \Gamma,
    \end{array}
  \end{gathered}
  \end{empheq}
\end{subequations}

\end{document}

The problem is that the "=" symbols are not aligned with each others and the introductive sentence is centered instead of being on the left.

Any idea on how to do that ?

4
  • please help us to help you! extend your code to complete small document with your equation beginning with \documentclass{...} and ending with `\end{document}
    – Zarko
    Jul 29, 2018 at 14:21
  • Hi Zarko, I extended the code. It should be reproductible now.
    – PeteAgor
    Jul 29, 2018 at 14:31
  • I see no reason for aligning the equality signs; I'd rather align the conditions \text{in $\Omega_1$} and so on. Also, I can't see why the introductory text should be in the brace.
    – egreg
    Jul 29, 2018 at 14:47
  • The introductory text is in the brace to reference the entire problem of finding functions that satisfy the following equations.
    – PeteAgor
    Jul 29, 2018 at 14:57

2 Answers 2

5

I can't see why the introductory text should be in the scope of the brace.

\documentclass{article}
\usepackage{amssymb}  
\usepackage{amsmath}
\usepackage{empheq}
\usepackage{eqparbox}

\newcommand{\matheqbox}[2]{\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

\begin{subequations}\label{pb:init} 
Find $u_1\colon \Omega_1 \to \mathbb{R}$ and 
$u_2\colon \Omega_2 \to \mathbb{R}$ such that
\begin{empheq}[left=\empheqlbrace]{align}
\label{eq:initOmega1}
\begin{split}
-\mu_1 \Delta u_1 &= \matheqbox{A}{f_1} \text{ in $\Omega_1$}, \\
              u_1 &= \matheqbox{A}{0}   \text{ on $\Gamma_1$},
\end{split}
\\[1ex]
\label{eq:initOmega2}
\begin{split}
-\mu_2 \Delta u_2 & = \matheqbox{A}{f_2} \text{ in $\Omega_2$}, \\
              u_2 & = \matheqbox{A}{0}   \text{ on $\Gamma_2$},
\end{split}
\\[1ex]
\label{eq:initCouplage}
\begin{split}
                      u_1 & = \matheqbox{A}{u_2} \text{ on $\Gamma$}, \\
\mu_1\nabla u_1 \cdot n_1 & = \matheqbox{A}{-\mu_2 \nabla u_2 \cdot n_2}
                                                    \text{ on $\Gamma$},
\end{split}
\end{empheq}
\end{subequations}

\end{document}

The first argument to \matheqbox should be an arbitrary tag (ASCII characters), different for every application of the trick.

enter image description here

With no alignment at equals signs:

\documentclass{article}
\usepackage{amssymb}  
\usepackage{amsmath}
\usepackage{empheq}
\usepackage{eqparbox}

\newcommand{\matheqbox}[2]{\eqmakebox[#1][l]{$\displaystyle#2$}}

\begin{document}

\begin{subequations}\label{pb:init} 
Find $u_1\colon \Omega_1 \to \mathbb{R}$ and 
$u_2\colon \Omega_2 \to \mathbb{R}$ such that
\begin{empheq}[left=\empheqlbrace]{align}
\label{eq:initOmega1}
\begin{split}
&\matheqbox{A}{-\mu_1 \Delta u_1 = f_1} \text{ in $\Omega_1$}, \\
&\matheqbox{A}{u_1 = 0}                 \text{ on $\Gamma_1$},
\end{split}
\\[1ex]
\label{eq:initOmega2}
\begin{split}
&\matheqbox{A}{-\mu_2 \Delta u_2 = f_2} \text{ in $\Omega_2$}, \\
&\matheqbox{A}{u_2 = 0}                 \text{ on $\Gamma_2$},
\end{split}
\\[1ex]
\label{eq:initCouplage}
\begin{split}
&\matheqbox{A}{u_1 = u_2} \text{ on $\Gamma$}, \\
&\matheqbox{A}{\mu_1\nabla u_1 \cdot n_1 = -\mu_2 \nabla u_2 \cdot n_2}
                          \text{ on $\Gamma$},
\end{split}
\end{empheq}
\end{subequations}

\end{document}

enter image description here

1
  • Thanks egreg, the matheqbox trick is what I was looking for !
    – PeteAgor
    Jul 29, 2018 at 15:19
3

Here's a solution that uses (a) three separate aligned environments and (b) left-hand and right-hand "math boxes" to store and display the material to the left and right of the first four = symbols. Note also that I've taken the introductory sentence out of the diplayed-equations group and that I advocate using \colon instead of : for the present use case.

enter image description here

\documentclass{article}
\usepackage{amssymb,amsmath,empheq}
%% code for right-hand-side and left-hand-side boxes
\newlength\mylenr
\newcommand\longblurbr{-\mu_2\nabla u_2\cdot n_2 \text{ on $\Gamma$.}}
\settowidth\mylenr{$\displaystyle\longblurbr$}
\newcommand\rbox[1]{\parbox{\mylenr}{$#1$}}
\newlength\mylenl
\newcommand\longblurbl{\mu_1\nabla u_1 \cdot n_1 }
\settowidth\mylenl{$\displaystyle\longblurbl$}
\newcommand\lbox[1]{\parbox{\mylenl}{\hfill$#1$}} 

\begin{document}
Find $u_1 \colon \Omega_1 \to \mathbb{R}$ and $u_2 \colon \Omega_2 \to \mathbb{R}$ such that
\begin{subequations}\label{pb:init} 
\begin{empheq}[left=\empheqlbrace]{gather}
    \begin{aligned}\label{eq:initOmega1}
      \lbox{-\mu_1 \Delta u_1} &= \rbox{f_1\text{ in $\Omega_1$,}} \\
      \lbox{u_1}               &= \rbox{0  \text{ on $\Gamma_1$,}}
    \end{aligned}\\[1ex]
    \begin{aligned} \label{eq:initOmega2}
      \lbox{-\mu_2 \Delta u_2} &= \rbox{f_2\text{ in $\Omega_2$,}} \\
      \lbox{u_2}               &= \rbox{0  \text{ on $\Gamma_2$,}}
    \end{aligned}\\[1ex]
    \begin{aligned}\label{eq:initCouplage}
      u_1        &= u_2 \text{ on $\Gamma$,} \\
     \longblurbl &= \longblurbr
    \end{aligned}
\end{empheq}
\end{subequations}

\end{document}

You must log in to answer this question.

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