![方程的侧面(一个大矩阵)](https://linux22.com/image/300524/%E6%96%B9%E7%A8%8B%E7%9A%84%E4%BE%A7%E9%9D%A2%EF%BC%88%E4%B8%80%E4%B8%AA%E5%A4%A7%E7%9F%A9%E9%98%B5%EF%BC%89.png)
我希望用于sideways
我的大矩阵,例如这和这。看起来很简单。但对我来说不起作用。
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{rotating}
\begin{document}
\begin{sideways}
\begin{equation}
\begin{bmatrix}
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 \\
0 &
0 &
0 &
\frac{1}{\phi_4} &
0 &
0 &
\frac{1}{\phi_4} &
0 &
\frac{1}{\phi_4} &
\frac{1}{\phi_4} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{1+\mathrm{e}^{a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
0 \\
0 &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
\frac{1}{1+\mathrm{e}^{a5+m}} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
\frac{1}{1+\mathrm{e}^{a5+m}}
\end{bmatrix}
\end{equation}
\end{sideways}
\end{document}
但它似乎不起作用。
我希望它需要数学环境?
答案1
我更愿意将矩阵放进去(戴上我的文字编辑帽子)。很多数据是重复的,这为操作提供了一些空间:
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\lipsum[4]
\begin{equation}
\begin{bmatrix}
\phi_1^{-1} &
\phi_1^{-1} &
\phi_1^{-1} &
\phi_1^{-1} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\phi_2^{-1} &
\phi_2^{-1} &
\phi_2^{-1} &
\phi_2^{-1} &
\phi_2^{-1} &
\phi_2^{-1} &
0 &
0 &
0 \\
0 &
0 &
\phi_3^{-1} &
\phi_3^{-1} &
0 &
\phi_3^{-1} &
\phi_3^{-1} &
\phi_3^{-1} &
\phi_3^{-1} &
0 \\
0 &
0 &
0 &
\phi_4^{-1} &
0 &
0 &
\phi_4^{-1} &
0 &
\phi_4^{-1} &
\phi_4^{-1} \\
f(b_2) &
g(b_2) &
g(b_2) &
g(b_2) &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
f(a_3) &
g(a_3) &
g(a_3) &
f(b_3) &
g(b_3) &
g(b_3) &
0 &
0 &
0 \\
0 &
0 &
f(a_4) &
g(a_4) &
0 &
f(a_4) &
g(a_4) &
f(b_4) &
g(b_4) &
0 \\
0 &
0 &
0 &
f(a_5) &
0 &
0 &
f(a_5) &
0 &
f(a_5) &
f(b_5) \\
f(b_2) &
g(b_2) &
g(b_2) &
g(b_2) &
f(b_3) &
g(b_3) &
g(b_2) &
f(b_4) &
g(b_4) &
f(b_5)
\end{bmatrix}
,\end{equation}
where
\[
f(a) \coloneqq \frac{1}{1+\mathrm{e}^a}
,\quad
g(a) \coloneqq \frac{-1}{1+\mathrm{e}^{-a}}
\quad\text{and}\quad
b_i \coloneqq a_i+m
.\]
\lipsum[13]
\end{document}
答案2
rotating
包的sideways
环境实际上只是为了与 LaTex2.09 版本兼容,它只是\rotatebox
提供旧语法的一个薄包装。
但是框命令会将您带出数学模式,因此您需要$
重新进入:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\begin{document}
\begin{equation}
\rotatebox{90}{$\begin{bmatrix}
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 \\
0 &
0 &
0 &
\frac{1}{\phi_4} &
0 &
0 &
\frac{1}{\phi_4} &
0 &
\frac{1}{\phi_4} &
\frac{1}{\phi_4} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{1+\mathrm{e}^{a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
0 \\
0 &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
\frac{1}{1+\mathrm{e}^{a5+m}} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
\frac{1}{1+\mathrm{e}^{a5+m}}
\end{bmatrix}$}
\end{equation}
\end{document}
答案3
环境的内容sideways
存储在 中,\hbox
以便稍后处理。在 中\hbox
,显示数学无法识别。(TeX 称之为“内部水平模式”)。需要通过将内容包装在\parbox
或minipage
环境中来切换到“垂直模式”。因此
\begin{sideways}
\parbox{8in}{
\begin{equation}
E=mc^2
\end{equation}
}
\end{sideways}
请注意,矩阵在横放时太高,超出正常页面尺寸。它仍会放置,但不知何故会移到下一页,除非它适合一页。
答案4
作为 David 为您解决问题的替代方案sideways
。您可以landscape
从lscape
支持数学模式的包中考虑。
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{lscape}
\begin{document}
\begin{landscape}
\begin{equation}
\begin{bmatrix}
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
\frac{1}{\phi_1} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
\frac{1}{\phi_2} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
\frac{1}{\phi_3} &
0 \\
0 &
0 &
0 &
\frac{1}{\phi_4} &
0 &
0 &
\frac{1}{\phi_4} &
0 &
\frac{1}{\phi_4} &
\frac{1}{\phi_4} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
0 &
0 &
0 &
0 &
0 &
0 \\
0 &
\frac{1}{1+\mathrm{e}^{a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{-1}{1+\mathrm{e}^{-a3}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
0 &
0 &
0 \\
0 &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
0 &
\frac{1}{1+\mathrm{e}^{a4}} &
\frac{-1}{1+\mathrm{e}^{-a4}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
0 \\
0 &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
0 &
\frac{1}{1+\mathrm{e}^{a5}} &
\frac{1}{1+\mathrm{e}^{a5+m}} \\
\frac{1}{1+\mathrm{e}^{a2+m}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a3+m}} &
\frac{-1}{1+\mathrm{e}^{-(a3+m)}} &
\frac{-1}{1+\mathrm{e}^{-(a2+m)}} &
\frac{1}{1+\mathrm{e}^{a4+m}} &
\frac{-1}{1+\mathrm{e}^{-(a4+m)}} &
\frac{1}{1+\mathrm{e}^{a5+m}}
\end{bmatrix}
\end{equation}
\end{landscape}
\end{document}