6

I'm using the devanagari package in LaTeX to incorporate Hindi/Sanskrit alphabet. Is there a way to draw an arc under words?

A basic example would be:

\documentclass{article}
\usepackage{devanagari}

\newcommand{\arc}{...}

\begin{document}
  \arc{{\dn saaregama}}
\end{document}

To generate a PDF document:

  1. Save the above document as example.dn.
  2. In the terminal run devnag example.dn.
  3. This generates a file example.tex.
  4. Run pdflatex example.tex to generate a PDF.

Without the \arc{} command, the PDF generated would be: input image

With the \arc{} command, the PDF generated would be: enter image description here

If I have \arc{ABCD}, then it should ouput the following:

enter image description here

Is there any way to do this

  1. Within devanagari package?
  2. If not within, then using some package that doesn't conflict with the devanagari package?
  3. If not, then by defining your own way to do it?
4
  • Welcome to TeX.se Since you're asking about compatibility with a specific package, it would be extremely helpful to provide a minimal compilable document using that package that people could test with.
    – Alan Munn
    Mar 16, 2018 at 17:08
  • 1
    Unrelated, but for Indic scripts, you're probably better off using XeLaTeX and polyglossia and entering your source directly.
    – Alan Munn
    Mar 16, 2018 at 17:10
  • Thank you @AlanMunn, I have added a minimal working example. Mar 16, 2018 at 17:26
  • The arcs package (ctan.org/pkg/arcs?lang=en) seems to do what you want. However, when compiled with XeLaTeX it doesn't work properly. If you are not using XeLaTeX maybe that helps you :)
    – Manza
    Oct 6, 2022 at 14:58

2 Answers 2

8

How about this?

\documentclass{article}

\usepackage{xparse}
\usepackage{tikz}

% usage: \uarc[sep][depth]{text}
\NewDocumentCommand\uarc{O{.2ex} O{.3ex} m}{%
    \tikz[baseline=(arced node.base)]{
        \node [inner sep=0pt, outer sep=0pt] (arced node) {#3};
        \draw [transform canvas={yshift=-#1}] (arced node.south west) parabola [parabola height=-#2] (arced node.south east);
    }%
}

\begin{document}

Look, it's an \uarc{arc}!

Look, it's a \uarc[-.1ex]{long arc}!

\end{document}

output of the code above

You can of course adjust the default values for the separation and the depth of the arc to your liking.

5

Not exactly what you're asking, but you can try the \underbracket command, from mathtools, or \undergroup, which comes from mathabx:

\documentclass{article}
\usepackage{mathtools}
\usepackage{mathabx} 

\begin{document}

$\underbracket[0.6pt][0.7ex]{\textsf{\,ABCD\,}}\qquad\undergroup{\textsf{\,ABCD\,}}$

\end{document} 

enter image description here

4
  • The devanagari package doesn't work in math environment unfortunately, but thanks for the answer though. Mar 16, 2018 at 17:03
  • 1
    Even with the command \text{...}?
    – Bernard
    Mar 16, 2018 at 17:06
  • Works with \text{...}, thank you. Mar 16, 2018 at 17:52
  • Very nice answer. +1.
    – Sebastiano
    Mar 17, 2018 at 9:09

You must log in to answer this question.

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