[Tex/LaTex] How to change the font family to default for math codes in beamer

beamerfonts

My compiled math font family is not like a default one(e.g., the font used in MahtJaX), but it is same as the text font family. My example code and it's complied one are shown below.

\documentclass[xcolor=x11names,compress]{beamer}

\usepackage{graphicx}
\usepackage{tikz}
\usepackage{palatino}

\useinnertheme{default}
\usefonttheme{serif}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{frame}{Example}
\begin{definition}
Let $R\subseteq S\timesT$ be a relation.\break
The domain of R is defined as:\break
$\operatorname{Dom} \left({\mathcal R}\right) := \left\{{s \in S: \exists t \in T: \left({s, t}\right) \in \mathcal R}\right\}$\break
and can be denoted $\operatorname{Dom} \left({\mathcal R}\right)$.
\end{definition}
\end{frame}

\end{document}

enter image description here
This definition is from the webpage of Proofwiki.
How to change the font family to default for math codes in beamer?

Best Answer

The first part of this echoes Herbert's answer but I posted it as a comment 8 minutes prior to that answer and so claim this answer is legitimate ;). (But I will remove it if Herbert objects or if anybody else, not being Herbert, both objects and can give me a good reason why they have a right to object despite not being Herbert.)

Original Question

\usefonttheme{professionalfonts} prevents beamer from overwriting your fonts and is therefore needed to use specified font packages.

palatino is deprecated, however. l2tabuen recommends this replacement:

\usepackage{mathpazo}
\usepackage[scaled=.95]{helvet}% uncomment these if required
\usepackage{courier}

URW Palatino look-alike

An alternative would be to use TeX Gyre's Pagella, for example.

Second Question

Since this is a different question it should really be a different question. However, you could use the description environment rather than the definition environment here. definition always starts a new line for the main part of the definition. (The name of the term can go on the same line but the definition itself starts below.) While this could obviously be changed, it seems to me there are simpler options. For example:

\begin{description}
  \item[Definition] Definition goes here.
\end{description}

A definition of a different kind...

The Code

\documentclass[xcolor=x11names,compress]{beamer}

\usepackage{graphicx}
\usepackage{tikz}
% \usepackage{palatino}% is obsolete - see l2tabu (or l2tabuen) for details
\usepackage{mathpazo}
% \usepackage[scaled=.95]{helvet}% uncomment these if required
% \usepackage{courier}

\useinnertheme{default}
\usefonttheme{professionalfonts}
\usefonttheme{serif}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{frame}{Example}
\begin{description}
  \item[Definition] Let $R\subseteq S\times T$ be a relation.\break
  The domain of R is defined as:\break
  $\operatorname{Dom} \left({\mathcal R}\right) := \left\{{s \in S: \exists t \in T: \left({s, t}\right) \in \mathcal R}\right\}$\break
  and can be denoted $\operatorname{Dom} \left({\mathcal R}\right)$.
\end{description}
\end{frame}

\end{document}
Related Question