Stefano Asks:

I was trying to fit this equation manipulation in a page as shown in the MWE:

*Very long equation manipulation with arrows*I was trying to fit this equation manipulation in a page as shown in the MWE:

Code:

```
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{geometry} geometry{a4paper,top=2.5cm,bottom=2.5cm,left=2cm,right=2cm,heightrounded,bindingoffset=5mm}
usepackage{amsmath,cancel,witharrows}
begin{document}
noindent
some words
begin{DispWithArrows*}
P(t|t)&=Eleft[tilde{e}_x(t)tilde{e}_x^T(t)right]\
&=Eleft[big((I-K(t)C)e_x(t)-K(t)v(t)big)big((I-K(t)C)e_x(t)-K(t)v(t)big)^Tright] Arrow[i]{$e_x$ is uncorrelated with $v(t)$\collect $E[e_x(t)e_x^T(t)]$ and $E[v(t)v^T(t)]$}\
&=big(I-K(t)Cbig)E[e_x(t)e_x^T(t)]big(I-K(t)Cbig)^T+K(t)E[v(t)v^T(t)]K(t)\
&=big(I-K(t)Cbig)P(t|t-1)big(I-K(t)Cbig)^T+K(t)R_vK^T(t)\
&begin{split}
=P(t|t-1)-P(t|t-1)C^TK^T(t)-K(t)CP(t|t-1)+\
+K(t)CP(t|t-1)C^TK^T(t)+K(t)R_vK^T(t)
end{split}
Arrow[i]{in the 4th and 5th terms,\factor out $K(t)$}\
&begin{split}
=P(t|t-1)-P(t|t-1)C^TK^T(t)-K(t)CP(t|t-1)+\
+K(t)big(CP(t|t-1)C^T+R_vbig)K^T(t)
end{split}
Arrow[i]{eqref{eqn_kalman_filter_gain}}\
&begin{split}=P(t|t-1)-P(t|t-1)C^TK^T(t)-K(t)CP(t|t-1)+\
+underbrace{P(t|t-1)C^Tbig(CP(t|t-1)C^T+R_vbig)^{-1}}_{=K(t)}big(CP(t|t-1)C^T+R_vbig)K^T(t)end{split}\
&=P(t|t-1)cancel{-P(t|t-1)C^T K^T(t)}-K(t)CP(t|t-1)cancel{+P(t|t-1)C^TK^T(t)}\
&=P(t|t-1)-K(t)CP(t|t-1)Arrow[i]{factor out $P(t|t-1)$}\
P(t|t)&=big(I-K(t)Cbig)P(t|t-1)
end{DispWithArrows*}
some other words
end{document}
```

**Problem 1:** The text displayed with the package `witharrows`

and with the command `Arrow[i]{...}`

falls off the right edge of the sheet, while the equation doesn’t start immediately at left but in the center-left of the sheet, so it doesn’t exploit all the available space.

**Problem 2:** I tried to use the `split`

environment but it doesn’t work very well because some equations don’t start aligned with the others (I think it’s because I don’t use it properly) and because its efforts are useless due to problem 1.

If my description is not clear, the output of the MWE will be clearer:

How can I solve these problems?

Thanks in advance!

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.