在手动的Ubuntu 22.04 上的文件夹中有文件manual.tex、A.tex、B.tex、C.tex、D.tex(章节),使用LATEX.cmake, 和CMakeLists.txt。
CMakeLists.txt 包含:
cmake_minimum_required(VERSION 3.22)
project ( manual NONE)
SET(LATEX_OUTPUT_PATH /home/username/manual_out)
INCLUDE(UseLATEX.cmake)
ADD_LATEX_DOCUMENT(manual.tex
INPUTS A.tex B.tex C.tex D.tex
IMAGE_DIRS images
BIBFILES bibliography.bib
USE_INDEX)
重新创建脚本
mkdir build
cd build
ccmake ..
make
错误输出
...
Output written on manual.pdf (1 page, 196553 bytes).
PDF statistics:
63 PDF objects out of 1000 (max. 8388607)
37 compressed objects within 1 object stream
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
CMake Error at /home/username/manual/UseLATEX.cmake:523 (message):
Executed LaTeX, but LaTeX returned an error.
Call Stack (most recent call first):
/home/username/manual/UseLATEX.cmake:2067 (latex_execute_latex)
make[2]: *** [CMakeFiles/manual_pdf.dir/build.make:85: /home/username/manual_out/manual.pdf] Error 1
make[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/manual_pdf.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
答案1
通过将样式文件“IEEEbib.bst”与“bibliography.bib”放在同一行并删除 USE_INDEX 解决了该问题。
更正后的 CMakeLists.txt 包含:
cmake_minimum_required(VERSION 3.22)
project ( manual NONE)
SET(LATEX_OUTPUT_PATH /home/username/manual_out)
INCLUDE(UseLATEX.cmake)
ADD_LATEX_DOCUMENT(manual.tex
INPUTS A.tex B.tex C.tex D.tex
IMAGE_DIRS images
BIBFILES bibliography.bib IEEEbib.bst)
事实证明这是 Biblatex。为了将 Biblatex 与 biber 后端结合使用并实现现代化,我使用了此参考资料 [https://github.com/josephwright/biblatex-ieee]。不幸的是,IEEE 的其他参考资料似乎造成了兼容性问题,我并不完全理解。