# Beamer xelatex images not show

% Created 2019-11-13 Wed 10:48
% Intended LaTeX compiler: xelatex
\documentclass[presentation]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{xeCJK}
\setCJKmainfont{Source Han Serif CN}
\setCJKsansfont{Source Han Serif CN}
\date{2019-11-12}
\title{ImageTest}
\hypersetup{
pdfauthor={Jilen Jilen},
pdftitle={ImageTest},
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 27.0.50 (Org mode 9.2.6)},
pdflang={English}}
\begin{document}

\maketitle

\begin{frame}[label={sec:org407d30b}]{Beamer image test}
\begin{center}
\includegraphics[width=.9\linewidth]{foo.png}
\end{center}
\end{frame}
\end{document}


This beamer presentation is exported by org-mode. But the image is not show. I tried both png/jpeg/bmp, no lucky.

Log related to image

File: """foo".png Graphic file (type bmp)
<"""foo".png>
[2

]


Version: This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Arch Linux) (preloaded format=xelatex)

• Welcome! The graphic is of type BMP and you cannot use it. You need an image in a supported format. (You can't just change the extension and say it is foo.png. You need it to really be a PNG or whatever.) You should also edit your preamble, since its toxicity level is currently quite high. Don't load: hyperref, longtable, wrapfig, graphicx, inputenc at a minimum. hyperref and graphicx are loaded by beamer. longtable and wrapfig make no sense with beamer and inputenc isn't relevant for XeTeX. Do you really need \captionof in a presentation? – cfr Nov 13 '19 at 5:11
• @cfr That is a png image, I am pretty sure. – jilen Nov 13 '19 at 5:20
• The error says it is bmp. So, if it is png, there is something very wrong with it. – cfr Nov 13 '19 at 5:21
• @cfr Both png and bmp and jpeg are treated as bitmap image, in latex I think. And that packages actually are imported by org-mode automatically. – jilen Nov 13 '19 at 5:23
• The quotes around foo look wrong. Is your system up-to-date? There has be a few changes in file handling (and the grffile package is now obsolete). – Ulrike Fischer Nov 13 '19 at 7:12

It seems there is something wrong with the grffile package [1]. Org-mode inserts it by default. Apparently it is fixed in the new release of the package (which only loads graphicx) but I also haven't received the update containing it. I opted for removing grffile from org-latex-default-packages-alist.