当前位置: 移动技术网 > IT编程>移动开发>WP > windows batch file 实现 tex 文件 的双档、单档(double column, single column)分别编译

windows batch file 实现 tex 文件 的双档、单档(double column, single column)分别编译

2018年04月11日  | 移动技术网IT编程  | 我要评论

妈妈和两个小儿子,塑料价格,袁咏琳个人资料

提交论文的时候有时需要同时提交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.*

参考文献

Batch: insert lines from a .txt file into a .txt file

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网