When I extend my code into a small example.
My tex code is:



\def\p{\partial }
\def\L{\mathcal L}
\def\M{\mathcal M}
\def\N{\mathcal N}
\def\F{\mathcal F}
\def\C{\mathcal C}
\def\R{\Bbb R}
\def\Z{\Bbb Z}
\def\pom{\p  \Omega}
\def\I{\mathcal I}
\ExecuteOptions{dvips} \marginparwidth 0pt \oddsidemargin 0.5 truecm
\evensidemargin 0.5 truecm \marginparsep 0pt \topmargin -25pt
\textheight 22 truecm \textwidth 15.0 truecm
\newtheoremstyle{mythm}{1.5ex plus 1ex minus .2ex}{1.5ex plus 1ex
   minus .2ex}{\kai}{\parindent}{\song\bfseries}{}{1em}{}
\newtheorem{remark}{Remark} [section]


In \cite{brezis1983positive}, Brezis and Nirenberg discussed 


My ref.bib code in the following:

  title={Positive solutions of nonlinear elliptic equations involving critical Sobolev exponents},
  author={Brezis, Ha{\"{i}}m and Nirenberg, Louis},
  journal={Communications on pure and applied mathematics},
  publisher={Wiley Subscription Services, Inc., A Wiley Company New York}

When I build and see the latex, I have the following errors:

  • Missing $ inserted. Ha"{i}
  • Improper \spacefactor. Ha"{i}
  • Extra }, or forgotten $. Ha"{i}
  • Please use \mathaccent for accents in math mode. Ha"{i}
  • Missing { inserted. Ha"{i}
  • You can't use `\spacefactor' in math mode. Ha"{i}
  • Please use \mathaccent for accents in math mode. Ha"{i}m Br'{e}
  • You can't use `\spacefactor' in math mode. Ha"{i}m Br'{e}.

How can I correct this?

  • Welcome to TeX.SE. More information is likely required, could you extend your code into a small example that can compile please
    – JamesT
    Commented Mar 18, 2023 at 11:48
  • 2
    Br \ '{e}is, Ha \ ''{i}m looks wrong. It should be Brezis, Ha{\"{i}}m. In particular the spaces are off and the diacritics for the "i" should be \"{i} with a " and not two ''. (Also the last name is Brezis according to doi.org/10.1002/cpa.3160360405 and not Bréis)
    – moewe
    Commented Mar 18, 2023 at 11:57
  • See tex.stackexchange.com/q/57743/35864 for the details of writing accented characters in BibTeX files. (There are subtle differences to the "normal TeX way" of doing that.)
    – moewe
    Commented Mar 18, 2023 at 12:00
  • It has the same error when I use Ha{\"{i}}m Commented Mar 18, 2023 at 12:43
  • Unrelated but you are loading multiple of the same math classes, amsthm is loaded 4 times. Whilst it may not cause errors or issues in this question, loading the same class multiple times is not recommended. Hopefully someone can answer your .bib issue!
    – JamesT
    Commented Mar 18, 2023 at 13:00

1 Answer 1


This is the minimal working example:



In \cite{brezis1983positive}


When compiled with pdflatex (but not xelatex) it produces the said error. This is because \"i is translated to \"\i internally (I'm simplifying a bit), which triggers your redefinition of \i. And since square roots are defined in math mode, TeX is confused.

It is highly discouraged to use \def unless you know what you are doing. Use \newcommand or \renewcommand instead. Also, it is highly recommended that you do not redefine commands such as \i or \d. Because it will cause problems (such as now!).

As a final note, before asking technical questions --- not restricted to TeX or LaTeX related ones --- you should try your best to minimize your problem. Think of it as a challenge to use the smallest amount of code to produce the phenomenon you want to show. This process actually helps you, because it has a fair chance to already reveal the problem! On the other hand, this also helps others to diagnose the problem. In addition, you should provide some basic info, and if you are not qualified enough to judge whether a piece of information is relevant, you can provide it. For instance, the fact that xelatex copes just fine with your code will prevent others from investigating your problem.

  • 2
    Good advice. In general, it's not good practice to (re)define one-letter commands; many of them are already defined, and debugging surprises is never obvious and often complicated. I'd never seen the particular form \"{i} but I'll be using it as a "good bad example". Commented Mar 18, 2023 at 18:39

You must log in to answer this question.

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