When I call two separate files(chapters) from a main file, it shows error for graphicx. Details are bellows:

(i) The main file main.tex contains following contents:


\author{No Author}
\title{Simple Book Example}

(ii) The first chapter chapter01.tex contained in the directory ch1. The chapter01.tex contains the following contents:

\chapter{first chapter}
Text sample

The image konigsberg1.png contained in ch1.

Similarly, the second chapter chapter02.tex contained in the directory ch2. The chapter02.tex contains the following contents:

\chapter{second  chapter}
Text sample for 2nd ch

The image Jordan_curve contained in ch2.

These two directories ch1 and ch2 are contained in the directory where the main file contained.

When I compile with pdflatex in texstudion on MacOS, it shows that

File `konigsberg1' not found.

for line \includegraphics{konigsberg1} and

File `Jordan_curve' not found.

for \includegraphics{Jordan_curve}. But when I comment out includegraphics, then everything is ok.

How can I fix error?




to your preamble

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.