-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
! Package amsmath Error: \hat allowed only in math mode. Error: Failed to compile MLE.tex. See MLE.log for more info. Execution halted #4089
Comments
@zjplab Line 175 is blank. If you remove it, the file should knit properly. Change
to
|
@ronblum Thanks. But just out of curiosity, why does a blank lead to such error? |
@zjplab Empty lines are not allowed in Latex math mode, according to this LaTeX wikibook and a thread on Stack Exchange. |
Hi, I've encountered the same error info:
and I've removed all empty lines:
3.11证: (1)左式: (2)对联合后验密度关于$\theta$积分,有: (3)对联合后验密度关于$\sigma^2$积分,有: 3.15(1)解:只对X做一次观察时: 则$\pi(\theta|x)=\frac{h(x,\theta)}{m(x)}=-x(x+1)\theta(1-\theta)^{x-1}$. (3)
解得$\hat{\theta_E}=1/3} 3.28(1)
(2)样本$X=x_1=6$的联合分布为:
可信区间为$\left[ 3.941,20.76368\right]$. 3.33有$\pi(\theta|x)\sim N(\mu_3(\bar{x}),\eta_3^2)=N(3,(1/2)^2)$
可见支持$H_0$的贝叶斯因子不高,故否定$H_0$,接受$H_1$.
|
@brainfo To you and someone else who later discovers via google (like I did): It's not just newlines, but also whitespace after the dollar signs on the same line that causes this. In @brainfo's case it's |
Hi did the error leave after editing your preamble in rmarkdown ! Package amsmath Error: \hat allowed only in math mode. getting the same |
Thank you so much for the help. I had the same problem but was able to fix them after I delete all the white space after the single and double dollar sign! |
已收到,谢谢。
|
System details
[1] "1.1.456"
$R
[1] "C:\PROGRA
1\MICROS2\ROPEN1\R-351.1\bin\x64\R.exe"$pdflatex
[1] "C:\Users\zjplab\AppData\Roaming\TinyTeX\bin\win32\pdflatex.exe"
$bibtex
[1] "C:\Users\zjplab\AppData\Roaming\TinyTeX\bin\win32\bibtex.exe"
$gcc
[1] "C:\Users\zjplab\MINICO~1\Library\MINGW-~1\bin\gcc.exe"
$git
[1] "C:\PROGRA~1\Git\cmd\git.exe"
$svn
[1] ""
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RevoUtils_11.0.1 RevoUtilsMath_11.0.0
loaded via a namespace (and not attached):
[1] compiler_3.5.1 backports_1.1.2 magrittr_1.5 rprojroot_1.3-2 htmltools_0.3.6
[6] tools_3.5.1 yaml_2.2.0 Rcpp_0.12.18 stringi_1.1.7 rmarkdown_1.10
[11] knitr_1.20 stringr_1.3.1 digest_0.6.15 evaluate_0.11
SysInfo:
sysname release version nodename machine
"Windows" ">= 8 x64" "build 9200" "WINDOWS-IO3NS2G" "x86-64"
login user effective_user
"zjplab" "zjplab" "zjplab"
R Version:
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
system x86_64, mingw32
status
major 3
minor 5.1
year 2018
month 07
day 02
svn rev 74947
language R
version.string R version 3.5.1 (2018-07-02)
nickname Feather Spray
$ALLUSERSPROFILE
[1] "C:\ProgramData"
Steps to reproduce the problem
Describe the problem in detail
Describe the behavior you expected
You could try knit the following RNotebook Code to pdf to reproduce this error?
The text was updated successfully, but these errors were encountered: