altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.27k stars 365 forks source link

error Unterminated quote in @-file: #367

Closed hirschhausen closed 1 year ago

hirschhausen commented 1 year ago

many thanks for the toolbox, which is very helpful I am running the code on Windows 10 and the latest Matlab and Ghostscript releases. Unforunately, I always receive the following error code when running the line 'append_pdfs(OutFile, fullInputFileName)' Error using append_pdfs Unterminated quote in @-file: A:\TestFile.pdf"

all files are correctly appended until it hits the last filein the list, the same happens when I spell out the filename individually and it is not a file problem as it happens when I append the same file several times

as I would like to use the command in a loop, it would be great if you have a hint for me how to fix the problem, many thanks in advance!

altmany commented 1 year ago

I cannot reproduce the problem, it behaves ok for me. Perhaps one of your filenames (either inputs or output) contains a " or some other special character.

You can place a breakpoint in append_pdfs.m line 108 to check the names, and/or in line 111 check the contents of the generated ghostscript command (by running type(cmdfile) in the Matlab command window when Matlab reaches line 111). If it all looks ok (unlikely) then you can reopen this issue, but in that case you need to specify exactly what your export_fig input parameters contain.

hirschhausen commented 1 year ago

many thanks for your fast response I tried the suggestions you made and learned a lot. After some time of unsuccessful tries, I ran the program with my old computer and it worked just fine. So, I installed the older version of ghostscript on my machine and the code ran without any error. Thank you very much, your toolbox and advice is much appreciated!