# How to draw an arrow with a different head?

I need to draw an arrow but with different head. The head should look like $\dashv$. And I do need to change the line. I tried with $--\dashv$, but it wasn't nice. Any idea?

It should look like a horizontal T.

-
Welcome to TeX.SX! You don't have to sign with your name since it automatically appears in the lower right corner of your post. –  Jubobs Mar 9 '14 at 23:26

Do you want something like this?

\documentclass{article}
\usepackage{turnstile}
\begin{document}
% \setlength{\leasturnstilewidth}{15em}% this should work if I've understood the documentation correctly, but seems to have no effect

$\nsststile{\hspace*{15em}}{}$

\end{document}


Just change 15em to whatever size you require.

# Changing the height of the vertical rule

It turns out that it is far from easy to change the height of the turnstile. Although the documentation suggests that the various lengths may be manipulated by the end-user this is not, in fact, the case. Looking in turnstile.sty, it turns out that this is the problem:

\newcommand{\turnstile}[6][s]
{\ifthenelse{\equal{#1}{d}}
{\sbox{\first}{$\displaystyle{#4}$}
\sbox{\second}{$\displaystyle{#5}$}}{}
\ifthenelse{\equal{#1}{t}}
{\sbox{\first}{$\textstyle{#4}$}
\sbox{\second}{$\textstyle{#5}$}}{}
\ifthenelse{\equal{#1}{s}}
{\sbox{\first}{$\scriptstyle{#4}$}
\sbox{\second}{$\scriptstyle{#5}$}}{}
\ifthenelse{\equal{#1}{ss}}
{\sbox{\first}{$\scriptscriptstyle{#4}$}
\sbox{\second}{$\scriptscriptstyle{#5}$}}{}
\setlength{\dashthickness}{0.111ex}
\setlength{\ddashthickness}{0.35ex}
\setlength{\leasturnstilewidth}{0.8em}
\setlength{\extrawidth}{0.2em}
\ifthenelse{%
\equal{#3}{n}}{\setlength{\tinyverdistance}{0ex}}{}
\ifthenelse{%
\equal{#3}{s}}{\setlength{\tinyverdistance}{0.5\dashthickness}}{}
\ifthenelse{%
\equal{#3}{d}}{\setlength{\tinyverdistance}{0.5\ddashthickness}
\ifthenelse{%
\equal{#3}{t}}{\setlength{\tinyverdistance}{1.5\dashthickness}
\setlength{\verdistance}{0.4ex}
\settoheight{\lengthvar}{\usebox{\first}}
\setlength{\raisedown}{-\lengthvar}
\settodepth{\raiseup}{\usebox{\second}}
\setlength{\lift}{0.8ex}
\settowidth{\firstwidth}{\usebox{\first}}
\settowidth{\secondwidth}{\usebox{\second}}
\ifthenelse{\lengthtest{\firstwidth = 0ex}
\and
\lengthtest{\secondwidth = 0ex}}
{\setlength{\turnstilewidth}{\leasturnstilewidth}}
{\setlength{\turnstilewidth}{2\extrawidth}
\ifthenelse{\lengthtest{\firstwidth < \secondwidth}}
\setlength{\turnstileheight}{3ex}
\sbox{\turnstilebox}
{\raisebox{\lift}{\ensuremath{
\makever{#2}{\dashthickness}{\turnstileheight}{\ddashthickness}
\makehor{#3}{\dashthickness}{\turnstilewidth}{\ddashthickness}
\hspace{-\turnstilewidth}
\raisebox{\raisedown}
{\makebox[\turnstilewidth]{\usebox{\first}}}
\hspace{-\turnstilewidth}
\raisebox{\raiseup}
{\makebox[\turnstilewidth]{\usebox{\second}}}
\makever{#6}{\dashthickness}{\turnstileheight}{\ddashthickness}}}}
\mathrel{\usebox{\turnstilebox}}}


Basically, this hard codes the various lengths defined here. You can redefine them all you like but as soon as you use \turnstile (or e.g. \nsststile which is defined in terms of \turnstile), the lengths will be reset to their default values.

The fist thing I tried was using the facilities of etoolbox to patch \turnstile. However, although etoolbox reports the command to be patchable, my attempts to do so failed.

Finally, desperate measures:

\documentclass{article}
\usepackage{turnstile}
\newlength{\myturnstileheight}
\setlength{\myturnstileheight}{1ex}
\newcommand*\myarrow[2][\myturnstileheight]
{\setlength{\dashthickness}{0.111ex}
\setlength{\ddashthickness}{0.35ex}
\setlength{\tinyverdistance}{0ex}
\setlength{\verdistance}{0.4ex}
\settoheight{\lengthvar}{}
\setlength{\raisedown}{-\lengthvar}
\settodepth{\raiseup}{}
\setlength{\lift}{0.8ex}
\setlength{\turnstilewidth}{#2}
\setlength{\turnstileheight}{#1}
\sbox{\turnstilebox}
{\raisebox{\lift}{\ensuremath{
\makever{n}{\dashthickness}{\turnstileheight}{\ddashthickness}
\makehor{s}{\dashthickness}{\turnstilewidth}{\ddashthickness}
\hspace{-\turnstilewidth}
\raisebox{\raisedown}
{\makebox[\turnstilewidth]{}}
\hspace{-\turnstilewidth}
\raisebox{\raiseup}
{\makebox[\turnstilewidth]{}}
\makever{s}{\dashthickness}{\turnstileheight}{\ddashthickness}}}}
\mathrel{\usebox{\turnstilebox}}}

\begin{document}

$\myarrow{3em}$

$\myarrow[2ex]{1em}$

$\myarrow[10ex]{10em}$

\end{document}


This defines a new command, \myarrow which is based on the definition of \turnstile but is simplified and adapted to make the height adjustable. It also defines a new length \myturnstileheight which you can set to a suitable default. Here, it is set to 1ex. The syntax of \myarrow is simplified considerably to make this more convenient for your usage:

\myarrow[<height>]{<width>}


Finally, the output:

-
Hey thanks. That is right, but when I change the 15em to like 3em (like a normal arrow size), it gets shorter, but head becomes very big. Any idea please? –  Maryam Mar 9 '14 at 23:57
@Maryam If I change it to 3em the head stays the same size. The only change is in the width of the line - the vertical line at the end keeps the same height. –  cfr Mar 9 '14 at 23:59
is there any way to change the head size? –  Maryam Mar 10 '14 at 0:02
@Maryam See my edit. –  cfr Mar 10 '14 at 1:11
@Maryam I've further edited this a bit to make it simpler but the syntax of the new command is unaltered. Would be curious to know if this works for you! –  cfr Mar 10 '14 at 1:30

Maybe, if I understand well, what you want exists in the mdsymbol font:

Look at this thread to have details on how to make it available without having all your math symbols typeset with the mdsymbol font.

-
hey thanks. It shows "Undefined control sequence" for both $\longrightfootline$, and $\longdashv$ –  Maryam Mar 10 '14 at 0:07
You need either to load the mdsymbol package or to define yourself the command(s) with the indications given in the thread. I'll take a look at the details. –  Bernard Mar 10 '14 at 0:17

With tikz

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\newcommand\myarrow[1][3em]{%
\tikz\draw[thick,-Bar] (0,0) -- (#1,0);
}
\begin{document}

$\myarrow[15em]$  $\myarrow[2em]$

\end{document}


-
thanks, but it shows an error: l.71 \usetikzlibrary{arrows.meta} (Press Enter to retry, or Control-D to exit) Please type another input file name: –  Maryam Mar 10 '14 at 0:14
@Maryam It needs latest tikz installed. I think you have old tikz please upgrade to v3. –  Harish Kumar Mar 10 '14 at 0:15
no, it don't have it. –  Maryam Mar 10 '14 at 0:18
@Maryam It is a better idea to upgrade your tex distro. :) –  Harish Kumar Mar 10 '14 at 0:20