3

Many previous questions have talked about extracting symbols from MnSymbol, or found alternatives from other packages. However, I have not been able to find a suitable replacement for \overrightharpoon that is in MnSymbol. Indeed, is there a nicer replacement for symbols of this type? It does not appear in any of the earlier summaries and questions.

Bonus: If you could be so nice as to include another symbol with harpoon style tick, but now with a backwards 4 tick (so that \overrightharpoon is a 3-vector, and the new symbol is a 4-vector, that would be much appreciated.

  • 1
  • I'm not posting an answer, because I'm not sure I fully understand the question. However, the actual horizontal harpoon glyphs from MnSymbol are in MnSymbolA, glyphs 64, 66, 72, 74. To turn them into oversets, once importing them, one could use, for example, \mathaccent, though the overset glyph tends to be wider than the letter. – Steven B. Segletes May 4 '15 at 15:30
  • @darthbith, The first link sends back here. The 2nd link has it too tall, as the original question poster noted, and is thus unusable. @StevenB.Segletes, I wanted to extract them out, but there is \overarrow, \arrowfill and more, that are undefined. Also, I do not know where the glyphs are supposed to be -- presumably I should be able to use the glyphs predefined in standard LaTeX, for all of them that I need were already predefined, but when I consulted the MnSymbol package documentation, it lists it after the F glyph bits, so I do not see why I should be importing A glyphs. – user77509 May 4 '15 at 15:36
  • @user77509 Sorry, first link was meant to be this one: tex.stackexchange.com/q/96141/32374 (which is the duplicate linked from the second link I posted earlier) :-) – darthbith May 4 '15 at 15:53
  • @darthbith, I tried everything that I could have searched before. In fact, since the MnSymbol \uprightharpoon character had been extracted by Steven, I have retried it with that too, but it is still too high, and most importantly, fails to scale. Scaling is necessary. You might want to check the test case I added as part of Steven's answer. – user77509 May 4 '15 at 16:20
1

You need to extract the harpoons and also the relation bar:

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\DeclareFontFamily{U}{MnSymbolA}{}
\DeclareFontShape{U}{MnSymbolA}{m}{n}{
    <-6>  MnSymbolA5
   <6-7>  MnSymbolA6
   <7-8>  MnSymbolA7
   <8-9>  MnSymbolA8
   <9-10> MnSymbolA9
  <10-12> MnSymbolA10
  <12->   MnSymbolA12}{}
\DeclareFontShape{U}{MnSymbolA}{b}{n}{
    <-6>  MnSymbolA-Bold5
   <6-7>  MnSymbolA-Bold6
   <7-8>  MnSymbolA-Bold7
   <8-9>  MnSymbolA-Bold8
   <9-10> MnSymbolA-Bold9
  <10-12> MnSymbolA-Bold10
  <12->   MnSymbolA-Bold12}{}
\DeclareSymbolFont{MnSyA}{U}{MnSymbolA}{m}{n}
\SetSymbolFont{MnSyA}{bold}{U}{MnSymbolA}{b}{n}

\DeclareRobustCommand{\overleftharpoon}{\mathpalette{\overarrow@\leftharpoonfill@}}
\DeclareRobustCommand{\overrightharpoon}{\mathpalette{\overarrow@\rightharpoonfill@}}
\def\leftharpoonfill@{\arrowfill@\leftharpoondown\mn@relbar\mn@relbar}
\def\rightharpoonfill@{\arrowfill@\mn@relbar\mn@relbar\rightharpoonup}

\DeclareMathSymbol{\leftharpoondown}{\mathrel}{MnSyA}{'112}
\DeclareMathSymbol{\rightharpoonup}{\mathrel}{MnSyA}{'100}
\DeclareMathSymbol{\mn@relbar}{\mathrel}{MnSyA}{'320}
\makeatother

\begin{document}
$\overrightharpoon{abc}$
$\overleftharpoon{abc}$
\end{document}

enter image description here

  • Oh beautiful, my students will love you. I have eliminated the definitions of left and right harpoon fills by unrolling them into the definitions referencing them, since they are only used once. ...\overarrow@{\arrowfill...}}} Also, I did not require the import of glyphs 112 and 100, just 320. Now, just to find the correct replacement for 4-vectors. Thanks. – user77509 May 4 '15 at 16:56
0

REWORKED based on comments from the OP, to provide extensibility.

It is based on my answer at Extensible \vec instead of \overrightarrow

Here, I use the default harpoon to provide extensibility. Method can be extended to other harpoon varieties.

\documentclass[12pt]{scrartcl}
\usepackage{stackengine}
\usepackage{calc}
\newlength\shlength
\newcommand\xshlonghvecr[2][1]{\setlength\shlength{#1pt}%
  \stackengine{-1.0pt}{$#2$}{\smash{$\kern\shlength%
    \stackengine{2.75pt}{$\mathchar"012A$}%
      {\rule{\widthof{$#2$}}{.50pt}\kern1pt}{O}{r}{F}{F}{L}\kern-\shlength$}}%
      {O}{c}{F}{T}{S}}
\newcommand\xshlonghvecl[2][1]{\setlength\shlength{#1pt}%
  \stackengine{-1.0pt}{$#2$}{\smash{$\kern\shlength%
    \stackengine{2.75pt}{\kern-1pt$\mathchar"0128$}%
      {\rule{\widthof{$#2$}}{.50pt}\kern1pt}{O}{l}{F}{F}{L}\kern-\shlength$}}%
      {O}{c}{F}{T}{S}}
\begin{document}
\centering
\[ \vec{A} \quad \xshlonghvecr{ABC} \quad \xshlonghvecr{xy}
 \quad \xshlonghvecr{x} \]
\[ \vec{A} \quad \xshlonghvecl{ABC} \quad \xshlonghvecl{xy}
 \quad \xshlonghvecl{x} \]
\end{document}

enter image description here

  • Actually, you do not even need to extract those glyphs. \rightharpoonup is almost exactly the same as \uprightharpoon, though the latter is slightly bigger. (Which would be good -- when I replaced your option with \rightharpoonup, it is too small. Also, both could use some increase in size.) But in any case, your solution does not scale, and is also much too high. Have you tried \overrightharpoon as MnSymbol defines it? It can be rather beautiful. My \vec is renewed to use \overrightharpoon. If you wish to test, try \overrightharpoon{ \mathrm{d}^3 r } – user77509 May 4 '15 at 15:59
  • @user77509 I noted that in my commentary. I showed the glyph extraction, just because you seemed particularly interested in the MnSymbol version for some reason. – Steven B. Segletes May 4 '15 at 16:07
  • the glyph extraction I was interested in, is in the accent lengthening part. The \uprightharpoon is an interesting addition for me, but not what I wanted. Surely, there is a precomputed accent lengthening engine that can combine parts. I already know of that system that could do, left parts, lengthening middle, and then right parts. Yet, I could not get it to work. Sigh. – user77509 May 4 '15 at 16:23
  • I am sorry that I do not have enough reputation points to give you some upvotes. – user77509 May 4 '15 at 17:00
  • @user77509 I had to depart for a period, but I will give additional thought on the issue of extensibility. – Steven B. Segletes May 4 '15 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.