How do I get an arch over letters?

Jump to solution
lph
Community Champion

Hey everyone. I'm stuck on the MathQuill editor. Getting a line over symbols is easy, use \overline. But what if I want an arch over the symbols?

DC A

This question is done to the point of using the overline but not sure how to get the arch for the D AC using the MathQuill editor.

336694_Screen Shot 2020-01-30 at 10.44.26 PM.png

1 Solution
James
Community Champion

lph,

This question was just asked about the legacy quizzes yesterday. It must be the time of the season for this kind of problem:LaTex 

The \overset works with New Quizzes, but the \overparen does not. Neither one can be entered into MathQuill, but needed entered into the rich content editor using the \( and \) delimiters.

Personally, I think there's a little too much vertical space with these examples, but it's the best I've got for you. Eliminating the vertical space took more than it seems MathQuill supports.

\overset{\huge\frown}{DCA}

\overset{\LARGE\frown}{DCA}

Here's what it looks like in Canvas with the \huge taking on different size specifiers

336702_pastedImage_10.png

You can also use \stackrel{\LARGE\frown}{DCA}. The frown appears to be a tiny bit closer to the DCA with this (maybe a pixel or 2 at most).

Another possibility is \overgroup{DCA} but there's not enough arc there for me.

336703_pastedImage_12.png

MathQuill itself added \overarc 3 years ago in September 2016, but it doesn't work in Canvas' version. At least one fork of MathQuill added \overparen as an alias 17 months ago. Canvas must either be using a really old version or just decided not to support it.

That said, I was surprised to see that trying to create the a quiz with MathQuill actually invoked KaTeX when it was displayed. It was an error message in the browser's console when it couldn't parse \overarc that caught my attention. That reminded me that someone had argued for KaTeX a while back, saying that MathQuill and KaTeX were a good combination: https://community.canvaslms.com/ideas/10432 (cold storage).

Here is a page that lists the supported functions for KaTeX to give you an idea of what's available: Supported Functions · KaTeX. It supports all kinds of horizontal spacing, but not any of the vertical spacing I normally use. I tried playing around with \raisebox but couldn't get it to affect the spacing between the frown and the DCA.

Based off the commands there, I played around with \stackrel, \vphantom, and \mathllap. I was able to take what I had before (on the left) with \huge and turn it into the object on the right.

336706_pastedImage_18.png

\( \stackrel{\huge\frown}{\vphantom{\small{e}}}\mathllap{DCA} \)

That is very hackish, though, and probably doesn't look good for accessibility.

The trick was to adjust the height of the thing under the huge frown, so I picked a half-height character e and then made it a little smaller. Your tastes may vary.

The \mathllap overlaps the previous item (the frown over an empty space because of vphantom) with the part that comes after (the DCA).

If you want to make the DCA not be in math mode, it can look even better (IMO). The third one has the DCA wrapped in \text{}

336707_pastedImage_19.png

This was accomplished with

\( \stackrel{\huge\frown}{\vphantom{\small{e}}}\mathllap{\text{DCA}} \)

If you want to keep the italics, but shift the arc, you can use \kern. Here the 3rd one has the frown kerned 0.1em

336708_pastedImage_24.png

\( {\stackrel{\huge\frown}{\vphantom{\small{e}}}\kern0.1em}\mathllap{DCA} \)

If you have a lot of these to do on a page, you can use the \gdef command to define a macro. This will then allow you to use \overarc. You can include the first instance inside the macro-definition statement, or declare it in one statement and then use it in another. The \gdef is global on a page and works in a browser. I have not tested any of this on a mobile device and you would want to do that before settling on a solution.

\( \gdef\overarc#1{\stackrel{\huge\frown}{\vphantom{\small{e}}}\mathllap{#1}}\)

\( \overarc{DCA} \)

Anyway, I hope that gets you close enough. In LaTeX, the \overarc command requires the arcs package and it has been described as buggy on StackOverflow and it contains a loop that tries different sizes to see what works. That would slow things down, which is not something you want for speedy rendering.

Here's another consideration. It's not as hackish, meaning it's better for accessibility and a whole lot easier to accomplish. That's to to just write out the word arc and not try to use the symbol.

What is the exact length of arc DAC on circle P?

Another possibility is to create an image of it the way it should look and then use an Alt tag of "arc DAC"

View solution in original post