2

Possible Duplicate:
Changing the apperance of equation numbers with amsmath

I would like to move an equation number from its default position a little bit left.

(I learned to move an equation a little bit left from this site. But I could not locate any reference to move the equation number a little bit left. I searched this site with "move equation number".)

The following is the code that I am using.

\documentclass[12pt]{report}
\usepackage{graphicx}
\usepackage{amssymb}

\begin{document}
\begin{equation}
\hspace{-9cm}a_1+d_1=47
\end{equation}
\end{document}

Edited Question:

How can I align both equations and the equation numbers in the following code?

\documentclass{article}
\usepackage{amsmath}
\makeatletter

\def\mytagform#1{\maketag@@@{\bfseries(\ignorespaces#1\unskip\@@italiccorr)}\hspace{3cm}}
\def\print@eqnum{\mytagform\theequation}
\makeatother
\begin{document}
\begin{align}
\label{eq:eq1}
\hspace{-6cm}a_1+7d=47
\end{align}

\begin{align}
\label{eq2}
\hspace{-6cm}a_1+20d=112
\end{align}

\end{document}
Sony
  • 3,920
  • 2
    Please, see the question I linked in my edit; it should have all the necessary information. If not, please be more specific in your question. – egreg Sep 25 '11 at 21:03
  • @egreg Thank you. That reference is enough for me to move on. I do not understand how it works (yet) but I used your (new) align environment (instead of the equation environment) to get the desired effect. – Sony Sep 25 '11 at 21:24
  • It's hard to understand the role of \hskip{-6cm} in that code. If you want "left aligned" equations, consider the fleqn option to amsmath. – egreg Sep 25 '11 at 21:45
  • If you remove the \hspace{-6cm} the equation numbers will be aligned. – Peter Grill Sep 25 '11 at 21:49
  • I wanted to move an equation few cms (say 6 cms) to left and then reduce the gap between the equation and the equation number by a different amount (say 3 cms). I still do not have a solution. However, as I mentioned, I am playing with Andrew Stacey's answer to the question referred by egreg. Thanks to everyone who made comments. I truly appreciate this site. – Sony Sep 25 '11 at 22:28
  • @Sony: have you considered using, for example, a minipage and one of the subsidiary environments (gathered, aligned, or alignedat) from amsmath? – Gonzalo Medina Sep 25 '11 at 22:39
  • As you seem to have found something that works via that other question, I've cast the last vote to close this as a duplicate of that one. If there's something that you can't figure out, please do post a new question explaining what you tried and what didn't work. – Andrew Stacey Sep 26 '11 at 07:33

1 Answers1

1

A short answer to the edited question would be to use \mathrlap from the mathtools package, together with a \phantom to obtain the correct horizontal alignment:

\usepackage{mathtools}% http://ctan.org/pkg/mathtools
...
\hspace{-6cm}\mathrlap{a_1+7d=47}\phantom{a_1+20d=112}
...
\hspace{-6cm}a_1+20d=112

Correct alignment of equation numbers

Regardless, as @egreg suggests in his comment, using \hspace for horizontal movement to some (arbitrary?) length of -6cm seems a bit bizarre.

Werner
  • 603,163
  • Thank you very much. I deleted the edited question" as I found a reasonable solution by using Andrew Stacey's solution to the question posted by egreg. But your solution seems much nice. Therefore, I retyped theedited question". Sorry. – Sony Sep 25 '11 at 22:11