[Tex/LaTex] Big O notation – visual difference related to document configurations

amsmath

Please refer to the information present at the image attached.

The last image is the one I get when I type the code suggested in the same image, for which the author gets exactly the visual symbol I would like to get.

Important: I donĀ“t want to mess up with previous document configurations, therefore I believe that what I need is to make a "local inibition" of the general document configuration, so that for this specific symbol I can get what I want.

I hope I could be understood. Not a native speaker, sorry for that.

Thanks a lot!
fskilnik.enter image description here

Best Answer

Just revert \mathcal to using Computer Modern Symbols:

\documentclass{article}
\usepackage{fourier}

% add these two lines to your long preamble    
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
\SetMathAlphabet{\mathcal}{bold}{OMS}{cmsy}{b}{n}

\begin{document}

$\mathcal{O}(n\log n)$

\end{document}

enter image description here

Actually I'd prefer to add also

\newcommand{\bigO}{\mathcal{O}}

so the formula can be written

$\bigO(n\log n)$

This has the advantage that you're free to redefine \bigO without having to change the document, except for one line.

If you just want that big O, but also want to keep the calligraphic letters from fourier, use

\documentclass{article}
\usepackage{amsmath}
\usepackage{fourier}

\DeclareRobustCommand{\bigO}{%
  \text{\usefont{OMS}{cmsy}{m}{n}O}%
}

\begin{document}

$\bigO(n\log n)$

\end{document}