# How do I align my initial conditions?

I'm trying to align my initial conditions (bottom two lines) to match the top ODEs.

 \begin{empheq}[left=\empheqlbrace]{align} \nonumber
\begin{rcases}
\dv{x}{t} = v \\
\dv{v}{t} = \frac{-kx}{m}+Asin(\omega t) - bv
\end{rcases}
\\
\begin{rcases} \nonumber
x(0)=-2 \\
v(0)=1
\end{rcases}
\end{empheq}

• Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. Please especially make clear where rcases and \dv are defined. – leandriis Feb 10 '18 at 16:26

edit: partly considered @marmot comment

like this?

it is not perfect ...

\documentclass{article}
\usepackage{empheq}

\begin{document}
\begin{empheq}[left=\empheqlbrace]{align}\nonumber
&  \begin{rcases}
\dfrac{\mathrm{d}x}{\mathrm{d}(t)}  = v                                 \\
\dfrac{\mathrm{d}v}{\mathrm{d}(t)}  = \dfrac{-kx}{m}+A\sin(\omega t) - bv \\
\end{rcases}          \\
&  \begin{rcases}\notag
x(0)   = -2\hphantom{,k+A\sin(\omega t) - bv } \\
v(0)   = 1
\end{rcases}
\end{empheq}
\end{document}


note: since mwe is not known, i anticipated the \dv{x}{t} can be own defined command, there fore i emulate it with suspected definition. however, such command is defined in physics package (not used in my mwe).

• The macro \dv{x}{t} very likely comes from the physics package, see my answer below, and it could be that you replaced by something that does not resemble the output of the macro. – user121799 Feb 10 '18 at 17:05
• @marmot, could be ... but this should tell as op with mwe, if it is from phisics package or it is defined by her/him :-) – Zarko Feb 10 '18 at 17:38
• I agree that the OP should provide an MWE. It's just that the output makes perfect sense if one uses the physics package (and becomes even better if one replaces sin by \sin ;-). Looks like I ws 2 seconds ahead of you ;-) – user121799 Feb 10 '18 at 17:44

I don't know if there is a better way than doing it "by hand".

\documentclass{article}
\usepackage{amsmath}
\usepackage{empheq}
\usepackage{physics}
\begin{document}
\begin{empheq}[left=\empheqlbrace]{align} \nonumber
\begin{rcases}
\dv{x}{t} &= v \\
\dv{v}{t} &= \frac{-kx}{m}+A \sin(\omega t) - bv
\end{rcases}
\\
\begin{rcases} \nonumber
x(0)&=-2 \\
v(0)&=\makebox[0pt][l]{1}\hphantom{\frac{-kx}{m}+A \sin(\omega t) - bv}
\end{rcases}
\end{empheq}
\end{document}


With drcases, as suggested by Bernard

\documentclass{article}
\usepackage{amsmath}
\usepackage{empheq}
\usepackage{physics}
\begin{document}
\begin{empheq}[left=\empheqlbrace]{align} \nonumber
\begin{drcases}
\dv{x}{t} = v \\
\dv{v}{t} = \frac{-kx}{m}+A \sin(\omega t) - bv
\end{drcases}
\\
\begin{drcases} \nonumber
x(0)=-2 \\
v(0)=\makebox[0pt][l]{1}\hphantom{\frac{-kx}{m}+A \sin(\omega t) - bv}
\end{drcases}
\end{empheq}
\end{document}


Or with TikZ.

\documentclass{article}
\usepackage{amsmath}
\usepackage{empheq}
\usepackage{physics}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {\strut};}
\begin{document}
\begin{empheq}[left=\empheqlbrace]{align*} \nonumber
\dv{x}{t} &= v&\tikzmark{1} &\\
\dv{v}{t} &= \frac{-kx}{m}+A \sin(\omega t) - bv&\tikzmark{2} &
\\
x(0)&=-2 &\tikzmark{3} &\\
v(0)&=1&\tikzmark{4} &
\end{empheq}
\tikz[remember picture, overlay,decoration={brace}]{%
\draw[decorate,thick] (1.north) --
(2.south) node[right,midway] {(initial conditions on velocities)};
\draw[decorate,thick] (3.north) --
(4.south) node[right,midway] {(initial conditions on positions)};}
\end{document}


• Maybe with drcases? – Bernard Feb 10 '18 at 18:16
• @Bernard I agree that this will look better (d stands for \displaystyle, right?) but I am not sure if that will lead to a simpler solution to the alignment problem. – user121799 Feb 10 '18 at 18:21
• It was only for the general look. The derivatives are much smaller than the initial conditions, which looks odd, semantically. – Bernard Feb 10 '18 at 18:29
• @Bernard I fully agree, what is even worse is that the alignment &s cause bad spacing. But since I knew that Zarko will post an answer in 2 seconds, I had to hurry up ;-) . OK, more seriously, I think one may need to create a new environment for this, or, alternatively, draw the braces with TikZ (which introduces its own problems). Anyway, thanks for your input, I'll be happy to use drcases in a revision of my answer. – user121799 Feb 10 '18 at 18:33
• @Zarko Thanks for the edit. I do not understand how that happened. There was also a wrong figure, which I fixed. Really strange. – user121799 Feb 10 '18 at 19:32