I am writing a simple commutative diagram and some objects of the second line are subsets of objects on the first line so instead of an upward arrow I would like to have a set inclusion symbol - which tilted 90 degrees to the left and effectively replacing the arrow. It seems easily achievable with a $\cong$ symbol but I cannot find an example with the subset or supset symbols.
4 Answers
This can be done as a single tikzcd using phantom arrows:
If you want the rows more compact you can add [row sep=small], or set row sep to any length you like.
\documentclass{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd} % [row sep=small]
A\arrow[r] & B\
C\arrow[r]\arrow[u, phantom, sloped, "\subset"] & D\arrow[u, phantom, sloped, "\subset"]
\end{tikzcd}
\end{document}
- 42,558
Just for fun, an easy solution with the psmatrix environment from pstricks:
\documentclass[border=5pt, 11pt]{standalone}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{pst-node, auto-pst-pdf}
\newpsobject{ncemptyline}{ncline}{linestyle=none}
\newcommand*\ncsubset[2]{\ncemptyline{#1}{#2}\ncput[nrot=:U]{\subset}}
\begin{document}
$ \psset{npos = 0.45}
\begin{psmatrix}[rowsep = 0.4, colsep =1cm]
[name = L] L & [name = L1] L'\\
[name = K] K & [name = K1] K'
\ncsubset{K}{L}\ncsubset{K1}{L1}
\psset{arrows=->, arrowinset=0.12, linewidth=0.5pt, nodesep=2pt}
\ncline{K}{K1}\ncline{L}{L1}
\end{psmatrix} $
\end{document}
- 271,350
Conceptually very similar to Bernard's nice answer, but based on tikz-cd.
\documentclass[12pt]{article}
\usepackage{tikz-cd}
\begin{document}
\begin{tikzcd}[remember picture]
A \arrow[r] & B\\
C \arrow[r] & D\\
\end{tikzcd}
\begin{tikzpicture}[overlay,remember picture]
\path (\tikzcdmatrixname-1-1) to node[midway,sloped]{$\subset$}
(\tikzcdmatrixname-2-1);
\path (\tikzcdmatrixname-1-2) to node[midway,sloped]{$\subset$}
(\tikzcdmatrixname-2-2);
\end{tikzpicture}
\end{document}
Using great code in https://tex.stackexchange.com/a/216042/4427
\documentclass{article}
\usepackage{tikz-cd}
% 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}
\begin{tikzcd}[row sep=small]
A\arrow[r] & B\
C\arrow[r]\arrow[u,symbol=\subset] & D\arrow[u,symbol=\subset]
\end{tikzcd}
\end{document}
- 1,121,712



