我正在文档类中输入矩阵,但其大小太大,无法适应页面宽度。我也使用了 TeX 代码\tiny
,但它使矩阵条目的字体太小。我无法解决这个问题。有人能帮助我吗?我将不胜感激。这是我正在使用的 tex 代码。
\documentclass{article}
\usepackage{latexsym}
\usepackage{latexsym}
\usepackage{amsmath, times, amsfonts, mathrsfs, amssymb}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage[labelsep=period]{caption}
\parindent 0.5 cm
\makeatletter \oddsidemargin .01in \evensidemargin .01in \textwidth
15cm \topmargin -1cm \textheight 20.5cm
\newcommand{\singlespacing}{\let\CS=\@currsize
\renewcommand{\baselinestretch}{1}\tiny\CS}
\newcommand{\doublespacing}{\let\CS=\@currsize
\renewcommand{\baselinestretch}{1.7}\tiny\CS}
\newcommand{\tab}{\hspace*{2em}}
\begin{document}
$X_1 = \left(
\begin{array}{cccccc}
1.059200000000000 & -1.059200000000000 & 0 & 0 & 0 & 0 \\
-1.059200000000000 & 1.059200000000000 & 0 & 0 & 0 & 0 \\
0 & 0 & 1.059200000000000 & -1.059200000000000 & 0 & 0 \\
0 & 0 & -1.059200000000000 & 1.059200000000000 & 0 & 0 \\
0 & 0& 0.364800000000000 & -1.364800000000000 & 0.694400000000000 & 0.305600000000000 \\
0 & 0 & -1.364800000000000 & 0.364800000000000 & 0.305600000000000 & 0.694400000000000 \\
\end{array}
\right)
$
\end{document}
答案1
我看不出所有这些零的意义。但是,使用:
\noindent
\resizebox{\linewidth}{!}{\arraycolsep=2pt%
$X_1 = \left(
\begin{array}{@{}*6r}
1.059200000000000 & -1.059200000000000 & 0 & 0 & 0 & 0 \\
-1.059200000000000 & 1.059200000000000 & 0 & 0 & 0 & 0 \\
0 & 0 & 1.059200000000000 & -1.059200000000000 & 0 & 0 \\
0 & 0 & -1.059200000000000 & 1.059200000000000 & 0 & 0 \\
0 & 0& 0.364800000000000 & -1.364800000000000 & 0.694400000000000 & 0.305600000000000 \\
0 & 0 & -1.364800000000000 & 0.364800000000000 & 0.305600000000000 & 0.694400000000000 \\
\end{array}
\right)
$}
答案2
我删除了所有负边距和其他设置(如果您需要更改页面大小,我推荐使用该geometry
软件包)。我\tiny\CS
从您的双倍行距设置中删除了奇怪的内容。使用amsmath
pmatrix
可以按照您的要求提供更严格的矩阵设置,但我还删除了尾随零(如果它们携带信息,这可能不是提供该信息的最佳方式),并且我使用了显示数学而不是内联数学,因为表达式显然太大而无法内联。还删除了几行重复的\usepackage
行。
\documentclass{article}
\usepackage{amsmath, times, amsfonts, mathrsfs, amssymb}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage[labelsep=period]{caption}
\newcommand{\singlespacing}{\renewcommand{\baselinestretch}{1}\selectfont}
\newcommand{\doublespacing}{\renewcommand{\baselinestretch}{1.7}\selectfont}
\newcommand{\tab}{\hspace*{2em}}
\begin{document}
\[
X_1 = \begin{pmatrix}
1.0592 & -1.0592 & 0 & 0 & 0 & 0 \\
-1.0592 & 1.0592 & 0 & 0 & 0 & 0 \\
0 & 0 & 1.0592 & -1.0592 & 0 & 0 \\
0 & 0 & -1.0592 & 1.0592 & 0 & 0 \\
0 & 0& 0.3648 & -1.3648 & 0.6944 & 0.3056 \\
0 & 0 & -1.3648 & 0.3648 & 0.3056 & 0.6944 \\
\end{pmatrix}
\]
\end{document}
或者对于芭芭拉来说:
\documentclass{article}
\usepackage{amsmath, times, amsfonts, mathrsfs, amssymb,dcolumn}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage[labelsep=period]{caption}
\newcommand{\singlespacing}{\renewcommand{\baselinestretch}{1}\selectfont}
\newcommand{\doublespacing}{\renewcommand{\baselinestretch}{1.7}\selectfont}
\newcommand{\tab}{\hspace*{2em}}
\makeatletter
\def\env@matrix{\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{*\c@MaxMatrixCols {D{.}{.}{2.4}}}}
\makeatother
\begin{document}
\[
X_1 = \begin{pmatrix}
1.0592 & -1.0592 & 0 & 0 & 0 & 0 \\
-1.0592 & 1.0592 & 0 & 0 & 0 & 0 \\
0 & 0 & 1.0592 & -1.0592 & 0 & 0 \\
0 & 0 & -1.0592 & 1.0592 & 0 & 0 \\
0 & 0& 0.3648 & -1.3648 & 0.6944 & 0.3056 \\
0 & 0 & -1.3648 & 0.3648 & 0.3056 & 0.6944 \\
\end{pmatrix}
\]
\end{document}