I have a simple slide in beamer, in which I want to type an underscore with \_. However, the underscore is very far away from the text, much further, than in a normal document (not in beamer). Maybe it's due to a package I am missing, but I cannot figure it out. See for yourself, this does not look like a normal underscore (it's far below the text where it should be):
\documentclass[xcolor= pdftex, dvipsnames, table, 16pt]{beamer}
\mode<presentation>
{
\usetheme{Default}
\setbeamercovered{transparent}
\usecolortheme{whale}
}
\usepackage{array}
\usepackage{booktabs}
\usepackage{mathptmx}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{adjustbox, lipsum}
\usepackage{tabularx}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{rotating}
\usepackage{setspace}
\usepackage{makecell}
\begin{document}
\begin{frame}
A\_B
\end{frame}
\end{document}
What am I doing wrong?
\documentclass{article}\begin{document} A\_B \end{document}, b)\documentclass{article}\usepackage[T1]{fontenc}\begin{document} A\_B\end{document}, c)\documentclass{beamer}\begin{document}\begin{frame} A\_B\end{frame} \end{document}and d)\documentclass{beamer}\usepackage[T1]{fontenc}\begin{document}\begin{frame} A\_B\end{frame}\end{document}. – leandriis Oct 03 '19 at 19:10T1encoding. – leandriis Oct 03 '19 at 19:15usepackage[T1]{fontenc}. But only in beamer. In my normal document, it does not look like that. But I have loaded more packages there, so maybe there is a fix. So your recommendation is not to use that option? – ghx Oct 03 '19 at 19:20\usepackage[T1]{fontenc}is not the suggested solution. Depending on what language you are writing in, it might be useful to load. Additionally, as egreg states in their anser: "So with the default OT1 encoding, the command \textunderscore (or _) is defined to produce a small rule, which is not recognized by PDF viewers as a character." – leandriis Oct 03 '19 at 19:27\usepackage[T1]{fontenc}has worked to make the distance better, but now the underscore is very short in width. I was looking for a way to write a simple underscore like it looks for instance here: A_B. But does not seem possible so easily. – ghx Oct 03 '19 at 19:32