0

This question already has an answer here:

I am not an expert with equations on latex. I have wrote these ones within a chapter of a book, but I missed how to write the label on the left with the equation number. Moreover, the text after the equations is italic for a couples of lines and I did not find the way to fix it. What is wrong?

(Edit with suggestions proposed)

\documentclass[a4paper,11pt,  twoside, openright]{book}
\usepackage[T1]{fontenc}                
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[a4paper,top=3.5cm,bottom=3cm,left=3cm,right=3cm]{geometry}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{font=small}
\usepackage{topfront}
\usepackage{emptypage}
\usepackage{natbib, authoryear}
\graphicspath{figure}
\usepackage{longtable}
\usepackage{chngcntr}
\usepackage{rotating}
\usepackage{mathtools}
\usepackage{textgreek}
\usepackage{hyperref}

\begin{document}

yi \in Y_{i} \sim mathrm{Multinom}(\pi^1_i , \pi^2_i , \pi^3_i ) 
\pi^k_i = \frac{exp(\eta^k_i)} {1+ \exp(\eta^2i) + exp(\eta^3i)}\hfill     k= 1,...,3

\eta^k_i = ln(\frac{\pi^k_i }{\pi^1_i}) = \beta^k_0 + x_i_1\beta^k_1 +    \sum^11_{j_=_3 } x_i_j\beta^k_j \hfill k= 2,3
\eta^1_i = 0 

some text which is italic
\end{document}

i have not solved the issue substituing with $\pi$

marked as duplicate by Werner equations Oct 23 '18 at 17:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • if you get a tex error then you should ask about the error message (the pdf output after any error isn't designed for use,it may possibly be useful for debugging but nothing else) – David Carlisle Oct 23 '18 at 17:37
  • You need to start the math mode with (for example) \[ and end it with \] (and remove the \bigskip) also exp should be \exp and Multinom should be \mathrm{Multinom} – David Carlisle Oct 23 '18 at 17:39
  • @DavidCarlisle you mean i have to add [ and ] for each line or just once at the beginning and at the end of the equations?thank you – ggg Oct 23 '18 at 17:40
  • 1
    really you should start with a basic tutorial on latex, as there are so many errors here in so few lines... I'll post something as an answer too long for a comment. – David Carlisle Oct 23 '18 at 17:41
  • @DavidCarlisle thank you, i read a lot about equations but still i was not able to solve the problem – ggg Oct 23 '18 at 17:42
3

enter image description here

I had to take some guesses as to the intended meaning in some cases...

\documentclass[a4paper,11pt,  twoside, openright]{book}
\usepackage[T1]{fontenc}                
\usepackage[utf8]{inputenc}

\usepackage{mathtools}

\DeclareMathOperator\Multinom{Multinom}

\begin{document}

some text
\begin{equation}
yi \in Y_{i} \sim \Multinom(\pi^1_i , \pi^2_i , \pi^3_i ) 
\end{equation}

some more text ${x_i}_1$ ?? $\sum^1$ ???
\begin{align}
\pi^k_i &= \frac{\exp(\eta^k_i)} {1+ \exp(\eta^2i) + \exp(\eta^3i)}  &&  k= 1,\dots,3\\
\eta^k_i &= \ln(\frac{\pi^k_i }{\pi^1_i}) = \beta^k_0 + x_{i1}\beta^k_1 +    \sum^11_{j=3 } x_{ij}\beta^k_j &&k= 2,3\\
\eta^1_i &= 0 
\end{align}

some text which is italic
\end{document}
  • Thank you very much. This solved all the issues but not the one of italic. could it be because i'm using texshop on a mac? just a couple of questions: there is a way to left align the first equation? and can i used just one numbered label for all this lines (instead of a number for each line)? – ggg Oct 23 '18 at 18:12
  • 1
    @ggg you can left align everything by using fleqn option on \documentclass and you can replace align by \begin{equation}\begin{aligned}...\end{aligned}\end{equation} if you want a single number. If you need more help then ask a new question not comments under an existing answer, but please take some time to read the amsmath user guile (amsldoc.pdf) first, there are many examples of all these things. – David Carlisle Oct 23 '18 at 18:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.