I want to design an equation which includes a long down arrow and long up arrow. I'm having just down arrow which is short. I need some help.
[Tex/LaTex] How to code long down arrow in equations
arrowsequations
Related Solutions
I find the horizontal spacing of the chemarrows in mathematical formulas surprisingly bad. It may well be that the spacing is adjusted to the use in chemistry. If you want an arrow with (approximately) the same length and spacing as a \longrightarrow
, then you can use this code:
\documentclass{article}
\usepackage{amsmath,xspace}
\usepackage{chemarrow}
\newcommand{\lra}{\ensuremath{\mathrel{%
\mkern1.5mu\textrm{\arro\symbol{71}}%
\mkern-1.1mu\textrm{\arro\symbol{65}}%
}}\xspace}
\begin{document}
Test \lra Result
Test $\longrightarrow$ Result
\end{document}
The xspace
package is only needed for having \lra
behave in the same way as $\lra$
(otherwise TeX wouldn't put a space after \lra
). It is always a good idea to include an \xspace
if you use \ensuremath
in a macro that takes no arguments.
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}
Best Answer
Just to practice with
tikz-cd
; the first diagram is in two versions, one with long arrows also in the first half, the second one with shorter arrows where long ones are not needed (just pass over an empty column for lengthening the arrows in the right half).A similar trick could be used for the second diagram.