2

The compiling the following with lualatex

\documentclass{article}
\usepackage{libertinus-otf}
\usepackage{yhmath}
\begin{document}
$\wideparen{ABC}$
\end{document}

gives the error message

/usr/local/texlive/2022/texmf-dist/tex/latex/yhmath/yhmath.sty:59: LaTeX Error:
 Command `\arrowvert' already defined.

What to do to prevent this?

2
  • You can use \let\arrowvert\relax after loading the first package and before loading the second. I don't post this as an answer because there seems to be many overlapping macros and you'd have to use this trick for each one, though.
    – Miyase
    Commented May 20, 2022 at 9:48
  • I lot of other error messages are popping up.
    – Ulrich
    Commented May 20, 2022 at 11:09

1 Answer 1

2

Just import \wideparen

\documentclass{article}
\usepackage{libertinus-otf}

\DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n}
\DeclareMathAccent{\wideparen}{\mathord}{yhlargesymbols}{"F3}

\begin{document}

$\wideparen{ABC}$

\end{document}

enter image description here

If you look in yhmath.sty, you will find

\DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n}

that's the standard LaTeX way to set up a math symbol font. One needs a name and a font specification; in this case a font encoding file named ofmyhex.fd exists, so we need nothing else.

Next you will find the required \DeclareMathAccent instruction, which is the LaTeX way to define a math accent. You find several of these examples in the basic fontmath.ltx file, part of the LaTeX kernel.

In some other cases one needs also to specify the font declarations. A case is when you need to import symbols from mathabx or fdsymbols. For such cases, mileage may vary and some experience is needed.

5
  • can you please provide me with a link where I can learn to understand this solution?
    – Ulrich
    Commented May 20, 2022 at 10:59
  • @Ulrich There are several posts on the site that show how this works.
    – egreg
    Commented May 20, 2022 at 13:50
  • \@egreg, ok I will search. Your solution fixed my problem.
    – Ulrich
    Commented May 20, 2022 at 14:09
  • @Ulrich I added a few comments.
    – egreg
    Commented May 20, 2022 at 14:51
  • @egrep I got it.
    – Ulrich
    Commented May 23, 2022 at 10:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .