9

I've got the following problem:

I want to set the letter "W" atop a "\vdash", like here:

W atop vdash

I've tried to get this result with \atop, \stackrel, and \above, but didn't get the wished result. All these put the W completely over the vdash:

W completely atop vdash

How can I get the first result?

PS: here is a sample file:

\documentclass{article}
\begin{document}
$A \stackrel{W}{\vdash} x$
\end{document} 
1
  • You can also use package "turnstile.sty", it supports placing symbols above and below the turnstile, which can be much longer. Aug 17, 2016 at 4:20

2 Answers 2

4
\documentclass{article}
\usepackage{stackengine}
\newcommand\letvdash[1]{\mathrel{
  \stackengine{1ex}{\vdash}{\;\;\scriptscriptstyle#1}{O}{c}{F}{T}{L}}}
\stackMath
\begin{document}
\( A\letvdash{W} x \)
\end{document}

enter image description here

2
  • This is great. But let's suppose I wanted it under the bar instead of over the bar. I can't see how your command generalizes (it's probably easy, but the syntax is dense and I don't want to go dig in the stackengine guide for it.). Dec 7, 2015 at 21:44
  • 1
    @Shay Maybe something like \newcommand\letvudash[1]{\mathrel{\stackengine{.4ex}{\vdash}{\;\;\scriptscriptstyle#1}{U}{c}{F}{T}{L}}} Dec 8, 2015 at 1:36
7

You can try with this:

\documentclass{article}
\newcommand{\xvdash}[1]{%
  \vdash^{\mkern-10mu\scriptscriptstyle\rule[-.9ex]{0pt}{0pt}#1}%
}

\begin{document}
\[
A \xvdash{W} x
\]
\end{document}

If all you need are uppercase letters and normal size (no subscripts or superscripts), this works; otherwise a more complex approach is needed.

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .