Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
me7pako opened this issue Aug 5, 2022 · 1 comment

Comments

@me7pako
Copy link

me7pako commented Aug 5, 2022

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
Copy link
Owner

fmarotta commented Sep 17, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants