Math & ScienceProblem with \rotatebox around a equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Problem with \rotatebox around a equation

Post by Montag »

Hello,

I'd like a equation to be turned 270 degrees clock-wise next to normal text.

So there are two examples in the file. The first example shows how it looks correctly in total, but the equation should be turned exactly the other way. So that's why I made the second example. Originally, I only made the second example but noticed how the text and equation don't match up vertically.

What I want to achieve is: The second example is aligned vertically in a proper way and all the errors are gone. I got 14 errors when compiling the MWE, 7 for each 2 minipages obviously.

Please help. :)

TEX:
minipage-rotatebox.tex
(1.84 KiB) Downloaded 313 times
PDF:
minipage-rotatebox.pdf
(55.64 KiB) Downloaded 313 times
Last edited by Montag on Mon Jan 31, 2011 10:08 am, edited 3 times in total.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: Problem with \rotatebox around a equation

Post by frabjous »

What examples? Did you forget to attach something?
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Re: Problem with \rotatebox around a equation

Post by Montag »

Yes, thanks for reminding me, I uploaded it now.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Problem with \rotatebox around a equation

Post by frabjous »

All right, first things first, let's get rid of those errors.

The argument inside \rotatebox is put in LR mode, not in paragraph mode (see here), so you can only use inline math inside of it, not display math. So either simply use \begin{math}...\end{math} (or just $...$) rather than \begin{equation*}...\end{equation*}:

Code: Select all

\rotatebox{270}{%
\begin{math}
\begin{bmatrix}
A & B \\ % etc
\end{bmatrix}
\end{math}
}
Or if you really must used displayed math environment, like equation*, put it inside a parbox:

Code: Select all

\rotatebox{270}{%
\parbox{\textwidth}{%
\begin{equation*}
\begin{bmatrix}
A & B \\ % etc
\end{bmatrix}
\end{equation*}
} % end of parbox
} % end of rotatebox
I'll wait to you fix that up and then you can re-ask your question about orientation and placement, etc. I have my LaTeX previewer set up to only show a result if there are no errors, and so I didn't see what the document looked like prior to fixing the errors, so I'm still a bit unclear about what you're trying to do.

I'd guess however, that you just need to use \begin{minipage} rather than \begin{minipage}[t] there given which one is bigger.
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Problem with \rotatebox around a equation

Post by Montag »

frabjous wrote:The argument inside \rotatebox is put in LR mode, not in paragraph mode (see here), so you can only use inline math inside of it, not display math. So either simply use \begin{math}...\end{math} (or just $...$) rather than \begin{equation*}...\end{equation*}:

[...]
Oh, thank you, I didn't know that, interesting fact. :)
frabjous wrote:I'd guess however, that you just need to use \begin{minipage} rather than \begin{minipage}[t] there given which one is bigger.
Well, you are right, thanks again, but it looks kind of off.
I'd like it if both minipages were aligned to the top. So I played through all possible t/b/none-combinations of the minipage environments and both with 'no alignment' yields the best result so far:
minipage-rotatebox.tex
(1012 Bytes) Downloaded 267 times
I'm guessing it has to do with the LR mode of the rotatebox? So is it possible to align both minipages to the top?

edit:
Never mind, I think it looks already quite alright with no alignment at all and the minipage's alignment seems to be dependent on its content, more precisely how much content.

And I'm seeing that although I wrote

Code: Select all

[b]edit:[/b]
, it doesn't display "edit:" in bold. ??
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Post Reply