3

Consider the following example:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}

\begin{document}
    \begin{equation*}
        \begin{split}
            |\mu|(B):=\sup\left\{&\sum_{i=1}^k|\mu(B_i)|:k\in\mathbb N\text{ and}\right.\\
            &\left.B_1,\ldots,B_k\in\mathcal E\text{ are disjoint with }\biguplus_{i=1}^kB_i\subseteq B\right\}
        \end{split}
    \end{equation*} 
\end{document}

This is how the output looks like:

enter image description here

I need to break the definition into two lines, since it takes too much horizontal space. Obviously, there is a problem with the braces. Actually, I think I know what's going wrong. The problem is that the first ampersand is occurring after the first \left\{ but the corresponding closing \right. is occurring after the first ampersand. So, I guess that's causing that they cannot match. However, I don't know how I can fix this.

  • Please indicate whether you use LuaLaTeX or XeLaTeX to compile your document. – Mico Jul 18 at 6:49
  • 1
    @Mico I'm using XeLaTeX. – 0xbadf00d Jul 18 at 7:06
  • Thanks. The answer I just posted works equally well (and produces the same output) under both LuaLaTeX and XeLaTeX. – Mico Jul 18 at 7:17
5

My main recommendation is to use \biggl\{ in the first row and \biggr\} in the second. And, since you load the mathtools package, I would replace := with \coloneqq; this affects how TeX inserts whitespace on either side of ":=".

Optionally, one may encase the \biguplus_{i=1}^k B_i \subseteq B \biggr\} code block in a \smash[t]{...} wrapper. Doing so allows the two rows of the equation to be spaced a bit more more closely. (\smash[t] sets the implicit height of its argument to zero. That's ok here since there's absolutely nothing immediately "above" the \biguplus_{i=1}^k B_i \subseteq B \biggr\} material.)

I used LuaLaTeX to compile the following modified version of your code. Using XeLaTeX results in the same output.

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amssymb, amsthm, thmtools}
\usepackage{mathtools} % for \coloneqq and \DeclarePairedDelimiter macros
\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}
\usepackage{unicode-math} % requires LuaLaTeX or XeLaTeX

\begin{document}
\begin{equation*}
\begin{split}
 \abs{\mu}(B) \coloneqq \sup {}\biggl\{
 &\sum_{i=1}^k\abs{\mu(B_i)} :
  \text{$k\in\mathbb{N}$ and}\\
 &\quad\text{$B_1,\dots,B_k\in\mathcal{E}$ 
  are disjoint with }
 \smash[t]{\biguplus_{i=1}^k B_i \subseteq B \biggr\}}
\end{split}
\end{equation*}
\end{document}
1

Automatic braces are seldom correct, it is often better to do them manually:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}

\begin{document}
    \begin{equation*}
        \begin{split}
            |\mu|(B):=\sup\Bigg\{&\sum_{i=1}^k|\mu(B_i)|:k\in\mathbb N\text{ and}\\
            &B_1,\ldots,B_k\in\mathcal E\text{ are disjoint with }\biguplus_{i=1}^kB_i\subseteq B\Bigg\}
        \end{split}
    \end{equation*} 
\end{document}

If you nevertheless want automatic resizing, you can make this little trick:

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{amsmath, amsthm, amssymb, mathtools, thmtools, unicode-math}

\begin{document}
    \begin{equation*}
        \begin{split}
            |\mu|(B):=\sup\left\{\vphantom{\biguplus_{i=1}^k}\right.&\sum_{i=1}^k|\mu(B_i)|:k\in\mathbb N\text{ and} \\
            &\left. B_1,\ldots,B_k\in\mathcal E\text{ are disjoint with }\biguplus_{i=1}^kB_i\subseteq B\right\}
        \end{split}
    \end{equation*} 
\end{document}
  • It's not only the automatic resizing which is going wrong. I also get a compiler error "extra }, or forgotten \right. Missing \right. inserted. Missing \ inserted. Extra \right. Missing { inserted". – 0xbadf00d Jul 18 at 5:54
  • 2
    @0xbadf00d this works for me – Johannes D Jul 18 at 6:03
1

Your equation I would wrote it on the following way:

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{amssymb, amsthm, mathtools, thmtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\usepackage{unicode-math}

\begin{document}
    \[
\abs{\mu(B)}\coloneqq \sup \sum_{i=1}^k\abs{\mu(B_i)},\quad
    \begin{cases}
        k\in\mathbb N\text{ and} \\
        B_1,\dotsc,B_k\in\mathcal{E}\text{ are disjoint with }
            \smash[t]{\biguplus\limits_{i=1}^k B_i \subseteq B}
    \end{cases}
    \]
\end{document}

Some solution in above code are stolen from nice @Mico answer (+1).

  • Thank you for your suggestion,but to be honest, I find the look of your write up pretty ugly and - which is the more important point - I wouldn't be sure what's meant with your equation if I read it somewhere. – 0xbadf00d Jul 18 at 12:45
  • @0xbadf00d, that is your opinion. The same finding I have about your equation :-) – Zarko Jul 18 at 13:39
  • @Zarko - De gustibus non est disputandum... – Mico Jul 18 at 13:53
  • @Mico, I agree with you ... – Zarko Jul 18 at 14:23

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.