我收到此错误“无法在目录中找到 .svg 文件”,但它确实在目录中

我收到此错误“无法在目录中找到 .svg 文件”,但它确实在目录中
"errorSummary": {
            "error": [
                "! Package svg Error: File `emptystar.svg' is missing.\n",
                "! Package svg Error: File `emptystar.svg' is missing.\n",
                "! Package svg Error: File `emptystar.svg' is missing.\n",
                "! Package svg Error: File `emptystar.svg' is missing.\n",
                "! Package svg Error: File `emptystar.svg' is missing.\n"
            ],
Above is error 

以下是函数片段

\usepackage{luacode}
\usepackage{svg}
\svgpath{{services/pdf_generator/libs/common-utils/}}

\begin{luacode*}
function generateRatingMarker(rating)
  local rating = tonumber(rating)
  
  -- Limit the rating to the range [0, 5]
  if rating > 5 then
    rating = 5
  elseif rating < 0 then
    rating = 0
  end

  -- Print color SVG images
  for i = 1, rating do
    tex.print("\\includesvg{emptystar}") -- Corrected path and removed extra slashes
  end

  -- Print empty SVG images
  for i = rating + 1, 5 do
    tex.print("\\includesvg{emptystar}") -- Corrected path and removed extra slashes
  end
end

相信我,我在上面指定的文件夹中有这些emptystar.svg

答案1

我已经解决了这个问题,这个问题与找不到文件无关,而是由于未启用而导致的escape shell command

相关内容