我需要帮助。我需要用 LaTeX 写出这些方程式,我是这样写的:
\newcounter{defcounter}
\setcounter{defcounter}{23}
\newenvironment{myequation}%
{\addtocounter{equation}{-1}%
\refstepcounter{defcounter}%
\renewcommand\theequation{D.\thedefcounter}%
\begin{equation}
}%
{\end{equation}%
}
\begin{myequation}
(x^{\alpha})' \ = \ \alpha x^{\alpha -1}, \ \alpha \in \mathbb{R}, \ x \in
\mathbb{R}
\end{myequation}
\begin{myequation}
(\log_a{x})' \ = \ \frac{1}{x}\log_a{e}, \ x>0 \\
\end{myequation}
答案1
在大多数情况下,这种包装环境的设计并不是很好,并且align
也可以进行对齐。
\documentclass{article}
\usepackage{mathtools}
\usepackage{amsfonts}
\renewcommand\theequation{D.\arabic{equation}}
\begin{document}
\setcounter{equation}{23}
\begin{align}
(x^{\alpha})' &= \alpha x^{\alpha -1}, \,\alpha \in \mathbb{R}, \, x \in
\mathbb{R} \\
(\log_a{x})' &= \frac{1}{x}\log_a{e}, \,x>0
\end{align}
\end{document}