3

I am writing a mathematical model using eqnarray environment in beamer, the problem is that I need it to be smaller, so I tried to use resize it using \scalebox or resizebox but I got error (not familiar with them thoug). Is there an easy way to resize the eqnarray environment ? (Do not want to use the \small, \tiny to change font size). Below there is a little equation I would like to apply some resize action. Thanks in advance.

\documentclass[hyperref={pdfpagelabels=false}]{beamer} \usepackage{amssymb,amsmath} \begin{document} \begin{frame}{test} \begin{eqnarray} && \textbf{TP} ~~\text{Max} \sum_{i \in N\setminus\{4\}} J_{i} z_{i} \label{S1}\\ && \text{st} \nonumber\\ && \sum_{j \in N} xv_{ij} = z_{i}, ~~\forall i \in N \label{S2} \end{frame} \end{document} 
1
  • Your objective isn't entirely clear. On the one hand, you say you don't want to use a smaller font size (via an instruction such as \tiny, say). On the other hand, you also say that the system of equations needs to be made smaller. What's driving the implied preference for \resizebox over using a smaller-than-normal font size? Commented Mar 2, 2018 at 6:56

2 Answers 2

3

with use of mathtools and nccmath you can slightly reduce size of equation (without changing font size):

\documentclass[hyperref={pdfpagelabels=false}]{beamer} \usepackage{mathtools, % instead amsmath, provide `\mathclap` nccmath, % for smaller `sum` symbol amssymb} \begin{document} \begin{frame}{test} \begin{align} & \textbf{TP} ~~\max \medop\sum_{\mathclap{i \in N\setminus\{4\}}} J_{i} z_{i} \label{S1}\\ & \text{st } \medop\sum_{j \in N} xv_{ij} = z_{i},\ \forall i \in N \label{S2} \end{align} \end{frame} \end{document} 

note: eqnarray is long time deprecated and replaced with math environment from amsmath.

enter image description here

for comparison result with your mwe:

enter image description here

1

Don't use \resizebox or scalebox unless you're fine with making your document look like an attempt at a ransom note.

To conserve some (vertical) space, don't place the "such that" statement on a separate line, and do place the limits of summation to the right of the summation symbols rather than below and above them; do this by writing \sum\nolimits. And, do use LaTeX "operators" such as \max for some standard math notation.

Since there seems to be no reason to perform vertical alignment, just use a gather environment. A final comment: The eqnarray environment is badly deprecated and should be avoided. If you must perform alignment across equations, use the align environment (provided by the amsmath package).

The following screenshot provides a before-and-after comparison; the first two equations generate your code, and the next two show a space savings of more than a third -- all without having to resort to \resizebox-based tricks.

enter image description here

\documentclass{beamer} \begin{document} \begin{frame}{test} \hrule \begin{eqnarray} && \textbf{TP} ~~\text{Max} \sum_{i \in N\setminus\{4\}} J_{i} z_{i} \label{S3}\\ && \text{st} \nonumber\\ && \sum_{j \in N} xv_{ij} = z_{i}, ~~\forall i \in N \label{S4} \end{eqnarray} \hrule \begin{gather} \mathbf{TP}\quad \max \sum\nolimits_{i\in \mathbb{N}\setminus\{4\}} J_{i} z_{i} \label{S1}\\ \text{s.t. } \sum\nolimits_{j \in N} xv_{ij} = z_{i}\quad \forall i\in \mathbb{N} \label{S2} \end{gather} \hrule \end{frame} \end{document} 
2
  • In that context, “s.t.” stands for “subject to” Commented Mar 2, 2018 at 6:58
  • @egreg - Many thanks for pointing out this issue. I'll apply the fix. Commented Mar 2, 2018 at 6:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.