0

On LaTeX, if I do \bar{u} in LaTeX, I get this:

enter image description here

Code:

\documentclass[12pt]{article} 
\begin{document} 
     \begin{frame} 
         $\bar{u}$ 
      \end{frame} 
\end{document}

But on Beamer, I get this:

enter image description here

Code:

\documentclass[12pt]{beamer} 
\begin{document} 
     \begin{frame} 
         $\bar{u}$ 
      \end{frame} 
\end{document}

I know that the default font for Beamer is serif, could it be why? Is there a way to realign the bar for Beamer?

Superman
  • 1,615
  • 4
    I cannot recreate your result. You need to provide a small, but complete working example that shows this behavior. – Steven B. Segletes Apr 22 '20 at 21:18
  • Let me try to set the font on a pure latex file and see how it goes – Superman Apr 22 '20 at 21:31
  • 6
    You have now asked 28 questions. In most of them you either post no MWE or a code with an excessive preamble. This essentially means that others need to do the work for you. While for newcomers this usually is not a big deal, after more than 20 questions you might want to consider taking this burden from others who spend their time solving your problems. I am also stumbling over the fact that hardly any answer you received seems to be worth being accepted. If the answers are that bad, why do you come back and ask new questions? –  Apr 22 '20 at 21:40
  • @Superman You can edit your question with this code:\documentclass[12pt]{beamer} \begin{document} \begin{frame} $\bar{u}$ \end{frame} \end{document} – Sebastiano Apr 22 '20 at 21:49
  • You wrote, "I know that the default font for Beamer is serif". I assume you meant to write, sans-serif, right? – Mico Apr 22 '20 at 21:59
  • Here there is the answer (i think): https://ipfs-sec.stackexchange.cloudflare-ipfs.com/tex/A/question/4192.html of Hendrik Vogt. – Sebastiano Apr 22 '20 at 22:07
  • @Schrödinger'scat Sometimes I just don’t know which minimal working example would be suitable enough, especially with types of files in which I have barely worked before – Superman Apr 22 '20 at 22:12
  • 2
    @Sebastiano made a suggestion. It is just that this example does not (at least on my TeX installation) lead to the displaced bar. This means that your problem is only reproducible if you provide a code that yields this output. –  Apr 22 '20 at 22:14
  • @Schrödinger'scat You have right totally. :-( excuse me. – Sebastiano Apr 22 '20 at 22:16
  • @Superman For my humble opinion with TeXLive 2019 (Papeeria) I have your same problem. Hence check for updates or add other informations. – Sebastiano Apr 22 '20 at 22:20

1 Answers1

2

Using MikTeX 2.9 with the updates you have not problems with or without \usepackage{sansmathaccent}.

\documentclass{beamer}
\usepackage{sansmathaccent}
\begin{document}
\begin{frame}{}
$\bar{u}$ 
\end{frame}
\end{document}

enter image description here

Sebastiano
  • 54,118
  • I tried to recreate your answer on my end, but to no effect. I even manually installed the sansmathaccent package and placed the folder right in my work directory, but to no avail. I also updated the MikTeX 2.9 packages, but I am not sure if I did so correctly. What should I do? – Superman Apr 23 '20 at 23:32
  • 1
    @Superman - You wrote, "but I am not sure if I did so correctly". Did you check the log files produced by MikTeX? If so, what do they say? – Mico Apr 24 '20 at 05:29
  • @Superman I am totally agree with the comment of the very good user Mico, which he is more expert than me. I suggest to see this link how install manually new fonts: https://tex.stackexchange.com/questions/419957/latest-miktex-suggestions-on-how-to-install-new-fonts-using-the-miktex-console. I never have installed sansmathaccent on my MikTeX distribuition. – Sebastiano Apr 25 '20 at 11:45
  • @Mico, I am not sure how and where to find the MikTeX log files... – Superman Apr 26 '20 at 18:06
  • 1
    @Superman - That's a good question. You should ask it as a new query. – Mico Apr 26 '20 at 18:24
  • 1
    Actually, I am planning to ask a modified version of this question such that it gives a better idea of what’s going on – Superman Apr 26 '20 at 18:24
  • For me it doesn't work either. MikTeX 21.10 usw. – Kazi bácsi Nov 07 '21 at 20:45
  • @Kazibácsi I have re-compiled and it works correctly (I have a recent version of MikTeX-updated). You can ask a new question putting all your details. – Sebastiano Nov 07 '21 at 21:11