Math & ScienceAlignment problem

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Alignment problem

Post by bazman »

Hi there,

I would like to know how to alter the following code so that the equals sign in both equations are aligned and that only one number appears for both equations.

Code: Select all

\documentclass{article} % Your input file must contain these two lines
\usepackage{natbib}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{bm}
\usepackage{grffile}
\usepackage{graphicx}
\usepackage[%
  font=small,
  labelfont=bf,
  figurewithin=section,
  tablewithin=section,
  tableposition=top
]{caption}
\numberwithin{equation}{section}

\makeatletter
  \def\env@matrix{\hskip -\arraycolsep
  \let\@ifnextchar\new@ifnextchar
  \array{*\c@MaxMatrixCols l}}
\makeatother

\begin{document} % plus the \end{document} command at the end
\parskip = 1pc %change spacing between paragraphs
\parindent = 0pc

\begin{align}
f_j(t)=X_j(f) + \alpha    \\   
dX_j(t)=\beta(t)X_j(t)dW_t  
\end{align}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Alignment problem

Post by gmedina »

Hi,

you can use something like the following:

Code: Select all

\begin{align}
  \begin{split}
     f_j(t) &= X_j(f) + \alpha. \\   
    dX_j(t) &= \beta(t)X_j(t)dW_t .
  \end{split}
\end{align}
P.S.: in other threads we have suggested you to read basic documentation about typesetting mathematical expressions using LaTeX; please, act accordingly.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Alignment problem

Post by localghost »

With a close look into the amsmath manual you would have found a solution by yourself.

Code: Select all

\begin{equation}\label{eqn:aligned}
  \begin{aligned}
    f_j(t)&=X_j(f)+\alpha \\
    dX_j(t)&=\beta(t)X_j(t)dW_t 
  \end{aligned}
\end{equation}
Package manuals are made for searching a solution. Another source for possible solutions is the search function of the forum.


Best regards
Thorsten
bazman
Posts: 78
Joined: Mon Jan 26, 2009 3:24 am

Re: Alignment problem

Post by bazman »

OK thanks.
Post Reply