\documentclass[12pt,a4paper,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{textgreek}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{mathtools}
\begin{document}
\begin{equation*}
\begin{aligned}
\theta_1^*(t) ~ P(\theta_1| Y_1^{obs}, Y_2^{(t-1)},…,Y_p^{(t-1)})\\
Y_1^{*(t)} ~ P(Y_1| Y_1^{obs}, Y_2^{(t-1)},…,Y_p^{(t-1)}, theta_1^{*(t)}) %<----stops here
\end{aligned}
\end{equation*}
\end{document}
您好,我正在尝试将方程式输入到我的论文中,我已经尝试了一段时间了,但它总是停在代码中指示的行。我不知道我做错了什么。请问有人能帮帮我吗?
答案1
~
不会产生可见的符号;你可能需要\sim
…
应该\dots
Y_p^(t-1)
应该Y_p^{t-1}
;theta
应该\theta
|
应该是\mid
,否则间距会错误^obs
应该是^{\mathrm{obs}}
上标处于文本模式并且是单个对象\Y
应该可能是Y
- 你缺少一个对齐点
修复后的代码如下:
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,amsthm}
\begin{document}
\begin{equation*}
\begin{aligned}
\theta_1^*(t) &\sim P(\theta_1\mid Y_1^{\mathrm{obs}}, Y_2^{t-1},\dots,Y_p^{t-1})\\
Y_1^*(t) &\sim P(Y_1\mid Y_1^{\mathrm{obs}}, Y_2^{t-1},\dots,Y_p^{t-1},\theta_1^*(t))
\end{aligned}
\end{equation*}
\end{document}
如果您想要一个空格而不是~
符号:
\documentclass[12pt,a4paper,oneside]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amssymb,amsthm}
\DeclareMathOperator{\Prob}{\mathnormal{P}}
\begin{document}
\begin{equation*}
\begin{aligned}
&\theta_1^*(t) \Prob(\theta_1\mid Y_1^{\mathrm{obs}}, Y_2^{t-1},\dots,Y_p^{t-1})\\
&Y_1^*(t) \Prob(Y_1\mid Y_1^{\mathrm{obs}}, Y_2^{t-1},\dots,Y_p^{t-1},\theta_1^*(t))
\end{aligned}
\end{equation*}
\end{document}