2

I am new in LaTex and need your help to write the following math equation in LaTeX.

enter image description here

  • 1
    Welcome to TeX.SX! What have you done so far? Try H_{k_p}=\frac{Y_{k_p}}{X_{k_p}} – Bobyandbob Oct 3 '18 at 16:50
  • Comment not at all an answer. ff you can conveniently write what you mean without using double subscripts many readers will find it easier to understand you. – Ethan Bolker Oct 3 '18 at 23:28
4

One of the simplest ways to input an equation into LaTeX is to write something like

\documentclass{article}

\begin{document}

\begin{equation}
H_{k_p}=\frac{Y_{k_p}}{X_{k_p}}
\end{equation}

\end{document}

enter image description here

Notice how I've used the syntax of LaTeX to format the equation into the way you want - subscripts need the _ key, and I've used { } to indicate "k_p" should itself be a subscript. Also note how to make fractions by using the \frac{}{} command.

  • 2
    You can mark inline code as such by using back ticks: `. – Skillmon Oct 3 '18 at 16:56
3

A very simple one. You can use one of the three methods below (among others…)

Edit

Use \frac instead of \dfrac

\documentclass{article}

\usepackage{amsmath}

\begin{document}
    In displaystyle
    \[H_{k_{p}}=\frac{Y_{k_{p}}}{X_{k_{p}}}\]

    Or inline $H_{k_{p}}=\dfrac{Y_{k_{p}}}{X_{k_{p}}}=\frac{Y_{k_{p}}}{X_{k_{p}}}=\tfrac{Y_{k_{p}}}{X_{k_{p}}}$.

    With a numbered and refenced equation (see \ref{eq:1})
    \begin{equation}
        H_{k_{p}}=\frac{Y_{k_{p}}}{X_{k_{p}}}\label{eq:1}
    \end{equation}
\end{document}

enter image description here

  • 1
    Why do you use \dfrac? With normal \baselineskip this is likely to be too large in inline maths (and in your displayed equation it is the same as \frac). – Skillmon Oct 3 '18 at 16:55
  • Only because I made a copy/paste… :( Answer edited. – NBur Oct 3 '18 at 16:57
  • @Skillmon However, in inline mode with \frac or \tfrac, I dislike the numerator touching the line… – NBur Oct 3 '18 at 17:05
  • Use the following MWE and you'll instantly see why using \dfrac is a bad idea without additional line spread (in fact even a \frac is too large here): \documentclass{article}\usepackage{amsmath,duckuments}\begin{document}\blindduck$H_{k_{p}}=\dfrac{Y_{k_{p}}}{X_{k_{p}}}$\blindduck\par \blindduck$H_{k_{p}}=\frac{Y_{k_{p}}}{X_{k_{p}}}$\blindduck\end{document}. – Skillmon Oct 3 '18 at 17:11
  • Also the numerator doesn't touch the line, that's the fault of your pdf viewer. – Skillmon Oct 3 '18 at 17:12

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.