6

The following code:

\documentclass{article}
  
\begin{document}
\[ f(x',\overline{x'}) \]
\end{document}

produces the following output for me:

enter image description here

I'm a bit bothered that the heights of the primes are mismatched. My first thought for how to fix this issue was to add a phantom overline over the first argument so that the prime in the first argument would get pushed down to the same height. However, despite some experimentation with syntax (\phantom{\overline}{x'} for instance), I couldn't find something which compiles.

Apologies if this has been asked before. The inverted version of this question overline over no text does not seem relevant here.

0

3 Answers 3

5

There are two options you can take:

  • \smash will cause its argument to act like it’s under an \overline (or inside a \sqrt):

    \[ f(\smash{x'},\overline{x'}) \]
    
  • You can define a command that will set the xʹ on its own and then add the \overline. I called \nsoverline (for no-smash overline) in the example below:

    \NewDocumentCommand{\nsoverline}{m}{\overline{\mbox{$#1$}}}
    ︙
    \[ f(x',\nsoverline{x'}) \]
    
2
  • 1
    Thanks for the valuable suggestions. For some reason, both options resulted in the primes being set at unequal (but much closer!) heights. However, I get a satisfactory result with f(\mbox{$x'$}, \overline{\mbox{$x'$}}). Commented 10 hours ago
  • 1
    In \[ f(x',\nsoverline{x'}) \], the first instance of x' is processed in display-style math mode, whereas the second is processed in text-style math mode. This affects the heights of the prime symbols. Commented 5 hours ago
1

An appropriate solution depends critically on the meanings of the \overline and ' ("prime") operations. Do please let us know what these operations mean.

If "prime" denotes transposition -- say, of a matrix or vector -- I think you should write either

f(x',\overline{x}')

or, better yet,

f(x',\bar{x}')

A happy side effect of making this change is that you needn't worry about the placement of the "prime" symbol.

But, again, absent knowledge of the meanings of the two operations, it's not possible to provide definitive formatting advice.

enter image description here

\documentclass{article}
\begin{document}
\[ 
f(x',\overline{x'}) \quad f(x',\overline{x}') \quad f(x',\bar{x}')
\]
\end{document}
1

The nucleus of an Overline atom is typeset in cramped style. You get the same height of the prime in a square root:

\documentclass{article}
\begin{document}
\[
\sqrt{x'}
\]
\end{document}

square root

You can see that the height of the prime in the denominator is the same as in \overline{x'}.

Normally this is desired, but your case requires remedy: use \cramped for the first x', but I also suggest adding \,.

\documentclass[twocolumn]{article}
\usepackage{mathtools} % for amsmath and \cramped

\begin{document}

Without \verb|\cramped|
\[
f(x',\overline{x'})
\]

With \verb|\cramped|
\[
f(\cramped{x'},\overline{x'})
\]

With \verb|\cramped| and \verb|\,|
\[
f(\cramped{x'},\overline{x'}\,)
\]

\end{document}

(I use twocolumn just to reduce the size of the picture)

output

You might force uncramped style by declaring \displaystyle

f(x',\overline{\displaystyle x'}\,)

uncramped

Not what I'd like to see, to be honest.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.