When using LaTeX, I used the esvect package, which has the following interesting features :
- very well lengthed vector arrows
- a lot of arrow versions
- a particular attention given to vectors with subscripts
I can't find any equivalent in ConTeXt. I've found this conversation, but the result doesn't suit me, especially with the subscript case.
I tried to use directly esvect's code, but it seems to use LaTeX programming utilities (so it is not Plain TeX, and not usable as-is in ConTeXt). I've tried adapting it (the package is about 20 lines of code, so I thought it would be feasible), but since I'm not a TeX programmer at all, I quickly abandoned.
Is there a Plain TeX programmer who would be able to make such a small translation ? Or any other satisfying alternative ?
EDIT
I understand that I poorly asked the question : my aim is to use the features of the esvect package with ConTeXt. I asked for a Plain TeX version because I (wrongly, as Henri Menke explained in the comments) thought it was usable as-is with ConTeXt, and that it might be easier to produce or reach more programmers. Henri Menke provided a perfectly working Plain TeX version, but since it isn't usable with ConTeXt, it is not what I seeked in the end. Is it possible to have a ConTeXt version of this package ? Since I am neither a TeX programmer nor a metapost user, I don't know what should be the best way to handle it…
Thanks in advance.
SECOND EDIT
Since @Aditya asked me to explain my problem in a more clear way, I made a comparison (with the Palatino font, since it is the one I use) of what I can acheive with esvect, what is with done basically by LaTeX and by ConTeXt. Below are the codes, then the snapshots, then the details :
%% LaTeX code
\documentclass[11pt]{article}
\usepackage[sc]{mathpazo}
\linespread{1.05}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage[g]{esvect}
\begin{document}
\begin{multicols}{2}
esvect package
\begin{equation*}
\vv{F}_{\text{spring}\to M} = -k(x-\ell_{0})\vv*{u}{x}
\end{equation*}
\begin{equation*}
\text{correct } \vv{AB}, \vv{\imath}
\end{equation*}
\begin{equation*}
\vv*{u}{x} \text{ more adapted than } \vv{u}_{x}
\end{equation*}
\begin{equation*}
\vv{v} = -\vv{grad}\phi
\end{equation*}
out of the box
\begin{equation*}
\vec{F}_{\text{spring}\to M} = -k(x-\ell_{0})\vec{u}_{x}
\end{equation*}
\begin{equation*}
\text{awful }\vec{AB}, \text{ correct } \vec{\imath}
\end{equation*}
\begin{equation*}
\vv*{u}{x} \text{ better arrow, worse spacing than } \vec{u}_{x}
\end{equation*}
\begin{equation*}
\vec{v} = -\vec{grad}\phi
\end{equation*}
\end{multicols}
\end{document}
% ConTeXt code
\usemodule[simplefonts]
\definefontfeature[default][default][onum=yes]
\setupbodyfont[11pt,palatino]
\starttext
\startformula
\vec{F}_{\text{spring}\to M} = -k(x-\ell_{0})\vec{u}_{x}
\stopformula
\startformula
\text{correct } \vec{AB}, \vec{\imath}
\stopformula
\startformula
\text{neither } \vec{u}_{x} \text{ nor } \vec{u_{x}}
\stopformula
\startformula
\vec{v} = -\vec{grad}\phi
\stopformula
\stoptext
Below is the result with LaTeX:
And below is the result with ConTeXT
Finally, what I seek in esvect can be summarized as this :
- On one-letter vectors, the arrow is a bit longer on both sides, and I find it much more readable
- On vectors with subscripts, it still makes arrows a bit longer, but also correct the spacing, so that the subscript is already under the arrow tip (I think the correction could be a bit stronger though, but I'm not thinking that this level of detail is important now)
- On multi-letters vectors, it behaves naturally as
\overrightarrow
, which ConTeXt does out of the box - Some special cases such as the grad or
ìmath
are not perfect but acceptable in my opinion - I prefer esvect's arrow look, but palatino's is fine by me
Maybe I could use TikZ to create my vector commands, but even if I have experience of TikZ I never did this kind of programming (I only drawed pre-defined plots).
Best Answer
I managed to convert
esvect
to Plain TeX. However, I couldn't get it to work in ConTeXt.