0

I am using codemirror render-math(https://github.com/cben/CodeMirror-MathJax). My code:

\documentclass{???????} %% please complete

\usepackage{???????} %% please complete and add all packages related to your problem

\begin{document}

\begin{equation}
e^{\pi i} + 1 = 0 
\end{equation}

%%% this is rendered
\begin{equation}
    a + b + c + d + \int_a^b f(x)dx - \sum_k c_k\int g(x)dx 
      = \prod_n \int_{\Omega_k} F(x,y,z) d\omega
\end{equation}

\end{document}

Only the second equation is rendered. How can I import packages for this problem?

Yank
  • 1
  • 1
  • 2
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Philipp Imhof Apr 29 '20 at 07:58
  • Also, please specify what your problem is. Is the first equation not rendered despite not being multiline? Otherwise, you should remove that first equation, as it would not be related to the problem. To me, it is not clear, what you need. That makes it hard to help you. – Philipp Imhof Apr 29 '20 at 08:04
  • being Yank a new user, we can wait a little longer before closing the question – Alessandro Cuttin Apr 29 '20 at 08:23

1 Answers1

1

Just using the article class will do the trick ;) The second equation fits on one line, but since you mentioned "multiline" in the title, I add an option with multline (equation 3), but it makes sense only if the equation is longer than it is now.

For multiline displayed math you can refer to https://tex.stackexchange.com/a/239309/177

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{equation}
    e^{\pi i} + 1 = 0
\end{equation}

\begin{equation}
    a + b + c + d + \int_a^b f(x)dx - \sum_k c_k\int g(x)dx
      = \prod_n \int_{\Omega_k} F(x,y,z) d\omega
\end{equation}
Or, alternatively
\begin{multline}
    a + b + c + d + \int_a^b f(x)dx - \sum_k c_k\int g(x)dx=  \\
    \prod_n \int_{\Omega_k} F(x,y,z) d\omega
\end{multline}

\end{document}

The output is

enter image description here

  • Thanks, But i'm using codemirror editor. In that how can i check the more than one equation line in MathJax – Yank Apr 29 '20 at 09:15
  • Can't really understand what you are asking – Alessandro Cuttin Apr 29 '20 at 09:19
  • I'm using (https://github.com/cben/CodeMirror-MathJax) render-math.js in codemirror-widget. In this they are handling only for single line not an multi line. Can you help me to do this? – Yank Apr 29 '20 at 09:24
  • 1
    @Yank mathjax specific questions are off topic here (it doesn't use tex) but it does support multline so it ought to work, although depending on the configuration they use you may need to put $ around it to trigger math processing ($ around multline would be an error if used with latex) – David Carlisle Apr 29 '20 at 15:32