Skip to content

Solution for \aemph{} command, avoiding \overline (and amsmath package) #9

Description

@DomoViridi

The manual for v1.2.1 has a note about the \aemph{} command (page 5, note 9, at end of introduction for section 3)

This macro makes use of the mathematical command \overline, which explains why arabxetex requires the amsmath package. I welcome any suggestion that would make it possible to circumvent this dependency by emulating \overline directly."

I had a similar problem with ancient Greek number codes, which require adding a horizontal line over one or more Greek characters. The math \overline was impractical, as switching to math mode interfered with the Greek font used.

To overcome this I wrote a command which draws a TeX "rule" over the characters, without using math mode.
The code is about 10 lines long. See the attached files (a zipped tex file, and a text file; the contents of these two is the same).
ruleover.tex.zip
ruleover.txt

The code defines a command \ruleover[<scale>]{<text>}. This takes a string of text as a parameter, shrinks that text down by a factor defined by the scale parameter (default 0.75) and draws a horizontal line (a "rule") over that text,
at a height of 1.3333 (1 and 1/3) times the height of the text string.

This code can easily be adapted into (a base for) the \aemph command, e.g. by defining
\newcommand{\aemph}[1]{\ruleover[1.0]{#1}}
to get a version with no shrinking.

Things that may need tweaking:

  • Remove \makeatletter and \makeatother; not needed inside a package
  • Rename ROver@ prefix to something else (e.g. ax@over@) to prevent future name clashes.
  • The command was developed based on LTR text. Might need to be modified to work with RTL text. This needs testing. Edit: It does need modification. See later comment.
  • Thickness of the rule is now 0.5333pt (for no scaling, 0.4pt for 0.75 scaling). Modify if desired.
  • The rule is drawn at 1.3333 times the text height above the baseline. Modify if desired.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions