0

I changed laptops and thus had to reinstall TeXStudio/TexLive. Now my projects don't compile correctly anymore. The same project is compiling correctly both on my old laptop and for a collaborator. There must be some setting wrong in TeXStudio but I don't know what. I get the following error for all my figures:

LaTeX Warning: File `../dir1/{name_including.dots}.pdf' not found on input line 249.
! Package pdftex.def Error: File `../dir1/{name_including.dots}.pdf' not found: using draft setting.

The file does exist in the appropriate directory (in directory dir1, one directory up from the main.tex file).

Version Info (current problematic TeXstudio setup):

LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>

Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)

TeXstudio 2.12.22

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)

kpathsea version 6.3.1


Thanks to David who pointed out that: 1.) Removing the brackets would fix things for me. 2.) Putting the brackets around {../dir1/name_including.dots}.pdf should work for both me and my collaborator using an older version of LaTeX2e. If my collaborator confirms this is indeed the case I think I would consider that a full answer if David or someone else (or me if no one wants to bother) writes it up in an answer.

Marten
  • 311
  • 6
  • the braces around the file name looks odd, why is it there? – Ulrike Fischer Dec 09 '20 at 22:07
  • @Ulrike, it was required because the filename contains dots and it would cause errors otherwise. There is a stackexchange question on this issue (https://tex.stackexchange.com/questions/10574/includegraphics-dots-in-filename). I will try a filename with dots and see whether the issue is not there without the braces but I don't think it will solve the issue. Besides I would like a solution by changing settings in TeXstudio since I don't want to force changes on collaborators that migth break things on their end. I had everything working in TeXStudio so I should be able to make it work again. – Marten Dec 09 '20 at 22:09
  • well if you have a newer latex then the braces are probably both unneeded and wrong (the file name handling has been improved, spaces and dots are now handled correctly by default). The texstudio version is quite irrelevant. What matters is your latex and graphicx version. – Ulrike Fischer Dec 09 '20 at 22:12
  • Okay, that would be very inconvenient. Maybe I should look whether I can downgrade then. That would be quite bad if the main way to correctly handle dots in file names has been changed in such a way that it no longer works. Also none of my collaborators has this issue. I guess we were all fortunate to use outdated versions then. – Marten Dec 09 '20 at 22:18
  • @Kvothe most forms still work (even when the braces are no longer needed) but as you have given no indication of your input markup or latex version it is really impossible to suggest any help. – David Carlisle Dec 09 '20 at 22:19
  • in particular {../dir1/name_including.dots}.pdf probably works on old and new systems. – David Carlisle Dec 09 '20 at 22:21
  • @David, what latex version information is still missing. I tried to add the relevant information. How can I find the graphicx version requested by Ulrike. The command is not found in the terminal (or is that the problem that it is missing). – Marten Dec 09 '20 at 22:21
  • you have not given any relevant version information. The log file will give the latex version, currently LaTeX2e <2020-10-01> patch level 2 and graphicx version, currently Package: graphicx 2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR) – David Carlisle Dec 09 '20 at 22:23
  • @David, thanks for pointing me to the relevant version information. I added it. (My LaTeX2e and graphicx seem to be somewhat outdated even though I just installed it probably because I got it from apt-get and did not build it myself from the newest version.) – Marten Dec 09 '20 at 22:29
  • so you should be able to check that the braces are not needed on your system and an initial brace group as i suggested above is ignored to help with compatibility with older systems – David Carlisle Dec 09 '20 at 22:32
  • @DavidCarlisle, thanks I just checked that the error goes away if I take out the brackets. Putting the brackets as you suggested also works for me {../dir1/name_including.dots}.pdf I will ask my collaborator whether it also still works for him. Thanks for the help. (Sorry I edited this because at first recompile the error somehow hadn't updated but on second compile it did.) – Marten Dec 09 '20 at 22:35
  • im confused: you say here it still errors with the initial brace, but you just edited the question suggesting I confirm that works. (it shoudl work by design) – David Carlisle Dec 09 '20 at 22:50
  • @DavidCarlisle, I'm very sorry I think you are referring to a comment that I immediately edited afterwards. It was a mistake. In fact your solution works and I am very grateful. – Marten Dec 09 '20 at 22:52

1 Answers1

2

In current latex multiple dots in filenames (along with spaces and non-ascii UTF-8 characters) should work in filenames across latex, not just \includegraphics but also \input etc. To make that work it wasn't possible to support every possible trick that was previously used to make some of these characters work. However the trick of adding braces to the filename to hide multiple dots is still supported if the brace group is at the start of the filename (such a brace group is simply discarded).

So on current systems

\includegraphics{../dir1/name_including.dots.pdf}

will work, and to also work on older systems you can add a brace group as

\includegraphics{{../dir1/name_including.dots}.pdf}
David Carlisle
  • 757,742