Skip to content

[BUG] The SVG generated by latex cannot be found because it may be due to the addition of random numbers #375

@SGL23187

Description

@SGL23187

Describe the bug

\documentclass{standalone}
\begin{document}
   Hello world!
\end{document}

使用此codeblock的时候会导致报错:

EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, open 'c:\Users\xxx\AppData\Local\Temp\crossnote_pdf2025622-25504-1b90rzt.aoj9\64e51f41b9dcc70f876fa9f8de65f289_1.svg?0.9262534297121938'

但是我看了一下,文件明明是存在的

而在参数中加入:latex_zoom=2就没问题

我怀疑是这里:pdf.ts中的111行开始

          if (svgZoom || svgWidth || svgHeight) {
            svgMarkdown += `<img src="${svgFilePath}" ${
              svgWidth ? `width="${svgWidth}"` : ''
            } ${svgHeight ? `height="${svgHeight}"` : ''} ${
              svgZoom ? `style="zoom:${svgZoom};"` : ''
            }>`;
          } else {
            svgMarkdown += `![](${svgFilePath}?${r})\n`;
          }
        }

这里加入了随机数,导致没办法读到文件

Environment

  • OS: Windows 11
  • Crossnote: 0.8.0
  • Node.js: 16.13.0
  • Browser: Chrome 95.0.4638.69

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions