3

I am new to Latex and was trying to insert the below equation.

I am trying to insert this equation

But I am not getting it right

below is my code

\begin{equation} 
S (ω)=1.466\, H_s^2 \,  \frac{ω_0^5}{ω^6 }  \, e^[-3^ { ω/(ω_0  )]^2}
\end{equation}
  • Welcome to TeX.SE. There seems to be almost no overlap between the formula shown in the screenshot and the formula shown in your LaTeX code. Which formula are you trying to get typeset? – Mico Feb 3 '17 at 15:32
  • 2
    Your code does not come close to matching the pictured equation, however note that, with ^ and _, only a single token that follows is used. If you want a longer super or subscript, you must enclose the whole extended super/sub-script between braces {}. – Steven B. Segletes Feb 3 '17 at 15:33
  • I am so sorry , I am trying to type the formula shown in screenshot. – Vai Ari Feb 3 '17 at 15:33
6

The formula to the right of the = symbol in the first row comes reasonably close to the screenshot you posted, including the use of small outer square brackets and large inner curly braces. However, I do not recommend this look. The "look" of the second row may be more appealing to your readers.

enter image description here

\documentclass{article}
\usepackage{amsmath} % for 'align*' env.
\begin{document}
\begin{align*}
S(\omega) 
&= \frac{\alpha g^2}{\omega^5} e^{[ -0.74\bigl\{\frac{\omega U_\omega 19.5}{g}\bigr\}^{\!-4}\,]} \\
&= \frac{\alpha g^2}{\omega^5} \exp\Bigl[ -0.74\Bigl\{\frac{\omega U_\omega 19.5}{g}\Bigr\}^{\!-4}\,\Bigr] 
\end{align*}
\end{document}
4

I only correct your code and not code your image from scratch:

enter image description here

\documentclass{article}
\usepackage{mathtools}

\begin{document}
    \begin{equation}
S(\omega)=1.466\, H_s^2 \,  \frac{\omega_0^5}{\omega^6}  \, e^{\left[-3^{\omega/(\omega_0)}\right]^2}
\end{equation}
or better
\begin{equation}
S(\omega)=1.466\, H_s^2 \frac{\omega_0^5}{\omega^6} \exp\Bigl[-3^{\frac{\omega}{\omega_0}}\Bigr]^2
    \end{equation}
\end{document}
4

Salient points include using brace delimiters {} around extended super and subscript groups. I also used \bigl and \bigr to extend the height of braces in the exponent, and added a thin space \, before the e of the exponential. Like the OP's original figure, I did not extend the height of the brackets in the exponential, as it kind of confuses it as looking less exponential.

\documentclass{article}
\begin{document}
\begin{equation} 
S (\omega)=\frac{\alpha g^2}{\omega^5} \,
e ^{[-0.74\bigl\{\frac{\omega U_\omega 19.5}{g}\bigr\}^{-4}]}
\end{equation}
\end{document}

enter image description here

If one finds, as I do, the \big braces in the exponential too "clunky", one can alternately use a vertically-scaled, width-limited version of the normal brace:

\documentclass{article}
\usepackage{scalerel}
\begin{document}
\begin{equation} 
S (\omega)=\frac{\alpha g^2}{\omega^5} \,
e ^{[-0.74\scaleleftright[.7ex]{\{}{\frac{\omega U_\omega 19.5}{g}}{\}}^{-4}]}
\end{equation}
\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.