0

I want to type this equation,

enter image description here

however I am struggling with \mathcal and \mathbb,

Here is my code, can anyone tell me what's wrong to my code and how to fix it? Thanks!

\begin{equation}
\min _{W} \underset{(x, y) \sim \mathcal{D}}{\mathbb{E}} \mathcal{L}(W ;(x, y))
\end{equation}

What I am having is: The letter E, and D did not display as expected

enter image description here

Solved: the package of \usepackage{breqn} disrupted the compilation. When I remove this line, the problem is resolved.

kegemo
  • 3
  • 1
    Are there blank lines after the \begin{equation} and before the \end{equation} in your code? There can't be empty blank lines in \begin{equation}...\end{equation}, the will cause errors. If I remove those lines, the following document compiles fine and without errors to what I would expect: https://gist.github.com/moewew/dd09718e521ec381cf6709095147d52e – moewe Jul 25 '21 at 10:39
  • 1
    You may want to have a look at https://tex.stackexchange.com/q/56765/35864 to make \mathbb{E} behave more like \min w.r.t. subscript placement. – moewe Jul 25 '21 at 10:42
  • @moewe I dont have blank lines, this compiles well however the letter "E" isn't displayed as expected... – kegemo Jul 25 '21 at 11:14
  • 1
    Please add an MWE – DG' Jul 25 '21 at 11:36
  • 2
    You need \usepackage{amssymb}. – egreg Jul 25 '21 at 12:28

1 Answers1

1

According totally with the comments of @moewe and @DG' here I add a minimal compilable code, where you can obtain, correctly, your expected 2nd image.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\begin{document}
\begin{equation}
\min_{W} \underset{(x, y) \sim \mathcal{D}}{\mathbb{E}} \mathcal{L}(W ;(x, y))
\end{equation}
\end{document}

The snapshot is:

enter image description here

Sebastiano
  • 54,118
  • @kegemo and now you know why asking for a full but minimal example is more than 50% of all comments around here, we cannot solve problems without it – daleif Jul 25 '21 at 13:05
  • 1
    OK, I have found that I have included the package of breqn disrupted the compilation. When I remove the line of \usepackage{breqn}, this problem is solved. Thanks! – kegemo Jul 25 '21 at 13:05
  • @kegemo You're welcome and glady to help you. – Sebastiano Jul 25 '21 at 22:07