0

I've tried adding a picture using:

\begin{figure}[htb]
    \centering
    \textbf{bbb}\par\medskip
    \includegraphics[width=\textwidth]{schematOgolny.png}
    \captionof{figure}{sth}
    \label{aaa}
\end{figure}

In the result I've got this:

result from xelatex

XeLaTeX added text schematOgolny.bb above the picture. This does not however happens when I use PDFLaTeX

result from pdflatex

I'm a bit hesitant towards using PDFLaTeX because for some reason utf8 is not supported (and I need utf8).

My question is how can I get rid of that extra text in XeLaTeX?

SOLUTION:

I had defined \graphicspath for `graphicx library, which caused the issue. Thanks for @Teepeemm for pointing me in the right direction

EDIT:

This is minimal reproducable example:

\documentclass{article}
\usepackage{graphicx}
\usepackage{capt-of}
% Problematic line (path does not need to actually exist):
\graphicspath{ { C:/sth/PracInż/obrazy/ } }
\begin{document}
\begin{figure}[htb]
    \centering
    \textbf{bbb}\par\medskip
    \includegraphics[width=\textwidth]{schematOgolny.png}
    % Any picture will do
    \captionof{figure}{sth}
    \label{aaa}
\end{figure}
\end{document}
  • 1
    I'm skeptical that this would actually happen. If you have a file that has only \documentclass{article}\usepackage{graphicx}\begin{document} and then your posted code and then \end{document}, do you still have the .bb occur? – Teepeemm Dec 1 '18 at 19:05
  • 1
    Welcome to TeX.SX! Please help us help you by providing a minimal compilable code example (MWE). – TeXnician Dec 1 '18 at 19:12
  • Could you show us your .log file? – book Dec 1 '18 at 19:13
  • without any example code it is hard to guess but I would suspect an incorrect option to the graphics package – David Carlisle Dec 1 '18 at 19:13
  • 1
    @Miku your \graphicspath had a space in it I would guess? So the error is in code that you did not show so only you can answer the question. – David Carlisle Dec 1 '18 at 21:16
2

Spaces are not stripped from segments in the graphics path so your specification causes Tex to try to load

C:/sth/PracInż/obrazy/ schematOgolny.png

and the space terminates TeX's primitive filename reader and things go wrong.

Use

\graphicspath{ {C:/sth/PracInż/obrazy/} }
  • I did what you said and it solved problem. Thanks :) – Miku Dec 3 '18 at 22:38

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.