3

I'm working with a long equation in case environment, the problem is that the equation overlaps the equation number... any ideas on how to solve that problem.

I've thought on aligning it all to the left, tried flushleft but i can't manage it to work.

  \begin{numcases}{\phi(x) =}
       -\frac{e^{-\frac{x}{k}}T_0\Big(-ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x)+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x)\Big)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  $x \in [0,\frac{L}{2}],$   \\
       \frac{e^{-\frac{L+2x}{2k}}T_0\Big(-ke^{\frac{3L}{2k}}+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x)+e^{\frac{L+x}{k}}(-k+L-x)\Big)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  $x \in [\frac{L}{2},L].$
  \end{numcases}
3

Here is one possibility.

\documentclass{article}
\usepackage{mathtools}
\usepackage{empheq}

\begin{document}
    \begin{empheq}[left={\phi(x) =\empheqlbrace}]{align}
       &-\frac{e^{-\frac{x}{k}}T_0(A)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  x \in \biggl[0,\frac{L}{2}\biggr],   \\
       &\frac{e^{-\frac{L+2x}{2k}}T_0(B)}{2\Big(1+e^{\frac{L}{2k}}\Big)GJ_t}\text{,} &  x \in \biggl[\frac{L}{2},L\biggr].
  \end{empheq}
  where
  \begin{align*}
A &= -ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x)+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x) \\
B &=  -ke^{\frac{3L}{2k}}+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x)+e^{\frac{L+x}{k}}(-k+L-x)
  \end{align*}
\end{document}

enter image description here

  • that is a possibility but i was trying to avoid that – Sebas Apr 15 '15 at 15:38
  • @Sebas Why to avoid. This is the best possibility, keeping your readers in mind. :-) – user11232 Apr 15 '15 at 15:40
  • because I've another similar system and i would have to add four more equations A, B, C and D – Sebas Apr 15 '15 at 15:46
2

There's no hope of having those long formulas in one line.

  1. The denominator is the same, so you can move it in front of \phi(x)
  2. The denominators can be split across two or three lines
  3. numcases should not be used

Example

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

\begin{document}

\begin{empheq}[
  left={2\bigl(1+e^{\frac{L}{2k}}\bigr)GJ_t\phi(x)=\empheqlbrace}
]{align}
&\begin{aligned}
  &-e^{-\frac{x}{k}}T_0\Bigl(-ke^{\frac{L}{2k}}-e^{\frac{x}{k}}(k+x) \\
  &\qquad+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k-x)\Bigr),
\end{aligned}
  &  x \in \biggl[0,\frac{L}{2}\biggr],   \\[2ex]
&\begin{aligned}
  &e^{-\frac{L+2x}{2k}}T_0\Bigl(-ke^{\frac{3L}{2k}} \\
  &\qquad+ke^{\frac{2x}{k}}+e^{\frac{L+2x}{2k}}(k+L-x) \\
  &\qquad+e^{\frac{L+x}{k}}(-k+L-x)\Bigr),
\end{aligned}
  &  x \in \biggl[\frac{L}{2},L\biggr].
\end{empheq}

\end{document}

enter image description here

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.