Math & Sciencealignment problem

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

alignment problem

Post by abu aasiyah »

Hello,

As usual I am having problems with my alignment. I think I have to make a selfstudy on this subject. Belox are two column(one to the right og the arrow and one to the left). As is obvious the column to the left looks weird. How can I align it to the left?

Code: Select all

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

\begin{document}

\begin{align*}
\int\varphi''''_{1}& \qquad \Leftrightarrow \qquad &\varphi'''_{1}=C_{1} &\\
\int\varphi'''_{1} &\qquad \Leftrightarrow \qquad & \varphi''_{1}=C_{1}\xi + C_{2} \\
\int\varphi''_{1} &\qquad \Leftrightarrow \qquad & \varphi'_{1}=\frac{1}{2}C_{1}\xi^{2} + C_{2}\xi + C_{3} \\
\int\varphi'_{1} &\qquad \Leftrightarrow \qquad & \varphi_{1}=\frac{1}{6}C_{1}\xi^{3} + \frac{1}{2}C_{2}\xi^{2} + C_{3}\xi + C_{3} 
\end{align*}

\end{document}

Thanks.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

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

alignment problem

Post by localghost »

I remember that some time ago you introduced a similar problem [1]. At that time I suggested to use the alignat* environment. I do the same here.

Code: Select all

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

\begin{document}
  \begin{alignat*}{2}
    \int\varphi''''_1 \qquad &\Leftrightarrow \qquad & \varphi'''_1&=C_1 \\
    \int\varphi'''_1 \qquad &\Leftrightarrow \qquad & \varphi''_1&=C_1\xi+C_2 \\
    \int\varphi''_1 \qquad &\Leftrightarrow \qquad & \varphi'_1&=\frac{1}{2}C_1\xi^2+C_2\xi+C_3 \\
    \int\varphi'_1 \qquad &\Leftrightarrow \qquad & \varphi_1&=\frac{1}{6}C_1\xi^3+\frac{1}{2}C_2\xi^2+C_3\xi+C_3
  \end{alignat*}
\end{document}
Furthermore I suggest to take a look into the "Math mode" document. There you will find some useful explanations concerning this environment.

[1] moving line to the right


Best regards
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10359
Joined: Mon Mar 10, 2008 9:44 pm

alignment problem

Post by Stefan Kottwitz »

Hi Abu,

very good example, because it's compilable. The alignment of this math environment is right in the left column and left in the right column, aligning at the relation symbol. You could align at more places using the alignat environment:

Code: Select all

\begin{alignat*}{2}
&\int\varphi''''_{1}& \qquad \Leftrightarrow \qquad &\varphi'''_{1}=C_{1} \\
&\int\varphi'''_{1} &\qquad \Leftrightarrow \qquad & \varphi''_{1}=C_{1}\xi + C_{2} \\
&\int\varphi''_{1} &\qquad \Leftrightarrow \qquad & \varphi'_{1}=\frac{1}{2}C_{1}\xi^{2} + C_{2}\xi + C_{3} \\
&\int\varphi'_{1} &\qquad \Leftrightarrow \qquad & \varphi_{1}=\frac{1}{6}C_{1}\xi^{3} + \frac{1}{2}C_{2}\xi^{2} + C_{3}\xi + C_{3}
\end{alignat*}
It could be even better aligned, for instance additionally on the = equal sign.

Code: Select all

\begin{alignat*}{3}
&\int\varphi''''_{1}& \qquad \Leftrightarrow \qquad &&\varphi'''_{1}&=C_{1} \\
&\int\varphi'''_{1} &\qquad \Leftrightarrow \qquad && \varphi''_{1}&=C_{1}\xi + C_{2} \\
&\int\varphi''_{1} &\qquad \Leftrightarrow \qquad && \varphi'_{1}&=\frac{1}{2}C_{1}\xi^{2} + C_{2}\xi + C_{3} \\
&\int\varphi'_{1} &\qquad \Leftrightarrow \qquad && \varphi_{1}&=\frac{1}{6}C_{1}\xi^{3} + \frac{1}{2}C_{2}\xi^{2} + C_{3}\xi + C_{3}
\end{alignat*}
Stefan
LaTeX.org admin
Post Reply