2

I know how to align these equations along the equal sign. What I want to do is put the equal sign anywhere on the page I want to, as though I was taking the aligned equations and shifting them left or right. Any ideas?

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}
\end{document}
3
  • 1
    just left or right? go the ugly way and add \hspaces to one equation (or any other horizontal spacing, e.g. \quad )
    – Bort
    Jul 27 '15 at 9:06
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Jul 27 '15 at 9:50
  • Thanks for all the help. I didn't realize I could do that with \hspace. I'm off!
    – Michael
    Jul 27 '15 at 16:44
1

Adding an \hspace before or after the longest align field will shift the whole block 1/2 of the \hspace value. So, in this MWE, after showing the generic align, I add a 2in shift first to the left and then to the right of the longest element. These should result in a net 1" shift of the block.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}
\begin{align*}
\hspace{2in}W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}
\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\hspace{2in}\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}

\end{document}

As seen in the result, enhanced with the PDF measuring tool, the left/right shifts are as predicted.

enter image description here

0

Here is a solution useing parbox

\documentclass{article}
\usepackage{mathtools}
\begin{document}\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}


\hspace{5cm}\parbox{\textwidth}{%
\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}}


\hspace{-5cm}\parbox{\textwidth}{%
\begin{align*}
W&=\frac{4}{3}\cdot\rho_w\cdot L_s\int\displaylimits_1^3(3-x)xdx\\
W&=78480J\int\displaylimits_1^3(3x-x^2)dx\\
W&=261600J
\end{align*}}
\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.