I would like to use a labeled mapsto (specifically, \xmapsto
from \usepackage{mathtools}
), but with two vertical bars (as in \Vdash
from \usepackage{amsmath,amssymb}
).
I tried to adapt the answer from here, but I cannot seem to align the additional vertical line correctly (see below).
What is the correct way to do this? My goal is to have something like the last command in the figures, but with both vertical lines at the same height, and of the same length.
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{mathtools}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{trimclip,adjustbox}
\newcommand{\XmapstoA}[1]{%
\mathrel{\text{\clipbox{0pt {0.40\height} {.8\width} 0pt}{$\Vdash$}}\mkern.9mu}\xmapsto{#1}
}
\newcommand{\XmapstoB}[1]{%
\mathrel{
\text{\clipbox{0pt 0pt {.8\width} 0pt}{$\Vdash$}}
\mkern.9mu
\text{\adjustbox{width=.87\width,height=\height}{$\xmapsto{#1}$}}
}
}
\newcommand{\VDashA}{%
\mathrel{\text{\clipbox{0pt 0pt {.8\width} 0pt}{$\Vdash$}}\mkern.9mu}\vDash
}
\newcommand{\VDashB}{%
\mathrel{
\text{\clipbox{0pt 0pt {.8\width} 0pt}{$\Vdash$}}
\mkern.9mu
\text{\adjustbox{width=.87\width,height=\height}{$\vDash$}}
}
}
\begin{document}
\begin{align*}
\vDash && \text{\textbackslash vDash}\\
\Vdash && \text{\textbackslash VDash} \\
\xmapsto{abcdef} && \text{\textbackslash xmapsto\{abcdef\}} \\
\XmapstoA{abcdef} && \text{\textbackslash XmapstoA\{abcdef\}} \\
\XmapstoA{ABCDEFG_2^2} && \text{\textbackslash XmapstoA\{ABCDEFG\_2\textasciicircum{}2\}} \\
\XmapstoB{abcdef} && \text{\textbackslash XmapstoB\{abcdef\}} \\
\XmapstoB{abcdef^2} && \text{\textbackslash XmapstoB\{abcdef\textasciicircum{}2\}}
\end{align*}
\end{document}