0

I have the following code in order to align some equation:

\begingroup\makeatletter\def\f@size{8}\check@mathfonts
\def\maketag@@@#1{\hbox{\m@th\large\normalfont#1}}%
\begin{empheq}[box=\widefbox]{align} \nonumber
&a_{M}^{c} = N'(t_{go},b,c) \frac{Z(y,\dot{y},t_{go},b,c)}{t^2_{go}}
\\ \nonumber
&N'(t_{go},b,c) = \frac{t_{go} \cdot \tau \cdot b}{A} 
\\ \nonumber
&Z(y,\dot{y},t_{go},b,c) = \tau \cdot b \cdot ZEM_{OGL} \left [ (1+c \cdot W_{4}) \cdot \psi(\zeta) + (W_{3}-W_{4})\cdot \zeta \right ] -c \cdot ZEM_{OGL2} \left [ (1+\tau^2 \cdot b \cdot W_{2}) \cdot \psi(\zeta)-(1+\tau^2 \cdot b \cdot W) \cdot \zeta \right ]
\\ \nonumber
&ZEM_{OGL} = x_{1}(t)+(t_{f}-t)x_{2}(t)+\frac{(t_{f}-t)^2}{2}x_{3}(t)-\tau^2 \psi(\zeta)x_{4}(t)
\\ \nonumber
&ZEM_{OGL2} = x_{2}(t) + (t-t_{f})\cdot x_{3}(t) + \tau \cdot \left [e^{-\zeta} -1 \right ]\cdot x_{4}(t)
\\ \nonumber
&W = \int_{t}^{t_{f}} \psi^2 \left (\frac{t_{f}-\zeta}{\tau} \right ) d\zeta
\\ \nonumber
&W_{2} = \int_{t}^{t_{f}} \psi \left (\frac{t_{f}-\zeta}{\tau} \right ) \cdot \frac{t-\zeta}{\tau} d\zeta 
\\ \nonumber
&W_{3} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )^2 d\zeta
\\ \nonumber
&W_{4} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )\cdot \frac{t-\zeta}{\tau} d\zeta 
\\ \nonumber
&A = (1+c \cdot w_{3})(1+\tau^2 \cdot b \cdot W) - \tau^2 \cdot b \cdot c \cdot (W-W_{2})(W_{3}-W_{4}) \nonumber
\end{empheq}\endgroup

and the result is as following:

enter image description here

How can I make the box wider than the usual margins in order to contain long equation as well?

Thank you.

  • You have the adjustbox environment from changepage. But why don't you split the longest equation? – Bernard Jan 12 '18 at 11:08
  • 1
    Also please make a full minimal example instead of posting a sniplet, makes testing a lot easier. – daleif Jan 12 '18 at 11:28
2

your equation are almost \pagewidth wide ... to put your equation in the frame, you need first locally increase \textwidth, for example with help of changepage package:

\documentclass{article}
\usepackage[strict]{changepage}
\usepackage{empheq}

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
    \begin{adjustwidth}{-2in}{-2in}
\begin{empheq}[box=\fbox]{align*}
&a_{M}^{c} = N'(t_{go},b,c) \frac{Z(y,\dot{y},t_{go},b,c)}{t^2_{go}} \\
&N'(t_{go},b,c) = \frac{t_{go} \cdot \tau \cdot b}{A}               \\
&Z(y,\dot{y},t_{go},b,c) = \tau \cdot b \cdot ZEM_{OGL} \left [ (1+c \cdot W_{4}) \cdot \psi(\zeta) + (W_{3}-W_{4})\cdot \zeta \right ] -c \cdot ZEM_{OGL2} \left [ (1+\tau^2 \cdot b \cdot W_{2}) \cdot \psi(\zeta)-(1+\tau^2 \cdot b \cdot W) \cdot \zeta \right ]    \\
&ZEM_{OGL} = x_{1}(t)+(t_{f}-t)x_{2}(t)+\frac{(t_{f}-t)^2}{2}x_{3}(t)-\tau^2 \psi(\zeta)x_{4}(t)       \\
&ZEM_{OGL2} = x_{2}(t) + (t-t_{f})\cdot x_{3}(t) + \tau \cdot \left [e^{-\zeta} -1 \right ]\cdot x_{4}(t)      \\
&W = \int_{t}^{t_{f}} \psi^2 \left (\frac{t_{f}-\zeta}{\tau} \right ) d\zeta      \\
&W_{2} = \int_{t}^{t_{f}} \psi \left (\frac{t_{f}-\zeta}{\tau} \right ) \cdot \frac{t-\zeta}{\tau} d\zeta       \\
&W_{3} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )^2 d\zeta       \\
&W_{4} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )\cdot \frac{t-\zeta}{\tau} d\zeta    \\
&A = (1+c \cdot w_{3})(1+\tau^2 \cdot b \cdot W) - \tau^2 \cdot b \cdot c \cdot (W-W_{2})(W_{3}-W_{4})
\end{empheq}
    \end{adjustwidth}
\end{document}

enter image description here

to my opinion it is better to split the longest equation into two lines:

enter image description here

\documentclass{article}
\usepackage{empheq}
\newcommand*\widefbox[1]{\fbox{\hspace{1em}#1\hspace{1em}}}

%-------------------------------- show page layout, only for test
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%

\begin{document}
\begin{empheq}[box=\widefbox]{align*}
&a_{M}^{c} = N'(t_{go},b,c) \frac{Z(y,\dot{y},t_{go},b,c)}{t^2_{go}} \\
&N'(t_{go},b,c) = \frac{t_{go} \cdot \tau \cdot b}{A}               \\
& \begin{multlined}[t]
    Z(y,\dot{y},t_{go},b,c) = \tau \cdot b \cdot 
        ZEM_{OGL} \left[(1+c \cdot W_{4}) \cdot \psi(\zeta) + (W_{3}-W_{4})\cdot \zeta \right] \\
    -c \cdot ZEM_{OGL2} \left[ (1+\tau^2 \cdot b \cdot W_{2}) \cdot \psi(\zeta)-(1+\tau^2 \cdot b \cdot W) \cdot \zeta \right]
    \end{multlined}    \\
&ZEM_{OGL} = x_{1}(t)+(t_{f}-t)x_{2}(t)+\frac{(t_{f}-t)^2}{2}x_{3}(t)-\tau^2 \psi(\zeta)x_{4}(t)
\\
&ZEM_{OGL2} = x_{2}(t) + (t-t_{f})\cdot x_{3}(t) + \tau \cdot \left [e^{-\zeta} -1 \right ]\cdot x_{4}(t)
\\
&W = \int_{t}^{t_{f}} \psi^2 \left (\frac{t_{f}-\zeta}{\tau} \right ) d\zeta
\\
&W_{2} = \int_{t}^{t_{f}} \psi \left (\frac{t_{f}-\zeta}{\tau} \right ) \cdot \frac{t-\zeta}{\tau} d\zeta
\\
&W_{3} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )^2 d\zeta
\\
&W_{4} = \int_{t}^{t_{f}} \left(e^{-\frac{t-\zeta}{\tau}} -1 \right )\cdot \frac{t-\zeta}{\tau} d\zeta
\\
&A = (1+c \cdot w_{3})(1+\tau^2 \cdot b \cdot W) - \tau^2 \cdot b \cdot c \cdot (W-W_{2})(W_{3}-W_{4})
\end{empheq}
\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.