提交论文的时候有时需要同时提交double column跟single column的pdf文件,而同时编辑同一篇论文的两个版本实在是一件很讨厌的事情,而且没有必要。可以通过开关tex 文件开关的documentclass 来实现分别编译,但用windows batch就更方便了。
准备
首先tex 文件开关的两个documentclass (单档和双档的)都要注释掉。tex 文件中实现单双档分支可以用条件编译语句
\ifCLASSOPTIONtwocolumn
...
\else
...
\fi
编译双档
ECHO Compiling double column version...
@ECHO OFF
(
ECHO \documentclass[journal,twocolumn,10pt]{IEEEtran}
type SPL.tex
)> temp.tex
texify -p temp.tex
move /y temp.pdf SPL_double.pdf
del temp.*
编译单档
ECHO Compiling double column version...
@ECHO OFF
(
ECHO \documentclass[journal,onecolumn,draftclsnofoot,11pt]{IEEEtran}
type SPL.tex
)> temp.tex
texify -p temp.tex
move /y temp.pdf SPL_single.pdf
del temp.*
本文介绍了一种使用Windows批处理脚本简化TeX文件单双栏PDF编译的方法。通过预先设置好单双栏的文档类型选项,并利用条件编译语句,可以轻松切换并编译出所需的PDF格式。
1万+

被折叠的 条评论
为什么被折叠?



