3

In this post, it is shown how to build a new symbol using some symbols of one package. To be honest, I don't understand this post.

I would like to only use the symbols \leftleftharpoonsrel and \rightrightharpoons of the package mathabx.

How can I do that?

projetmbc
  • 13,315
  • 2
    Use the same code, and replace the last two lines with \DeclareMathSymbol{\leftleftharpoons}{\mathrel}{mathb}{"D8} \DeclareMathSymbol{\rightrightharpoon}{\mathrel}{mathb}{"D9} – Bernard Feb 28 '21 at 11:52
  • @Bernard Thanks. How do you find the hexadecimal values D9 and D8 ? – projetmbc Feb 28 '21 at 12:13
  • @egreg See the question above. – projetmbc Feb 28 '21 at 12:14
  • 1
    @projetmbc: Just looking at the table for mathb in the documentation, p. 19 (it's not as simple for all font packages…). – Bernard Feb 28 '21 at 12:30
  • @Bernard What are the changes to do so as to use some symbols of the table in the page 18 of the documentation? I can open a new question if you think this is relevant. – projetmbc Feb 28 '21 at 12:42
  • First check the category of the symbols (mathrel, mathbin,…) and the font it belongs to (matha,mathb,mathx), then see from the tables their hexadecimal code (indicated with the prefix "). The rest of the code is unchanged, as far as I remember, at least for non-delimiters. – Bernard Feb 28 '21 at 12:47
  • The following answer of egreg makes it easy to do. Just replace mathb by matha and this will do the job. Thanks for all. – projetmbc Feb 28 '21 at 13:44
  • This answer, https://tex.stackexchange.com/questions/217986/standard-ams-sum-operator-using-mnsymbols/219282#219282, helps you in figuring out D8 and D8. It helps to use fonttable to print out the font map, which tells you that information. – Steven B. Segletes Feb 28 '21 at 18:04
  • @StevenB.Segletes Very useful. Thanks for this link. – projetmbc Feb 28 '21 at 21:03

1 Answers1

8

You look in the file mathabx.dcl for \leftleftharpoons and \rightrightharpoons to find

\DeclareMathSymbol{\leftleftharpoons}      {3}{mathb}{"D8}

\DeclareMathSymbol{\rightrightharpoons} {3}{mathb}{"D9}

Now you know that you need the font called mathb, which you find in mathabx.sty

\DeclareFontFamily{U}{mathb}{\hyphenchar\font45}
\DeclareFontShape{U}{mathb}{m}{n}{
      <5> <6> <7> <8> <9> <10> gen * mathb
      <10.95> mathb10 <12> <14.4> <17.28> <20.74> <24.88> mathb12
      }{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}

I suggest to make the fonts fully scalable at all sizes, so the complete code becomes

\DeclareFontFamily{U}{mathb}{}
\DeclareFontShape{U}{mathb}{m}{n}{
  <-5.5> mathb5
  <5.5-6.5> mathb6
  <6.5-7.5> mathb7
  <7.5-8.5> mathb8
  <8.5-9.5> mathb9
  <9.5-11> mathb10
  <11-> mathb12
}{}
\DeclareSymbolFont{mathb}{U}{mathb}{m}{n}
\DeclareFontSubstitution{U}{mathb}{m}{n}
\DeclareMathSymbol{\leftleftharpoons}      {\mathrel}{mathb}{"D8}
\DeclareMathSymbol{\rightrightharpoons}    {\mathrel}{mathb}{"D9}

(the \hyphenchar declaration is useless).

I changed {3} into \mathrel that's clearer about the role of the symbols (however the two styles are equivalent).

egreg
  • 1,121,712