2

I am using LaTeX to create a formula, however, I have found that the placement of the number (in my case, (2)) of the formula is too close. I want to put the number at the right side.

enter image description here

This is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}

\begin{equation}
{C_m = (D_m_1, D_m_2, ..., D_m_k__m}), (m \in (1, j))
\end{equation}
\end{document}

\end{document}

How should I change my code?

9
  • 3
    Please extend your sniplet to a full but minimal example that others can copy and test as is. Here there is no document class or preamble. Additionally your image does not match the code provided.
    – daleif
    May 16 at 14:12
  • 1
    The code shown can not possibly make the ouput shown, so impossible to say what to change. May 16 at 14:27
  • You must get an error from D_m_1 After any error don't even look at the ouput, TeX only recovers enough to syntax check the rest of the document, not to make sensible output. May 16 at 14:29
  • Is "formel" a math term I'm not familiar with, or should this be "formula"?
    – frabjous
    May 16 at 14:43
  • Sorry for that, I just updated my code
    – James
    May 16 at 14:56

2 Answers 2

2

when I run your code on my computer, I get several error messages, due to the double subscript" (eg D_m_2). Use D_{m_2}. You write you equation {......(........} ......). First, the {....} is not necessary in this case, and the (...) should be open and closed within the {...}, Ex: {....(...)... .}

Are all the parentheses really necessary?

The code below worked for me.

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{document}
    \begin{equation}
        C_m = (D_{m_1}, D_{m_2}, ..., D_{mk_m}), (m \in (1, j))
    \end{equation}
\end{document

enter image description here

3
  • Thanks a lot! That works!
    – James
    May 16 at 15:17
  • That doesn't change the position of the number, it just moves the formula itself slightly to the left. The OP must have been using different settings or the result was a byproduct of the code errors, as they're not getting it all the way on the right to begin with, as one would with your code, with or without the \quad.
    – frabjous
    May 16 at 15:20
  • and ... should be `\dots
    – daleif
    May 16 at 15:56
3

The reason why the number is close to the equation is that a } is missed in the input. The codes should be revised and improved in the following way.

\documentclass[runningheads]{llncs}

\begin{document}
\begin{equation}
C_m = (D_{m1}, D_{m2},\cdots, D_{mk_m}),
\end{equation}
where $m \in (1, j)$.
\end{document}

enter image description here

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.