我的 latex 文档中包含一个不适合页面宽度的矩阵。因此,我将其包含在数学模式中,然后对其应用 scalemath 命令。排版很顺利,但是,出于某种原因,矩阵前面出现了一个“t”。我尝试了一些方法,但无法解决这个问题……
梅威瑟:
\documentclass[11pt, oneside]{report}
%\renewcommand{\baselinestretch}{1.5} % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry}
% See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for rotated page geometry
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx} % Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
\usepackage{eqnarray,amsmath}
% TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{mathtools}
\usepackage{setspace}
\singlespacing
%\onehalfspacing
\usepackage[T1]{fontenc}
\usepackage{subcaption}
\usepackage{pdflscape}
\usepackage{pdfpages}
\usepackage{etoolbox}
\usepackage{pdfpages}
\usepackage{atbegshi}
\makeatletter
\usepackage{capt-of}
\usepackage[utf8]{inputenc} % Any characters can be typed directly from the keyboard, eg éçñ
\usepackage{textcomp} % provide lots of new symibols
\usepackage{graphicx} % Add graphics capabilities
\usepackage{flafter} % Don't place floats before their definition
\usepackage{amsmath,calc}
\usepackage{amsmath,amssymb} % Better maths support & more symbols
\usepackage{bm} % Define \bm{} to use bold math fonts
\usepackage{hyperref}
\usepackage{caption}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{rotating}
\usepackage[babel]{csquotes}
\usepackage[backend=biber]{biblatex}
\addbibresource{library.bib} % with extension
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\usepackage{memhfixc}
% \usepackage[activate]{pdfcprot}
\usepackage{pdfsync}
\begin{document}
$$
\scalemath{0.75}{\begin{pmatrix}
- \frac{x_1}{c_t} \cdot \left( \frac{1}{\mathcal{D}_{12}} + \frac{1}{\mathcal{D}_{13}} \right) - \frac{x_2}{c_t \cdot \mathcal{D}_{12}} - \frac{x_3}{c_t \cdot \mathcal{D}_{13}} & \frac{x_1}{c_t} \cdot \left(\frac{1}{\mathcal{D}_{12}} - \frac{1}{\mathcal{D}_{13}} \right) & \frac{x_1}{c_t} \cdot \left( \frac{1}{\mathcal{D}_{13}} - \frac{1}{\mathcal{D}_{12}}\right) \\
\frac{x_2}{c_t} \cdot \left(\frac{1}{\mathcal{D}_{21}} - \frac{1}{\mathcal{D}_{23}} \right) & - \frac{x_2}{c_t} \cdot \left( \frac{1}{\mathcal{D}_{21}} + \frac{1}{\mathcal{D}_{23}} \right) - \frac{x_1}{c_t \cdot \mathcal{D}_{21}} - \frac{x_3}{c_t \cdot \mathcal{D}_{23}} & \frac{x_2}{c_t} \cdot \left(\frac{1}{\mathcal{D}_{23}} - \frac{1}{\mathcal{D}_{21}} \right) \\
\frac{x_3}{c_t} \cdot \left(\frac{1}{\mathcal{D}_{31}} - \frac{1}{\mathcal{D}_{32}} \right) & \frac{x_3}{c_t} \cdot \left(\frac{1}{\mathcal{D}_{32}} - \frac{1}{\mathcal{D}_{31}} \right) & - \frac{x_3}{c_t} \cdot \left( \frac{1}{\mathcal{D}_{31}} + \frac{1}{\mathcal{D}_{32}} \right) - \frac{x_1}{c_t \cdot \mathcal{D}_{31}} - \frac{x_2}{c_t \cdot \mathcal{D}_{32}}
\end{pmatrix}}
$$
\end{document}
答案1
将矩阵拆分成两部分:
\documentclass[11pt, oneside]{report}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bm}
\begin{document}
\begin{multline*}
\begin{pmatrix}
-\frac{x_1}{c_t} \left(\frac{1}{\mathcal{D}_{12}} + \frac{1}{\mathcal{D}_{13}}\right) &
\frac{x_1}{c_t} \left(\frac{1}{\mathcal{D}_{12}} - \frac{1}{\mathcal{D}_{13}}\right) &
\frac{x_1}{c_t} \left(\frac{1}{\mathcal{D}_{13}} - \frac{1}{\mathcal{D}_{12}}\right) \\[2ex]
\frac{x_2}{c_t} \left(\frac{1}{\mathcal{D}_{21}} - \frac{1}{\mathcal{D}_{23}}\right) &
-\frac{x_2}{c_t} \left(\frac{1}{\mathcal{D}_{21}} + \frac{1}{\mathcal{D}_{23}}\right) &
\frac{x_2}{c_t} \left(\frac{1}{\mathcal{D}_{23}} - \frac{1}{\mathcal{D}_{21}}\right) \\[2ex]
\frac{x_3}{c_t} \left(\frac{1}{\mathcal{D}_{31}} - \frac{1}{\mathcal{D}_{32}}\right) &
\frac{x_3}{c_t} \left(\frac{1}{\mathcal{D}_{32}} - \frac{1}{\mathcal{D}_{31}}\right) &
-\frac{x_3}{c_t} \left(\frac{1}{\mathcal{D}_{31}} + \frac{1}{\mathcal{D}_{32}}\right)
\end{pmatrix}
\\[2ex]
-\begin{pmatrix}
\frac{x_2}{c_t \cdot \mathcal{D}_{12}} + \frac{x_3}{c_t \cdot \mathcal{D}_{13}} & 0 & 0 \\[2ex]
0 & \frac{x_1}{c_t \cdot \mathcal{D}_{21}} + \frac{x_3}{c_t \cdot \mathcal{D}_{23}} & 0 \\[2ex]
0 & 0 & \frac{x_1}{c_t \cdot \mathcal{D}_{31}} + \frac{x_2}{c_t \cdot \mathcal{D}_{32}}
\end{pmatrix}
\end{multline*}
\begin{multline*}
\begin{pmatrix}
-\dfrac{x_1}{c_t} \left(\dfrac{1}{\mathcal{D}_{12}} + \dfrac{1}{\mathcal{D}_{13}}\right) &
\dfrac{x_1}{c_t} \left(\dfrac{1}{\mathcal{D}_{12}} - \dfrac{1}{\mathcal{D}_{13}}\right) &
\dfrac{x_1}{c_t} \left(\dfrac{1}{\mathcal{D}_{13}} - \dfrac{1}{\mathcal{D}_{12}}\right) \\[3ex]
\dfrac{x_2}{c_t} \left(\dfrac{1}{\mathcal{D}_{21}} - \dfrac{1}{\mathcal{D}_{23}}\right) &
-\dfrac{x_2}{c_t} \left(\dfrac{1}{\mathcal{D}_{21}} + \dfrac{1}{\mathcal{D}_{23}}\right) &
\dfrac{x_2}{c_t} \left(\dfrac{1}{\mathcal{D}_{23}} - \dfrac{1}{\mathcal{D}_{21}}\right) \\[3ex]
\dfrac{x_3}{c_t} \left(\dfrac{1}{\mathcal{D}_{31}} - \dfrac{1}{\mathcal{D}_{32}}\right) &
\dfrac{x_3}{c_t} \left(\dfrac{1}{\mathcal{D}_{32}} - \dfrac{1}{\mathcal{D}_{31}}\right) &
-\dfrac{x_3}{c_t} \left(\dfrac{1}{\mathcal{D}_{31}} + \dfrac{1}{\mathcal{D}_{32}}\right)
\end{pmatrix}
\\[2ex]
-\begin{pmatrix}
\dfrac{x_2}{c_t \cdot \mathcal{D}_{12}} + \dfrac{x_3}{c_t \cdot \mathcal{D}_{13}} & 0 & 0 \\[2ex]
0 & \dfrac{x_1}{c_t \cdot \mathcal{D}_{21}} + \dfrac{x_3}{c_t \cdot \mathcal{D}_{23}} & 0 \\[2ex]
0 & 0 & \dfrac{x_1}{c_t \cdot \mathcal{D}_{31}} + \dfrac{x_2}{c_t \cdot \mathcal{D}_{32}}
\end{pmatrix}
\end{multline*}
\end{document}
我给出了两个例子,可能会选择后者,分数更大,因为文本宽度似乎允许这样做。
关于你的序言:它很混乱,而且包被加载多次。需要重新排序。
pdfsync
已经过时且具有侵略性;避免使用它hyperref
应该最后加载$$
永远不应该在 LaTeX 中使用
这是一个可能的重塑。
\documentclass[11pt, oneside]{report}
% text input and output
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
% pages and text
\usepackage{geometry}
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{setspace}
% math
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{bm} % Define \bm{} to use bold math fonts
% tables and floats
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{flafter} % Don't place floats before their definition
% utilities
\usepackage{graphicx}
\usepackage{rotating}
\usepackage{pdflscape}
\usepackage{pdfpages}
\usepackage{etoolbox}
\usepackage{calc}
\usepackage{atbegshi}
%\usepackage[activate]{pdfcprot}
%\usepackage{memhfixc} % it's for memoir
\usepackage{titlesec}
% bibliography
\usepackage[babel]{csquotes}
\usepackage[backend=biber]{biblatex}
% hyperlinks
\usepackage{hyperref}
%%% Settings
% spacing
\singlespacing
%\onehalfspacing
% bibliography
\addbibresource{library.bib} % with extension
% numbering
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
%%% Personal commands
\begin{document}
答案2
除非您能找到一种方法来简化或缩写矩阵主对角线上的表达式,否则最好的选择可能是分别显示组成矩阵的三个列向量。
\documentclass{article}
\usepackage{mathtools,bm}
\usepackage{geometry}
\begin{document}
Let $\bm{A}=\begin{pmatrix*} \bm{a}_1 & \bm{a}_2 &\bm{a}_3 \end{pmatrix*}$, with
\begin{align*}
\bm{a}_1 &= \begin{pmatrix*}[l]
- \frac{x_1}{c_t} \bigl( \frac{1}{\mathcal{D}_{12}} + \frac{1}{\mathcal{D}_{13}} \bigr)
- \frac{x_2}{c_t \mathcal{D}_{12}} - \frac{x_3}{c_t \mathcal{D}_{13}} \\[1ex]
\phantom{-}\frac{x_2}{c_t} \bigl(\frac{1}{\mathcal{D}_{21}} - \frac{1}{\mathcal{D}_{23}} \bigr) \\[1ex]
\phantom{-}\frac{x_3}{c_t} \bigl(\frac{1}{\mathcal{D}_{31}} - \frac{1}{\mathcal{D}_{32}} \bigr)
\end{pmatrix*} \\[1ex]
\bm{a}_2 &= \begin{pmatrix*}[l]
\phantom{-}\frac{x_1}{c_t} \bigl(\frac{1}{\mathcal{D}_{12}} - \frac{1}{\mathcal{D}_{13}} \bigr) \\[1ex]
- \frac{x_2}{c_t} \bigl( \frac{1}{\mathcal{D}_{21}} + \frac{1}{\mathcal{D}_{23}} \bigr)
- \frac{x_1}{c_t \mathcal{D}_{21}} - \frac{x_3}{c_t \mathcal{D}_{23}} \\[1ex]
\phantom{-}\frac{x_3}{c_t} \bigl(\frac{1}{\mathcal{D}_{32}} - \frac{1}{\mathcal{D}_{31}} \bigr)
\end{pmatrix*} \\[1ex]
\bm{a}_2 &= \begin{pmatrix*}[l]
\phantom{-}\frac{x_1}{c_t} \bigl( \frac{1}{\mathcal{D}_{13}} - \frac{1}{\mathcal{D}_{12}}\bigr) \\[1ex]
\phantom{-}\frac{x_2}{c_t} \bigl(\frac{1}{\mathcal{D}_{23}} - \frac{1}{\mathcal{D}_{21}} \bigr) \\[1ex]
- \frac{x_3}{c_t} \bigl( \frac{1}{\mathcal{D}_{31}} + \frac{1}{\mathcal{D}_{32}} \bigr)
- \frac{x_1}{c_t \mathcal{D}_{31}} - \frac{x_2}{c_t \mathcal{D}_{32}}
\end{pmatrix*}
\end{align*}
\end{document}
答案3
由于矩阵的特殊结构(仅对角线上的元素非常大),使用来自nccmath
(~ 80% 的\displaystyle
) 的 dium-sized 命令,您的矩阵可以适应边距:
\documentclass[11pt, oneside]{report}
\usepackage[utf8]{inputenc} % Any characters can be typed directly from the keyboard, eg éçñ
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage{pdflscape}
% See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper, showframe} % \dots or a4paper or a5paper or ...
% TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
\usepackage{bm} % Define \bm{} to use bold math fonts
\usepackage{textcomp} % provide lots of new symbols
\usepackage{mathtools, nccmath}
\begin{document}
Normal text. Normal text. Normal text. Normal text. Normal text. Normal text. Normal text. Normal text.
\[
\medmath{\begin{pmatrix}
- \mfrac{x_1}{c_t} \left( \mfrac{1}{\mathcal{D}_{12}} + \mfrac{1}{\mathcal{D}_{13}} \right) - \mfrac{x_2}{c_t \mathcal{D}_{12}} - \mfrac{x_3}{c_t \mathcal{D}_{13}} & \mfrac{x_1}{c_t} \left(\mfrac{1}{\mathcal{D}_{12}} - \mfrac{1}{\mathcal{D}_{13}} \right) & \mfrac{ x_1}{c_t} \left( \mfrac{1}{\mathcal{D}_{13}} - \mfrac{1}{\mathcal{D}_{12}}\right) \\[3ex]
\mfrac{x_2}{c_t} \left(\mfrac{1}{\mathcal{D}_{21}} - \mfrac{1}{\mathcal{D}_{23}} \right) & \hspace*{-1.75em}- \mfrac{x_2}{c_t} \left( \mfrac{1}{\mathcal{D}_{21}} + \mfrac{1}{\mathcal{D}_{23}} \right) - \mfrac{x_1}{c_t \mathcal{D}_{21}} - \mfrac{x_3}{c_t \mathcal{D}_{23}} \hspace*{-1.75em} & \mfrac{x_2}{c_t} \left(\mfrac{1}{\mathcal{D}_{23}} - \mfrac{1}{\mathcal{D}_{21}} \right) \\[3ex]
\mfrac{x_3}{c_t} \left(\mfrac{1}{\mathcal{D}_{31}} - \mfrac{1}{\mathcal{D}_{32}} \right) & \mfrac{x_3}{c_t} \left(\mfrac{1}{\mathcal{D}_{32}} - \mfrac{1}{\mathcal{D}_{31}} \right) & - \mfrac{x_3}{c_t} \left( \mfrac{1}{\mathcal{D}_{31}} + \mfrac{1}{\mathcal{D}_{32}} \right) - \mfrac{x_1}{c_t \mathcal{D}_{31}} - \mfrac{x_2}{c_t \mathcal{D}_{32}}
\end{pmatrix}}
\]
\end{document}