[Tex/LaTex] How to write the double turnstile & its negation in ShareLaTeX

errorslogicsymbols

I think the code for the double turnstile is \vDash and the code for its negation is \nvDash. Neither of these commands work for me in ShareLatex. I enter them, hit recompile and nothing appears. What am I doing wrong?

MWE:

\documentclass{article} 
\usepackage[utf8]{inputenc} 
\begin{document} 
\maketitle 
\vDash 
\nvDash 
\nvDash 
\end{document}

Best Answer

As mentioned in comments, you need to load amssymb in order to access these symbols:

\usepackage{amssymb}

In addition,

\maketitle

will give an error because no title etc. is defined. I simply removed this from the example, but in a real document, you'd use \title{} etc. to set things up.

Moreover, mathematics cannot be typeset in text mode. By default, TeX assumes we're in text mode. To switch to maths mode, you need to tell TeX that's what you want to do.

The simplest two ways to do this in LaTeX are

$ <maths stuff> $

for inline mathematics and

\[
  <maths stuff>
\]

for a line of mathematics which should be displayed on its own (e.g. centred with a bit of vertical space before and after.

Putting this together

\documentclass{article}
\usepackage{amssymb}
\begin{document}
\[
  \vDash
  \nvDash
\]
\end{document}

gives us

semantic turnstiles

For more sophisticated turnstiles, turnstile can be used. For example (with somewhat random annotations for demonstration purposes):

\documentclass{article}
\usepackage{turnstile,amssymb}
\begin{document}
\[
  \sststile{\mathcal{L}}{}\quad \dststile{S}{a^+}\quad \ddtstile{T_1}{}\quad  \tdtstile{L_2}{\alpha\beta\gamma}
\]
\end{document}

variant turnstiles

Related Question