我有一个非常大的符号矩阵(下面的代码)
我无法垂直或水平查看矩阵的输出 pdf
这是垂直方向的样子
这是水平方向的样子
如果页面是水平的,那就没问题,我只需要弄清楚如何包装这些方程式
有人能提供一个解决方案,以便那些长的方程式可以被包装起来,从而可以生成足够的空间来将整个矩阵放入页面上吗?
提前致谢!
% !TeX program = xelatex
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[12pt]{moresize}
% This first part of the file is called the PREAMBLE. It includes
% customizations and command definitions. The preamble is everything
% between \documentclass and \begin{document}.
\usepackage[margin=1in]{geometry} % set the margins to 1in on all sides
%\usepackage[draft]{graphicx} % to include figures
\usepackage{graphicx}
\usepackage{amsmath} % great math stuff
\usepackage{amsfonts} % for blackboard bold, etc
\usepackage{amsthm} % better theorem environments
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{upgreek}
\usepackage{dsfont} %to use mathds(1)
\usepackage{cancel}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{changepage}
\usepackage{stackengine}
\setcounter{MaxMatrixCols}{20}
\allowdisplaybreaks
\title{Very Large Matrix, How?}
\begin{document}
\begin{landscape}
\begin{equation*}
M = \begin{bmatrix} -k-k_1-k_2 & -x & 0 & 0 & 0 & 0 & 0 & k_1 & z & x & 0\\
c & k_1 - d_2*y*x & 0 & 0 & 0 & 0 & (d*k*x)/(2*x_7^{1/2}) - (d*k*x)/y & d_2*k_2*x_7^(1/2) - k_1 & 0 & 0 & 0\\
0 & 0 & -k*-y - k_3 & 0 & 0 & 0 & 0 & k*u*xy^(1/2)*x)*y^2 - (d*k*x_3^(1/2)*x)*y^2 & 0 & 0 & 0
\end{bmatrix}
\end{equation*}
\end{landscape}
\end{document}
答案1
您有两个选择:
- 将较长的数学表达式拆分为两行
- 引入新变量,其含义请用文字解释:
\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[12pt]{moresize}
\usepackage[margin=1in]{geometry} % set the margins to 1in on all sides
\usepackage{mathtools} % great math stuff
\usepackage{pdflscape}
\setcounter{MaxMatrixCols}{20}
\begin{document}
\begin{landscape}
splitting long math expression into two line:
\begin{equation*}
M = \begin{bmatrix}
-k-k_1-k_2 & -x & 0 & 0 & 0 & 0 & 0 & k_1 & z & x & 0\\[2ex]
c & k_1 - d_2*y*x & 0 & 0 & 0 & 0 &
\begin{multlined}
(d*k*x)/(2*x_7^{1/2}) \\[-2ex]
- (d*k*x)/y
\end{multlined} & d_2*k_2*x_7^{1/2} - k_1 & 0 & 0 & 0\\[2ex]
0 & 0 & -k*-y - k_3 & 0 & 0 & 0 & 0 &
\begin{multlined}
k*u*xy^{1/2}*x)*y^2 \\[-2ex]
- (d*k*x_3^{1/2}*x)*y^2
\end{multlined} & 0 & 0 & 0
\end{bmatrix}
\end{equation*}
more elegant option:
\begin{equation*}
M = \begin{bmatrix}
-k-k_1-k_2 & -x & 0 & 0 & 0 & 0 & 0 & k_1 & z & x & 0\\
c & k_1 - d_2*y*x & 0 & 0 & 0 & 0 & A & B & 0 & 0 & 0\\
0 & 0 & -k*-y - k_3
& 0 & 0 & 0 & 0 & C & 0 & 0 & 0
\end{bmatrix}
\end{equation*}
where are $A=(d*k*x)/(2*x_7^{1/2}) - (d*k*x)/y$, $B=d_2*k_2*x_7^{1/2} - k_1$
and $C=k*u*xy^{1/2}*x)*y^2 - (d*k*x_3^{1/2}*x)*y^2$ respectively.
\end{landscape}
\end{document}