0

Preparing a presentation, text that involves HTML tags gets rendered as Spanish question mark and exclamation mark.

I am not particularly familiar with Latex Beamer and I could not figure out where this behavior comes from. Below is a minimum example.

When compiling in Overleaf, what I get on the slide is: ¡p¿ ¡br¿

What can I do about it?

\documentclass[aspectratio=169]{beamer}
\usetheme[progressbar=frametitle, block=fill]{metropolis}
\useoutertheme{metropolis}
\useinnertheme{metropolis}
\usefonttheme{metropolis}
\usepackage{svg}
\usepackage[utf8]{inputenc}

\usepackage{appendixnumberbeamer}

% Define a custom footer
\setbeamertemplate{frame footer}{\inserttitle \quad - \quad \insertsectionhead}  %\insertshortauthor | \insertshortinstitute
\setbeamerfont{page number in head/foot}{size=\tiny}
\setbeamercolor{footline}{fg=gray}

\title{Latex Beamer Problems}
\date{May 15, 2019}
\author{Simon}

\institute{\begin{figure}[!tbp]

    \end{figure}
}


\begin{document}
\maketitle

\section{Start}
\begin{frame}{HTML Tags Rendered as Spanish Punctuation}
    <p> <br>
\end{frame}

\end{document}

  • remember \usepackage[T1]{fontenc}, under the default OT1, some symbols may have a different meaning in text. Also, why are you adding a "floating" figure in \institute? – daleif May 15 at 12:16
1

Add

\usepackage[T1]{fontenc}

(I usually do before inputenc) and it will work.

The default is OT1 in which (due to space limitations) certain chars have a different meaning in text mode.

0

HTML tags are no normal text, they are source code and should be rendered as such. Either with the build in verbatim stuff or \lstinline from the listsings package.

\documentclass{article}

\usepackage{listings}

\begin{document}

    \verb|<p> <br>|

    \lstinline|<p> <br>|

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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