if username has spaces or is long, tempdir replaces username with tilde (`~`) (breaks pdflatex)
<!-- See our full bug reporting guidelines at https://inkscape.org/contribute/report-bugs/ Writing a good bug report will ensure we'll be able to help efficiently. 🙂 --> #### Summary: <!-- Summarize the issue/suggestion concisely: --> Error when trying to insert LaTeX formula using Extensions->Render->LaTeX Formula in Inkscape. #### Steps to reproduce: <!-- Describe what you did (step-by-step) so we can reproduce: --> - open Inkscape - Click Extensions->Render->LaTeX Formula. - When "use" is pressed a new window is launched. #### What happened? - The new window says: "Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected." - In the tex area below it says: ``` "Traceback (most recent call last): File "pdflatex.py", line 83, in <module> PdfLatex().run() File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\base.py", line 123, in run self.save_raw(self.effect()) File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\extensions.py", line 159, in effect for child in fragment: File "pdflatex.py", line 49, in generate call('pdflatex', tex_file,\ File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\command.py", line 182, in call return _call(program, *args, **kwargs) File "C:\Program Files\Inkscape\share\inkscape\extensions\inkex\command.py", line 171, in _call raise ProgramRunError("Return Code: {}: {}\n{}\nargs: {}".format( inkex.command.ProgramRunError: Return Code: 1: b'' b"This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.7)\r\nentering extended mode\r\n! I can't find file `C:/Users/ESPENM'.\r\n<to be read again> \r\n \\protect \r\n<*> C:/Users/ESPENM~\r\n 1/AppData/Local/Temp/inktmpbw2nsret/input.tex\r\nPlease type another input file name: \r\n! Emergency stop.\r\n<to be read again> \r\n \\protect \r\n<*> C:/Users/ESPENM~\r\n 1/AppData/Local/Temp/inktmpbw2nsret/input.tex\r\n! ==> Fatal error occurred, no output PDF file produced!\r\nTranscript written on C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret\\texpu\r\nt.log.\r\n" args: ['C:\\Users\\Espen Myrset\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\pdflatex.exe', '-output-directory=C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret', '-halt-on-error', 'C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret\\input.tex']" Edited for readability: b"This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.7) entering extended mode ! I can't find file `C:/Users/ESPENM'. <to be read again> \\protect <*> C:/Users/ESPENM~ 1/AppData/Local/Temp/inktmpbw2nsret/input.tex Please type another input file name: ! Emergency stop. <to be read again> \\protect <*> C:/Users/ESPENM~ 1/AppData/Local/Temp/inktmpbw2nsret/input.tex ! ==> Fatal error occurred, no output PDF file produced! Transcript written on C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret\\texpu t.log. " args: ['C:\\Users\\Espen Myrset\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\\pdflatex.exe', '-output-directory=C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret', '-halt-on-error', 'C:\\Users\\ESPENM~1\\AppData\\Local\\Temp\\inktmpbw2nsret\\input.tex']" ``` #### What should have happened? A box with a LaTeX formula inside should be created in the document. #### Sample attachments: [sample_attachment.txt](/uploads/55bdfa3f0f79af0ad0832a113b749114/sample_attachment.txt): #### Version Info: ``` - Inkscape Version: Inkscape 1.0 (4035a4fb49, 2020-05-01) - Operating System: Windows 10 Pro - Operating System version: 2004 ``` <!-- ❤️ Thank you for filling in a new bug report, we appreciate the help! ❤️ Please be patient while we try to find the time to look into your issue. Remember that Inkscape is developed by volunteers in their spare time, we'll try our best to respond to all reports. --> <!-- Please be careful when/after writing # for example in logs, code, or versions of linux - use inline code span - single backticks (`) before and after it, like this - `inbox#1618` - use multi-line code block - triple backticks (```) to fence/enclose console logs - attach long logs as a text file. -->
issue