TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to introduce a new type of math accent that is basically an overbar, but also has small (scriptscriptsize?) text set to the right of the bar. Basically something like


but I'd like the text to be set higher---preferably centered vertically on the bar. And I'd like to not have to tweak the height because I'll be making arbitrarily many of these. Is this feasible?

The context is: I'm working on some math that requires an unusually large number of operations similar to complex conjugation. There is no consensus in the literature on which symbols to use for which operations (Hermitian dagger, overbar, overtilde, overset smiley, etc.), which is endlessly confusing. I want to introduce a new notation. My goal is to use an overbar for everything, but also have a short string describing which type of conjugate this is. The string will always be just two or three characters; co in the example above.

share|improve this question
Give the \widebar command from this answer a try! – Hendrik Vogt Apr 24 '13 at 18:15
up vote 3 down vote accepted

Here is an option that uses a combination of things:

enter image description here

\usepackage{amsmath,graphicx}% http://ctan.org/pkg/{amsmath,graphicx}
$\bar{A}^{\mathrm{co}} \quad \mathco{A} \quad \mathabc{A} \quad \mathco{XYZ} \quad \mathabc{A}_{\mathabc{B}_{\mathabc{C}}}$

The text in the "accent" (the operation) is scaled to 70% of its original using graphicx's \scalebox{<factor>}{<stuff>}. The \bar is replaced with a "slanted" \overline, pushed to the right a default of 3mus.

Using it in subscripts is not the best... bit I'm not sure whether your use would extend that far.

share|improve this answer
That's good, and I'll keep it in mind, but I really wanted the text to be set on the side. I've added an answer below. Feel free to improve on that. – Mike Apr 24 '13 at 15:52

I've come up with the following:


This allows me to write (in my amsmath + revtex4-1 document)


and obtain

C with conjugate

It's not automatic. (I tried using .5\height for the argument to \raisebox, but couldn't find any number that worked well.) I can probably live with it, but any improvements are welcome.

share|improve this answer
The \mathpalette command is useless, as you always choose \tiny: \newcommand{\conjug@te}[3]{\overline{#1}^{\raisebox{#3}{\tiny#2}}} gives essentially the same result. – egreg Apr 24 '13 at 17:55

There is a first step, based on a plainTeX construction. Several adjustments are needed. What should be done, if an argument is short, e.g. \barca{A}?




enter image description here

share|improve this answer

protected by Community Mar 14 '15 at 6:55

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.