CarLaTeX
Is it possible to have exactly this result, with these fonts:
```
\documentclass{beamer}
\usepackage{tikz-cd}
\tikzcdset{ampersand replacement=\&}
\begin{document}
\begin{frame}
\[
\begin{tikzcd}
X\ar[r]\ar[d] \& \begin{pmatrix} e & f \\ g & h \end{pmatrix}\ar[d]\\
Y\ar[r] \& Z
\end{tikzcd}
\]
\end{frame}
\end{document}
```

But with `\documentclass{article}`?
Only for an example, not in all the document (I'm writing a van Duck's article).
Top Answer
samcarter
Not exactly the same, but you can get a similar result for a part of the document with the help of the `sansmath` package:
```
\documentclass{article}
\usepackage{tikz-cd}
\tikzcdset{ampersand replacement=\&}
\usepackage{amsmath}
\def\familydefault{\sfdefault}
\usepackage{sansmath}
\begin{document}
\[
\begin{tikzcd}
X\ar[r]\ar[d] \& \begin{pmatrix} e & f \\ g & h \end{pmatrix}\ar[d]\\
Y\ar[r] \& Z
\end{tikzcd}
\]
\begingroup
\sffamily\sansmath
\[
\begin{tikzcd}
X\ar[r]\ar[d] \& \begin{pmatrix} e & f \\ g & h \end{pmatrix}\ar[d]\\
Y\ar[r] \& Z
\end{tikzcd}
\]
\endgroup
\end{document}
```

If you want to make sure the result is exactly the same, I suggest a standalone document and include the result as image:
```
\documentclass[beamer,crop=true]{standalone}
\usepackage{tikz-cd}
\tikzcdset{ampersand replacement=\&}
\begin{document}
\begin{tikzcd}
X\ar[r]\ar[d] \& \begin{pmatrix} e & f \\ g & h \end{pmatrix}\ar[d]\\
Y\ar[r] \& Z
\end{tikzcd}
\end{document}
```
