8

I want to scale or resize an equation because it goes over the margin. Take this example:

$$0<a_{1}\leq a(X,t)\leq
a_{2}<+\infty, ~~~\forall X \in \Omega;~~~ \eqno(3) $$

In normal equation command I can resize it like this:

\begin{equation}
\resizebox{0.9\hsize}{!}{$
0<a_{1}\leq a(X,t)\leq
a_{2}<+\infty, ~~~\forall X \in \Omega;~~~ \eqno(3) 
$}
\end{equation}

But when I try to do the same approach for the equation with \eqno it doesn't work, it says you cannot use \eqno in math mode, even if I put the \eqno outside the resizebox it says you can't use \eqno in horizontal mode.

Note that I have hundreds of equation already written in \eqno format not \begin{equation} so it will be hard for me to convert them. Also, I want to use \eqno to customize the equation numbers.

Is there any solution for this?

  • Welcome to TeX.sx! – Peter Jansson Jan 29 '13 at 7:51
  • Let me point out that before resorting to \resizebox, you should try all your best to make the equation fit without resizing it, for example by splitting it into two or more parts. – Hendrik Vogt Jan 29 '13 at 9:36
  • @HendrikVogt I already use splitting but you know sometimes the equation is just slightly out of margin, doesn't worth a split. – Hesham Saeed Jan 29 '13 at 10:47
  • 1
    @Hesham: I know this problem very well, but resizing is somewhat poor typesetting. I always stick to some very slight manual squeezing at appropriate places, with \mkern-1mu or so. – Hendrik Vogt Jan 29 '13 at 11:23
  • Instead of using ~~~ to add space between the equation and the equation number, amsmath will place the equation number automatically, and even if you resize the equation, it will keep the equation number the same size as all the others in the document. (This was a particular request of the copyeditors at AMS.) – barbara beeton Feb 7 at 23:41
5

Here are three different approaches to circumvent the usage of \eqno:

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}

\begin{document}

\begin{equation}
  a = b
\end{equation}

This version will change the equation counter, and thus indfluence the
equation number for all subsequent equations:
\setcounter{equation}{10}
\begin{equation}\label{eq1}
\resizebox{0.5\hsize}{!}{$%
0<a_{1}\leq a(X,t)\leq%
a_{2}<+\infty, ~~~\forall X \in \Omega;~~~ 
$%
}%
\end{equation}
Equation~(\ref{eq1}).

This version steps the equation counter, but we have to revert the
change again after the equation:
\renewcommand{\theequation}{A}
\begin{equation}\label{eq2}
\resizebox{0.5\hsize}{!}{$%
0<a_{1}\leq a(X,t)\leq%
a_{2}<+\infty, ~~~\forall X \in \Omega;~~~
$%
}%
\end{equation}
\renewcommand{\theequation}{\arabic{equation}}
Equation~(\ref{eq2}).

This version does not step the equation counter:
\begin{equation}\label{eq3}
\resizebox{0.5\hsize}{!}{$%
0<a_{1}\leq a(X,t)\leq%
a_{2}<+\infty, ~~~\forall X \in \Omega;~~~
$%
}%
\tag{Z}
\end{equation}
Equation~(\ref{eq3}).

\begin{equation}
  c = d
\end{equation}
\end{document}

It depends what you want to achieve with \eqno: If you want to change all equation numbers from that point on, change the equation counter; ifyou want to change the label, but silently keep numbering the equations, use a temporary change of \theequation; if you really want just a custom tag, use \tag from amsmath.

|improve this answer|||||
7

Found some time ago interesting solution here: Resize/Scale equation in Beamer

But, the method is applicable not only in Beamer.

First, put the following code in the preamble:

\newcommand\scalemath[2]{\scalebox{#1}{\mbox{\ensuremath{\displaystyle #2}}}}

Second, use it in the following way:

\[
\scalemath{0.7}{
...
}
\]

Also can be used for certain parts of equations, e.g.

\[
A_{\zeta_{1}} = \scalemath{0.8}{\begin{bmatrix}
...
...
\end{bmatrix}.
}
\]

The problem may arise if one wants to scale the whole {align} environment, then, e.g.

\[
\scalemath{0.8}{
\begin{aligned}
...
...
\end{aligned}
}
\]

So, \scalemath does not work well if all content inside align/aligned environment is put into one scalemath, thus one has to fiddle with various walk-around solutions, e.g., put \scalemath for each separate line or part of a line, or put whole aligned and similar environments inside \scalemath.

|improve this answer|||||
  • Welcome to TeX.SX! The question is whether it works with equation numbers. Does it? – TeXnician Jul 5 '17 at 15:24
  • Thank You.It works for equations, Latex reserves certain space for equation numbers, so one cannot put – Mladen Janjic Jul 5 '17 at 15:38
  • sorry, wanted to say that, if equations are centered, seems that the same space required for equation numbers is reserved on both sides of equation, but that space depends on the font size, so not easy to calculate automatically. I use this method for journal typesetting only when some very long equations (usually more than 7-8 lines) break into the right margin, and it is too complicated to break that line, since it is inside large brackets or parentheses, part of a sum/product/integral, etc. – Mladen Janjic Jul 5 '17 at 15:48
  • Works like a charm – Blasco May 3 '19 at 8:48

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.