[Tex/LaTex] Resolve LaTeX Error: Cannot determine size of graphic X (no BoundingBox)

arxivoverleafpstricks

I am using Overleaf and must use LaTeX compiler. This is because I use pst-poker which only works with LaTeX or XeLaTeX and want to submit to arXiv which does not accepts XeLaTeX.)

I have several images in formats JPG and PNG. Compiling the paper with XeLaTeX produces no errors, however when switching to the LaTeX compiler each image produces this "No Bounding Box" error.

I saw I need to determine the bounding box this way:

\includegraphics[width=0.8\linewdith,bb=0 0 100 100]{figurefile}

However it does not work, the PDF it produces contains only the 2 pages before the first image appears.

Problem:

LaTeX-Compiler can’t determine the graphic-size, because there is no
such information in the graphics-file.

Error messages like: “Cannot determine size of graphic (no
BoundingBox)”

I have tried:

  1. Use a graphic file format, which saves picture-size information, e.g. EPS

    • .eps is too large, exceeds the size limit of arXiv
  2. Use the PdfLaTeX compiler instead of the LaTeX compiler

    • Can't use PdfLaTeX since it is not compatible with pst-poker.
  3. Specify the picture size manually: \includegraphics[scale=0.75, natwidth=640, natheight=480]{picture.jpg}

    • Does not work, I get a white box, no image.

On a similar question someone answered that LaTeX does not support anything other than EPS. — Is that right?

EDIT:
I need the pst-poker package to draw cards symbols as the paper is about a card game.

enter image description here

Best Answer

with pdflatex --shell-escape file:

\documentclass{standalone}
\usepackage{auto-pst-pdf}
\usepackage{pst-poker}
\begin{document}
\begin{pspicture}\crdAs\end{pspicture}
\end{document}

enter image description here

Related Question