0

I have problem about finding files in latex from server filesystem.

Here is my whole latex code for rendering business card.

\documentclass[a4paper,11]{article}
    \usepackage[utf8]{inputenc}
    \usepackage[zw32010,crossmark]{ticket}
    \usepackage{graphicx}

    \usepackage[paperwidth=80mm, paperheight=50mm]{geometry}

    \graphicspath{{app/static/images/}{app/static/users_documents/146/}}

    \newcommand*{\myfont}{\fontfamily{\sfdefault}\selectfont}

    \renewcommand{\ticketdefault}{}
    \newcommand{\vcard}[5]{\ticket{
        \put(7, 31.75){\tt \LARGE #1}
        \put(7, 9){\tt #2}
        \put(66, 7.5){\tt #3}
        \put(68, 22){\tt #4}
        \put(28, 12){\tt #5}
    }}

    \newcounter{numcards}
    \begin{document}

    \setcounter{numcards}{0}

    \whiledo{\thenumcards<1}{
      \stepcounter{numcards}
      \vcard
      {\includegraphics[width=54.23mm, height=15.87mm]{nic_int_logo_logobitmapmid_1v0.jpg}}
      {\includegraphics[width=19.84mm]{personal_photo_1.jpg}}
      {\includegraphics[width=13.23mm]{qr.png}}
      {\includegraphics[width=9mm, height=29.93mm]{gray.png}}
      {\parbox{\textwidth}{\large \myfont{Matija \\Lukic}}}
    }

    \end{document}

In my log file I get error:

Package pdftex.def Error: File `personal_photo_1.jpg' not found.

I've been trying to fix error by changing paths where images are located:

\graphicspath{{app/static/images/}{app/static/users_documents/146/}}

to

\graphicspath{{app/static/images/}{app/static/users\_documents/146/}}

Also, I tried to remove last slash in paths, and add line before each filename. I still get the same error.

4
  • Where exactly is app/static in relation to the file being compiled? Also did you try ./app/static/... if app is a subfolder if the folder in which the file is being compiled.
    – daleif
    Oct 26, 2018 at 10:35
  • File being compiled is in the same directory as app folder. I tried to add ./ but it doesn't work. Oct 26, 2018 at 10:48
  • Does it work if the images are in the same folder as the tex file? Then we can rule out the the issue is with the file names.
    – daleif
    Oct 26, 2018 at 11:03
  • Also are you 100% sure this is the only error from the log file?
    – daleif
    Oct 26, 2018 at 11:03

1 Answer 1

1

I resolved problem.

If you use

\graphicspath{{app/static/images/}{app/static/users_documents/146/}}

you must add slash before filename like this:

{\includegraphics[width=54.23mm, height=15.87mm]{/nic_int_logo_logobitmapmid_1v0.jpg}}
  {\includegraphics[width=19.84mm]{/personal_photo_1.jpg}}
  {\includegraphics[width=13.23mm]{/qr.png}}
  {\includegraphics[width=9mm, height=29.93mm]{/gray.png}}
  {\parbox{\textwidth}{\large \myfont{Matija \\Lukic}}}

Now it works.

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.