I'm trying to recreate the following diagram:
Thanks in advance!
A matrix works
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\begin{matrix} N&\subset&M \ \cup&&\cup \ Q&\subset&P \end{matrix}$
\end{document}
A very short code with pstricks:
\documentclass[a4paper,11pt, pdf]{article}
\usepackage{pst-node}
\newpsobject{ncemptyline}{ncline}{linestyle=none}
\newcommand*\ncsubset[2]{\ncemptyline{#1}{#2}\ncput[nrot=:U, npos=0.45]{ ⊂}}
\pagestyle{empty}
\begin{document}
\[ \begin{psmatrix}[rowsep = 0.1, colsep = 0.3]
N & \subset & M \\
\rput{*90}{\subset} & & \rput{*90}{\subset} \\[1ex]
Q & \subset & P
\end{psmatrix} \]
\end{document}
You can use matrix for a naïve solution, but you should realize that \subset and \cup are generally not the same symbol with a rotation.
I suggest to rotate \subset, but also to modify the vertical spacing.
A different solution uses tikz-cd; I show also how to change the spacing in a simpler way.
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx} % for the first solution
\usepackage{tikz-cd} % for the second solution
% for the second solution, see https://tex.stackexchange.com/a/216042/4427
\tikzset{
symbol/.style={
draw=none,
every to/.append style={
edge node={node [sloped, allow upside down, auto=false]{$#1$}}}
}
}
\begin{document}
[
\renewcommand{\arraystretch}{0}
\begin{matrix}
N & \subset & M \[2ex]
\rotatebox[origin=c]{90}{$\subset$} &&
\rotatebox[origin=c]{90}{$\subset$} \[2.5ex]
Q & \subset & P
\end{matrix}
]
[
\begin{tikzcd}
N \arrow[r,symbol=\subset] & M \
Q \arrow[r,symbol=\subset] \arrow[u,symbol=\subset] &
P \arrow[u,symbol=\subset]
\end{tikzcd}
]
[
\begin{tikzcd}[row sep=1em,column sep=1em]
N \arrow[r,symbol=\subset] & M \
Q \arrow[r,symbol=\subset] \arrow[u,symbol=\subset] &
P \arrow[u,symbol=\subset]
\end{tikzcd}
]
\end{document}