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.

5
  • 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: gist.github.com/moewew/dd09718e521ec381cf6709095147d52e Commented Jul 25, 2021 at 10:39
  • 1
    You may want to have a look at tex.stackexchange.com/q/56765/35864 to make \mathbb{E} behave more like \min w.r.t. subscript placement. Commented Jul 25, 2021 at 10:42
  • @moewe I dont have blank lines, this compiles well however the letter "E" isn't displayed as expected... Commented Jul 25, 2021 at 11:14
  • 1
    Please add an MWE Commented Jul 25, 2021 at 11:36
  • 2
    You need \usepackage{amssymb}. Commented Jul 25, 2021 at 12:28

1 Answer 1

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

3
  • @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 Commented Jul 25, 2021 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! Commented Jul 25, 2021 at 13:05
  • @kegemo You're welcome and glady to help you. Commented Jul 25, 2021 at 22:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.