2

I have the following LaTeX code:

\begin{subequations} 
\begin{align}
F_h(t) = F(\Delta y) = \left\{
            \begin{array}{lr}
                K_h (\Delta y)^{P_h} \; \text{if} \; \Delta y > 0\\
                0 \; \; \hspace{1.23cm}\; \text{if} \; \Delta y \leq 0
            \end{array}
            \right. \label{eqn: hammer1}\\
F_h(t) = -m_h \label{eqn: hammer2}
\end{align}
\end{subequations}

when I compile it, the 2nd equation is aligned to the right-most margin of equation 1. How do I set it such that the 2nd equation is aligned to the left-most margin of the first equation?

migrated from stackoverflow.com May 1 '14 at 19:23

This question came from our site for professional and enthusiast programmers.

3

You forgot to place the alignment character inside your align construction. Also, consider using cases for the conditional constructions:

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools

\begin{document}

\begin{subequations} 
\begin{align}
F_h(t) &= F(\Delta y) = {\begin{cases}
                K_h (\Delta y)^{P_h} & \text{if $\Delta y > 0$} \\
                0                    & \text{if $\Delta y \leq 0$}
            \end{cases}}
            \label{eqn: hammer1} \\
F_h(t) &= -m_h \label{eqn: hammer2}
\end{align}
\end{subequations}

\end{document}

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.