DSPRelated.com
Forums

MathJax/Latex question

Started by ChuckMcM 5 years ago7 replieslatest reply 4 years ago273 views

Hi All,

If this isn't the right place for this I apologize, I've tried a couple of other forums as well and I'm striking out.

I'm trying to write Hoagenaur's equations for the system equation of the #cic in #mathjax. That has two parts, one where \(j = 1, 2, ... ,N \) and one with \( j = N+1, ..., 2N \). I can get it all on one like like so:

$$ h_j(k)  = \left \{
{
\displaystyle\sum_{l=0}^{[ k/RM ]} (-1)^l\binom {N} {I} \binom { N - j + k - RMl }  { k - RMl }, j = 1, 2, ... ,N
}
\\

{
(-1)^k \binom {2N + 1 - j} {k}, j = N+1, ..., 2N
} \right.  $$

But realistically want the left brace to be taller and to have it on two lines. Thoughts on what construct would allow me to break the thing into two lines? I've tried the double back slash and that doesn't have an effect.

Interestingly, after showing "math error" and then refreshing, it is on two lines but the brace is still just on the top line, not spanning both lines.



[ - ]
Reply by ChuckMcMOctober 28, 2020

Hmm okay, I seem to have got it, the trick is using the begin{equation*} / end{equation*} from the ams math package, and begin{align} / end{align} to align the parts.

$$
\begin{equation*}
h_j(k)  = \left \{
\begin{aligned}
{
\displaystyle\sum_{l=0}^{[ k/RM ]} (-1)^l\binom {N} {I} \binom { N - j + k - RMl }  { k - RMl }, j = 1, 2, ... ,N
}
\\

{
(-1)^k \binom {2N + 1 - j} {k}, j = N+1, ..., 2N
}
\end{aligned} \right.
\end{equation*} $$


[ - ]
Reply by drmikeOctober 28, 2020

Thank you for showing this!  I found that right clicking on the equation and selecting "show math as" and "tex commands" shows me what you are talking about.  I've struggled with mathjax a lot, so this is really useful.

[ - ]
Reply by ChuckMcMOctober 28, 2020

Glad it helped! Two resources I depend on heavily are the Mathjax "demo" page (that lets you type in code and see what it produces) https://www.mathjax.org/#demo and the AMS document on using LaTeX to write math : http://texdoc.net/texmf-dist/doc/latex/amsmath/ams...

[ - ]
Reply by CedronOctober 28, 2020

There is a Latex group on StackExchange.  I'll bet you'd find some experts there as well.

https://tex.stackexchange.com/

[ - ]
Reply by jms_nhOctober 28, 2020
tex.stackexchange.com is great (they've answered loads of questions from me on TikZ) but they're snobs and Soup Nazis when it comes to answering any question on MathJax, because "it's not TeX".
[ - ]
Reply by CedronOctober 28, 2020
That's interesting.  I've never hung out there so I wouldn't know.

You don't have to tell them it's MathJax.  I do all my rough drafts as .tex files, then I have a converter I wrote that makes them .htm for my blog articles.  The 'pdflatex' package running locally on my machine is much, much faster than MathJax rendering in a web page.  AFAIK, the syntax is basically the same.

Now, how can we get Lyons to use it?


Just for fun, here is a variation:

\begin{equation*}
 h_j(k)  =
\left \{
\begin{aligned}
&\displaystyle\sum_{l=0}^{[k/RM]} (-1)^l \binom{N}{I} \binom{ N - j + k - RMl }{ k - RMl }, \; j = 1, 2, ... ,N \\
&(-1)^k \binom {2N + 1 - j}{k}, \qquad \qquad j = N+1, ..., 2N
\end{aligned}
\right.  
\end{equation*}

[ - ]
Reply by jms_nhOctober 28, 2020

test: \(a + b = c\)

$$a^2 + b^2 = c^2$$

\[E = mc^2\]


ok for delimiters you have to use  \( and its complement (backslash + right parentheses) for inline and $$ or \[ and its complement for display math