! LaTeX 错误:Unicode 字符 − (U+2212) 未设置为用于 LaTeX

! LaTeX 错误:Unicode 字符 − (U+2212) 未设置为用于 LaTeX
\documentclass[a4paper,12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsthm}
\DeclareMathOperator{\var}{var} % variance "operator"
\DeclareMathOperator{\mse}{mse}

\begin{document}
\chapter{Probability and inference}
\section{means and variances of conditional distributions}
The following result 
\begin{equation}
\var(u) = E(\var(u|v)) + \var(E(u|v))
\end{equation}
can be derived by expanding the terms on the right side
\begin{equation} \label{eqn:means_variances}
\begin{aligned}
E(\var(u|v)) + \var(E(u|v)) & = E(E(u^2|v)-(E(u|v))^2)+E((E(u|v))^2)-(E(E(u|v)))^2 \\                & = E(u^2)-E((E(u|v))^2)+E((E(u|v))^2)-(E(u))^2        \\                & =E(u^2)-(E(u))^2=\var(u).
\end{aligned}
\end{equation}
The above Identity %$\ref{eqn:means_variances}$
,along with
\begin{equation}
E(u) = E(E(u|v)),
\end{equation}
also hold if $u$ is a vector, in which case $E(u)$ is a vector and $\var(u)$
a matrix.
\subsection{Transformation of variables}
In one dimension, we commonly use the logarithm to transform the parameter space from $(0,\infty)$ to $(−\infty,\infty)$. When working with parameters defined on the open unit interval, $(0, 1)$, we often use the logistic transformation:
\begin{equation}
logit(u) = log\left(\frac{u}{1-u}\right),
\end{equation}
whose inverse transformation is
\begin{equation}
logit^{-1}(v) = \frac{e^v}{1+e^v}.
\end{equation}
Another common choice is the probit transformation, $\Phi^{−1}(u)$, where $\Phi$ is the standard normal cumulative distribution function, to transform from $(0, 1)$ to $(−\infty,\infty)$.
\end{document}

我真的不明白我收到的错误的含义

! LaTeX Error: Unicode character − (U+2212)
               not set up for use with LaTeX.

答案1

unicode-math包接受该字符。您可以通过例如 加载支持该字符的字体fontsetup

与 PDFTeX 配合使用的另一种方法是添加命令:

\DeclareUnicodeCharacter{2212}{\ensuremath{-}}

以上将 U+2212 转换为数学模式的别名-

最后,您可以进行从(U+2212) 到-(hyphen-minus) 的搜索和替换。

答案2

-你应该使用普通键盘

$\Phi^{-1}(u)$
      %^%%

不是

$\Phi^{−1}(u)$
      %^%%

相关内容