2
$\begingroup$

A vector accent can be applied to a letter, or a string of letters, via the \vec command, which is built into MathJax, as follows: \vec{x} yields $\vec{x}$, and \vec{xy} yields $\vec{xy}$.

I'm interested in a similar accent with the difference that the vector's origin (namely, the left edge of the arrow) is emphasized with a full circle, something similar to a vector accent over a single letter with an emphasized origin, and a vector accent over multiple letters with an emphasized origin, respectively.

How can such an accent be achieved?

$\endgroup$
8
  • 3
    $\begingroup$ This really seems like more of a TeX - LaTeX question than a Math SE question... $\endgroup$
    – Xander Henderson Mod
    Sep 11, 2022 at 12:00
  • 1
    $\begingroup$ @XanderHenderson OK. I posted a question in the TeX stackexchange. However, I'll be interested in using this accent in an answer I'm writing for math.stackexchange. And \vec acts a little differently in math.stackexchange than in TeX: the TeX version doesn't stretch automatically. $\endgroup$
    – Evan Aad
    Sep 11, 2022 at 14:51
  • 4
    $\begingroup$ Honestly, I would recommend against using MathJax to insert this sort of symbol. One of the good things about MathJax is that it retains semantic meaning, thus folk using screenreaders can still understand what is being said (e.g. \vec means "vector"). In a real LaTeX document, that semantic meaning can be retained by defining macros in an appropriate way. But MathJax is going to lose some of that semantic meaning if you start prioritizing the "look" of a symbol over the meaning. $\endgroup$
    – Xander Henderson Mod
    Sep 11, 2022 at 15:26
  • 4
    $\begingroup$ I would further argue that you probably shouldn't use the symbol you are proposing. The symbol you propose looks almost exactly the same as that produced by \vec. If you were to use both symbols in a document, I would imagine that it would be nearly impossible for most people to distinguish them. But if only one is needed, why not just use the symbol which already exists? $\endgroup$
    – Xander Henderson Mod
    Sep 11, 2022 at 15:31
  • 1
    $\begingroup$ @XanderHenderson: The use of this symbol is required in order to retain syntactic meaning in an appropriate way. It is intended to be used in conjunction with \vec, not in its stead. $\endgroup$
    – Evan Aad
    Sep 11, 2022 at 15:51
  • $\begingroup$ @Xander Extremely minor quibble... The command \vec meaning "vector" should be an example of LaTeX being designed with "semantics" not "syntax" in mind. See also these posts for this usage, as well as some discussions concerning how much semantics matter in TeX. $\endgroup$
    – Elliot Yu
    Sep 14, 2022 at 18:51
  • $\begingroup$ @ElliotYu Oi. Of course. I blame the dyslexia. Thanks. $\endgroup$
    – Xander Henderson Mod
    Sep 14, 2022 at 18:55
  • $\begingroup$ BTW MathJax allows you to define new macros using \newcommand and so on. MathJax will render it if it's defined before you use it, even if the definition and usage are not within one single math environment. This means that you can still make a macro like \altvec to convey the meaning. $\endgroup$
    – Elliot Yu
    Sep 14, 2022 at 19:03

2 Answers 2

2
$\begingroup$

$\newcommand{vvec}[1]{\overset{\tiny\mapsto}{#1}}$ $\newcommand{longvvec}[1]{\overset{\mapsto}{#1}}$

The following answer doesn't exactly meet the specifications, but it'll do for my purposes. It is much simpler to implement than the solution described here.

With the commands

\newcommand{vvec}[1]{\overset{\tiny\mapsto}{#1}}, and \newcommand{longvvec}[1]{\overset{\mapsto}{#1}}, the code \vvec{x}\ \longvvec{xy} yields $\vvec{x}\ \longvvec{xy}$.

$\endgroup$
2
$\begingroup$

I don't think you should do this usually. But here are some possibilities.

$\stackrel{\bullet\!\to}{x}$ $\stackrel{\bullet\!\to}{X}$ $\stackrel{\bullet\!\to}{xy}$

$\overrightarrow{\smash{\stackrel{\bullet}{x}}y}$ $\overrightarrow{\smash{\stackrel{\bullet}{x}}y\smash{b}}$ $\overrightarrow{\smash{\stackrel{\bullet}{x}}y\smash{bAc}}$ $\overrightarrow{\smash{\stackrel{\bullet}{A}}B}$ $\overrightarrow{\smash{\stackrel{\bullet}{A}}C}$ $\overrightarrow{\smash{\stackrel{\bullet}{C}}F}$ $\overrightarrow{\smash{\stackrel{\bullet}{A}}BCDG}$ $\overrightarrow{\smash{\stackrel{\bullet}{\mathcal X}}\mathcal YZ}$ $\overrightarrow{\smash{\stackrel{\bullet}{\mathbb X}}\smash{\mathscr Y}Z}$ $\overrightarrow{CDEF\smash{\stackrel{\bullet}{A}}B_1\smash{\stackrel{\bullet}{A}}B_2\smash{\stackrel{\bullet}{A}}B_3CDEF}$

There are mainly two constructs; firstly, $\stackrel{\bullet\!\to}x$ makes $\stackrel{\bullet\!\to}x$ which barely works for two symbols $\stackrel{\bullet\!\to}{xy}$ $\smash{\stackrel{\bullet\!\to}{xy}}$.

Secondly, using \smash, you can also overlay the \bullet on top of a \overrightarrow: $\overrightarrow{\smash{\stackrel{\bullet}{x}}y}$ $\overrightarrow{\smash{\stackrel{\bullet}{x}}y}$ The arrow pokes out the left of the \bullet, and the height isn't so consistent. But it works for longer strings of letters, and you can put many different \bullets. You may need to experiment with \smash e.g. $\overrightarrow{\smash{\stackrel{\bullet}{x}}y\smash{bAc}}$ $\overrightarrow{\smash{\stackrel{\bullet}{x}}y\smash{bAc}}$.

And of course there is $\stackrel{\leftarrow\!\bullet}{xy} $ etc.

$\endgroup$

You must log in to answer this question.

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