1

I would like to have the following systems horizontally aligned (the misalignment is due to some of the equations having a fraction, others not). Basically, I want (for example) all the $q_1$ on the same line. Thanks in advance for your help!

Here it is the code

\begin{tcolorbox}[title={2. Calcolo $0+X\cdot a=b$}, colback=white,colframe=black!20,coltitle=black]
\eqal{&\hs{1}0&+X\cdot &\hs{1}a&=&\hs{1}b&\hs{.2}\implies&\hs{1}\delta\mathcal{L}^{ab}_{p/c,i}\\
&\left\{
\begin{aligned}
q_1^0&=0\\
q_2^0&=0\\
q_3^0&=0\\
q_4^0&=-\frac{T}{h}\\
P_1^0&=-\frac{TL}{h}\\
P_2^0&=0\\
P_3^0&=0\\
P_4^0&=\frac{TL}{h}
\end{aligned}
\right.&+X\cdot\hs{.2}
&\left\{
\begin{aligned}
q_1^a&=-\frac{1}{2L}\\
q_2^a&=\frac{1}{2L}\\
q_3^a&=-\frac{1}{2L}\\
q_4^a&=\frac{1}{2L}\\
P_1^a&=1\\
P_2^a&=-1\\    
P_3^a&=1\\
P_4^a&=-1
\end{aligned}
\right.&=\hs{.2}
&\left\{
\begin{aligned}
q_1^b&=-\frac{X}{2L}\\
q_2^b&=\frac{X}{2L}\\
q_3^b&=-\frac{X}{2L}\\
q_4^b&=-\frac{T}{h}+\frac{X}{2L}\\
 P_1^b&=-\frac{TL}{h}+X\\
 P_2^b&=-X\\
 P_3^b&=X\\
 P_4^b&=\frac{TL}{h}-X
 \end{aligned}
 \right.\notag
 &\hs{.2}&\hs{.2}\left\{
 \begin{aligned}
 \delta\mathcal{L}_{c1}^{ab}&=\frac{Lb}{Gs}\left(-\frac{1}{2L}\right)\left(-\frac{X}{2L}\right)\\
 \delta\mathcal{L}_{c2}^{ab}&=\frac{Lh}{Gs}\left(\frac{1}{2L}\frac{X}{2L}\right)\\
\delta\mathcal{L}_{c3}^{ab}&=\frac{Lb}{Gs}\left(-\frac{1}{2L}\right)\left(-\frac{X}{2L}\right)\\
\delta\mathcal{L}_{c4}^{ab}&=\frac{Lh}{Gs}\left(\frac{1}{2L}\right)\left(-\frac{T}{h}+\frac{X}{2L}\right)\\
\delta\mathcal{L}_{p1}^{ab}&=\frac{L}{3EA}\left[1\left(-\frac{TL}{h}+X\right)\right]\\
\delta\mathcal{L}_{p2}^{ab}&=\frac{L}{3EA}\left(-1\right)\left(-X\right)\\
\delta\mathcal{L}_{p3}^{ab}&=\frac{L}{3EA}\left(1\cdot X\right)\\
\delta\mathcal{L}_{p4}^{ab}&=\frac{L}{3EA}\left[-1\left(\frac{TL}{h}-X\right)\right]\\
 \end{aligned}
 \right.
 }
 \end{tcolorbox}

Please note \hs{X} is \hspace{Xcm} (a newcommand*) and \eqal{X} is \begin{eqnarray} \left{ \begin{aligned} X \end{aligned} \right. \end{eqnarray}

enter image description here

  • welcome to tex.se! what you try so far? please show this! it is not fun to retype your equations from scratch. help us to help you! – Zarko Aug 26 '18 at 16:23
  • Right, I'm sorry but I was not sure how to paste the code. Here it is – L Mascolo Aug 26 '18 at 16:28
  • Thank you!!! (adding exclamation marks so I have enough characters :) ) – L Mascolo Aug 26 '18 at 16:51
  • thank you for code snippet, but i expect complete document beginning with \documentclass ... and ending with \end{document} with preamble loaded with only necessary package for compiling your code snippet. it seems that it contain errors, please check again. – Zarko Aug 26 '18 at 17:37
0

Add phantoms:

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

\newcommand{\phnf}{\vphantom{\left(\frac{A}{B}\right)}}

\begin{document}
\[
\begin{array}{
  @{}c
  @{}>{{}}c<{{}}
  @{}c
  @{}>{{}}c<{{}}
  @{}c
  @{}>{{}}c<{{}}
  @{}c
  @{}>{{}}c<{{}}
  @{}c
}
0 &+& X &\cdot& a&=& b &\implies&\delta\mathcal{L}^{ab}_{p/c,i} \\[4ex]
\begin{cases}
\begin{aligned}
q_1^0&=0 \phnf \\
q_2^0&=0 \phnf \\
q_3^0&=0 \phnf \\
q_4^0&=-\frac{T}{h} \phnf \\
P_1^0&=-\frac{TL}{h} \phnf \\
P_2^0&=0 \phnf \\
P_3^0&=0 \phnf \\
P_4^0&=\frac{TL}{h} \phnf
\end{aligned}
\end{cases}
&+& X &\cdot&
\begin{cases}
\begin{aligned}
q_1^a&=-\frac{1}{2L} \phnf \\
q_2^a&=\frac{1}{2L} \phnf \\
q_3^a&=-\frac{1}{2L} \phnf \\
q_4^a&=\frac{1}{2L} \phnf \\
P_1^a&=1 \phnf \\
P_2^a&=-1 \phnf \\    
P_3^a&=1 \phnf \\
P_4^a&=-1 \phnf
\end{aligned}
\end{cases}
&=&
\begin{cases}
\begin{aligned}
q_1^b&=-\frac{X}{2L} \phnf \\
q_2^b&=\frac{X}{2L} \phnf \\
q_3^b&=-\frac{X}{2L} \phnf \\
q_4^b&=-\frac{T}{h}+\frac{X}{2L} \phnf \\
P_1^b&=-\frac{TL}{h}+X \phnf \\
P_2^b&=-X \phnf \\
P_3^b&=X \phnf \\
P_4^b&=\frac{TL}{h}-X \phnf
\end{aligned}
\end{cases}
 &&
\begin{cases}
\begin{aligned}
\delta\mathcal{L}_{c1}^{ab}&=\frac{Lb}{Gs}\left(-\frac{1}{2L}\right)\left(-\frac{X}{2L}\right) \phnf \\
\delta\mathcal{L}_{c2}^{ab}&=\frac{Lh}{Gs}\left(\frac{1}{2L}\frac{X}{2L}\right) \phnf \\
\delta\mathcal{L}_{c3}^{ab}&=\frac{Lb}{Gs}\left(-\frac{1}{2L}\right)\left(-\frac{X}{2L}\right) \phnf \\
\delta\mathcal{L}_{c4}^{ab}&=\frac{Lh}{Gs}\left(\frac{1}{2L}\right)\left(-\frac{T}{h}+\frac{X}{2L}\right) \phnf \\
\delta\mathcal{L}_{p1}^{ab}&=\frac{L}{3EA}\left[1\left(-\frac{TL}{h}+X\right)\right] \phnf \\
\delta\mathcal{L}_{p2}^{ab}&=\frac{L}{3EA}\left(-1\right)\left(-X\right) \phnf \\
\delta\mathcal{L}_{p3}^{ab}&=\frac{L}{3EA}\left(1\cdot X\right) \phnf \\
\delta\mathcal{L}_{p4}^{ab}&=\frac{L}{3EA}\left[-1\left(\frac{TL}{h}-X\right)\right] \phnf
\end{aligned}
\end{cases}
\end{array}
\]

\end{document}

And never ever use eqnarray.

It's up to you having a suitable line width to contain the thing.

enter image description here

  • Thank you very much!! I will fix my super-uber use of eqnarray asap :) – L Mascolo Aug 26 '18 at 17:57

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.