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).
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}


![Screenshot 2022-02-19 at 13.13.14.png](/image?hash=a393909cbfb4cd6df2133cc0a45aa15d7e0d391a1420bacb0eea77801bf9c7c4)

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}


![document.png](/image?hash=e798e11d1fa04001c6682f44dcaeb8d6ba2dda9a70eb458914080f30c7702bc5)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.