6

I am trying to bring the bar over $\rho$ and \sim over $u_i$ at the same level in the following equation (second term) but unable to do so. Kindly help me on how to do it? Someone told me to go for \strut but I am unable to get this command. I tried but failed.

\begin{equation}
\centering
\frac{\partial \overline{\rho}}{\partial{t}}+\frac{\partial (\overline{\rho}\overset{\sim}{u_i})} 
{\partial{t}}
 \end{equation}

enter image description here

2
  • 6
    It will probably not end up at the exact same height, but note that the usual way to put a tilde over a variable is \tilde{<variable>}, not \overset{\sim}{<variable>}, i.e. \tilde{u}_i. (I would also lose the \centering. Usually equations are centred already. And if not, there is probably an option to toggle that on or off.)
    – moewe
    Commented May 25, 2020 at 17:10
  • When a variable is subscripted, the accent is usually set over the variable only; don't write \dot{x_i}, for instance, but \dot{x}_i. This case is similar, but \sim is not what you're looking for.
    – egreg
    Commented May 26, 2020 at 8:55

2 Answers 2

21

By all means replace \overset{\sim}{u} with \tilde{u}. Optionally, replace \overline{\rho} with \bar{\rho}.

Here's a screenshot of u with various math-mode adornments.

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
$\bar{u} \tilde{u} \hat{u} \dot{u} \ddot{u} \acute{u} \grave{u} \check{u} \breve{u}$ 
$\bar{\bar{u}} \tilde{\tilde{u}} \hat{\hat{u}} \hat{\tilde{u}} \tilde{\bar{u}}$
\end{document}
7

I have used accents package to put correctly (using the negative space \kern-.2em) the \sim symbol over the u_i. See the command \accentset{\kern-.2em\sim}{u_i}.

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{accents}
\begin{document}
\begin{equation}
\frac{\partial \bar{\rho}}{\partial{t}}+\frac{\partial (\bar{\rho}\accentset{\kern-.2em\sim}{u_i})} 
{\partial{t}}
\end{equation}
\end{document}

enter image description here

Or you can use the "natural" code without the negative space:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{accents}
\begin{document}
\begin{equation}
\frac{\partial \bar{\rho}}{\partial{t}}+\frac{\partial (\bar{\rho}\accentset{\sim}{u_i})} 
{\partial{t}}
\end{equation}
\end{document}

enter image description here

This addition is due to the comment of the very good user @egreg that you can see below: Following his advice putting

\accentset{\sim}{u}_i

you will have:

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\usepackage{accents}
\begin{document}
\begin{equation}
\frac{\partial \bar{\rho}}{\partial{t}}+\frac{\partial (\bar{\rho}\accentset{\sim}{u}_i)} 
{\partial{t}}
\end{equation}
\end{document}

enter image description here

Just from comment by the user @barbara beeton into chat I use also the \widetilde command: here there is the output.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools}
\usepackage{amssymb}

\begin{document}
\begin{equation}
\frac{\partial \bar{\rho}}{\partial{t}}+\frac{\partial (\bar{\rho}{\widetilde u}_i)} 
{\partial{t}}
\end{equation}
\end{document}

enter image description here

6
  • 1
    @down-voter: Is there a reason for a downvote for my answer? Where is my mistake?
    – Sebastiano
    Commented May 25, 2020 at 22:31
  • 2
    +1. Happy to undo the downvoter's mistake. :-)
    – Mico
    Commented May 25, 2020 at 22:41
  • 1
    Sorry, that was me - I did change my mind immediately afterwards, and tried to cancel the vote, but it told me my vote was locked. I have been able to undo it now since you edited the post. My trigger-reaction reasoning/concern was that an inferior (imho) solution posted hours after Mico's and moewe's might suggest to the asker that your answer was an improvement. Of course, your method does achieve the desired output. Apologies.
    – Fintan
    Commented May 25, 2020 at 23:12
  • 3
    I'd recommend \accentset{\sim}{u}_i if \tilde is deemed too small.
    – egreg
    Commented May 26, 2020 at 8:56
  • @egreg Thank you very much for your precious suggestion.
    – Sebastiano
    Commented May 26, 2020 at 19:25

You must log in to answer this question.

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