![将一排点放入等式中](https://linux22.com/image/268710/%E5%B0%86%E4%B8%80%E6%8E%92%E7%82%B9%E6%94%BE%E5%85%A5%E7%AD%89%E5%BC%8F%E4%B8%AD.png)
是否有可能创建一个如下所示的方程组:
aX(x_0)+bX(x_0)+cX(x_0)=A
dX(x_1)+eX(x_1)+fX(x_1)=B
.........................
gX(x_n)+hX(x_n)+iX(x_n)=B
我尝试过这个:
\documentclass[a4paper,12pt,twoside]{article}
\usepackage{amsmath,amssymb,amsthm,amssymb}
\usepackage{tikz}
\usetikzlibrary{decorations.shapes}
\begin{document}
\begin{equation*}
\begin{split}
a_0\varphi_0(x_0)+a_1\varphi_1(x_0)+\ldots+a_n\varphi_n(x_0)&=f_0\\
a_0\varphi_0(x_1)+a_1\varphi_1(x_1)+\ldots+a_n\varphi_n(x_1)&=f_1\\
\begin{tikzpicture}
\draw[decorate sep={0.4mm}{2mm},fill] (6,0) -- (12,0);
\end{tikzpicture}
a_0\varphi_0(x_n)+a_1\varphi_1(x_n)+\ldots+a_n\varphi_n(x_n)&=f_n\\
\end{split}
\end{equation*}
\end{document}
但那是行不通的:我可以只放\cdots
一些类似的点,但我想要一条穿过该行的连续的线。
答案1
您可以将对齐视为一个数组,并使用\hdotsfor
(由 定义amsmath
):
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begingroup
\setlength{\arraycolsep}{0pt}
\begin{equation*}
\begin{array}{rl}
a_0\varphi_0(x_0)+a_1\varphi_1(x_0)+\ldots+a_n\varphi_n(x_0)&{}=f_0\\
a_0\varphi_0(x_1)+a_1\varphi_1(x_1)+\ldots+a_n\varphi_n(x_1)&{}=f_1\\
\hdotsfor{2}\\
a_0\varphi_0(x_n)+a_1\varphi_1(x_n)+\ldots+a_n\varphi_n(x_n)&{}=f_n\\
\end{array}
\end{equation*}
\endgroup
\end{document}
因为需要重置\arraycolset
为零,所以需要将其隐藏在组内。虽然您可以使用{ ... }
,但除非您%
在右括号后面放置一个,否则紧随其后的一行文本将缩进一个空格;我曾经利用后面的空格(或行尾)将被忽略的\begingroup ... \endgroup
事实。\endgroup
当然,如果您希望每行单独编号,那么这种方法就行不通了。
答案2
这是一个选项:
\documentclass[a4paper,12pt,twoside]{article}
\usepackage{amsmath,amssymb,amsthm,amssymb}
\begin{document}
\begin{displaymath}
\begin{array}{*{3}{c@{\;+\:}}c@{\;=\;}c}
a_{1,1}x_{1} & a_{1,2}x_{2} & \cdots & a_{1,n}x_{n} & b_1 \\
a_{2,1}x_{1} & a_{2,2}x_{2} & \cdots & a_{2,n}x_{n} & b_2 \\
\multicolumn{5}{c}{\dotfill} \\
a_{n,1}x_{1} & a_{n,2}x_{2} & \cdots & a_{n,n}x_{n} & b_n \\
\end{array}
\end{displaymath}
\end{document}
答案3
如何在 tikz 中绘制一条点线
演示如何绘制这样的线。也许另一种选择是使用包hdashrule
中的dashrule
?
\intertext{\hdashrule{8cm}{1pt}{1mm 1mm}}
而不是可能tikzpicture
足够好但仍然需要硬编码的宽度。
答案4
以下是使用 TikZ 和您的设置的解决方案。只需在上一行的开头和结尾处放置一些标记,然后使用\mdotteline
这些标记:
\documentclass[a4paper,12pt,twoside]{article}
\usepackage{amsmath,amssymb,amsthm,amssymb}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\tikzmark[1]{%
\tikz[remember picture,overlay]\coordinate (#1);}
\newcommand\mdottedline[2]{%
\begin{tikzpicture}[remember picture,overlay]
\path let \p1=(#1), \p2=(#2) in
node [text width=\x2-\x1] at ( $ ([yshift=-\baselineskip]#1)!0.5!([yshift=-\baselineskip]#2) $ ) {\dotfill};
\end{tikzpicture}
}
\begin{document}
\begin{equation*}
\begin{split}
a_0\varphi_0(x_0)+a_1\varphi_1(x_0)+\ldots+a_n\varphi_n(x_0)&=f_0\\
\tikzmark{start}a_0\varphi_0(x_1)+a_1\varphi_1(x_1)+\ldots+a_n\varphi_n(x_1)&=f_1\tikzmark{end}
\\ \\
a_0\varphi_0(x_n)+a_1\varphi_1(x_n)+\ldots+a_n\varphi_n(x_n)&=f_n
\end{split}
\end{equation*}
\begin{align}
a_0\varphi_0(x_0)+a_1\varphi_1(x_0)+\ldots+a_n\varphi_n(x_0)&=f_0\\
\tikzmark{starti}a_0\varphi_0(x_1)+a_1\varphi_1(x_1)+\ldots+a_n\varphi_n(x_1)&=f_1\tikzmark{endi}
\\ \notag\\
a_0\varphi_0(x_n)+a_1\varphi_1(x_n)+\ldots+a_n\varphi_n(x_n)&=f_n
\end{align}
\mdottedline{start}{end}
\mdottedline{starti}{endi}
\end{document}
如示例所示,无论您是否对行进行编号,这都是有效的。