annProg / PanBook

Pandoc LaTeX,Epub模板,用于生成书籍,幻灯片(beamer),简历,论文等(cv, thesis, ebook,beamer)
BSD 3-Clause "New" or "Revised" License
263 stars 28 forks source link

part编译错误 #41

Closed SealingX closed 2 years ago

SealingX commented 2 years ago

环境:pandoc版本为2.18(忘记碰到什么问题了,换到2.18才解决,crossref也是对应的版本),windows10,工作目录”D:\workspaces\PanBook“。

问题如下:

编译src/chapter-01/100-introduction.md时,

1、settings.json中,"terminal.integrated.shellArgs.windows": ["-i", "-l"],如果不加“-i”命令,执行part task,会提示:

/usr/bin/bash:行1: panbook:未找到命令 The terminal process "D:\msys64\usr\bin\bash.exe '-l', '-c', 'panbook book --part=100-introduction.md && start build/part.pdf'" terminated with exit code: 127.

加上“-i”可以正常执行。

2、但此时执行,会提示:

Executing task: panbook book --part=100-introduction.md && start build/part.pdf <

[NOTE] Welcome to PanBook! [NOTE] use -V device:(pc|mobile|kindle) to produce different size of pdf [NOTE] use -V cover:(1-60|R|N|filepath) select cover background.R=random,N=no cover,filepath=custom cover file [NOTE] use -V pagestyle:style to set pagestyle pandoc.exe: 100-introduction.md: openBinaryFile: does not exist (No such file or directory) Rc files read: NONE Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b. Set environment variable BIBINPUTS='D:/workspaces/PanBook/build;' Set environment variable TEXINPUTS='D:/workspaces/PanBook/build;' Latexmk: All targets (D:/workspaces/PanBook/build/part.xdv D:/workspaces/PanBook/build/part.pdf) are up-to-date [NOTE] book Compile SUCCESSFUL

因为task中是“fileBasename”,命令执行时找不到文件,换成{file}或{relativeFile}也不行,因为路径分隔符为“/”不识别,仍然提示找不到文件,以{relativeFile}为例:

Executing task: panbook book --part=src\chapter-01\100-introduction.md && start build/part.pdf <

[NOTE] Welcome to PanBook! [NOTE] use -V device:(pc|mobile|kindle) to produce different size of pdf [NOTE] use -V cover:(1-60|R|N|filepath) select cover background.R=random,N=no cover,filepath=custom cover file [NOTE] use -V pagestyle:style to set pagestyle pandoc.exe: srcchapter-01100-introduction.md: openBinaryFile: does not exist (No such file or directory) Rc files read: NONE Latexmk: This is Latexmk, John Collins, 29 September 2020, version: 4.70b. Set environment variable BIBINPUTS='D:/workspaces/PanBook/build;' Set environment variable TEXINPUTS='D:/workspaces/PanBook/build;' Latexmk: All targets (D:/workspaces/PanBook/build/part.xdv D:/workspaces/PanBook/build/part.pdf) are up-to-date [NOTE] book Compile SUCCESSFUL

3、不使用task,直接在集成到vscode的msys2中执行“panbook book --part=chapter-01/100-introduction.md”是可以的(但奇怪为何不是“panbook book --part=src/chapter-01/100-introduction.md“?)

annProg commented 2 years ago

第3点,因为是相对于build的路径,不能带 src