kaobook icon indicating copy to clipboard operation
kaobook copied to clipboard

Not possible to modify vertical dimension of equation with resizebox package

Open me7pako opened this issue 1 year ago • 1 comments

Description

So, I am trying to write some long equations, but I want them to be on one line. So I resorted to the resizebox package, normally one can specify the width and height of the said equation. In my case I had no problem with the width, but the height seems to be unmodifiable. The following example consists of 5 equations, some are longer than others. I want them to be all with the same height so I modified each one differently (especially the middle 3). But their height seems to be linked to the width as if I have specified the height to be {i} which adjusts it automatically.

Any idea what the reason can be?

Thanks a bunch for the quality work you do here btw.

Minimal Working Example

\documentclass{kaobook}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{kaobiblio}
\usepackage{kaotheorems}
\usepackage{kaorefs}
\usepackage{amsmath}
\usepackage[makeroom]{cancel}
\begin{document}

\title{Bug Report}
\author{Author}
\date{\today}

\frontmatter
\maketitle
\mainmatter
\setchapterstyle{kao}

\chapter{First Chapter}

\begin{align*}
\ddot{\theta} & = -\frac{mgl\sin\theta + ml\cos\theta\frac{\left(I+ml^2\right)\left(u - b\dot x\right) + ml\sin\theta\left[\left(I+ml^2\right)\dot\theta^2 + mlg\cos\theta\right]}{\left(I+ml^2\right)\left(M+m\right) - m^2l^2\cos^2 \!\theta}}{I+ml^2}\\
&= \frac{ml\cos\theta\frac{\left(I+ml^2\right)\left(u - b\dot x\right) + ml\sin\theta\left[\left(I+ml^2\right)\dot\theta^2 + mlg\cos\theta\right]}{m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)} - mgl\sin\theta}{I+ml^2}\\
&= \resizebox{\linewidth}{1.3\height}{$\frac{ml\cos\theta}{I+ml^2}\cdot\frac{\left(I+ml^2\right)\left(u - b\dot x\right) + ml\sin\theta\left[\left(I+ml^2\right)\dot\theta^2 + mlg\cos\theta\right]}{m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)} - \frac{mgl\sin\theta}{I+ml^2}$}\\
&= \resizebox{\linewidth}{1.7\height}{$\frac{ml\cos\theta}{I+ml^2}\cdot\frac{\left(I+ml^2\right)\left(u - b\dot x\right) + ml\sin\theta\left[\left(I+ml^2\right)\dot\theta^2 + mlg\cos\theta\right] + \left[\left(I+ml^2\right)\left(M+m\right) -m^2l^2\cos^2 \!\theta\right]mgl\sin\theta}{m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)}$}\\
&= \resizebox{\linewidth}{2\height}{$\frac{ml\cos\theta\left(I+ml^2\right)\left(u - b\dot x\right) + m^2l^2\cos\theta\sin\theta\left(I+ml^2\right)\dot\theta^2 + \cancel{m^3l^3g\cos^2 \! \theta\sin\theta} + \left(I+ml^2\right)\left(M+m\right)mgl\sin\theta -\cancel{m^3l^3\cos^2 \!\theta\sin\theta}}{\left(I+ml^2\right)\left[m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)\right]}$}\\
&= \frac{ml\cos\theta\left(u - b\dot x\right) + m^2l^2\dot\theta^2\cos\theta\sin\theta + \left(M+m\right)mgl\sin\theta}{m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)}\\
&= \frac{ml\left[\cos\theta\left(u - b\dot x\right) + ml\dot\theta^2\cos\theta\sin\theta + \left(M+m\right)g\sin\theta\right]}{m^2l^2\cos^2 \!\theta - \left(I+ml^2\right)\left(M+m\right)}\\
\end{align*}

\end{document}

Expected behavior: Change in the height of each equation based on the coefficient with which the height is affected

Actual behavior: Height is adjusted automatically, it is the same behavior as if the height argument is given as {i}.

Additional Information

me7pako avatar Aug 05 '22 14:08 me7pako

Thanks. Does this happen also with the scrbook class, or just with kao?

fmarotta avatar Sep 17 '22 19:09 fmarotta