diff --git a/doc/rcfs.pdf b/doc/rcfs.pdf
index 41415821f7d2c86431767dd5d1214cc7c46a9074..504320302976aca92562959b4982e70dd28cc079 100644
Binary files a/doc/rcfs.pdf and b/doc/rcfs.pdf differ
diff --git a/doc/rcfs.tex b/doc/rcfs.tex
index e97e00aa5fc2524e5aceab889d6c0099a7f2f6aa..079368484aa266b851212a2145757ca5db1bc3ce 100644
--- a/doc/rcfs.tex
+++ b/doc/rcfs.tex
@@ -1,6 +1,6 @@
 \documentclass[10pt,a4paper]{article} %twocolumn
 \usepackage{graphicx,amsmath,amssymb,bm,xcolor,soul,nicefrac,listings,algorithm2e,dsfont,caption,subcaption,wrapfig,sidecap} 
-%\usepackage[hidelinks]{hyperref}
+\usepackage[hidelinks]{hyperref}
 
 %pseudocode
 \newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{lightgray}{#1}}
@@ -70,6 +70,8 @@
 \newcommand{\tmax}{{\scriptscriptstyle\max}}
 %\newcommand{\filename}[1]{{\raggedleft\colorbox{rr2}{{\color{white}\texttt{#1}}}\\[2mm]}}
 \newcommand{\filename}[1]{\colorbox{rr2}{\color{white}\texttt{#1}}}
+%\newcommand{\filename}[1]{\texttt{#1}}
+
 
 %\usepackage{hyperref}
 %\hypersetup{
@@ -106,7 +108,7 @@
 This technical report presents several learning and optimal control techniques in robotics in the form of simple toy problems that can be easily coded. It comes with a set of standalone examples gathered as a git repository \textbf{Robotics Codes From Scratch (RCFS)}, accessed at:
 \begin{center}
 \texttt{https://gitlab.idiap.ch/rli/robotics-codes-from-scratch}
-\end{center}\\
+\end{center}%\\
 
 Each section in this report lists the corresponding source codes in Python and Matlab (ensuring full compatibility with GNU Octave), as well as in C++ and Julia for some of the principal examples. 
 
@@ -366,12 +368,11 @@ The position and orientation of all articulations can similarly be computed with
 	\end{bmatrix} \!\!,
 	\label{eq:FKall}
 \end{align} 
-\begin{equation*}
-\text{with}\quad
 \begin{alignat*}{3}
-	& \tilde{f}_{1,1} = \ell_1 \!\cos(x_1), &&
-	\tilde{f}_{1,2} = \ell_1 \!\cos(x_1) \!+\! \ell_2 \!\cos(x_1\!+\!x_2), &&
+	& \tilde{f}_{1,1} = \ell_1 \!\cos(x_1),\quad &&
+	\tilde{f}_{1,2} = \ell_1 \!\cos(x_1) \!+\! \ell_2 \!\cos(x_1\!+\!x_2),\quad &&
 	\tilde{f}_{1,3} = \ell_1 \!\cos(x_1) \!+\! \ell_2 \!\cos(x_1\!+\!x_2) \!+\! \ell_3 \!\cos(x_1\!+\!x_2\!+\!x_3),\\ 
+\text{with}\quad 
 	& \tilde{f}_{2,1} = \ell_1 \sin(x_1), &&
 	\tilde{f}_{2,2} = \ell_1 \sin(x_1) \!+\! \ell_2 \!\sin(x_1\!+\!x_2), &&
 	\tilde{f}_{2,3} = \ell_1 \sin(x_1) \!+\! \ell_2 \!\sin(x_1\!+\!x_2) \!+\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3), \quad\ldots\\ 
@@ -379,7 +380,6 @@ The position and orientation of all articulations can similarly be computed with
 	\tilde{f}_{3,2} = x_1 + x_2, &&
 	\tilde{f}_{3,3} = x_1 + x_2 + x_3.
 \end{alignat*}
-\end{equation*}
 
 %\begin{align*}
 %	\tilde{f}_{1,1} &= \ell_1 \!\cos(x_1),\\ 
@@ -425,11 +425,10 @@ The Jacobian corresponding to the end-effector forward kinematics function can b
 	\end{bmatrix} \!\!,
 \end{align*}
 with
-\begin{equation*}
-\scriptsize
+{\scriptsize
 \begin{alignat*}{3}
-	& J_{1,1} = -\ell_1 \!\sin(x_1) \!-\! \ell_2 \!\sin(x_1\!+\!x_2) \!-\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots, 
-	&& J_{1,2} = -\ell_2 \!\sin(x_1\!+\!x_2) \!-\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots, 
+	& J_{1,1} = -\ell_1 \!\sin(x_1) \!-\! \ell_2 \!\sin(x_1\!+\!x_2) \!-\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots,\quad 
+	&& J_{1,2} = -\ell_2 \!\sin(x_1\!+\!x_2) \!-\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots,\quad 
 	&& J_{1,3} = -\ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots,
 	\\
 	& J_{2,1} = \ell_1 \!\cos(x_1) \!+\! \ell_2 \!\cos(x_1\!+\!x_2) \!+\! \ell_3 \!\cos(x_1\!+\!x_2\!+\!x_3) \!+\! \ldots, 
@@ -440,8 +439,7 @@ with
 	&& J_{3,2} = 1, 
 	&& J_{3,3} = 1,
 \end{alignat*}
-\end{equation*}
-
+}
 %with
 %\begin{align*}
 %	J_{1,1} &= -\ell_1 \!\sin(x_1) \!-\! \ell_2 \!\sin(x_1\!+\!x_2) \!-\! \ell_3 \!\sin(x_1\!+\!x_2\!+\!x_3) \!-\! \ldots,\\
@@ -559,10 +557,12 @@ By substituting the derived equations into \eqref{eq:Lag_with_generalized_forces
 	u_z - \sum_{j=z}^{N}m_j \Big(\sum_{k=1}^{j} l_zl_k s_{z-k}\dot{q}_k^2\Big) -  \sum_{j=z}^{N}m_j g l_z c_z,
 	\quad\text{where}\quad
 	\left\{
-	\begin{align*}
+	{
+	\begin{aligned}
 	c_{h-k} &= c_h c_k - s_h s_k,\\
 	s_{h-k} &= s_h c_k - c_h s_k.
-	\end{align*}\right.
+	\end{aligned}
+	}\right.
 	\label{eq:arranged_dyn_eq}
 \end{equation}
 
@@ -1547,7 +1547,8 @@ The complete iLQR procedures are described in Algorithms \ref{alg:iLQRbatch} and
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\subsection{iLQR with quadratic cost on $\bm{f}(\bm{x}_t)$}
+%\bm in titles and hyperref are incompatible: https://tex.stackexchange.com/questions/174840/bmp-in-the-section-title-or-subsection-title-produces-error
+\subsection{iLQR with quadratic cost on {\boldmath$f(x_t)$}} 
 \begin{flushright}
 \filename{iLQR\_manipulator.*}
 \end{flushright}
@@ -1823,15 +1824,15 @@ The forward kinematics function $\bm{f}^\tp{CoM}$ can be used in tracking tasks
 \filename{iLQR\_bimanual.*}
 \end{flushright}
 
-\begin{SCfigure}
+\begin{SCfigure}%[40]
 \centering
-\includegraphics[width=.48\columnwidth]{images/iLQR_bimanual02.png}\\
-\includegraphics[width=.48\columnwidth]{images/iLQR_bimanual01.png}
+\includegraphics[width=.38\columnwidth]{images/iLQR_bimanual02.png}
+\includegraphics[width=.38\columnwidth]{images/iLQR_bimanual01.png}
 \caption{\footnotesize
 Reaching tasks with a bimanual robot (frontal view). \emph{Left:} with a target for each hand. \emph{Right:} with a target for the hand on the left, while keeping the center of mass at the same location during the whole movement.
 }
-\label{SCfig:iLQR_bimanual}
-\end{figure}
+\label{fig:iLQR_bimanual}
+\end{SCfigure}
 
 %\begin{wrapfigure}{r}{.36\textwidth}
 %\vspace{-20pt}