0

I have a symbol in my presentation(beamer) that should be \mathcal{P}, but it appears like the following: enter image description here I want this: enter image description here

could you help me with that? Thanks

This is the code:

\documentclass{beamer}
\mode<presentation> {
%\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs,dsfont}
\usepackage{color}
\usepackage{float}
\usepackage{mathtools}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{etoolbox}
\usepackage{ragged2e}
\usepackage{mathtools} % must go before semantic
%\usepackage{semantic}
\usepackage{cases}
\usepackage{stackengine}
\usepackage{graphicx} 
\usepackage{flexisym}
\usepackage{ thmtools, amssymb}
\usepackage{commath}
\usepackage{mathrsfs,dsfont}
\usefonttheme[onlymath]{serif}  #I want the font be serif
\usetheme{Madrid}}




\begin{document}
\begin{align}
\boldsymbol{\mathcal{P}}_{\mathrm{A}}\!= [\boldsymbol{P}_{\mathrm{m},1}, \boldsymbol{P}_{\mathrm{m},2},  \cdots, \boldsymbol{P}_{\mathrm{m},N} ]^\top
\end{align}
\end{document}```
8
  • 1
    Can you post MWE from \documentclass to \end{document}
    – MadyYuvi
    Jun 23 '21 at 19:03
  • Thanks for the comments. I have edited the question.
    – Meskaj
    Jun 23 '21 at 19:16
  • 1
    Still no \documentclass in your MWE.
    – SebGlav
    Jun 23 '21 at 19:49
  • the ``` \documentclass{beamer}```is at the top of that. I've just edited again
    – Meskaj
    Jun 23 '21 at 20:19
  • 1
    @Meskaj: You're probably compiling this on Overleaf? Remove \usepackage{flexisym} and things will compile to the desired output. There are a number of unnecessary packages you're loading (also some twice).
    – Werner
    Jun 23 '21 at 20:40
2

Remove flexisym from your preamble. The following minimal example provides the desired output.

enter image description here

\documentclass{beamer}

\usepackage{amssymb}
\usepackage{mathtools}

\usefonttheme[onlymath]{serif} %I want the font be serif

\usetheme{Madrid}

\begin{document}

\begin{frame}

\[
  \boldsymbol{\mathcal{P}}_{\mathrm{A}} = [
    \boldsymbol{P}_{\mathrm{m},1}, \boldsymbol{P}_{\mathrm{m},2}, \dots, \boldsymbol{P}_{\mathrm{m},N}
  ]^\top
\]

\end{frame}

\end{document}
1

The culprit is package flexisym, which cause error:

\mathchardef\ordinarycolon\mathcode`\:

and after forcing compilation gives wrong character.

Do you really need this package? Removing them gives desired result:

enter image description here

BTW, you need to clean-up your document preamble. In it you load soma packages, twice, also load packages which are already load by beamer (as graphicx, amsmath etc).

\documentclass{beamer}
\usefonttheme[onlymath]{serif}  %I want the font be serif
\usetheme{Madrid}

\mode<presentation> {
%\usepackage{amsfonts}
\usepackage{flexisym}
\usepackage{amssymb}
\usepackage{mathrsfs, dsfont}
\usepackage{etoolbox}
\usepackage{ragged2e}
\usepackage{semantic}
\usepackage{cases}
\usepackage{stackengine}
\usepackage{thmtools}
\usepackage{commath}
    }


\begin{document}
\begin{frame}
\begin{equation}
\boldsymbol{\mathcal{P}}_{\mathrm{A}}
    = [\boldsymbol{P}_{\mathrm{m},1}, \boldsymbol{P}_{\mathrm{m},2},  \cdots, \boldsymbol{P}_{\mathrm{m},N} ]^\top
\end{equation}
\end{frame}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.