texwork 上 arara 的语法以 preamble.tex 作为输入文件,用于生成许多不同的文档

texwork 上 arara 的语法以 preamble.tex 作为输入文件,用于生成许多不同的文档

我在 Windows 上安装了 arara,从 cmd shell 运行它时,它工作正常。将以下语法放在“模板”序言中,我将其用作输入文件来生成多个文档,足以编译文档,或者我必须在每个 tex 文件中每次都提及文件名。我正在使用 texwork。

我怎样才能让 texwork 在文件更改时自动构建文件?

% arara: xelatex
% arara: xelatex
% arara: clean: { files: [ *.aux, *.bbl ] }
% arara: clean: { files: [ *.bcf, *.cod ] } 
% arara: clean: { files: [ *.blg, *.lof ] }
% arara: clean: { files: [ *.lot, *.out ] } 
% arara: clean: { files: [ *.toc, *.log ] } 

答案1

有一条规则,remove称为Paulo Cereda

!config
# Clean rule for arara
# author: Paulo Cereda
# requires arara 3.0+
identifier: remove
name: Remove
command: <arara> @{remove}
arguments:
- identifier: remove
  default: <arara> @{isNotEmpty(item, isWindows("cmd /c del", "rm -f").concat(' "').concat(getBasename(file))concat('.').concat(item).concat('"'))}

这将删除

% arara: remove: { items: [ aux , toc , bbl ] }

文件jobname.auxjobname.tocjobname.bbl

如果您想删除像*.aux*.toc*.bbl任何名称的文件,请尝试进行以下微小的更改:

!config
# Clean rule for arara
# requires arara 3.0+
identifier: removex
name: RemoveX
command: <arara> @{removex}
arguments:
- identifier: removex
  default: <arara> @{isNotEmpty(item, isWindows("cmd /c del", "rm -f").concat(' "').concat('*')concat('.').concat(item).concat('"'))}

这将删除

% arara: removex: {items: [ png , tmp ] }

所有扩展名为*.png和 的文件*.tmp

相关内容