我需要在两个对齐的方程式之间添加一个单词,但单词和下一个方程式之间的间距太大。 有没有针对我文档的这一部分进行快速调整的方法?(注意:使用 {alignat*} 环境,这样我就不必一直告诉 LaTeX 我不想要数字)
(代码已修复)
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[]{amsthm}
\usepackage[]{amssymb}
\usepackage[]{amsmath}
\usepackage{textcomp}
\usepackage{chngcntr}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{matrix}
\usepackage{wrapfig}
\usepackage{physics}
\usepackage{mathtools}
\usepackage{bm}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[T1]{fontenc}
\usepackage[numbered]{matlab-prettifier}
\lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3}
\begin{document}
\begin{align*}
(a-\lambda)v_1 + b v_2 &= 0,\\
cv_1 + (a-\lambda)v_2 + b v_3 &= 0\\
\cdots\quad\qquad&\\
cv_{n-3} + (a-\lambda)v_{n-2} + b v_{n-1} &= 0
\intertext{and}
cv_{n-1} + (a-\lambda)v_{n} &= 0.
\end{align*}
\end{document}
我认为“and”后面的空格,可能还有“too”前面的空格太大了
答案1
(红线表示文本边框)
最小工作示例:
\documentclass{article}
\usepackage{mathtools}% instead of amsmath, it provide \shortintertext
\begin{document}
\begin{align*}
(a-\lambda)v_1 + b v_2 & = 0, \\% removed \left( and \right)
cv_1 + (a-\lambda)v_2 + b v_3 & = 0 \\% removed \left( and \right)
\cdots\quad\qquad & \\% removed \left( and \right)
cv_{n-3} + (a-\lambda)v_{n-2} + b v_{n-1} & = 0 % removed \left( , \right) and \\
\shortintertext{and}
cv_{n-1} + (a-\lambda)v_{n} & = 0. % removed \left( , \right) and \\
\end{align*}
\end{document}
您的文档有错误。请尝试编译它。大部分序言与显示您的问题无关。
答案2
另一种可能性是nccmath
(也会加载);它使用可选参数amsmath
完全控制的间距:\intertext
\documentclass{article}
\usepackage{mathtools}% instead of amsmath, it provide \shortintertext
\usepackage{nccmath} % proviides medium sized formulae and acontrol of intertext soacing via an optional argument
\begin{document}
\begin{align*}
(a-\lambda)v_1 + b v_2 & = 0, \\% removed \left( and \right)
cv_1 + (a-\lambda)v_2 + b v_3 & = 0 \\% removed \left( and \right)
\cdots\quad\qquad & \\% removed \left( and \right)
cv_{n-3} + (a-\lambda)v_{n-2} + b v_{n-1} & = 0 % removed \left( , \right) and \\
\intertext[-1ex]{and}
cv_{n-1} + (a-\lambda)v_{n} & = 0. % removed \left( , \right) and \\
\end{align*}
\end{document}