大型多行方程对齐

大型多行方程对齐

我有以下乳胶代码:

\begin{equation*}
\begin{split}
Vect =& (\frac{1}{55},0,\frac{2}{113},-\frac{3}{46}-\frac{5i}{67},-\frac{1}{50},0,0,\frac{3}{107},-\frac{7}{41},\frac{1}{113}-\frac{4 i}{63}, \\
& -\frac{3}{89},-\frac{3}{289},-\frac{12}{275}+\frac{i}{7},-\frac{18}{137}-\frac{8 i}{143},-\frac{16}{108},\frac{1}{76}-\frac{i}{24},\\
&-\frac{3}{89},\frac{10}{101},\frac{3}{40},-\frac{16}{47},\frac{8}{91}+\frac{25i}{111},\frac{3}{40},\frac{15}{128},\frac{11}{131},\frac{16}{43},0,\\
&\frac{1}{51}-\frac{18i}{137},\frac{7}{20},0,\frac{7}{125},\frac{16}{43},\frac{10}{201},0,0,-\frac{1}{104},-\frac{7}{146}+\frac{7i}{187},\\
&-\frac{1}{81}+\frac{3 i}{62},0,0,-\frac{4}{105}+\frac{4i}{105},\frac{1}{32}+\frac{3 i}{34},0,0,\frac{1}{7},\frac{2}{7}+\frac{4 i}{35},\\
&0,\frac{5}{151}+\frac{6 i}{89},-\frac{1}{44},-\frac{3}{107},-\frac{2}{57}+\frac{10i}{151},-\frac{4}{87}+\frac{5 i}{108},\\
&\frac{21}{118}+\frac{16 i}{123},-\frac{1}{44},-\frac{3}{107},-\frac{3}{107},-\frac{7}{86}+\frac{17i}{145},\frac{1}{44},0,\frac{1}{44},\\
&-\frac{3}{107},-\frac{3}{62}-\frac{15 i}{187},\frac{1}{114},\frac{1}{8826},-\frac{1}{24}+\frac{3 i}{59})
\end{split}
\end{equation*}

如果这样编译,它看起来会很乱。有没有办法把它写得漂亮些,比如说,在一行上放置 6-7 个向量元素,但整个向量在两边都完美对齐(就像 Word 中的文本对齐一样)?

答案1

有点棘手,但采用内联数学似乎值得。

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % just for the example

\begin{document}

\lipsum*[2]
\begin{equation*}
\mathrm{Vect} = \biggl(
\begin{minipage}[t]{.85\displaywidth}
% make locally the comma to allow line breaks
\mathchardef\comma=\mathcode`,
\begingroup\lccode`~=`,\lowercase{\endgroup\def~}{\comma\penalty 0 }
\mathcode`,=\string"8000
% change the automatic spacing parameters, don't allow breaks at + and -
\thinmuskip=12mu plus 6mu minus 3mu \medmuskip=4mu \binoppenalty=10000
% give more room to lines
\linespread{2.4}\selectfont
$\displaystyle
\frac{1}{55}, 0, \frac{2}{113}, -\frac{3}{46}-\frac{5i}{67}, -\frac{1}{50},
0, 0, \frac{3}{107}, -\frac{7}{41}, \frac{1}{113}-\frac{4i}{63},
-\frac{3}{89}, -\frac{3}{289}, -\frac{12}{275}+\frac{i}{7}, -\frac{18}{137}-\frac{8i}{143},
-\frac{16}{108}, \frac{1}{76}-\frac{i}{24}, -\frac{3}{89}, \frac{10}{101}, \frac{3}{40},
-\frac{16}{47}, \frac{8}{91}+\frac{25i}{111}, \frac{3}{40}, \frac{15}{128}, \frac{11}{131},
\frac{16}{43}, 0, \frac{1}{51}-\frac{18i}{137}, \frac{7}{20},  0,
\frac{7}{125}, \frac{16}{43}, \frac{10}{201}, 0, 0,
-\frac{1}{104}, -\frac{7}{146}+\frac{7i}{187}, -\frac{1}{81}+\frac{3 i}{62}, 0, 0,
-\frac{4}{105}+\frac{4i}{105}, \frac{1}{32}+\frac{3 i}{34}, 0, 0, \frac{1}{7},
\frac{2}{7}+\frac{4 i}{35}, 0, \frac{5}{151}+\frac{6 i}{89}, -\frac{1}{44}, -\frac{3}{107},
-\frac{2}{57}+\frac{10i}{151}, -\frac{4}{87}+\frac{5 i}{108}, \frac{21}{118}+\frac{16 i}{123},
 -\frac{1}{44}, -\frac{3}{107}, -\frac{3}{107},  -\frac{7}{86}+\frac{17i}{145}, \frac{1}{44},
0, \frac{1}{44}, -\frac{3}{107}, -\frac{3}{62}-\frac{15 i}{187}, \frac{1}{114}, \frac{1}{8826},
 -\frac{1}{24}+\frac{3 i}{59}\biggr)$
\end{minipage}
\end{equation*}
\lipsum[3]

\end{document}

在此处输入图片描述

在某些情况下,这行不通,因为某些包可能已经重新定义了逗号。您可以进行分支检查。例如,使用您的序言,您可以这样做(并且它将独立于是否加载而工作breqn)。

\documentclass[%
 reprint,
%superscriptaddress,
%groupedaddress,
%unsortedaddress,
%runinaddress,
%frontmatterverbose,
%preprint,
%showpacs,preprintnumbers,
%nofootinbib,
%nobibnotes,
%bibnotes,
 amsmath,amssymb,
 aps,
%pra,
%prb,
%rmp,
%prstab,
%prstper,
%floatfix,
]{revtex4-1}

\usepackage{graphicx}% Include figure files
\usepackage{dcolumn}% Align table columns on decimal point
\usepackage{bm}% bold math
\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{siunitx}
\usepackage{braket}
\usepackage{breqn}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{wrapfig}
\usepackage{subcaption}
\usepackage{xcolor}
%\usepackage{mhchem}
\usepackage{bbold}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage{float}
\usetikzlibrary{arrows}


\usepackage{lipsum} % just for the example

\begin{document}

\lipsum*[2]
\begin{equation*}
\mathrm{Vect} = \biggl(
\begin{minipage}[t]{.8\displaywidth}
% make locally the comma to allow line breaks
\ifnum\mathcode`,=\string"8000
  \begingroup\lccode`~=`,
  \lowercase{\endgroup\expandafter\def\expandafter~\expandafter{~\penalty 0 }}%
\else
  \mathchardef\comma=\mathcode`,
  \begingroup\lccode`~=`,\lowercase{\endgroup\def~}{\comma\penalty 0 }
  \mathcode`,=\string"8000
\fi
% change the automatic spacing parameters, don't allow breaks at + and -
\thinmuskip=12mu plus 6mu minus 3mu \medmuskip=4mu \binoppenalty=10000
% give more room to lines
\linespread{2.4}\selectfont
$\displaystyle
\frac{1}{55}, 0, \frac{2}{113}, -\frac{3}{46}-\frac{5i}{67}, -\frac{1}{50},
0, 0, \frac{3}{107}, -\frac{7}{41}, \frac{1}{113}-\frac{4i}{63},
-\frac{3}{89}, -\frac{3}{289}, -\frac{12}{275}+\frac{i}{7}, -\frac{18}{137}-\frac{8i}{143},
-\frac{16}{108}, \frac{1}{76}-\frac{i}{24}, -\frac{3}{89}, \frac{10}{101}, \frac{3}{40},
-\frac{16}{47}, \frac{8}{91}+\frac{25i}{111}, \frac{3}{40}, \frac{15}{128}, \frac{11}{131},
\frac{16}{43}, 0, \frac{1}{51}-\frac{18i}{137}, \frac{7}{20},  0,
\frac{7}{125}, \frac{16}{43}, \frac{10}{201}, 0, 0,
-\frac{1}{104}, -\frac{7}{146}+\frac{7i}{187}, -\frac{1}{81}+\frac{3 i}{62}, 0, 0,
-\frac{4}{105}+\frac{4i}{105}, \frac{1}{32}+\frac{3 i}{34}, 0, 0, \frac{1}{7},
\frac{2}{7}+\frac{4 i}{35}, 0, \frac{5}{151}+\frac{6 i}{89}, -\frac{1}{44}, -\frac{3}{107},
-\frac{2}{57}+\frac{10i}{151}, -\frac{4}{87}+\frac{5 i}{108}, \frac{21}{118}+\frac{16 i}{123},
 -\frac{1}{44}, -\frac{3}{107}, -\frac{3}{107},  -\frac{7}{86}+\frac{17i}{145}, \frac{1}{44},
0, \frac{1}{44}, -\frac{3}{107}, -\frac{3}{62}-\frac{15 i}{187}, \frac{1}{114}, \frac{1}{8826},
 -\frac{1}{24}+\frac{3 i}{59}\biggr)$
\end{minipage}
\end{equation*}
\lipsum

\end{document}

在此处输入图片描述

相关内容