Basic Solution:
Now sure exactly what problem you had with using \rotatebox
, but it seems to work if used as \rotatebox{-90}{$\dashrightarrow$}
:
Notes:
Depending on the actual application this might need to be raised vertically, and that can be down with \raisebox
:
\newcommand{\dashdownarrow}{\raisebox{2.0ex}{\rotatebox{-90}{$\dashrightarrow$}}}
If it is a binary/relational operator than you can enclose the symbol in \mathbin{}/\mathrel{}
:
\newcommand{\dashdownarrow}{\mathbin{\raisebox{2.0ex}{\rotatebox{-90}{$\dashrightarrow$}}}}
Use \mathchoice
to auto resize:
As per Gonzalo Medina 's suggestion, to be able to use this for different math sizes such as in subscripts, you can use \mathchoice
to ensure that the symbol also adjusts in size depending on the surrounding math environment:
Code:
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphicx}
\newcommand\dashdownarrowi{\mathchoice%
{\rotatebox[origin=c]{-90}{$\displaystyle\dashrightarrow$}}%
{\rotatebox[origin=c]{-90}{$\displaystyle\dashrightarrow$}}%
{\rotatebox[origin=c]{-90}{$\scriptstyle\dashrightarrow$}}%
{\rotatebox[origin=c]{-90}{$\scriptscriptstyle\dashrightarrow$}}%
}
\newcommand{\dashdownarrow}{\mathrel{\dashdownarrowi}}
\begin{document}
$A\dashdownarrow B\quad M_{A\dashdownarrow B}\quad L_{M_{A\dashdownarrow B}}$
\end{document}
Use \text{}
for auto resizing (and change size):
egreg had provided a simpler way to get the same effect and that is by enclosing the symbol in \text{}
, allows it to re size appropriately:
Notes:
- In this version I added
\scalebox
so that you can make the symbol smaller -- adjust the scale factor to suit.
- If you desire to move it vertically you can use
\raisebox{<length>}{}
.
Code:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\newcommand\ddaaux{\rotatebox[origin=c]{-90}{\scalebox{0.70}{$\dashrightarrow$}}}
\newcommand\dashdownarrow{\mathrel{\text{\ddaaux}}}
\begin{document}
$A\dashdownarrow B\quad M_{A\dashdownarrow B}\quad L_{M_{A\dashdownarrow B}}$
\end{document}
The \arrowsize
length is only an auxiliary dimen that you can use to calculate a length. It does not actually have anything to do with size of the arrow tip.
The right extend is the length the line will be shorten when the arrow tip is applied. This also does move the origin of the arrow coordinate system (the \pgfpointorigin
you use). You need to take the same amount into consideration if you want to draw the arrow.
The line has to be shortened by 1.5
its width.
The left extend (which is actually only needed if you want to combine arrow tips) is then 5pt-1.5\pgflinewidth
. I have used basic TeX dimen calculation and the \pgfutil@tempdima
dimen to calculate this so that the PGF math parser isn't needed (as indicated and forced by the +
in the extend macros).
The \pgftransformshift
macro is used to shift the origin back to the tip of the arrow.
The q
uick version of \pgfpoint
is used as its arguments do not need to get parsed by PGF math, either.
Instead of another \pgfpathlineto
I used \pgfpathclose
(this is the low-level equivalent of -- cycle
) even though you use filling and the closing is implied.
The backgrounds
library and its gridded
option is only used so one can easily spot the coordinates (0,0)
and (1,0)
. The second picture is the result of opacity=.5
and shows the line and the arrow tip separately.
Code
\documentclass[tikz,convert=false]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,backgrounds}
\makeatletter
\pgfarrowsdeclare{ipe arrow}{ipe arrow}{%
\pgfutil@tempdima=5pt\relax
\advance\pgfutil@tempdima-1.5\pgflinewidth
\pgfarrowsleftextend{+-\pgfutil@tempdima}%
\pgfarrowsrightextend{+1.5\pgflinewidth}%
}{%
\pgftransformshift{\pgfqpoint{1.5\pgflinewidth}{0pt}}%
\pgfpathmoveto{\pgfpointorigin}%
\pgfpathlineto{\pgfqpoint{-5pt}{-1.666pt}}%
\pgfpathlineto{\pgfqpoint{-5pt}{+1.666pt}}%
\pgfpathclose
\pgfusepathqfill
}
\makeatother
\begin{document}
Output
Best Answer
I support the use of TikZ for diagrams, but if you are looking for something slightly simpler, you could try the
amscd
package.@>>>
and@VVV
make right and down arrows, respectively. You can also use@<<<
and@AAA
for left or up arrows. The arrow labels go between the first and second characters or between the second and third characters, depending on whether you want them above/left or below/right.