I wanted to generate a PDF-file out of a ".Rmd"-file. I clicked "Knit to PDF". The rendering started and finished. At the end, I read the following red message:
! Undefined control sequence.
l.864 ...me, et see seos on järgmine: (R=k\cdotI
^{n}).
Here is how much of TeX's memory you used:
12962 strings out of 480313
204473 string characters out of 5897214
505208 words of memory out of 5000000
30544 multiletter control sequences out of 15000+600000
451032 words of font info for 69 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
60i,9n,63p,689b,469s stack positions out of 5000i,500n,10000p,200000b,80000s
! ==> Fatal error occurred, no output PDF file produced!
The corresponding line isn't actually 864 but 217 in my ".Rmd"-file and contains the following code:
Pooljuhi takistus on läbi pooljuhi mineva voolu tugevuse funktsioon *R=f(I)*. Eeldame, et see seos on järgmine: $R=k\cdotI^{n}$. Joonistada graafik, logaritmiline graafik. Leida konstandid *k* ja *n*.
This is the first appearance of LaTex-code in that file at all.
The same snippet on the line 217 in my ".Rmd"-file is really on the line 864 in the corresponding ".tex"-file:
Pooljuhi takistus on läbi pooljuhi mineva voolu tugevuse funktsioon
\emph{R=f(I)}. Eeldame, et see seos on järgmine: \(R=k\cdotI^{n}\).
Joonistada graafik, logaritmiline graafik. Leida konstandid \emph{k} ja
\emph{n}.
I have no glue what's wrong.
In order to test it, you can create a ".Rmd"-file, enter these rows to the beginning of the file:
and then add the snippet from my first post. And then, you click "Knit" -> "Knit to PDF".
HTML-knitting works just fine, PDF-knitting causes this trouble.
I wonder if you should be treating *(R=k\cdotI^{n}* as an in line equation? And probably \emph{R=f(I)} as well?
Try
Pooljuhi takistus on läbi pooljuhi mineva voolu tugevuse funktsioon
$R=f(I)$. Eeldame, et see seos on järgmine: ($R=k\cdot I^{n}$).
Joonistada graafik, logaritmiline graafik. Leida konstandid \emph{k} ja \emph{n}.
instead of telling that the first formula should be italic, you turned it into a formula which changed nothing,
you added parenthesis to the second formula which changed nothing instead of just displaying these unnecessary parenthesis in addition to the formula itself,
you put TEX-syntax for the last two variables instead of letting them be italic which rendered them invisible.
I've solved the particular issue considering the mentioned row by adding a space between \cdot and I. Otherwise, even HTML version didn't display the dot but colored \cdotI red.
You haven't. I helped myself. None of advices here helped me to solve the issue. After a while, I just wanted to see how that part looked like in the website. That made me quess that there must be a space between LaTex command and something else. Maybe also braces can be used.