# Using unicode “combining right arrow above” to generate vector command

This question originated from a confusion created by some Linux systems where, for some software (editor and browser) the combining unicode characters appear to apply to the right (instead of to the left like the documented convention). So it could be a "localized" issue (well, localized to all Linux systems). In fact this bug looks like a useful feature because it allows straight conversion for the typesetter commands. Still answers and workarounds are greatly appreciated. -- The OP

The unicode-math list of symbol describes "combining right arrow above" (⃗ or ⃗x) as translated into \vec in Section 7.

How is one supposed to use this feature of unicode-math?

In this example I don't get the arrow above the $x$:

\documentclass{article}
\usepackage{unicode-math}
\begin{document}
$⃗x$ %this line contains the unicode arrow and the x character (in case your browser doesn't show it).
\end{document}


(The compilation with lualatex and xelatex shows simply x with no arrow)

This is strange because unicode-math works for other things like superindexes, etc.

EDIT: For those having trouble seeing the unicode characters, here it is an screenshot of my editor (gedit), my browser shows basically the same:

EDIT 2: This is how @Jukka answer looks like in my browser:

screenshot:

For example, so far, I find that <arrow>x renders the arrow over the x in Gedit 3.10 and Firefox 28.0 and the arrow before the x for TeXworks and Google Chrome.

-
Interestingly for me in firefox it is drawn on the character before the x. –  Chris H Apr 14 at 9:27
In Firefox Linux the arrow shows above the x. Maybe depends on the font. This is the precise symbol fileformat.info/info/unicode/char/20d7/index.htm. –  alfC Apr 14 at 9:29
Generally speaking it's best to avoid such combining characters in typeset work and let the typesetter position the vector arrow. Not least because then you will get consistent behaviour if the base is not just a single letter. –  David Carlisle Apr 14 at 9:29
But that transformation is hard in tex as a combining character comes after the base and a tex accent command has to come before, so you would need to make every character such as x look ahead to see if it is followed by a combining character. which is possible but will break some things and be slow, and just telling people not to do that seems like a better option (although I don't maintain unicode-math so it isn't my decision) –  David Carlisle Apr 14 at 9:34
copy the text from your posted code $⃗x$ %this to the first text block at people.w3.org/rishida/tools/conversion and hit convert you see the code points displayed as 0024 0020 20D7 0078 0024 0020 0025 0074 0068 0069 0073 so the second character is U+0020 ie a space. –  David Carlisle Apr 14 at 20:28

In Unicode, a combining mark is associated with the character that precedes it, so you should use $x⃗$(the content between dollar signs is letter x followed by U+20D7 COMBINING RIGHT ARROW ABOVE). And you should declare a mathematical font that contains the character.
The conclusion is that you should use methods like \vec{x} or, if you can choose the notations used, use bold face for vectors instead of an arrow above. Bold face is the primary notation according to the ISO 80000-2 standard and the only notation described in the US standard (ANSI/IEEE Std 260.3-1993). It is also typographically more robust.
After all the confusion about the order (TeXworks works as everybody describes). Does "combining character" works in you unicode-math and typesetter? Mine are XeTeX 3.1415926-2.6-0.9999.3 (TeX Live 2014/dev) This is LuaTeX, Version beta-0.76.0-2013122811 (TeX Live 2014/dev) (rev 4627). Fedora 20. –  alfC Apr 14 at 23:46