2

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
    Do either of http://tex.stackexchange.com/q/242115/32374 or http://tex.stackexchange.com/q/98155/32374 help? – darthbith May 04 '15 at 15:07
  • 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 04 '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.

    – naturallyInconsistent May 04 '15 at 15:36
  • @user77509 Sorry, first link was meant to be this one: http://tex.stackexchange.com/q/96141/32374 (which is the duplicate linked from the second link I posted earlier) :-) – darthbith May 04 '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. – naturallyInconsistent May 04 '15 at 16:20
  • See here: Importing a single symbol from a different font You may have a different question, but it seems like you've felt comfortable enough to accept a similar solution. – Werner May 04 '15 at 16:45
  • @Werner, I have already used that. It did not work, but egreg has already given the answer I wanted -- I simply did not extract one more symbol that I could not have known beforehand. Thanks anyway. – naturallyInconsistent May 04 '15 at 16:55
  • @user77509: For future reference, please mention what you have tried. And don't say "it doesn't work". If the ultimate solution seems to replicate another answer, then it seems like you something must have gone wrong in your attempt. Showing this would help you in the future. – Werner May 04 '15 at 16:57
  • @Werner, ah, yes, thanks. I did not know that my starting statement referencing "Many previous questions" was not sufficient. Mea culpa. The solution by egreg is fundamentally different from the solutions other people have accepted, and actually should be added to those other questions, as being the necessary addendum to complete them. Especially the summary thread that includes all the extensible arrows. That was a brilliant solution. – naturallyInconsistent May 04 '15 at 16:59
  • @Werner, the appropriate questions that are most related to this question, that would benefit from the answer egreg supplied, are these: Extensible \vec instead of \overrightarrow and Configurable and Extensible Accents (Arrows, Dots, Vectors) If you know how this question could be collapsed onto them, it would be best. – naturallyInconsistent May 04 '15 at 17:12
  • @user77509: Since you've supplied these questions in the comment thread, they are now linked (you'll see them in the right bar). That should be sufficient. – Werner May 04 '15 at 17:14

3 Answers3

2

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 }

    – naturallyInconsistent May 04 '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 04 '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.

    – naturallyInconsistent May 04 '15 at 16:23
  • I am sorry that I do not have enough reputation points to give you some upvotes. – naturallyInconsistent May 04 '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 04 '15 at 17:35
  • it is already solved. See egreg's solution. No need to waste your time any longer. – naturallyInconsistent May 04 '15 at 17:39
  • @user77509 True, but I wanted to give at least an alternative that worked as you wanted it. – Steven B. Segletes May 04 '15 at 18:06
2

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

egreg
  • 1,121,712
  • 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.

    – naturallyInconsistent May 04 '15 at 16:56
0

I'm not sure to really understand the question (is it a question of fonts or arrows?), but if you're only look for \rightharpoonup and \leftharpoonup macros, I wrote a the overarrows package which redefine them (and other variants).

As example:

\documentclass{article}

\usepackage[overleftharpoonup, overrightharpoonup]{overarrows}

\begin{document}

[ \overrightharpoonup{abc} ]

[ \overleftharpoonup{abc} ]

\bigskip

\TestOverArrow{overleftharpoonup}

\medskip

\TestOverArrow{overrightharpoonup}

\end{document}

which gives (\TestOverArrow is a test macro defined by the overarrows package): \overleftharpoonup and \overrightharpoonup from the overarrows package

If you want symbols from MnSymbol, you can redefine leftharpoonup and rightharpoonup like in egreg's answer:

\documentclass{article}

\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}

\DeclareMathSymbol{\leftharpoonup}{\mathrel}{MnSyA}{'112} \DeclareMathSymbol{\rightharpoonup}{\mathrel}{MnSyA}{'100}

\usepackage[overleftharpoonup, overrightharpoonup]{overarrows}

\begin{document}

[ \overrightharpoonup{abc} ]

[ \overleftharpoonup{abc} ]

\bigskip

\TestOverArrow{overleftharpoonup}

\medskip

\TestOverArrow{overrightharpoonup}

\end{document}

or simply add

\usepackage{MnSymbol}

Both give: overharpoons with MnSymbol

jlab
  • 1,834
  • 1
  • 13
  • Hi there; this is many years old and as the comments have made clear, I have been using egreg's solution in all my LaTeX code for... hmm, almost a decade now. Your answer is a lot shorter, though. Thanks. – naturallyInconsistent Mar 02 '24 at 04:34