Math & Sciencemoving line to the right

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
abu aasiyah
Posts: 26
Joined: Wed Sep 30, 2009 7:04 pm

moving line to the right

Post by abu aasiyah »

Hey,

I have the following code:

Code: Select all

\documentclass[12pt,a4paper,danish]{article} 
\usepackage[latin1]{inputenc} 
\usepackage[danish]{babel} % danske overskrifter
\usepackage[T1]{fontenc} 
\usepackage{lmodern} 
\usepackage{graphicx} 
\usepackage{mathtools}
\usepackage{amsmath}

\begin{document}

\begin{align*}
&\varphi_{0}''''=\frac{p}{EI} &, \qquad \varphi_{0}(0)=\varphi_{0}(l) = \varphi_{0}'(0)=\varphi_{0}'(l)=0 && \\
&\varphi_{1}''''=0 &, \qquad \varphi_{1}(0)=1 , \qquad \varphi_{1}(l)=\varphi_{1}'(0)=\varphi_{1}'(l)=0 \\
&\varphi_{2}''''=0 &, \qquad \varphi_{2}'(0)=1 , \qquad \varphi_{2}(0)=\varphi_{2}(l)=\varphi_{2}'(l)=0 \\
&\varphi_{3}''''=0 &, \qquad \varphi_{3}(l)=1 , \qquad \varphi_{3}(0)=\varphi_{3}'(0)=\varphi_{3}'(l)=0 \\
&\varphi_{4}''''=0 &, \qquad \varphi_{4}'(l)=1 , \qquad \varphi_{4}(0)=\varphi_{4}(l)=\varphi_{4}'(0)=0 
\end{align*}

\end{document}
When i compile the first equation row is not aligned with the rest of the rows. I would like the first comma in the first row to be aligned with the first comma in the rest of the rows.

Thanks in advance.

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

moving line to the right

Post by localghost »

Try the alignat* environment from amsmath.

Code: Select all

\begin{alignat*}{4}
  \varphi_{0}''''&=\frac{p}{EI}\; &&, &&&\qquad \varphi_{0}(0)=\varphi_{0}(l) = \varphi_{0}'(0)=\varphi_{0}'(l)=0 \\
  \varphi_{1}''''&=0 &&, \qquad \varphi_{1}(0)&=1 ,&& \qquad \varphi_{1}(l)=\varphi_{1}'(0)=\varphi_{1}'(l)=0 \\
  \varphi_{2}''''&=0 &&, \qquad \varphi_{2}'(0)&=1 , &&\qquad \varphi_{2}(0)=\varphi_{2}(l)=\varphi_{2}'(l)=0 \\
  \varphi_{3}''''&=0 &&, \qquad \varphi_{3}(l)&=1 , &&\qquad \varphi_{3}(0)=\varphi_{3}'(0)=\varphi_{3}'(l)=0 \\
  \varphi_{4}''''&=0 &&, \qquad \varphi_{4}'(l)&=1 ,&& \qquad \varphi_{4}(0)=\varphi_{4}(l)=\varphi_{4}'(0)=0
\end{alignat*}
More information can be found in the manual.

You don't need the danish language option twice. Use it as global option for the document class in order to pass it to other packages that may need it.


Best regards
Thorsten
Post Reply