我使用该命令编译源代码:
$ latexmk -pdf main.tex
稍后我想清理该文件夹(确实这是规则的一部分make clean
,但是没关系)。
$ latexmk -C
Latexmk: This is Latexmk, John Collins, 17 March 2019, version: 4.63b.
Latexmk: Disallowing switch of output file as incompatible
with file requests.
为什么会产生该警告信息(第2行和第3行)?
答案1
latexmk
在生成此警告消息的代码中搜索显示以下注释:
if ( $dvi_mode || $postscript_mode
|| ( $printout_mode && ($print_type eq 'ps') || ($print_type eq 'dvi') )
|| ( ($preview_mode || $preview_continuous_mode) && ( ($view eq 'ps') || ($view eq 'dvi') ) )
) {
# Automatic switching (e.g., pdf<->dvi o/p) requires pdf files to be
# the only destinations. So if ps or dvi files needed, we cannot
# allow switching. (There will then be an error condition if a TeX
# engine fails to produce the correct type of output file.)
warn "$My_name: Disallowing switch of output file as incompatible\n",
" with file requests.\n";
$can_switch = 0;
}
因此,不要只是说要latexmk
清理,而是指定您希望它清理编译为 PDF 时生成的所有文件:
$ latexmk -pdf -C
Latexmk: This is Latexmk, John Collins, 17 March 2019, version: 4.63b.
(添加-quiet
到命令以删除最后一行,这只是一个信息而不是警告。)