2

The code

 \[\boxed{\begin{split}
     3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + \text{skill} \\
     &\text{or} \\
    3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + 4 \\
     &\text{or} \\
    3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + \text{skill} \\
     &\text{or} \\
    3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + 4
 \end{split}}\]

works.

But the code

 \[\begin{split}
     \boxed{3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + \text{skill}} \\
     &\text{or} \\
    \boxed{3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + 4} \\
     &\text{or} \\
    \boxed{3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + \text{skill}} \\
     &\text{or} \\
    \boxed{3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + 4}
 \end{split}}\]

doesn't.

How can I make it work?

2
  • I think you have your examples backwards: the first one that you say works, generates an error. It would be easier to test if you provided complete examples not just fragments. – David Carlisle Oct 17 '16 at 23:54
  • 1
    Perhaps you're interested in this answer? – Emma Oct 18 '16 at 0:33
3

Here are some options:

enter image description here

\documentclass{article}

\usepackage{amsmath,eqparbox}

\begin{document}

\[
  \boxed{
    \begin{aligned}
      3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + \text{skill} \\
        &\text{or} \\
      3\mathrm{d}6 + \text{ability} + \text{skill} & \ge 10 + \text{ability} + 4 \\
        &\text{or} \\
      3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + \text{skill} \\
        &\text{or} \\
      3\mathrm{d}6 + \text{ability} + 4 & \ge 10 + \text{ability} + 4
    \end{aligned}
  }
\]

\begin{gather*}
  \boxed{\eqmakebox[LHS][r]{$3\mathrm{d}6 + \text{ability} + \text{skill}$}
    \eqmakebox[RHS][l]{${}\geq 10 + \text{ability} + \text{skill}$}} \\
    \text{or} \\
  \boxed{\eqmakebox[LHS][r]{$3\mathrm{d}6 + \text{ability} + \text{skill}$} 
    \eqmakebox[RHS][l]{${}\geq 10 + \text{ability} + 4$}} \\
    \text{or} \\
  \boxed{\eqmakebox[LHS][r]{$3\mathrm{d}6 + \text{ability} + 4$}
    \eqmakebox[RHS][l]{${}\geq 10 + \text{ability} + \text{skill}$}} \\
    \text{or} \\
  \boxed{\eqmakebox[LHS][r]{$3\mathrm{d}6 + \text{ability} + 4$}
    \eqmakebox[RHS][l]{${}\geq 10 + \text{ability} + 4$}}
\end{gather*}

\newlength{\LHSlong}\newlength{\LHSshort}%
\newlength{\RHSlong}\newlength{\RHSshort}%
\newcommand{\LHSfill}{\hspace*{\dimexpr\LHSlong-\LHSshort}}%
\newcommand{\RHSfill}{\hspace*{\dimexpr\RHSlong-\RHSshort}}%
\settowidth{\LHSlong}{$3\mathrm{d}6 + \text{ability} + \text{skill}$}%
\settowidth{\RHSlong}{${}\geq 10 + \text{ability} + \text{skill}$}%
\settowidth{\LHSshort}{$3\mathrm{d}6 + \text{ability} + 4$}%
\settowidth{\RHSshort}{${}\geq 10 + \text{ability} + 4$}%
\begin{gather*}
  \boxed{3\mathrm{d}6 + \text{ability} + \text{skill} \geq 10 + \text{ability} + \text{skill}} \\
    \text{or} \\
  \boxed{3\mathrm{d}6 + \text{ability} + \text{skill} \geq 10 + \text{ability} + 4} \RHSfill \\
    \text{or} \\
  \LHSfill\boxed{3\mathrm{d}6 + \text{ability} + 4 \geq 10 + \text{ability} + \text{skill}} \\
    \text{or} \\
  \LHSfill\boxed{3\mathrm{d}6 + \text{ability} + 4 \geq 10 + \text{ability} + 4}\RHSfill
\end{gather*}

\end{document}

The last option relies on the fact that your constructions seems deterministic with two fixed Left/Right Hand Sides. As such, we're able to measure their widths and use it to correct for the too-short equation sides.

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.