fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.
https://github.com/fmarotta/kaobook
LaTeX Project Public License v1.3c
858 stars 184 forks source link

Not possible to modify vertical dimension of equation with resizebox package #246

Open me7pako opened 2 years ago

me7pako commented 2 years ago

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

fmarotta commented 2 years ago

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