1

I need help. I need to write these equations in LaTeX, I wrote it like this:

\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}

to get the numbers on the right side. I also have a Section so if I use align he automatically put number 2.3 which I don't need enter image description here

enter image description here

  • 1
    I think you should rather use \begin{align} ...\end{align} instead of such \begin{equation}...\end{equation} wrapper. equation itself is numbered already, so there is no need to number it again with a different counter, in my point of view. – user31729 Apr 5 '17 at 14:14
  • it is myequation because i need to have D.24 if i put only equation it will be numbered as 1 – Ana Leko Apr 5 '17 at 14:20
  • 1
    You could as well set equation to 23 – user31729 Apr 5 '17 at 14:24
1

In most cases such wrapper environments are not really well-designed and the alignment can be done with align as well.

\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}

enter image description here

| improve this answer | |
  • So here is another problem – Ana Leko Apr 5 '17 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.