2

The arcs package is useful to put an arc over or under a piece of text.

It is a package that works in text-mode, but could be another one that works only in text-mode and not necessarily the one that I have chosen.

enter image description here

I think it's just a specific package that is only used in text mode but not in mathematical mode. I never have used this package. With this MWE I have an error

\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} 
\usepackage{amssymb, amsmath}
\usepackage{arcs}

\begin{document}
\overarc{A}
\end{document}

LaTeX Font Warning: Font shape OML/cmm/m/it in size <3.59999> not available(Font)

At this moment I remember very little. What could be the strategies in LaTeX to transform a specific package in text-mode into a math-mode?

12
  • 1
    I think this package is just broken, because this results in an infinite loop: dpaste.com/3JVAWDALV (expires in 10 days) Jul 27, 2020 at 23:52
  • @HenriMenke I'm always very lucky 😄😄. I have chosen the corrupt package. Yes I have seen that I have a loop of errors . Very nice dpaste, that I not knew. <4.19997> not available(Font) and <2.99998> not available(Font) for OT1, OML, cmr, cmm, etc. The package can be found inside the symbol guide on page 23. If it doesn't work, what do you do?
    – Sebastiano
    Jul 27, 2020 at 23:58
  • @HenriMenke With the latest version of MikTeX, I have no errors and no bugs in this package.
    – AndréC
    Jul 28, 2020 at 4:44
  • When you say you want it to work "in math mode", do you want the arc over an italic letter, or over a roman letter in math mode? Also, are you expecting to have math kernings? Jul 28, 2020 at 9:15
  • 1
    It is specific for the arcs package. The only change from the package definitions is to add the $s around #2. Jul 28, 2020 at 15:52

2 Answers 2

2

To fix the infinite loop, this should work:

\documentclass{article}
\usepackage{arcs}

\usepackage{xpatch}
\makeatletter
\xpatchcmd\over@under@arc
  {\let \rs@size@warning = \@gobbletwo}
  {\let \rs@size@warning = \@gobblethree}
  {}{\fail}
\makeatother

\begin{document}
\overarc{A}\overarc{a} \par
\underarc{A}\underarc{a}
\end{document}

But I'm not capable of providing a math-mode variant. Sorry.

Update:

A poor attempt: $\overarc{$A$}, \underarc{$a$}$.

Or, you can use \overparen and \underparen provided by unicode-math package. This package requires unicode-aware engine like XeTeX or LuaTeX. Those two commands are documented in unimath-symbols.pdf, sec. 5 & 6.

\documentclass{article}

% this uses otf math font "Latin Modern Math" by default
\usepackage{unicode-math}

\begin{document}
\[
  \overparen{a}  \overparen{A}  \overparen{AB}
  \underparen{a} \underparen{A} \underparen{AB}
\]
\end{document}

enter image description here

There is a wonderful TeX-SX answer providing updated info about available otf math fonts.

3
  • I, meanwhile, thank you very much from the bottom of my heart. You don't have to worry about me at all if you haven't been able to give a complete answer. My philosophy is simple and you can see it in my profile: to vote positively for the effort, the time dedicated, ...and then above all we should all be united and in solidarity. Only in this way can we make our world slightly better.
    – Sebastiano
    Jul 28, 2020 at 7:24
  • 1
    @Sebastiano Hi, I've added a unicode-math example. Hope that helps. Jul 28, 2020 at 9:16
  • Always welcome and appreciated every addition.😉
    – Sebastiano
    Jul 28, 2020 at 11:20
2

Rather than use the arcs package, I borrowed from my answer at Big tilde in math mode, to adapt for the present purposes. See ADDENDUM for arcs package approach.

Note that I did some vertical squeezing (not in the macro definitions) in the MWE presentation to not have it run off my screen capture.

\documentclass{article}
\usepackage{scalerel}
\usepackage{stackengine,wasysym}

\newcommand\reallywideoverarc[1]{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle#1$}%
  \stackengine{-.5\LMpt}{$\SavedStyle#1$}{%
    \stretchto{\scaleto{\SavedStyle\mkern.2mu\frown}{.4\wd0}}{.6\ht0}%
  }{O}{c}{F}{T}{S}%
}}
\newcommand\reallywideunderarc[1]{\ThisStyle{%
  \setbox0=\hbox{$\SavedStyle#1$}%
  \stackengine{1.5\LMpt}{$\SavedStyle#1$}{%
    \stretchto{\scaleto{\SavedStyle\mkern.2mu\smile}{.4\wd0}}{.6\ht0}%
  }{U}{c}{F}{T}{S}%
}}

\def\test#1{$%
  \reallywideoverarc{#1}\,
  \scriptstyle\reallywideoverarc{#1}\,
  \scriptscriptstyle\reallywideoverarc{#1}
$\par\vspace{-4pt}$%
  \reallywideunderarc{#1}\,
  \scriptstyle\reallywideunderarc{#1}\,
  \scriptscriptstyle\reallywideunderarc{#1}
$\par\vspace{-2pt}}

\parskip 1ex
\begin{document}

\test{abcdefghijklm}
\test{abcdefghijk}
\test{abcdefghi}
\test{abcdefg}
\test{abcde}
\test{abc}
\test{ab}
\end{document}

enter image description here

p.s. I later found I had done at least a partial answer to this sort of question here: Strange result with patch of \overarc


ADDENDUM

Based on a comment, the OP asked me to elaborate as part of my answer. In trying to actually use the arcs package, I discovered, as did another answer to this question, that the package was not well behaved. The fix to that problem given in the other answer was to change the \@gobbletwo to \@gobblethree in the definition of \over@under@arc. However, that still leaves the result in text mode. To achieve math mode as a default, two additional changes are needed:

\renewcommand{\overarc}[2][1]{\over@under@arc{#1}{$#2$}\z@}
\renewcommand{\underarc}[2][1]{\over@under@arc{#1}{$#2$}\@ne}

With those three changes the result will be set in math mode. However, the \overarc` does not have an italic correction to the arc itself.

\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} 
\usepackage{amssymb, amsmath}
\usepackage{arcs}
\usepackage{xpatch}
\makeatletter
\xpatchcmd\over@under@arc
  {\let \rs@size@warning = \@gobbletwo}
  {\let \rs@size@warning = \@gobblethree}
  {}{\fail}
\renewcommand{\overarc}[2][1]{\over@under@arc{#1}{$#2$}\z@}
\renewcommand{\underarc}[2][1]{\over@under@arc{#1}{$#2$}\@ne}
\makeatother
\begin{document}
\overarc{A}
\overarc{AB}
\underarc{A}
\underarc{AB}
\end{document}

enter image description here

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.