![如何在 eqnarray 环境中在方程和方程编号之间添加一行点?](https://linux22.com/image/405773/%E5%A6%82%E4%BD%95%E5%9C%A8%20eqnarray%20%E7%8E%AF%E5%A2%83%E4%B8%AD%E5%9C%A8%E6%96%B9%E7%A8%8B%E5%92%8C%E6%96%B9%E7%A8%8B%E7%BC%96%E5%8F%B7%E4%B9%8B%E9%97%B4%E6%B7%BB%E5%8A%A0%E4%B8%80%E8%A1%8C%E7%82%B9%EF%BC%9F.png)
我想在方程式和方程式数字之间添加一行点,就像这样:
我得到了一个答案这里
\begin{equation}
\hskip \textwidth minus \textwidth
\sin^2{\theta}+\cos^2{\theta}=1
\leaders\hbox{$\cdot$ }\hskip \textwidth minus \textwidth
\end{equation}
然而,它在 eqnarray 环境中不起作用
\begin{eqnarray}
{f_1(x)=12x^2+36x+\sin x}
f_2(x)=\sqrt{3}{x^3+3x}
\end{eqnarray}
编辑:最后,我的解决方案如下:
\newlength{\eqlength}
\newlength{\numlength}
\newlength{\dotlength}
\newlength{\frontlength}
\newcounter{eq}[chapter]
\stepcounter{eq}
\newcommand{\drawdots}[2][0pt]{
#2
\stepcounter{eq}
\settowidth{\eqlength}{$#2$}
\settowidth{\numlength}{(\thechapter.\theeq)}
\setlength{\dotlength}{0.5\textwidth-0.5\eqlength-\numlength}
\addtolength{\dotlength}{#1}
\makebox[0em][l]{\leaders\hbox{ $\cdot$}\hskip \dotlength}
}
\let\normeq\equation
\let\endnormeq\endequation
\renewenvironment{equation}{
\normeq
\drawdots
}{
\endnormeq
}
\begin{equation}
{\sin^2{\theta}+\cos^2{\theta}=1}
\label{eq:pingfanghe}
\end{equation}
\begin{align}
&\drawdots{f_1(x)=12x^2+36x+\sin x}\\
&\drawdots[4ex]{f_2(x)=\sqrt{3}{x^3+3x}}
\label{eq:fx2}
\end{align}
答案1
使用\dotfill
\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation}
\sin^2{\theta}+\cos^2{\theta}=1\makebox[20em]{\dotfill}
\end{equation}
\begin{equation}
\begin{cases}
f_1(x) &=12x^2+36x+\sin x \\
f_2(x)&=\sqrt{3}{x^3+3x}\makebox[20em]{\dotfill}
\end{cases}
\end{equation}
\end{document}
答案2
可以应用下面的解决方案吗?
\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\hskip \textwidth minus \textwidth
\sin^2{\theta}+\cos^2{\theta}=1
\leaders\hbox{$\cdot$ }\hskip \textwidth minus \textwidth
\end{equation}
\begin{eqnarray}
\hskip 0.3\textwidth
f_1(x)=12x^2+36x+\sin x
\leaders\hbox{$\cdot$ }\hskip 0.3\textwidth \\
f_2(x)=\sqrt{3}x^3+3x
\leaders\hbox{$\cdot$ }\hskip 0.3\textwidth
\end{eqnarray}
\end{document}