0

enter image description here

How to enter this equation in latex?

Torbjørn T.
  • 206,688
James
  • 415

3 Answers3

4

Like this.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
H^{l+1} = \sigma\Biggl( \tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} H^l W^l \Biggr)
\end{equation}
\end{document}

To reduce the size of the parentheses (which are unnecessarily big), you could replace \Biggl and \Biggr with \bigl and \bigr, which seem to be more appropriate here.

Vincent
  • 20,157
3

You really should take advantage of a beginner's guide, see What are good learning resources for a LaTeX beginner?

Split the problem into parts. You have letters with an exponent and others with a decoration and an exponent.

For a letter with an exponent, the LaTeX way is

a^{b}

(a subscript would be a_{b} and you can combine both in either order). The decoration is a tilde and the syntax is

\tilde{a}

The Greek letter is a (lowercase) sigma and you input it as \sigma.

A two-story fraction is input as \frac{a}{b}.

It remains the problem of the parentheses that, in the picture you show are obnoxiously big for no reason. So the first try would be

H^{l+1}=\sigma(\tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} H^{l} W^{l})

quite likely in a displayed equation. You might consider the simple parentheses too small in the particular case, because of the decorations and the high exponents, so you may try \big size:

H^{l+1}=\sigma \bigl( \tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} H^{l} W^{l} \bigr)

In the minimal document below, both are shown.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation} H^{l+1}=\sigma(\tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} H^{l} W^{l}) \end{equation}

\begin{equation} H^{l+1}=\sigma \bigl( \tilde{D}^{-\frac{1}{2}} \tilde{A} \tilde{D}^{-\frac{1}{2}} H^{l} W^{l} \bigr) \end{equation}

\end{document}

enter image description here

Personally, I'd go with the top one: parentheses are delimiters that denote, in this case, the argument to a function. You reader expects them and will see them. They're not blankets that must cover the entire thing.

Note \bigl for the opening (left) parenthesis and \bigr for the closing (right) parenthesis.

The next size, \Big (with \Bigl( and \Bigr)) would be too large

enter image description here

and there's no reason to do like this. The fact that such big fences are seen in papers on the net is not a reason. You'll find that somebody recommends \left( and \right). The result would be

enter image description here

which is even worse. It uses \Big size, but also adds an undesired horizontal space that hinders understanding the meaning.

egreg
  • 1,121,712
1

Is it what you want?

\documentclass{article}
\usepackage{amsmath, amssymb}

\begin{document}

[ H^{l + 1} = \sigma\Bigl( \widetilde{D}{}^{-\frac 12}\widetilde{A},\widetilde{D}{}^{-\frac 12}H^{l}W^{l}\Bigr) ]%

\end{document}

enter image description here

Bernard
  • 271,350
  • Are the {} empty math atoms needed? Aside: do also replace σ with \sigma. :-) – Mico Jul 15 '22 at 15:32
  • 1
    @Mico: I used {} to avoid having the exponent too high (because of the tilde). As to \sigma, it's a problem with my editor; I configured WinEdt so that greek ketters appear as they look on a printed page, but they're saved as the latex command, and I forgot to check this point in my answer. 'Tis fixed now. Thanks for pointing the problem! – Bernard Jul 15 '22 at 16:39