# Scale equation in NewEnviron

I write my long equations through a created environment nr that allows vertical alignment and manual breaking of the equations:

\documentclass{article}
\DeclareMathSizes{10}{18}{12}{8} % this option is for inline equations
\usepackage[fleqn]{amsmath}
\usepackage{graphicx}
\usepackage{environ}
\usepackage{xcolor}

\NewEnviron{nr}[2]{%
\setlength{\abovedisplayskip}{#1}
\setlength{\abovedisplayshortskip}{#1}
\setlength{\belowdisplayskip}{#2}
\setlength{\belowdisplayshortskip}{#2}
{\color{white}\hrule}
\begin{equation*}
\begin{split}
\BODY
\end{split}
\end{equation*}
%\vskip 0mm
}

\begin{document}

\begin{nr}{5pt}{0pt}&
\frac{1}{2}\cdot m\cdot v^2_{2,x}+\frac{1}{2}\cdot m\cdot v^2_{2,y}+\frac{1}{2}\cdot m\cdot v^2_{2,z}-\frac{1}{2}\cdot m\cdot v^2_{1,x}-\frac{1}{2}\cdot m\cdot v^2_{1,y}-\frac{1}{2}\cdot m\cdot v^2_{1,z}=\\&=
\int\limits^2_1{F_{\mathrm{net,x}}\cdot {dl}_x}+\int\limits^2_1{F_{\mathrm{net,y}}\cdot {dl}_y}+\int\limits^2_1{F_{\mathrm{net,z}}\cdot {dl}_z}
\end{nr}

\end{document}


I want that equation to be bigger, but failed to add \scalebox or any other scaling tool to the NewEnviron. The \DeclareMathSizes declares size of my inline equations.
How can I rescale the given equation?

• Not the solution to your problem, but your posted code is missing \usepackage{color} or \usepackage{xcolor} – user31729 Jun 7 '17 at 19:46
• You need to put the equation inisde a minipage of width {\dimexpr \textwidth/scale} so that is scales back to \textwidth. – John Kormylo Jun 8 '17 at 1:12
• your equation is already to big that can be fit in text width. so first you need first to broken it in more lines, than you can simply wrote as \begin{minipage}{\textwidth} \huge $\begin{split} ... \end{split}$ \end{minipage} – Zarko Sep 6 '17 at 10:50

I scaled the equation with resizebox inside minibox. Now the math expressions with fractions or integrals have perfect vertical spacing. Nevertheless the math without fractions/integrals contains unwanted top vertical space, as can be seen from the example:

\documentclass{article}
\DeclareMathSizes{10}{18}{12}{8} % this option is for inline equations
\usepackage[fleqn]{amsmath}
\usepackage{graphicx}
\usepackage{environ}
\usepackage{xcolor}

\NewEnviron{nr}[2]{%
\setlength{\abovedisplayskip}{#1}
\setlength{\abovedisplayshortskip}{#1}
\setlength{\belowdisplayskip}{#2}
\setlength{\belowdisplayshortskip}{#2}
\resizebox{1.1\textwidth}{!}{
\begin{minipage}[l]{\textwidth}
{\color{black}\hrule}
\vskip 0mm
\begin{equation*}
\begin{split}
\BODY
\end{split}
\end{equation*}
\vskip 0mm
\end{minipage}
}}

\begin{document}

Definujme v~bodě tělesa $\overrightarrow{V}$ o objemu $dV$ element veličiny hybnost $\overrightarrow{dp}(dV)$:

\begin{nr}{0pt}{0pt}
\overrightarrow{dp}(dV)\equiv \overrightarrow{v}\cdot dm(dV)
\end{nr}

kde $\overrightarrow{v}$ je rychlost v bodě tělesa $\overrightarrow{V}$ a $dm$ je hmotnost elementu.\vskip 10pt

V libovolném bodě tělesa $\overrightarrow{V}$ je derivace elementu hybnosti podle času:

\begin{nr}{0pt}{0pt}
\frac{d\left(\overrightarrow{dp}\left(dV\right)\right)}{d\tau }=\frac{d}{d\tau }\left(\overrightarrow{v}\cdot dm(dV)\right)
\end{nr}

\end{document}


How one can unify the vertical spacing in those equations?

Here, I applay the \scalebox to a \vbox of the nr environemnt.

\documentclass{article}
\usepackage[landscape]{geometry}
\DeclareMathSizes{10}{18}{12}{8} % this option is for inline equations
\usepackage[fleqn]{amsmath}
\usepackage{graphicx}
\usepackage{environ}
\usepackage{xcolor}

\NewEnviron{nr}[2]{%
\setlength{\abovedisplayskip}{#1}
\setlength{\abovedisplayshortskip}{#1}
\setlength{\belowdisplayskip}{#2}
\setlength{\belowdisplayshortskip}{#2}
{\color{white}\hrule}
\begin{equation*}
\begin{split}
\BODY
\end{split}
\end{equation*}
%\vskip 0mm
}

\begin{document}

\begin{nr}{5pt}{0pt}&
\frac{1}{2}\cdot m\cdot v^2_{2,x}+\frac{1}{2}\cdot m\cdot v^2_{2,y}+\frac{1}{2}\cdot m\cdot v^2_{2,z}-\frac{1}{2}\cdot m\cdot v^2_{1,x}-\frac{1}{2}\cdot m\cdot v^2_{1,y}-\frac{1}{2}\cdot m\cdot v^2_{1,z}=\\&=
\int\limits^2_1{F_{\mathrm{net,x}}\cdot {dl}_x}+\int\limits^2_1{F_{\mathrm{net,y}}\cdot {dl}_y}+\int\limits^2_1{F_{\mathrm{net,z}}\cdot {dl}_z}
\end{nr}

{\centering\scalebox{.7}{\vbox{
\begin{nr}{5pt}{0pt}&
\frac{1}{2}\cdot m\cdot v^2_{2,x}+\frac{1}{2}\cdot m\cdot v^2_{2,y}+\frac{1}{2}\cdot m\cdot v^2_{2,z}-\frac{1}{2}\cdot m\cdot v^2_{1,x}-\frac{1}{2}\cdot m\cdot v^2_{1,y}-\frac{1}{2}\cdot m\cdot v^2_{1,z}=\\&=
\int\limits^2_1{F_{\mathrm{net,x}}\cdot {dl}_x}+\int\limits^2_1{F_{\mathrm{net,y}}\cdot {dl}_y}+\int\limits^2_1{F_{\mathrm{net,z}}\cdot {dl}_z}
\end{nr}}}\par}

\end{document}