LyX ⇒ problem with formula in rotatebox
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
problem with formula in rotatebox
in LyX, I have a very large formula, and I'm trying to rotate is using "rotatebox". I get an error/warning as in "warning.jpg", but strangely enough, the pdf-output looks rather OK.
Also the Lyx-file in attachment, the rotatebox is near to the end of the document.
Any help appreciated a lot,
Stef
- Attachments
-
- cursus hyperstatica.lyx
- (57.19 KiB) Downloaded 551 times
-
- warning.JPG (71.72 KiB) Viewed 7261 times
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
problem with formula in rotatebox
There is an error in the code, and LyX seems to hide it. Perhaps post also the pdfLaTeX export here, as attachment, as I don't have LyX here, then I could easily see the cause.
Stefan
-
- Site Moderator
- Posts: 542
- Joined: Sat Sep 01, 2012 6:38 am
problem with formula in rotatebox
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
problem with formula in rotatebox
I also tried with a scalebox (included in the example also), resulting into similar behaviour: I get similar errormessages, while the pdf-output looks rather OK to me.
I also exported from LyX a LaTeX (pdflatex) and a pdf (pdflatex) file, I hope these are the exprts that you wanted to see?
Please let me know if my info should be in another format, I really use LyX without knowing very much of LaTeX (but you allready guessed that ...)
Thanks,
Stef
- Attachments
-
- minimal example rotatebox or scalebox formula.pdf
- (86.85 KiB) Downloaded 366 times
-
- minimal example rotatebox or scalebox formula.tex
- (3.25 KiB) Downloaded 515 times
-
- minimal example rotatebox or scalebox formula.lyx
- (4.88 KiB) Downloaded 425 times
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
problem with formula in rotatebox
A solution would be, to rotate a box that has a width, such as a parbox or minipage. That can contain the equation. Such as, said in LaTeX code:
Code: Select all
\rotatebox{90}{\parbox{\textheight}{
\begin{equation}
...
\end{equation}
}}
Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
problem with formula in rotatebox
(Should this be considered as a bug in LyX?)
Stef
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
problem with formula in rotatebox
\rotatebox
uses the width of the inner object (for placement), equation
uses the width of the outer object (to center within). One of them needs to have a width, so putting a box of a defined width between them fixes it.Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
problem with formula in rotatebox
Is there an easy way to avoid this?
Stef
- Attachments
-
- minimal example rotatebox or scalebox formula.pdf
- (85.21 KiB) Downloaded 409 times
-
- minimal example rotatebox or scalebox formula.tex
- (2.02 KiB) Downloaded 558 times
-
- minimal example rotatebox or scalebox formula.lyx
- (3.69 KiB) Downloaded 498 times
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
problem with formula in rotatebox

The equation number is place below if the equation is very wide. That happens inside the box, the resizing comes later, outside, via \scalebox. So, a way to get working is
- making the minipage big enough (the LyX box),
- compensate by scaling a bit smaller then.
Code: Select all
\scalebox{0.66}{%
\noindent\begin{minipage}[t]{1.4\textwidth}%
\begin{equation}
Stefan
-
- Posts: 51
- Joined: Sat Oct 22, 2016 3:43 pm
problem with formula in rotatebox
Stef