10

Writing the code

The weight decay was set to $1 \times {10^{−4}}$ for Model 8 and $5\times 10^{−4}$.

the negative sign is missing.

enter image description here

And these are the packages I'm using

\usepackage{jmlr2e}
\usepackage{indentfirst}
% Definitions of handy macros can go here
\usepackage{float}
\usepackage{underscore}
\restylefloat{table}
\newcommand{\dataset}{{\cal D}}
\newcommand{\fracpartial}[2]{\frac{\partial #1}{\partial  #2}}
2
  • 2
    Please give a minimal working sample.
    – M. Logic
    Commented Dec 15, 2017 at 6:39
  • 5
    By the way, the \cal command has been deprecated for 25 years. It should be \mathcal{D} rather than {\cal D}
    – egreg
    Commented Dec 15, 2017 at 7:10

3 Answers 3

15

The problem occurs because the symbol that's used in both exponents is not a "normal" dash symbol, -. Instead, it is the Unicode symbol U+2212, the "math minus" symbol. (Did you maybe copy and paste the input from some other source?)

Here are three remedies:

  • Switch to either XeLaTeX or LuaLaTeX and load either the fontspec package or the unicode-math package (which loads fontspec automatically).

  • If you need to use pdfLaTeX, add the following instructions to your preamble:

    \usepackage[utf8]{inputenc}
    \DeclareUnicodeCharacter{2212}{-}
    
  • Finally, consider simply replacing all instances of with -. (That's what's done in the code below.)

enter image description here

\documentclass{article}

\begin{document}

\section*{Your code}
The weight decay was set to $1 \times {10^{−4}}$ for Model 8 and $5 
\times 10^{−4}$.

\bigskip

\section*{Correct code}
The weight decay was set to $1 \times {10^{-4}}$ for Model 8 and $5 
\times 10^{-4}$.

\end{document}
3
  • 1
    I've taken the liberty of augmenting your answer a bit. :-)
    – Mico
    Commented Dec 15, 2017 at 7:26
  • 1
    @Mico It's perfect to me. Thank you for improving my answer with your original contribution, I really appreciate that. ;-)
    – Cragfelt
    Commented Dec 15, 2017 at 9:09
  • Just to be fussy: I wouldn't write that - is a normal dash: this might be confusing as it recalls the en and the em dash. The correct name, I believe, is hyphen.
    – campa
    Commented Dec 15, 2017 at 16:45
2

I fixed your codes as follows:

The weight decay was set to $1 \times {10^{-4}}$ for Model 8 and $5\times 10^{-4}$.

And the following is the PDF style.

enter image description here

The reason that why your can't be complied may be that you type it not in English typewriting. Please make sure you are under English typewriting when you type codes in math environment.

2
  • 4
    I wouldn't emphasize the "English" aspect. The exact same problem is going to occur if the document is in French, German, Italian, ...
    – Mico
    Commented Dec 15, 2017 at 6:48
  • 1
    Hopefully needless to say, the preceding comment was not supposed to slight users of Spanish, Portuguese, Norwegian, Swedish, Finnish, Polish, etc, etc, etc.
    – Mico
    Commented Dec 15, 2017 at 7:27
2

shorter and correct with use siunitx package:

\documentclass{article}
\usepackage{siunitx}

\begin{document}
The weight decay was set to \num{1e-4} for Model 8 and \num{5e-4}.
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .