0

I re-installed my OS (Ubuntu 20.04) and Latex (package texlive-latex-extra), and I get compilation errors for my previously working documents. The documents still work fine on Overleaf, but not on my machine. Most errors seem to stem from graphics.

Example:


\documentclass[english]{article}

\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{babel}
\usepackage{float}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[unicode=true]
 {hyperref}


\begin{document}

\begin{figure}[H]
\centerline{ \includegraphics[width=1.3\textwidth]{ {{Figs/DW_narrow_wide/potential}} } }
\end{figure}

\end{document}

Error: LaTeX Error: File ` {{Figs/DW_narrow_wide/potential}} ' not found. Even though the file is clearly there and it worked before (and online). I never quite understood why I had to use double braces around the file name, but even if I remove them and use one or no curly braces, it does not work.

Any help is appreciated.

7
  • 2
    why all the extra {} in h]{ {{Figs/DW_narrow_wide/potential}} } ??? as you see in the error message they are taken as a literal part of the file name. It can never work with those braces. (or the space) Aug 8, 2023 at 8:42
  • 2
    unrelated but \usepackage[latin9]{inputenc} it would be better to use utf-8 and delete this line, certainly any examples you post on this site will be utf-8 not latin9, as they will be converted to utf-8 as you paste in to the code block. Aug 8, 2023 at 8:45
  • 2
    I've tried \includegraphics{ {{example-image}} } with TeX Live from 2012 up to 2023 and the error message is always the same, namely ! LaTeX Error: File ` {{example-image}} ' not found.
    – egreg
    Aug 8, 2023 at 9:03
  • I don't know why I needed the braces for it to work before tbh. Why does it work on Overleaf with the braces then? If I remove the two braces around the file name as well as the latin9 line I still get the same error saying that the figure was not found.
    – reloh100
    Aug 8, 2023 at 9:03
  • did you remove the spaces as well Aug 8, 2023 at 9:08

0

You must log in to answer this question.

Browse other questions tagged .