This is a turnstile with and without a subscript


\def\sstile#1{{|\kern-.225em-}_{\rm #1}}

$$\stile \alpha$$

$$\sstile{K} \alpha$$


It would be nice to have just one command and be able to type either \stile \alpha or \stile[K] \alpha. How is that done?

enter image description here

  • You can look into latex.ltx how \newcommand is defined in order to make your Plain version of that
    – user31729
    Mar 4, 2018 at 15:07

4 Answers 4


Look ahead for the [:

  \ifx[\next %]
\def\dostileopt[#1]{_{\rm #1}}

$\stile \alpha$

$\stile[K] \alpha$


enter image description here


You could use the plain compatible eplain macros:

enter image description here

\input eplain





$$\stile \alpha$$

$$\stile[K] \alpha$$


With a primitive implementation of \@ifnextchar (taking the one from latex.ltx would be better, I guess):

\def\stile@i[#1]{{|\kern-.225em-}_{\rm #1}}%

$$\stile \alpha$$

$$\stile[K] \alpha$$


A more stable version of \@ifnextchar (similar to the one of latex.ltx but not the same):

  • The problem with this is that \stile{[}K] works like this, or may be \stile {[A/B] \over C} will give problems.
    – Manuel
    Mar 4, 2018 at 15:29
  • @Manuel as I said, it's a primitive implementation.
    – Skillmon
    Mar 4, 2018 at 15:50
  • A primitive definition of \ifnextchar (that does not skip spaces) could be easily done with \futurelet like egreg. I just wanted to note that, if someone knows what (s)he's doing (s)he can use this version.
    – Manuel
    Mar 4, 2018 at 16:02

I realize that you tagged this {plain-tex}, but this really is an instance in which the use of LaTeX, with the turnstile package, would be of considerable help.

You could then simply use, $\sststile{\mathrm{K}}{} \alpha$. This package would also improve the overall typesetting quality of your turnstiles (refer to the below image, from the turnstile article), and provide a myriad of additional options.

Comparison of turnstile subscript typography

You must log in to answer this question.

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