Latex 超长矩阵如何处理显示问题

问题

矩阵内容太多,不能完全显示。下面是我的处理方法。

双栏论文中矩阵跨栏显示

使用 \begin{figure*}给公式包起来,跨双栏

复制代码
\begin{figure*}[t]
  \begin{equation}
      T_{PRY} =\left[
      % \setlength\arraycolsep{2.5pt}
      \begin{array}{cccc}
      A      & B       & C      & D      \\
  
      E      & F      & G      & H      \\
  
      I      & J      & K      & L      \\
  
      0     & 0       & 0     & 1
      \end{array}
      \right].
      \label{Eq::aa}
  \end{equation}
\end{figure*}

调整间隙宽度

上面一段代码中已经注释掉了。使用 \setlength\arraycolsep{2.5pt},设置数值进行调整

调整字号

\small, \footnotesize, \tiny

变量替换

把 局部太长的分量 用一个变量替换,然后在正文中指明变量具体公式。

换行

单一行公式,使用 align, multline, split 等宏,配合 换行符"\" 自行给公式断行。

参考Equations alignment using amsmath Package

矩阵旋转 或者 页面旋转

矩阵旋转单独一页

旋转页面

使用 \begin{landscape}旋转页面,参考latex 表格 图片超宽,旋转放置方法

矩阵换行

不需要编号

参考Split a huge matrix across lines to fit on page

复制代码
\documentclass{article}

\usepackage{mathtools,trimclip,lipsum}
\setcounter{MaxMatrixCols}{20}
\newcommand{\hugematrix}{$\left[\begin{smallmatrix*}[r]
-0.0629& 0.0629& -0.1819&  0.1819&       0&       0&       0&       0&       0&  0.0652&  0.0185&  0.0034&  0.0019& -0.0019& -0.0034\\
0.0107& 0.0107& -0.0676& -0.0676& -0.1455& -0.1455& -0.1494& -0.1494& -1.2860&       0&       0&  0.0013&  0.0035&  0.0035&  0.0013\\
-0.0142& 0.0142& -0.0128&  0.0128&       0&       0&       0&       0&       0& -0.1272& -0.0929&  0.0195&  0.0111& -0.0111& -0.0195\\         
0&      0&       0&       0&       0&       0&       0&       0& -0.3122&       0&       0&  0.1999&  0.1999&  0.1999&  0.1999\\
0&      0& -0.0098& -0.0098& -0.0071& -0.0071& -0.0074& -0.0074& -0.0676&       0&       0& -0.0004& -0.0004& -0.0004& -0.0004\\     
0&      0&       0&       0&       0&       0&       0&       0&       0&  0.0078&  0.0066&  0.0001&  0.0001& -0.0001& -0.0001\\
0&      0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0\\
0&      0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0\\
0&      0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0\\
0&      0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0&       0
\end{smallmatrix*}\right]$}

\begin{document}

\lipsum[1] 			% 生成随机文案
\begin{multline*}
B_u  = \clipbox*{0pt {-1.1\depth} {.53\width} {1.1\height}}{\hugematrix}\\ 
\clipbox*{{.53\width} {-1.1\depth} {\width} {1.1\height}}{\hugematrix}
\end{multline*}

\lipsum[2]
\end{document}

编号

参考 Equation number at the right of first line with multline

结合上一节方法,做如下修改

复制代码
\begin{equation}
\begin{multlined}[t]%
	包裹上一小节的公式
\end{multlined}%
\end{equation}%

注意此处使用的是 \begin{multlined}上一小结使用的是 \begin{multline*}。其中可能有 package 区别。注意报错信息中是不是缺少 package。具体区别不想继续整了。

最后我的代码。其中 hugematrix参考上一节设定。

复制代码
\begin{equation}%
    \begin{multlined}[b]%
        ^0_tT  = \scalebox{.8}{\clipbox*{0pt {-1.1\depth} {.6\width} {1.1\height}}{\hugematrix}}\\ 
        \scalebox{.8}{\clipbox*{{.6\width} {-1.1\depth} {\width} {1.1\height}}{\hugematrix}}
    \end{multlined}%
\end{equation}

where <llx> and <lly> are the x and y coordinates of the lower left corner of the box you want to keep from <content> and <urx> and <ury> are the upper right coordinates. You can use \height, \width and \depth (or multiples of those) to reference the height (above the baseline), depth (below baseline) and width of the content. To avoid clipping a small portion of the edge, you need slightly more than \height and \depth.

复制代码
\clipbox*{{<llx>} {<lly>} {<urx>} {<ury>}}{<content to be clipped>}

通过调整上面四个参数调整缩进,主要是第一个和第三个调整横向断开位置。

相关推荐
云手机管家2 小时前
CDN加速对云手机延迟的影响
运维·服务器·网络·容器·智能手机·矩阵·自动化
云手机管家2 小时前
账号风控突破:云手机设备指纹篡改检测与反制技术解析
android·运维·网络协议·网络安全·智能手机·矩阵·自动化
Magnum Lehar10 小时前
3d游戏引擎的math矩阵实现
线性代数·矩阵·游戏引擎
HappyAcmen15 小时前
线代第二章矩阵第九、十节:初等变换、矩阵的标准形、阶梯形与行最简阶梯形、初等矩阵
笔记·学习·线性代数·矩阵
fancy16616615 小时前
搜索二维矩阵 II
c++·算法·矩阵
人类发明了工具18 小时前
【优化算法】协方差矩阵自适应进化策略(Covariance Matrix Adaptation Evolution Strategy,CMA-ES)
线性代数·算法·矩阵·cma-es
程序员莫小特1 天前
【GESP真题解析】第 20 集 GESP 二级 2025 年 3 月编程题 1:等差矩阵
c语言·数据结构·c++·算法·青少年编程·矩阵
csdnzzt1 天前
CUDA编程——性能优化基本技巧
性能优化·矩阵·cuda
kovlistudio2 天前
机器学习第八讲:向量/矩阵 → 数据表格的数学表达,如Excel表格转数字阵列
机器学习·矩阵·excel
伊织code2 天前
PyTorch API 7 - TorchScript、hub、矩阵、打包、profile
人工智能·pytorch·python·ai·矩阵·api